aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2006-01-06 10:50:26 -0700
committerJeff Law <law@gcc.gnu.org>2006-01-06 10:50:26 -0700
commit736432eedbab9ede68c755437ae8228a95e89871 (patch)
tree632c2510f93d3283918e12e09ca26259dd93ad01 /gcc/tree-cfg.c
parent8ae5e6f215545e316f6cb2b84fae7b64cdd44de1 (diff)
downloadgcc-736432eedbab9ede68c755437ae8228a95e89871.zip
gcc-736432eedbab9ede68c755437ae8228a95e89871.tar.gz
gcc-736432eedbab9ede68c755437ae8228a95e89871.tar.bz2
tree-cfg.c (bsi_replace): Rename final argument from PRESERVE_EH_INFO to UPDATE_EH_INFO.
* tree-cfg.c (bsi_replace): Rename final argument from PRESERVE_EH_INFO to UPDATE_EH_INFO. Fix typo in last change (stmt -> orig_stmt). * tree-eh.c (verify_eh_throw_stmt_node): New function. (bsi_remove): Add new argument. Remove EH information if requested. (verify_eh_throw_table_statements): New function. (bsi_remove): Add new argument REMOVE_EH_INFO. All callers updated. * tree-optimize.c (execute_free_cfg_annotations): Verify the EH throw statement table after removing annotations. * except.h (verify_eh_throw_table_statements): Prototype. * tree-flow.h (bsi_remove): Update prototype. * tree-vrp.c (remove_range_assertions): Add new argument to bsi_remove call. * tree-ssa-loop-im.c (move_computations_stmt): Likewise. * tree-complex.c (expand_complex_div_wide): Likewise. * tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges): Likewise * tree-tailcall.c (eliminate_tailcall): Likewise. * tree-ssa-dse.c (dse_optimize_stmt): Likewise. * tree-ssa-loop-ivopts.c (remove_statement): Likewise. * tree-nrv.c (tree_nrv): Likewise. * tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Likewise. * tree-if-conv.c (tree_if_convert_cond_expr): Likewise. (combine_blocks): Likewise. * tree-ssa-phiopt.c (replace_phi_edge_with_variable): Likewise. * tree-cfgcleanup.c (cleanup_ctrl_expr_graph): Likewise. (cleanup_control_flow): Likewise. (remove_forwarder_block): Likewise. * tree-ssa-pre.c (remove_dead_inserted_code): Likewise. * tree-sra.c (sra_replace): Likewise. * tree-ssa-forwprop.c (forward_propagate_into_cond): Likewise. (forward_propagate_single_use_vars): Likewise. * tree-ssa-dce.c (remove_dead_stmt): Likewise. * tree-inline.c (expand_call_inline): Likewise. * tree-vect-transform.c (vect_transform_loop): Likewise. * tree-outof-ssa.c (rewrite_trees): Likewise. * tree-cfg.c (make_goto_expr_edges): Likewise. (cleanup_dead_labels): Likewise. (tree_merge_blocks, remove_bb, disband_implicit_edges): Likewise. (bsi_move_before, bsi_move_after): Likewise. (bsi_move_to_bb_end, try_redirect_by_replacing_jump): Likewise (tree_redirect_edge_and_branch, tree_split_block): Likewise. From-SVN: r109421
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 2f45836..342b9d2 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -843,7 +843,7 @@ make_goto_expr_edges (basic_block bb)
#else
e->goto_locus = EXPR_LOCUS (goto_t);
#endif
- bsi_remove (&last);
+ bsi_remove (&last, true);
return;
}
@@ -1064,7 +1064,7 @@ cleanup_dead_labels (void)
|| DECL_NONLOCAL (label))
bsi_next (&i);
else
- bsi_remove (&i);
+ bsi_remove (&i, true);
}
}
@@ -1362,7 +1362,7 @@ tree_merge_blocks (basic_block a, basic_block b)
{
tree label = bsi_stmt (bsi);
- bsi_remove (&bsi);
+ bsi_remove (&bsi, false);
/* Now that we can thread computed gotos, we might have
a situation where we have a forced label in block B
However, the label at the start of block B might still be
@@ -2024,7 +2024,7 @@ remove_bb (basic_block bb)
new_bb = bb->prev_bb;
new_bsi = bsi_start (new_bb);
- bsi_remove (&i);
+ bsi_remove (&i, false);
bsi_insert_before (&new_bsi, stmt, BSI_NEW_STMT);
}
else
@@ -2036,7 +2036,7 @@ remove_bb (basic_block bb)
if (in_ssa_p)
release_defs (stmt);
- bsi_remove (&i);
+ bsi_remove (&i, true);
}
/* Don't warn for removed gotos. Gotos are often removed due to
@@ -2584,7 +2584,7 @@ disband_implicit_edges (void)
if (bb->next_bb == EXIT_BLOCK_PTR
&& !TREE_OPERAND (stmt, 0))
{
- bsi_remove (&last);
+ bsi_remove (&last, true);
single_succ_edge (bb)->flags |= EDGE_FALLTHRU;
}
continue;
@@ -2800,16 +2800,25 @@ bsi_insert_after (block_stmt_iterator *i, tree t, enum bsi_iterator_update m)
/* Remove the statement pointed to by iterator I. The iterator is updated
- to the next statement. */
+ to the next statement.
+
+ When REMOVE_EH_INFO is true we remove the statement pointed to by
+ iterator I from the EH tables. Otherwise we do not modify the EH
+ tables.
+
+ Generally, REMOVE_EH_INFO should be true when the statement is going to
+ be removed from the IL and not reinserted elsewhere. */
void
-bsi_remove (block_stmt_iterator *i)
+bsi_remove (block_stmt_iterator *i, bool remove_eh_info)
{
tree t = bsi_stmt (*i);
set_bb_for_stmt (t, NULL);
delink_stmt_imm_use (t);
tsi_delink (&i->tsi);
mark_stmt_modified (t);
+ if (remove_eh_info)
+ remove_stmt_from_eh_region (t);
}
@@ -2819,7 +2828,7 @@ void
bsi_move_after (block_stmt_iterator *from, block_stmt_iterator *to)
{
tree stmt = bsi_stmt (*from);
- bsi_remove (from);
+ bsi_remove (from, false);
bsi_insert_after (to, stmt, BSI_SAME_STMT);
}
@@ -2830,7 +2839,7 @@ void
bsi_move_before (block_stmt_iterator *from, block_stmt_iterator *to)
{
tree stmt = bsi_stmt (*from);
- bsi_remove (from);
+ bsi_remove (from, false);
bsi_insert_before (to, stmt, BSI_SAME_STMT);
}
@@ -2851,11 +2860,12 @@ bsi_move_to_bb_end (block_stmt_iterator *from, basic_block bb)
/* Replace the contents of the statement pointed to by iterator BSI
- with STMT. If PRESERVE_EH_INFO is true, the exception handling
- information of the original statement is preserved. */
+ with STMT. If UPDATE_EH_INFO is true, the exception handling
+ information of the original statement is moved to the new statement. */
+
void
-bsi_replace (const block_stmt_iterator *bsi, tree stmt, bool preserve_eh_info)
+bsi_replace (const block_stmt_iterator *bsi, tree stmt, bool update_eh_info)
{
int eh_region;
tree orig_stmt = bsi_stmt (*bsi);
@@ -2865,12 +2875,12 @@ bsi_replace (const block_stmt_iterator *bsi, tree stmt, bool preserve_eh_info)
/* Preserve EH region information from the original statement, if
requested by the caller. */
- if (preserve_eh_info)
+ if (update_eh_info)
{
eh_region = lookup_stmt_eh_region (orig_stmt);
if (eh_region >= 0)
{
- remove_stmt_from_eh_region (stmt);
+ remove_stmt_from_eh_region (orig_stmt);
add_stmt_to_eh_region (stmt, eh_region);
}
}
@@ -3969,7 +3979,7 @@ tree_try_redirect_by_replacing_jump (edge e, basic_block target)
if (TREE_CODE (stmt) == COND_EXPR
|| TREE_CODE (stmt) == SWITCH_EXPR)
{
- bsi_remove (&b);
+ bsi_remove (&b, true);
e = ssa_redirect_edge (e, target);
e->flags = EDGE_FALLTHRU;
return e;
@@ -4066,7 +4076,7 @@ tree_redirect_edge_and_branch (edge e, basic_block dest)
}
case RETURN_EXPR:
- bsi_remove (&bsi);
+ bsi_remove (&bsi, true);
e->flags |= EDGE_FALLTHRU;
break;
@@ -4142,7 +4152,7 @@ tree_split_block (basic_block bb, void *stmt)
while (!bsi_end_p (bsi))
{
act = bsi_stmt (bsi);
- bsi_remove (&bsi);
+ bsi_remove (&bsi, false);
bsi_insert_after (&bsi_tgt, act, BSI_NEW_STMT);
}