summaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorAndy Hutchinson <hutchinsonandy@gcc.gnu.org>2009-11-12 02:35:49 +0000
committerAndy Hutchinson <hutchinsonandy@gcc.gnu.org>2009-11-12 02:35:49 +0000
commitae761c4536548e9bfa0619430726b249d732279d (patch)
tree0adde9e7a3206137a3a0b73acd97affa373a4628 /gcc/cfgexpand.c
parent50b4d31c59815411ea5230dfcb610b2448de022b (diff)
downloadgcc-ae761c4536548e9bfa0619430726b249d732279d.tar.gz
re PR middle-end/41440 (SEG FAULT in CSE.C caused by bad RTL expansion)
PR middle-end/41440 * cfgexpand.c (expand_gimple_basic_block): Append NOP to a fallthru, single successor block, ending with jump created by RTL expander. From-SVN: r154112
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index cfb4d17dc20..c9e1f1a3d73 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -3220,6 +3220,18 @@ expand_gimple_basic_block (basic_block bb)
}
}
+ /* Expanded RTL can create a jump in the last instruction of block.
+ This later might be assumed to be a jump to successor and break edge insertion.
+ We need to insert dummy move to prevent this. PR41440. */
+ if (single_succ_p (bb)
+ && (single_succ_edge (bb)->flags & EDGE_FALLTHRU)
+ && (last = get_last_insn ())
+ && JUMP_P (last))
+ {
+ rtx dummy = gen_reg_rtx (SImode);
+ emit_insn_after_noloc (gen_move_insn (dummy, dummy), last, NULL);
+ }
+
do_pending_stack_adjust ();
/* Find the block tail. The last insn in the block is the insn