summaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-08-13 18:50:39 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-08-13 18:50:39 +0000
commit3e6a1a9e9c1d090362df0c0a14405862e136351f (patch)
treedab73222a58bf3a5f665ef8fa232ee6c13322657 /gcc/loop.c
parentb20c8db8f1cd336e18dafb71b3cf7ccbfcdc5fab (diff)
downloadgcc-3e6a1a9e9c1d090362df0c0a14405862e136351f.tar.gz
(find_and_verify_loops): Set dest_loop only if JUMP_LABEL (insn) is
non-zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@10210 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 2729450a389..f48a42a0930 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -2338,8 +2338,8 @@ find_and_verify_loops (f)
{
rtx p;
rtx our_next = next_real_insn (insn);
- int dest_loop = uid_loop_num[INSN_UID (JUMP_LABEL (insn))];
- int outer_loop;
+ int dest_loop;
+ int outer_loop = -1;
/* Go backwards until we reach the start of the loop, a label,
or a JUMP_INSN. */
@@ -2354,15 +2354,17 @@ find_and_verify_loops (f)
/* Check for the case where we have a jump to an inner nested
loop, and do not perform the optimization in that case. */
- if (dest_loop != -1)
+ if (JUMP_LABEL (insn))
{
- for (outer_loop = dest_loop; outer_loop != -1;
- outer_loop = loop_outer_loop[outer_loop])
- if (outer_loop == this_loop_num)
- break;
+ dest_loop = uid_loop_num[INSN_UID (JUMP_LABEL (insn))];
+ if (dest_loop != -1)
+ {
+ for (outer_loop = dest_loop; outer_loop != -1;
+ outer_loop = loop_outer_loop[outer_loop])
+ if (outer_loop == this_loop_num)
+ break;
+ }
}
- else
- outer_loop = -1;
/* If we stopped on a JUMP_INSN to the next insn after INSN,
we have a block of code to try to move.