e = make_edge (bb, then_bb, EDGE_TRUE_VALUE);
e->goto_locus = gimple_location (then_stmt);
+ if (e->goto_locus)
+ e->goto_block = gimple_block (then_stmt);
e = make_edge (bb, else_bb, EDGE_FALSE_VALUE);
if (e)
- e->goto_locus = gimple_location (else_stmt);
+ {
+ e->goto_locus = gimple_location (else_stmt);
+ if (e->goto_locus)
+ e->goto_block = gimple_block (else_stmt);
+ }
/* We do not need the labels anymore. */
gimple_cond_set_true_label (entry, NULL_TREE);
tree dest = gimple_goto_dest (goto_t);
edge e = make_edge (bb, label_to_block (dest), EDGE_FALLTHRU);
e->goto_locus = gimple_location (goto_t);
+ if (e->goto_locus)
+ e->goto_block = gimple_block (goto_t);
gsi_remove (&last, true);
return;
}
static void
remove_phi_nodes_and_edges_for_unreachable_block (basic_block bb)
{
- gimple_stmt_iterator gsi;
-
/* Since this block is no longer reachable, we can just delete all
of its PHI nodes. */
- for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); )
- remove_phi_node (&gsi, true);
-
- set_phi_nodes (bb, NULL);
+ remove_phi_nodes (bb);
/* Remove edges to BB's successors. */
while (EDGE_COUNT (bb->succs) > 0)
debug_gimple_stmt (node->stmt);
eh_error_found = true;
}
- return 0;
+ return 1;
}
update_stmt (stmt);
pop_cfun ();
}
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (e->goto_locus)
+ {
+ tree block = e->goto_block;
+ if (d->orig_block == NULL_TREE
+ || block == d->orig_block)
+ e->goto_block = d->new_block;
+#ifdef ENABLE_CHECKING
+ else if (block != d->new_block)
+ {
+ while (block && block != d->orig_block)
+ block = BLOCK_SUPERCONTEXT (block);
+ gcc_assert (block);
+ }
+#endif
+ }
}
/* Examine the statements in BB (which is in SRC_CFUN); find and return
for (tp = &BLOCK_VARS (block); *tp; tp = &TREE_CHAIN (*tp))
{
t = *tp;
+ if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != CONST_DECL)
+ continue;
replace_by_duplicate_decl (&t, vars_map, to_context);
if (t != *tp)
{