diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2319b0dca4c..e2b9974a9c8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-07-06 Bernd Schmidt + + 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 PR target/53383 diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index 8c1e18a2731..2c6f1958f52 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 {