aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-unroll.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2006-05-09 11:10:15 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2006-05-09 09:10:15 +0000
commit2c790a28841f2a404f1f6e96d07041138583788a (patch)
treeaabd0f9c50090c14bb5730b3f5bec41c2e9be980 /gcc/loop-unroll.c
parentec4fc7edafe1c67b09d5462efe3beb8bcc1e6732 (diff)
downloadgcc-2c790a28841f2a404f1f6e96d07041138583788a.zip
gcc-2c790a28841f2a404f1f6e96d07041138583788a.tar.gz
gcc-2c790a28841f2a404f1f6e96d07041138583788a.tar.bz2
re PR rtl-optimization/27335 (ICE in get_loop_body)
PR rtl-optimization/27335 * loop-unroll.c (peel_loops_completely): Use loops->parray to walk the loops. * gcc.dg/pr27335.c: New test. From-SVN: r113648
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 5c28eaf..156f688 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;
}
}