aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2005-03-08 19:42:46 -0700
committerJeff Law <law@gcc.gnu.org>2005-03-08 19:42:46 -0700
commitb0c32a738700b8d010d97cda9d6be3334b7d05a5 (patch)
tree06c0224c7be0a6643a617ff27b888cd03448df33 /gcc/tree-cfg.c
parentb735d54b7a3eb3446a161ed162d422ee32a5b6b6 (diff)
downloadgcc-b0c32a738700b8d010d97cda9d6be3334b7d05a5.zip
gcc-b0c32a738700b8d010d97cda9d6be3334b7d05a5.tar.gz
gcc-b0c32a738700b8d010d97cda9d6be3334b7d05a5.tar.bz2
tree-cfg.c (cleanup_control_flow): If removal of a computed goto results in the removal of edges in the CFG...
* tree-cfg.c (cleanup_control_flow): If removal of a computed goto results in the removal of edges in the CFG, then we need to recompute dominators. From-SVN: r96160
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 7622bf7..be7ee56b 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -2148,6 +2148,7 @@ cleanup_control_flow (void)
tree label;
edge_iterator ei;
basic_block target_block;
+ bool removed_edge = false;
/* First look at all the outgoing edges. Delete any outgoing
edges which do not go to the right block. For the one
@@ -2157,7 +2158,10 @@ cleanup_control_flow (void)
for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); )
{
if (e->dest != target_block)
- remove_edge (e);
+ {
+ removed_edge = true;
+ remove_edge (e);
+ }
else
{
/* Turn off the EDGE_ABNORMAL flag. */
@@ -2169,6 +2173,11 @@ cleanup_control_flow (void)
}
}
+ /* If we removed one or more edges, then we will need to fix the
+ dominators. It may be possible to incrementally update them. */
+ if (removed_edge)
+ free_dominance_info (CDI_DOMINATORS);
+
/* Remove the GOTO_EXPR as it is not needed. The CFG has all the
relevant information we need. */
bsi_remove (&bsi);