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
This commit is contained in:
Andy Hutchinson 2009-11-12 02:35:49 +00:00
parent 50b4d31c59
commit ae761c4536
2 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2009-11-11 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
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.
2009-11-11 Jan Hubicka <jh@suse.cz>
PR middle-end/41729

View File

@ -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