aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgloopmanip.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2013-01-17 19:19:37 +0000
committerMarek Polacek <polacek@redhat.com>2013-01-17 19:19:37 +0000
commit2375e9dca9948fc6144e46024e3812cd24e73e86 (patch)
tree3822c20e0748ca647e4e66ae8d810fb118d5e225 /gcc/cfgloopmanip.c
parentaead01f4ccace8654c622b55da4bfdfca0fc04b6 (diff)
Fix PR55833.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@195280 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloopmanip.c')
-rw-r--r--gcc/cfgloopmanip.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 487560734fa..8c6c39de86b 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -111,10 +111,13 @@ fix_bb_placement (basic_block bb)
/* Fix placement of LOOP inside loop tree, i.e. find the innermost superloop
of LOOP to that leads at least one exit edge of LOOP, and set it
as the immediate superloop of LOOP. Return true if the immediate superloop
- of LOOP changed. */
+ of LOOP changed.
+
+ IRRED_INVALIDATED is set to true if a change in the loop structures might
+ invalidate the information about irreducible regions. */
static bool
-fix_loop_placement (struct loop *loop)
+fix_loop_placement (struct loop *loop, bool *irred_invalidated)
{
unsigned i;
edge e;
@@ -139,7 +142,12 @@ fix_loop_placement (struct loop *loop)
/* The exit edges of LOOP no longer exits its original immediate
superloops; remove them from the appropriate exit lists. */
FOR_EACH_VEC_ELT (exits, i, e)
- rescan_loop_exit (e, false, false);
+ {
+ /* We may need to recompute irreducible loops. */
+ if (e->flags & EDGE_IRREDUCIBLE_LOOP)
+ *irred_invalidated = true;
+ rescan_loop_exit (e, false, false);
+ }
ret = true;
}
@@ -212,7 +220,7 @@ fix_bb_placements (basic_block from,
if (from->loop_father->header == from)
{
/* Subloop header, maybe move the loop upward. */
- if (!fix_loop_placement (from->loop_father))
+ if (!fix_loop_placement (from->loop_father, irred_invalidated))
continue;
target_loop = loop_outer (from->loop_father);
}
@@ -965,7 +973,7 @@ fix_loop_placements (struct loop *loop, bool *irred_invalidated)
while (loop_outer (loop))
{
outer = loop_outer (loop);
- if (!fix_loop_placement (loop))
+ if (!fix_loop_placement (loop, irred_invalidated))
break;
/* Changing the placement of a loop in the loop tree may alter the