summaryrefslogtreecommitdiffstats
path: root/gcc/cfgloopmanip.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-05 19:25:14 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-05 19:25:14 +0000
commit753f2949e582336c573fb9e1458146b10a7f5dff (patch)
treec37a75fb7f091174552a67e58c1b9f3c0fff0deb /gcc/cfgloopmanip.c
parent8a3acf3f759c74ee235bad124bbd4380361d3fb0 (diff)
downloadppe42-gcc-753f2949e582336c573fb9e1458146b10a7f5dff.tar.gz
ppe42-gcc-753f2949e582336c573fb9e1458146b10a7f5dff.zip
PR middle-end/49710
* cfgloopmanip.c (remove_path): Walk loop hiearchy upwards when unlooping loops. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182919 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloopmanip.c')
-rw-r--r--gcc/cfgloopmanip.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 967541756b5..33bcf4b9872 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -291,6 +291,7 @@ remove_path (edge e)
sbitmap seen;
bool irred_invalidated = false;
edge_iterator ei;
+ struct loop *l, *f;
if (!can_remove_branch_p (e))
return false;
@@ -314,10 +315,12 @@ remove_path (edge e)
we belong to. In this case first unloop the loops, then proceed
normally. We may assume that e->dest is not a header of any loop,
as it now has exactly one predecessor. */
- while (loop_outer (e->src->loop_father)
- && dominated_by_p (CDI_DOMINATORS,
- e->src->loop_father->latch, e->dest))
- unloop (e->src->loop_father, &irred_invalidated);
+ for (l = e->src->loop_father; loop_outer (l); l = f)
+ {
+ f = loop_outer (l);
+ if (dominated_by_p (CDI_DOMINATORS, l->latch, e->dest))
+ unloop (l, &irred_invalidated);
+ }
/* Identify the path. */
nrem = find_path (e, &rem_bbs);
OpenPOWER on IntegriCloud