summaryrefslogtreecommitdiff
path: root/gcc/mode-switching.c
diff options
context:
space:
mode:
authorkkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-05 21:41:23 +0000
committerkkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-05 21:41:23 +0000
commit9e236a59876447c22ad433c09800a635eb33b2dc (patch)
tree609974c074f0c5de52b68f305975f08af487b385 /gcc/mode-switching.c
parent75d5c225dde7895ef9c3af45bfed2a6c6e715861 (diff)
downloadgcc-9e236a59876447c22ad433c09800a635eb33b2dc.tar.gz
PR target/28764
* mode-switching.c (optimize_mode_switching): Make the destination block of an abnormal edge have no anticipatable mode. Don't insert mode switching code at the end of the source block of an abnormal edge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116703 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/mode-switching.c')
-rw-r--r--gcc/mode-switching.c43
1 files changed, 10 insertions, 33 deletions
diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c
index 0d485dd0a1e..407ae76a8c6 100644
--- a/gcc/mode-switching.c
+++ b/gcc/mode-switching.c
@@ -465,7 +465,11 @@ optimize_mode_switching (void)
if (e->flags & EDGE_COMPLEX)
break;
if (e)
- RESET_BIT (transp[bb->index], j);
+ {
+ ptr = new_seginfo (no_mode, BB_HEAD (bb), bb->index, live_now);
+ add_seginfo (info + bb->index, ptr);
+ RESET_BIT (transp[bb->index], j);
+ }
}
for (insn = BB_HEAD (bb);
@@ -608,38 +612,11 @@ optimize_mode_switching (void)
if (mode_set == NULL_RTX)
continue;
- /* If this is an abnormal edge, we'll insert at the end
- of the previous block. */
- if (eg->flags & EDGE_ABNORMAL)
- {
- emited = true;
- if (JUMP_P (BB_END (src_bb)))
- emit_insn_before (mode_set, BB_END (src_bb));
- else
- {
- /* It doesn't make sense to switch to normal
- mode after a CALL_INSN. The cases in which a
- CALL_INSN may have an abnormal edge are
- sibcalls and EH edges. In the case of
- sibcalls, the dest basic-block is the
- EXIT_BLOCK, that runs in normal mode; it is
- assumed that a sibcall insn requires normal
- mode itself, so no mode switch would be
- required after the call (it wouldn't make
- sense, anyway). In the case of EH edges, EH
- entry points also start in normal mode, so a
- similar reasoning applies. */
- gcc_assert (NONJUMP_INSN_P (BB_END (src_bb)));
- emit_insn_after (mode_set, BB_END (src_bb));
- }
- bb_info[j][src_bb->index].computing = mode;
- RESET_BIT (transp[src_bb->index], j);
- }
- else
- {
- need_commit = 1;
- insert_insn_on_edge (mode_set, eg);
- }
+ /* We should not get an abnormal edge here. */
+ gcc_assert (! (eg->flags & EDGE_ABNORMAL));
+
+ need_commit = 1;
+ insert_insn_on_edge (mode_set, eg);
}
FOR_EACH_BB_REVERSE (bb)