diff options
author | Richard Biener <rguenther@suse.de> | 2013-02-11 15:07:40 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-02-11 15:07:40 +0000 |
commit | 8e89b5b5fbe131046e8f8905c455a52fd9378e28 (patch) | |
tree | 51f6d16e5f451e7162e917a8e60c40e7bd15004f /gcc/loop-init.c | |
parent | b4a4b56dc7ff0bb336abd777cb8f2437cd05909b (diff) | |
download | gcc-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/loop-init.c')
-rw-r--r-- | gcc/loop-init.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/loop-init.c b/gcc/loop-init.c index d64c110..5b3fd63 100644 --- a/gcc/loop-init.c +++ b/gcc/loop-init.c @@ -171,16 +171,19 @@ loop_fini_done: the latch, and loops did not get new subloops (new loops might possibly get created, but we are not interested in them). Fix up the mess. - If CHANGED_BBS is not NULL, basic blocks whose loop has changed are - marked in it. */ + If CHANGED_BBS is not NULL, basic blocks whose loop depth has changed are + marked in it. -void + Returns the number of new discovered loops. */ + +unsigned fix_loop_structure (bitmap changed_bbs) { basic_block bb; int record_exits = 0; loop_iterator li; struct loop *loop; + unsigned old_nloops; timevar_push (TV_LOOP_INIT); @@ -228,6 +231,10 @@ fix_loop_structure (bitmap changed_bbs) delete_loop (loop); } + /* Remember the number of loops so we can return how many new loops + flow_loops_find discovered. */ + old_nloops = number_of_loops (); + /* Re-compute loop structure in-place. */ flow_loops_find (current_loops); @@ -253,6 +260,8 @@ fix_loop_structure (bitmap changed_bbs) #endif timevar_pop (TV_LOOP_INIT); + + return number_of_loops () - old_nloops; } /* Gate for the RTL loop superpass. The actual passes are subpasses. |