Fix assert caused by bad cfg manipulation in bfin.

PR target/66620
	* config/bfin/bfin.c (hwloop_optimize): Create new bb between jump and
	loop start when inserting LSETUP.

From-SVN: r225453
This commit is contained in:
Bernd Schmidt 2015-07-06 12:49:26 +00:00 committed by Bernd Schmidt
parent ec1590f257
commit 91f0f975e6
2 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2015-07-06 Bernd Schmidt <bernds@codesourcery.com>
PR target/66620
* config/bfin/bfin.c (hwloop_optimize): Create new bb between jump and
loop start when inserting LSETUP.
2015-07-06 H.J. Lu <hongjiu.lu@intel.com>
PR target/53383

View File

@ -3796,8 +3796,19 @@ hwloop_optimize (hwloop_info loop)
{
gcc_assert (JUMP_P (prev));
prev = PREV_INSN (prev);
emit_insn_after (seq, prev);
}
else
{
emit_insn_after (seq, prev);
BB_END (loop->incoming_src) = prev;
basic_block new_bb = create_basic_block (seq, seq_end,
loop->head->prev_bb);
edge e = loop->incoming->last ();
gcc_assert (e->flags & EDGE_FALLTHRU);
redirect_edge_succ (e, new_bb);
make_edge (new_bb, loop->head, 0);
}
emit_insn_after (seq, prev);
}
else
{