+2005-03-08 Jeff Law <law@redhat.com>
+
+ * 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.
+
2005-03-09 Ben Elliston <bje@au.ibm.com>
* c-common.c (c_do_switch_warnings): Comment fix.
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
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. */
}
}
+ /* 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);