aboutsummaryrefslogtreecommitdiff
path: root/gcc/dominance.c
diff options
context:
space:
mode:
authorZdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>2004-07-29 19:47:31 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2004-07-29 17:47:31 +0000
commite7bd94ccb8ab37c75b42a735cbd99a05f5f3e890 (patch)
tree593182763d4cd5ae55c67b3a00af45d725ccefd7 /gcc/dominance.c
parentd397dbcd99452ed440e1a99495436af91513a5ac (diff)
downloadgcc-e7bd94ccb8ab37c75b42a735cbd99a05f5f3e890.zip
gcc-e7bd94ccb8ab37c75b42a735cbd99a05f5f3e890.tar.gz
gcc-e7bd94ccb8ab37c75b42a735cbd99a05f5f3e890.tar.bz2
cfgloop.c (update_latch_info): Update dominator of the new block.
* cfgloop.c (update_latch_info): Update dominator of the new block. (canonicalize_loop_headers, flow_loops_find): Do not free dominance info. * dominance.c (verify_dominators): Check that the dominance tree is connected. (recount_dominator): Ignore unreachable blocks. (iterate_fix_dominators): Cleanup old dominance information before recomputing it. From-SVN: r85307
Diffstat (limited to 'gcc/dominance.c')
-rw-r--r--gcc/dominance.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/dominance.c b/gcc/dominance.c
index 156fc98..d46d8f5 100644
--- a/gcc/dominance.c
+++ b/gcc/dominance.c
@@ -824,6 +824,20 @@ verify_dominators (enum cdi_direction dir)
err = 1;
}
}
+
+ if (dir == CDI_DOMINATORS
+ && dom_computed[dir] >= DOM_NO_FAST_QUERY)
+ {
+ FOR_EACH_BB (bb)
+ {
+ if (!dominated_by_p (dir, bb, ENTRY_BLOCK_PTR))
+ {
+ error ("ENTRY does not dominate bb %d", bb->index);
+ err = 1;
+ }
+ }
+ }
+
if (err)
abort ();
}
@@ -846,6 +860,11 @@ recount_dominator (enum cdi_direction dir, basic_block bb)
{
for (e = bb->pred; e; e = e->pred_next)
{
+ /* Ignore the predecessors that either are not reachable from
+ the entry block, or whose dominator was not determined yet. */
+ if (!dominated_by_p (dir, e->src, ENTRY_BLOCK_PTR))
+ continue;
+
if (!dominated_by_p (dir, e->src, bb))
dom_bb = nearest_common_dominator (dir, dom_bb, e->src);
}
@@ -873,6 +892,9 @@ iterate_fix_dominators (enum cdi_direction dir, basic_block *bbs, int n)
if (!dom_computed[dir])
abort ();
+ for (i = 0; i < n; i++)
+ set_immediate_dominator (dir, bbs[i], NULL);
+
while (changed)
{
changed = 0;
@@ -887,6 +909,10 @@ iterate_fix_dominators (enum cdi_direction dir, basic_block *bbs, int n)
}
}
}
+
+ for (i = 0; i < n; i++)
+ if (!get_immediate_dominator (dir, bbs[i]))
+ abort ();
}
void