diff options
author | sirl <sirl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-10-08 21:20:43 +0000 |
---|---|---|
committer | sirl <sirl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-10-08 21:20:43 +0000 |
commit | ef40dec5166c423b8d0a624f51921270b0d03003 (patch) | |
tree | b6d0cdb17f0f0e233132c9646b118f05a8145743 /gcc/unroll.c | |
parent | ee861ec5ad84d6e3c6ee0383a20e5065945fe799 (diff) | |
download | gcc-ef40dec5166c423b8d0a624f51921270b0d03003.tar.gz |
2001-10-08 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* unroll.c (loop_iterations): Extend check for multiple back edges.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46099 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r-- | gcc/unroll.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c index c0fe373fdfb..a2af2137f05 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -3519,6 +3519,27 @@ loop_iterations (loop) return 0; } + /* If there are multiple conditionalized loop exit tests, they may jump + back to differing CODE_LABELs. */ + if (loop->top && loop->cont) + { + rtx temp = PREV_INSN (last_loop_insn); + + do + { + if (GET_CODE (temp) == JUMP_INSN + && INSN_LUID (JUMP_LABEL (temp)) > INSN_LUID (loop->top) + && INSN_LUID (JUMP_LABEL (temp)) < INSN_LUID (loop->cont)) + { + if (loop_dump_stream) + fprintf (loop_dump_stream, + "Loop iterations: Loop has multiple back edges.\n"); + return 0; + } + } + while ((temp = PREV_INSN (temp)) != loop->cont); + } + /* Find the iteration variable. If the last insn is a conditional branch, and the insn before tests a register value, make that the iteration variable. */ |