aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2015-07-06 12:49:26 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2015-07-06 12:49:26 +0000
commit91f0f975e684fb47640ab65596170f549103ce69 (patch)
tree4a316b9f3f6f5f38dcbdccbbd48a5c0dfad706f6 /gcc/config
parentec1590f2571ecf093de855ed2c9c1383320063a1 (diff)
downloadgcc-91f0f975e684fb47640ab65596170f549103ce69.zip
gcc-91f0f975e684fb47640ab65596170f549103ce69.tar.gz
gcc-91f0f975e684fb47640ab65596170f549103ce69.tar.bz2
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
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/bfin/bfin.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 8c1e18a..2c6f195 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -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
{