diff options
author | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-03-25 23:53:39 +0000 |
---|---|---|
committer | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-03-25 23:53:39 +0000 |
commit | 1fd36c3a4412341826b9518daa8d77589d0f3afc (patch) | |
tree | eb9a7388e0ffde6448465cdc51561a41e66015ff /gcc | |
parent | 9a7acb0c3d5c22899f8aad410f3a20e4e2a6246c (diff) | |
download | gcc-1fd36c3a4412341826b9518daa8d77589d0f3afc.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145080 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/bfin/bfin.c | 14 |
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7d9fe815e35..1f525bfb35d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index f4f9d45e321..d1c964d02ea 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -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) |