bfin.c (bfin_optimize_loop): If the LSETUP goes before a jump insn...

* config/bfin/bfin.c (bfin_optimize_loop): If the LSETUP goes before
	a jump insn, count that jump in the distance to the loop start.

From-SVN: r145080
This commit is contained in:
Bernd Schmidt 2009-03-25 23:53:39 +00:00 committed by Bernd Schmidt
parent c0b753c770
commit 03f8829b50
2 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2009-03-26 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin/bfin.c (bfin_optimize_loop): If the LSETUP goes before
a jump insn, count that jump in the distance to the loop start.
2009-03-25 Kaz Kojima <kkojima@gcc.gnu.org>
PR target/39523

View File

@ -3854,9 +3854,17 @@ bfin_optimize_loop (loop_info loop)
/* Make sure the predecessor is before the loop start label, as required by
the LSETUP instruction. */
length = 0;
for (insn = BB_END (loop->incoming_src);
insn && insn != loop->start_label;
insn = NEXT_INSN (insn))
insn = BB_END (loop->incoming_src);
/* If we have to insert the LSETUP before a jump, count that jump in the
length. */
if (VEC_length (edge, loop->incoming) > 1
|| !(VEC_last (edge, loop->incoming)->flags & EDGE_FALLTHRU))
{
gcc_assert (JUMP_P (insn));
insn = PREV_INSN (insn);
}
for (; insn && insn != loop->start_label; insn = NEXT_INSN (insn))
length += length_for_loop (insn);
if (!insn)