aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfgcleanup.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-02-11 15:07:40 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-02-11 15:07:40 +0000
commit8e89b5b5fbe131046e8f8905c455a52fd9378e28 (patch)
tree51f6d16e5f451e7162e917a8e60c40e7bd15004f /gcc/tree-cfgcleanup.c
parentb4a4b56dc7ff0bb336abd777cb8f2437cd05909b (diff)
downloadgcc-8e89b5b5fbe131046e8f8905c455a52fd9378e28.zip
gcc-8e89b5b5fbe131046e8f8905c455a52fd9378e28.tar.gz
gcc-8e89b5b5fbe131046e8f8905c455a52fd9378e28.tar.bz2
re PR tree-optimization/56264 (ICE in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:557)
2013-02-11 Richard Biener <rguenther@suse.de> PR tree-optimization/56264 * cfgloop.h (fix_loop_structure): Adjust prototype. * loop-init.c (fix_loop_structure): Return the number of newly discovered loops. * tree-cfgcleanup.c (repair_loop_structures): When new loops are discovered, do a full loop-closed SSA rewrite. * gcc.dg/torture/pr56264.c: New testcase. From-SVN: r195941
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r--gcc/tree-cfgcleanup.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index b26281d..94e616b 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -707,18 +707,22 @@ static void
repair_loop_structures (void)
{
bitmap changed_bbs;
+ unsigned n_new_loops;
calculate_dominance_info (CDI_DOMINATORS);
timevar_push (TV_REPAIR_LOOPS);
changed_bbs = BITMAP_ALLOC (NULL);
- fix_loop_structure (changed_bbs);
+ n_new_loops = fix_loop_structure (changed_bbs);
/* This usually does nothing. But sometimes parts of cfg that originally
were inside a loop get out of it due to edge removal (since they
- become unreachable by back edges from latch). */
+ become unreachable by back edges from latch). Also a former
+ irreducible loop can become reducible - in this case force a full
+ rewrite into loop-closed SSA form. */
if (loops_state_satisfies_p (LOOP_CLOSED_SSA))
- rewrite_into_loop_closed_ssa (changed_bbs, TODO_update_ssa);
+ rewrite_into_loop_closed_ssa (n_new_loops ? NULL : changed_bbs,
+ TODO_update_ssa);
BITMAP_FREE (changed_bbs);