summaryrefslogtreecommitdiff
path: root/gcc/loop-init.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-11 15:07:40 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-11 15:07:40 +0000
commitb6f3c6f1b86fd50a17464a642d557b8dac852eab (patch)
tree51f6d16e5f451e7162e917a8e60c40e7bd15004f /gcc/loop-init.c
parent4d73937862a9c0ec5ae01927f946f0ccadc4b961 (diff)
downloadgcc-b6f3c6f1b86fd50a17464a642d557b8dac852eab.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195941 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-init.c')
-rw-r--r--gcc/loop-init.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/loop-init.c b/gcc/loop-init.c
index d64c110c1b5..5b3fd63b2e8 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.