summaryrefslogtreecommitdiff
path: root/gcc/loop-unroll.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/loop-unroll.c')
-rw-r--r--gcc/loop-unroll.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index 5c28eaf2f19..156f688651e 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -233,22 +233,15 @@ loop_exit_at_end_p (struct loop *loop)
static void
peel_loops_completely (struct loops *loops, int flags)
{
- struct loop *loop, *next;
-
- loop = loops->tree_root;
- while (loop->inner)
- loop = loop->inner;
+ struct loop *loop;
+ unsigned i;
- while (loop != loops->tree_root)
+ /* Scan the loops, the inner ones first. */
+ for (i = loops->num - 1; i > 0; i--)
{
- if (loop->next)
- {
- next = loop->next;
- while (next->inner)
- next = next->inner;
- }
- else
- next = loop->outer;
+ loop = loops->parray[i];
+ if (!loop)
+ continue;
loop->lpt_decision.decision = LPT_NONE;
@@ -271,7 +264,6 @@ peel_loops_completely (struct loops *loops, int flags)
verify_loop_structure (loops);
#endif
}
- loop = next;
}
}