Commit ae761c45 by Andy Hutchinson

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
parent 50b4d31c
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> 2009-11-11 Jan Hubicka <jh@suse.cz>
PR middle-end/41729 PR middle-end/41729
...@@ -3220,6 +3220,18 @@ expand_gimple_basic_block (basic_block bb) ...@@ -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 (); do_pending_stack_adjust ();
/* Find the block tail. The last insn in the block is the insn /* Find the block tail. The last insn in the block is the insn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment