summaryrefslogtreecommitdiffstats
path: root/gcc/cfgloop.c
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-14 16:01:10 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-14 16:01:10 +0000
commit4e9768188f093c874916a3a7399802af58fe0c2a (patch)
tree4464f678351d15a2ac886efa3d2f24239ee68188 /gcc/cfgloop.c
parent1cface392e052c3530d3ea14b977e2a4f699dc74 (diff)
downloadppe42-gcc-4e9768188f093c874916a3a7399802af58fe0c2a.tar.gz
ppe42-gcc-4e9768188f093c874916a3a7399802af58fe0c2a.zip
* graphite-scop-detection.c (create_sese_edges): Compute dominance
info before trying to fix loop structure. * cfgloopmanip.c (fix_loop_structure): Require fast DOM queries. * tree-cfgcleanup.c (repair_loop_structures): Likewise. * cfgloop.c (verify_loop_structure): Verify loop fathers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190390 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloop.c')
-rw-r--r--gcc/cfgloop.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index dd75be668e3..44df99b8f33 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -1294,6 +1294,7 @@ cancel_loop_tree (struct loop *loop)
-- loop header have just single entry edge and single latch edge
-- loop latches have only single successor that is header of their loop
-- irreducible loops are correctly marked
+ -- the cached loop depth and loop father of each bb is correct
*/
DEBUG_FUNCTION void
verify_loop_structure (void)
@@ -1308,6 +1309,7 @@ verify_loop_structure (void)
loop_iterator li;
struct loop_exit *exit, *mexit;
bool dom_available = dom_info_available_p (CDI_DOMINATORS);
+ sbitmap visited = sbitmap_alloc (last_basic_block);
/* We need up-to-date dominators, compute or verify them. */
if (!dom_available)
@@ -1344,11 +1346,34 @@ verify_loop_structure (void)
if (!flow_bb_inside_loop_p (loop, bbs[j]))
{
error ("bb %d do not belong to loop %d",
- bbs[j]->index, loop->num);
+ bbs[j]->index, loop->num);
err = 1;
}
free (bbs);
}
+ sbitmap_zero (visited);
+ FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
+ {
+ bbs = get_loop_body (loop);
+
+ for (j = 0; j < loop->num_nodes; j++)
+ {
+ bb = bbs[j];
+
+ /* Ignore this block if it is in an inner loop. */
+ if (TEST_BIT (visited, bb->index))
+ continue;
+ SET_BIT (visited, bb->index);
+
+ if (bb->loop_father != loop)
+ {
+ error ("bb %d has father loop %d, should be loop %d",
+ bb->index, bb->loop_father->num, loop->num);
+ err = 1;
+ }
+ }
+ free (bbs);
+ }
/* Check headers and latches. */
FOR_EACH_LOOP (li, loop, 0)
@@ -1556,6 +1581,7 @@ verify_loop_structure (void)
gcc_assert (!err);
+ sbitmap_free (visited);
free (sizes);
if (!dom_available)
free_dominance_info (CDI_DOMINATORS);
OpenPOWER on IntegriCloud