summaryrefslogtreecommitdiff
path: root/gcc/loop-unroll.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-09 09:10:15 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-09 09:10:15 +0000
commit34e61d776ce435000b57d778b41582cd14891a3f (patch)
treeaabd0f9c50090c14bb5730b3f5bec41c2e9be980 /gcc/loop-unroll.c
parent1ad3c8703545b2e3de5c2799f92149a49cb8d9f7 (diff)
downloadgcc-34e61d776ce435000b57d778b41582cd14891a3f.tar.gz
PR rtl-optimization/27335
* loop-unroll.c (peel_loops_completely): Use loops->parray to walk the loops. * gcc.dg/pr27335.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113648 138bc75d-0d04-0410-961f-82ee72b054a4
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;
}
}