diff options
author | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-29 17:47:31 +0000 |
---|---|---|
committer | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-29 17:47:31 +0000 |
commit | e7f5d6c3181a63892e6efaef2a9d248f7c862265 (patch) | |
tree | 593182763d4cd5ae55c67b3a00af45d725ccefd7 /gcc/dominance.c | |
parent | 030d6db5c00398de83059e9835d7d7882f6437c2 (diff) | |
download | gcc-e7f5d6c3181a63892e6efaef2a9d248f7c862265.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85307 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dominance.c')
-rw-r--r-- | gcc/dominance.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/dominance.c b/gcc/dominance.c index 156fc98b6e0..d46d8f56ecd 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 |