aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgloop.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/cfgloop.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/cfgloop.c')
-rw-r--r--gcc/cfgloop.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 50f31e6..58d9dd0 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -575,6 +575,7 @@ update_latch_info (basic_block jump)
HEADER_BLOCK (jump) = 0;
alloc_aux_for_edge (jump->pred, sizeof (int));
LATCH_EDGE (jump->pred) = 0;
+ set_immediate_dominator (CDI_DOMINATORS, jump, jump->pred->src);
}
/* A callback for make_forwarder block, to redirect all edges except for
@@ -606,9 +607,6 @@ canonicalize_loop_headers (void)
basic_block header;
edge e;
- /* Compute the dominators. */
- calculate_dominance_info (CDI_DOMINATORS);
-
alloc_aux_for_blocks (sizeof (int));
alloc_aux_for_edges (sizeof (int));
@@ -638,8 +636,6 @@ canonicalize_loop_headers (void)
HEADER_BLOCK (header) = num_latches;
}
- free_dominance_info (CDI_DOMINATORS);
-
if (HEADER_BLOCK (ENTRY_BLOCK_PTR->succ->dest))
{
basic_block bb;
@@ -711,6 +707,10 @@ canonicalize_loop_headers (void)
free_aux_for_blocks ();
free_aux_for_edges ();
+
+#ifdef ENABLE_CHECKING
+ verify_dominators (CDI_DOMINATORS);
+#endif
}
/* Find all the natural loops in the function and save in LOOPS structure and
@@ -747,12 +747,12 @@ flow_loops_find (struct loops *loops, int flags)
dfs_order = NULL;
rc_order = NULL;
+ /* Ensure that the dominators are computed. */
+ calculate_dominance_info (CDI_DOMINATORS);
+
/* Join loops with shared headers. */
canonicalize_loop_headers ();
- /* Compute the dominators. */
- calculate_dominance_info (CDI_DOMINATORS);
-
/* Count the number of loop headers. This should be the
same as the number of natural loops. */
headers = sbitmap_alloc (last_basic_block);
@@ -880,10 +880,6 @@ flow_loops_find (struct loops *loops, int flags)
loops->num = num_loops;
}
- else
- {
- free_dominance_info (CDI_DOMINATORS);
- }
sbitmap_free (headers);