Commit 736432ee by Jeff Law Committed by Jeff Law

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
parent 8ae5e6f2
2005-01-06 Jeff Law <law@redhat.com>
PR ada/24994
* 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.
2006-01-06 Andrew Pinski <pinskia@physics.uc.edu> 2006-01-06 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/25528 PR tree-opt/25528
......
...@@ -173,3 +173,7 @@ struct throw_stmt_node GTY(()) ...@@ -173,3 +173,7 @@ struct throw_stmt_node GTY(())
extern struct htab *get_eh_throw_stmt_table (struct function *); extern struct htab *get_eh_throw_stmt_table (struct function *);
extern void set_eh_throw_stmt_table (struct function *, struct htab *); extern void set_eh_throw_stmt_table (struct function *, struct htab *);
#ifdef ENABLE_CHECKING
extern void verify_eh_throw_table_statements (void);
#endif
...@@ -843,7 +843,7 @@ make_goto_expr_edges (basic_block bb) ...@@ -843,7 +843,7 @@ make_goto_expr_edges (basic_block bb)
#else #else
e->goto_locus = EXPR_LOCUS (goto_t); e->goto_locus = EXPR_LOCUS (goto_t);
#endif #endif
bsi_remove (&last); bsi_remove (&last, true);
return; return;
} }
...@@ -1064,7 +1064,7 @@ cleanup_dead_labels (void) ...@@ -1064,7 +1064,7 @@ cleanup_dead_labels (void)
|| DECL_NONLOCAL (label)) || DECL_NONLOCAL (label))
bsi_next (&i); bsi_next (&i);
else else
bsi_remove (&i); bsi_remove (&i, true);
} }
} }
...@@ -1362,7 +1362,7 @@ tree_merge_blocks (basic_block a, basic_block b) ...@@ -1362,7 +1362,7 @@ tree_merge_blocks (basic_block a, basic_block b)
{ {
tree label = bsi_stmt (bsi); tree label = bsi_stmt (bsi);
bsi_remove (&bsi); bsi_remove (&bsi, false);
/* Now that we can thread computed gotos, we might have /* Now that we can thread computed gotos, we might have
a situation where we have a forced label in block B a situation where we have a forced label in block B
However, the label at the start of block B might still be However, the label at the start of block B might still be
...@@ -2024,7 +2024,7 @@ remove_bb (basic_block bb) ...@@ -2024,7 +2024,7 @@ remove_bb (basic_block bb)
new_bb = bb->prev_bb; new_bb = bb->prev_bb;
new_bsi = bsi_start (new_bb); new_bsi = bsi_start (new_bb);
bsi_remove (&i); bsi_remove (&i, false);
bsi_insert_before (&new_bsi, stmt, BSI_NEW_STMT); bsi_insert_before (&new_bsi, stmt, BSI_NEW_STMT);
} }
else else
...@@ -2036,7 +2036,7 @@ remove_bb (basic_block bb) ...@@ -2036,7 +2036,7 @@ remove_bb (basic_block bb)
if (in_ssa_p) if (in_ssa_p)
release_defs (stmt); release_defs (stmt);
bsi_remove (&i); bsi_remove (&i, true);
} }
/* Don't warn for removed gotos. Gotos are often removed due to /* Don't warn for removed gotos. Gotos are often removed due to
...@@ -2584,7 +2584,7 @@ disband_implicit_edges (void) ...@@ -2584,7 +2584,7 @@ disband_implicit_edges (void)
if (bb->next_bb == EXIT_BLOCK_PTR if (bb->next_bb == EXIT_BLOCK_PTR
&& !TREE_OPERAND (stmt, 0)) && !TREE_OPERAND (stmt, 0))
{ {
bsi_remove (&last); bsi_remove (&last, true);
single_succ_edge (bb)->flags |= EDGE_FALLTHRU; single_succ_edge (bb)->flags |= EDGE_FALLTHRU;
} }
continue; continue;
...@@ -2800,16 +2800,25 @@ bsi_insert_after (block_stmt_iterator *i, tree t, enum bsi_iterator_update m) ...@@ -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 /* 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 void
bsi_remove (block_stmt_iterator *i) bsi_remove (block_stmt_iterator *i, bool remove_eh_info)
{ {
tree t = bsi_stmt (*i); tree t = bsi_stmt (*i);
set_bb_for_stmt (t, NULL); set_bb_for_stmt (t, NULL);
delink_stmt_imm_use (t); delink_stmt_imm_use (t);
tsi_delink (&i->tsi); tsi_delink (&i->tsi);
mark_stmt_modified (t); mark_stmt_modified (t);
if (remove_eh_info)
remove_stmt_from_eh_region (t);
} }
...@@ -2819,7 +2828,7 @@ void ...@@ -2819,7 +2828,7 @@ void
bsi_move_after (block_stmt_iterator *from, block_stmt_iterator *to) bsi_move_after (block_stmt_iterator *from, block_stmt_iterator *to)
{ {
tree stmt = bsi_stmt (*from); tree stmt = bsi_stmt (*from);
bsi_remove (from); bsi_remove (from, false);
bsi_insert_after (to, stmt, BSI_SAME_STMT); bsi_insert_after (to, stmt, BSI_SAME_STMT);
} }
...@@ -2830,7 +2839,7 @@ void ...@@ -2830,7 +2839,7 @@ void
bsi_move_before (block_stmt_iterator *from, block_stmt_iterator *to) bsi_move_before (block_stmt_iterator *from, block_stmt_iterator *to)
{ {
tree stmt = bsi_stmt (*from); tree stmt = bsi_stmt (*from);
bsi_remove (from); bsi_remove (from, false);
bsi_insert_before (to, stmt, BSI_SAME_STMT); bsi_insert_before (to, stmt, BSI_SAME_STMT);
} }
...@@ -2851,11 +2860,12 @@ bsi_move_to_bb_end (block_stmt_iterator *from, basic_block bb) ...@@ -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 /* Replace the contents of the statement pointed to by iterator BSI
with STMT. If PRESERVE_EH_INFO is true, the exception handling with STMT. If UPDATE_EH_INFO is true, the exception handling
information of the original statement is preserved. */ information of the original statement is moved to the new statement. */
void 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; int eh_region;
tree orig_stmt = bsi_stmt (*bsi); tree orig_stmt = bsi_stmt (*bsi);
...@@ -2865,12 +2875,12 @@ bsi_replace (const block_stmt_iterator *bsi, tree stmt, bool preserve_eh_info) ...@@ -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 /* Preserve EH region information from the original statement, if
requested by the caller. */ requested by the caller. */
if (preserve_eh_info) if (update_eh_info)
{ {
eh_region = lookup_stmt_eh_region (orig_stmt); eh_region = lookup_stmt_eh_region (orig_stmt);
if (eh_region >= 0) 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); add_stmt_to_eh_region (stmt, eh_region);
} }
} }
...@@ -3969,7 +3979,7 @@ tree_try_redirect_by_replacing_jump (edge e, basic_block target) ...@@ -3969,7 +3979,7 @@ tree_try_redirect_by_replacing_jump (edge e, basic_block target)
if (TREE_CODE (stmt) == COND_EXPR if (TREE_CODE (stmt) == COND_EXPR
|| TREE_CODE (stmt) == SWITCH_EXPR) || TREE_CODE (stmt) == SWITCH_EXPR)
{ {
bsi_remove (&b); bsi_remove (&b, true);
e = ssa_redirect_edge (e, target); e = ssa_redirect_edge (e, target);
e->flags = EDGE_FALLTHRU; e->flags = EDGE_FALLTHRU;
return e; return e;
...@@ -4066,7 +4076,7 @@ tree_redirect_edge_and_branch (edge e, basic_block dest) ...@@ -4066,7 +4076,7 @@ tree_redirect_edge_and_branch (edge e, basic_block dest)
} }
case RETURN_EXPR: case RETURN_EXPR:
bsi_remove (&bsi); bsi_remove (&bsi, true);
e->flags |= EDGE_FALLTHRU; e->flags |= EDGE_FALLTHRU;
break; break;
...@@ -4142,7 +4152,7 @@ tree_split_block (basic_block bb, void *stmt) ...@@ -4142,7 +4152,7 @@ tree_split_block (basic_block bb, void *stmt)
while (!bsi_end_p (bsi)) while (!bsi_end_p (bsi))
{ {
act = bsi_stmt (bsi); act = bsi_stmt (bsi);
bsi_remove (&bsi); bsi_remove (&bsi, false);
bsi_insert_after (&bsi_tgt, act, BSI_NEW_STMT); bsi_insert_after (&bsi_tgt, act, BSI_NEW_STMT);
} }
......
...@@ -117,7 +117,7 @@ cleanup_control_expr_graph (basic_block bb, block_stmt_iterator bsi) ...@@ -117,7 +117,7 @@ cleanup_control_expr_graph (basic_block bb, block_stmt_iterator bsi)
else else
taken_edge = single_succ_edge (bb); taken_edge = single_succ_edge (bb);
bsi_remove (&bsi); bsi_remove (&bsi, true);
taken_edge->flags = EDGE_FALLTHRU; taken_edge->flags = EDGE_FALLTHRU;
/* We removed some paths from the cfg. */ /* We removed some paths from the cfg. */
...@@ -207,7 +207,7 @@ cleanup_control_flow (void) ...@@ -207,7 +207,7 @@ cleanup_control_flow (void)
/* Remove the GOTO_EXPR as it is not needed. The CFG has all the /* Remove the GOTO_EXPR as it is not needed. The CFG has all the
relevant information we need. */ relevant information we need. */
bsi_remove (&bsi); bsi_remove (&bsi, true);
retval = true; retval = true;
} }
...@@ -433,7 +433,7 @@ remove_forwarder_block (basic_block bb, basic_block **worklist) ...@@ -433,7 +433,7 @@ remove_forwarder_block (basic_block bb, basic_block **worklist)
{ {
label = bsi_stmt (bsi); label = bsi_stmt (bsi);
gcc_assert (TREE_CODE (label) == LABEL_EXPR); gcc_assert (TREE_CODE (label) == LABEL_EXPR);
bsi_remove (&bsi); bsi_remove (&bsi, false);
bsi_insert_before (&bsi_to, label, BSI_CONTINUE_LINKING); bsi_insert_before (&bsi_to, label, BSI_CONTINUE_LINKING);
} }
} }
......
...@@ -1124,7 +1124,7 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type, ...@@ -1124,7 +1124,7 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
bsi_insert_before (bsi, t1, BSI_SAME_STMT); bsi_insert_before (bsi, t1, BSI_SAME_STMT);
t1 = build2 (MODIFY_EXPR, inner_type, ri, ti); t1 = build2 (MODIFY_EXPR, inner_type, ri, ti);
bsi_insert_before (bsi, t1, BSI_SAME_STMT); bsi_insert_before (bsi, t1, BSI_SAME_STMT);
bsi_remove (bsi); bsi_remove (bsi, true);
} }
} }
...@@ -1163,7 +1163,7 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type, ...@@ -1163,7 +1163,7 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
bsi_insert_before (bsi, t1, BSI_SAME_STMT); bsi_insert_before (bsi, t1, BSI_SAME_STMT);
t1 = build2 (MODIFY_EXPR, inner_type, ri, ti); t1 = build2 (MODIFY_EXPR, inner_type, ri, ti);
bsi_insert_before (bsi, t1, BSI_SAME_STMT); bsi_insert_before (bsi, t1, BSI_SAME_STMT);
bsi_remove (bsi); bsi_remove (bsi, true);
} }
} }
......
...@@ -2075,3 +2075,25 @@ maybe_clean_or_replace_eh_stmt (tree old_stmt, tree new_stmt) ...@@ -2075,3 +2075,25 @@ maybe_clean_or_replace_eh_stmt (tree old_stmt, tree new_stmt)
return false; return false;
} }
#ifdef ENABLE_CHECKING
static int
verify_eh_throw_stmt_node (void **slot, void *data ATTRIBUTE_UNUSED)
{
struct throw_stmt_node *node = (struct throw_stmt_node *)*slot;
gcc_assert (node->stmt->common.ann == NULL);
return 1;
}
void
verify_eh_throw_table_statements (void)
{
if (!get_eh_throw_stmt_table (cfun))
return;
htab_traverse (get_eh_throw_stmt_table (cfun),
verify_eh_throw_stmt_node,
NULL);
}
#endif
...@@ -449,7 +449,7 @@ static inline void bsi_prev (block_stmt_iterator *); ...@@ -449,7 +449,7 @@ static inline void bsi_prev (block_stmt_iterator *);
static inline tree bsi_stmt (block_stmt_iterator); static inline tree bsi_stmt (block_stmt_iterator);
static inline tree * bsi_stmt_ptr (block_stmt_iterator); static inline tree * bsi_stmt_ptr (block_stmt_iterator);
extern void bsi_remove (block_stmt_iterator *); extern void bsi_remove (block_stmt_iterator *, bool);
extern void bsi_move_before (block_stmt_iterator *, block_stmt_iterator *); extern void bsi_move_before (block_stmt_iterator *, block_stmt_iterator *);
extern void bsi_move_after (block_stmt_iterator *, block_stmt_iterator *); extern void bsi_move_after (block_stmt_iterator *, block_stmt_iterator *);
extern void bsi_move_to_bb_end (block_stmt_iterator *, basic_block); extern void bsi_move_to_bb_end (block_stmt_iterator *, basic_block);
......
...@@ -287,7 +287,7 @@ tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond, ...@@ -287,7 +287,7 @@ tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond,
using new condition. */ using new condition. */
if (!bb_with_exit_edge_p (loop, bb_for_stmt (stmt))) if (!bb_with_exit_edge_p (loop, bb_for_stmt (stmt)))
{ {
bsi_remove (bsi); bsi_remove (bsi, true);
cond = NULL_TREE; cond = NULL_TREE;
} }
return; return;
...@@ -934,7 +934,7 @@ combine_blocks (struct loop *loop) ...@@ -934,7 +934,7 @@ combine_blocks (struct loop *loop)
for (bsi = bsi_start (bb); !bsi_end_p (bsi); ) for (bsi = bsi_start (bb); !bsi_end_p (bsi); )
{ {
if (TREE_CODE (bsi_stmt (bsi)) == LABEL_EXPR) if (TREE_CODE (bsi_stmt (bsi)) == LABEL_EXPR)
bsi_remove (&bsi); bsi_remove (&bsi, true);
else else
{ {
set_bb_for_stmt (bsi_stmt (bsi), merge_target_bb); set_bb_for_stmt (bsi_stmt (bsi), merge_target_bb);
......
...@@ -2067,7 +2067,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data) ...@@ -2067,7 +2067,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
else else
{ {
tree stmt = bsi_stmt (stmt_bsi); tree stmt = bsi_stmt (stmt_bsi);
bsi_remove (&stmt_bsi); bsi_remove (&stmt_bsi, false);
bsi_insert_after (&bsi, stmt, BSI_NEW_STMT); bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
} }
stmt_bsi = bsi_start (return_block); stmt_bsi = bsi_start (return_block);
...@@ -2182,7 +2182,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data) ...@@ -2182,7 +2182,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
else else
/* We're modifying a TSI owned by gimple_expand_calls_inline(); /* We're modifying a TSI owned by gimple_expand_calls_inline();
tsi_delink() will leave the iterator in a sane state. */ tsi_delink() will leave the iterator in a sane state. */
bsi_remove (&stmt_bsi); bsi_remove (&stmt_bsi, true);
bsi_next (&bsi); bsi_next (&bsi);
if (bsi_end_p (bsi)) if (bsi_end_p (bsi))
......
...@@ -200,7 +200,7 @@ tree_nrv (void) ...@@ -200,7 +200,7 @@ tree_nrv (void)
if (TREE_CODE (*tp) == MODIFY_EXPR if (TREE_CODE (*tp) == MODIFY_EXPR
&& TREE_OPERAND (*tp, 0) == result && TREE_OPERAND (*tp, 0) == result
&& TREE_OPERAND (*tp, 1) == found) && TREE_OPERAND (*tp, 1) == found)
bsi_remove (&bsi); bsi_remove (&bsi, true);
else else
{ {
walk_tree (tp, finalize_nrv_r, &data, 0); walk_tree (tp, finalize_nrv_r, &data, 0);
......
...@@ -209,6 +209,12 @@ execute_free_cfg_annotations (void) ...@@ -209,6 +209,12 @@ execute_free_cfg_annotations (void)
/* And get rid of annotations we no longer need. */ /* And get rid of annotations we no longer need. */
delete_tree_cfg_annotations (); delete_tree_cfg_annotations ();
#ifdef ENABLE_CHECKING
/* Once the statement annotations have been removed, we can verify
the integrity of statements in the EH throw table. */
verify_eh_throw_table_statements ();
#endif
} }
struct tree_opt_pass pass_free_cfg_annotations = struct tree_opt_pass pass_free_cfg_annotations =
......
...@@ -1940,7 +1940,7 @@ rewrite_trees (var_map map, tree *values) ...@@ -1940,7 +1940,7 @@ rewrite_trees (var_map map, tree *values)
/* Remove any stmts marked for removal. */ /* Remove any stmts marked for removal. */
if (remove) if (remove)
bsi_remove (&si); bsi_remove (&si, true);
else else
bsi_next (&si); bsi_next (&si);
} }
......
...@@ -1825,7 +1825,7 @@ static void ...@@ -1825,7 +1825,7 @@ static void
sra_replace (block_stmt_iterator *bsi, tree list) sra_replace (block_stmt_iterator *bsi, tree list)
{ {
sra_insert_before (bsi, list); sra_insert_before (bsi, list);
bsi_remove (bsi); bsi_remove (bsi, false);
if (bsi_end_p (*bsi)) if (bsi_end_p (*bsi))
*bsi = bsi_last (bsi->bb); *bsi = bsi_last (bsi->bb);
else else
......
...@@ -799,7 +799,7 @@ remove_dead_stmt (block_stmt_iterator *i, basic_block bb) ...@@ -799,7 +799,7 @@ remove_dead_stmt (block_stmt_iterator *i, basic_block bb)
tree def = DEF_FROM_PTR (def_p); tree def = DEF_FROM_PTR (def_p);
mark_sym_for_renaming (SSA_NAME_VAR (def)); mark_sym_for_renaming (SSA_NAME_VAR (def));
} }
bsi_remove (i); bsi_remove (i, true);
release_defs (t); release_defs (t);
} }
......
...@@ -351,7 +351,7 @@ dse_optimize_stmt (struct dom_walk_data *walk_data, ...@@ -351,7 +351,7 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
SET_USE (use_p, USE_FROM_PTR (var2)); SET_USE (use_p, USE_FROM_PTR (var2));
} }
/* Remove the dead store. */ /* Remove the dead store. */
bsi_remove (&bsi); bsi_remove (&bsi, true);
/* And release any SSA_NAMEs set in this statement back to the /* And release any SSA_NAMEs set in this statement back to the
SSA_NAME manager. */ SSA_NAME manager. */
......
...@@ -433,7 +433,7 @@ forward_propagate_into_cond (tree cond_expr) ...@@ -433,7 +433,7 @@ forward_propagate_into_cond (tree cond_expr)
{ {
tree def = SSA_NAME_DEF_STMT (test_var); tree def = SSA_NAME_DEF_STMT (test_var);
block_stmt_iterator bsi = bsi_for_stmt (def); block_stmt_iterator bsi = bsi_for_stmt (def);
bsi_remove (&bsi); bsi_remove (&bsi, true);
} }
} }
} }
...@@ -827,7 +827,7 @@ tree_ssa_forward_propagate_single_use_vars (void) ...@@ -827,7 +827,7 @@ tree_ssa_forward_propagate_single_use_vars (void)
if (TREE_CODE (rhs) == ADDR_EXPR) if (TREE_CODE (rhs) == ADDR_EXPR)
{ {
if (forward_propagate_addr_expr (stmt)) if (forward_propagate_addr_expr (stmt))
bsi_remove (&bsi); bsi_remove (&bsi, true);
else else
bsi_next (&bsi); bsi_next (&bsi);
} }
......
...@@ -759,7 +759,7 @@ move_computations_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED, ...@@ -759,7 +759,7 @@ move_computations_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
cost, level->num); cost, level->num);
} }
bsi_insert_on_edge (loop_preheader_edge (level), stmt); bsi_insert_on_edge (loop_preheader_edge (level), stmt);
bsi_remove (&bsi); bsi_remove (&bsi, false);
} }
} }
......
...@@ -5326,7 +5326,7 @@ remove_statement (tree stmt, bool including_defined_name) ...@@ -5326,7 +5326,7 @@ remove_statement (tree stmt, bool including_defined_name)
{ {
block_stmt_iterator bsi = bsi_for_stmt (stmt); block_stmt_iterator bsi = bsi_for_stmt (stmt);
bsi_remove (&bsi); bsi_remove (&bsi, true);
} }
} }
......
...@@ -351,7 +351,7 @@ replace_phi_edge_with_variable (basic_block cond_block, ...@@ -351,7 +351,7 @@ replace_phi_edge_with_variable (basic_block cond_block,
/* Eliminate the COND_EXPR at the end of COND_BLOCK. */ /* Eliminate the COND_EXPR at the end of COND_BLOCK. */
bsi = bsi_last (cond_block); bsi = bsi_last (cond_block);
bsi_remove (&bsi); bsi_remove (&bsi, true);
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, fprintf (dump_file,
......
...@@ -3407,7 +3407,7 @@ remove_dead_inserted_code (void) ...@@ -3407,7 +3407,7 @@ remove_dead_inserted_code (void)
else else
{ {
bsi = bsi_for_stmt (t); bsi = bsi_for_stmt (t);
bsi_remove (&bsi); bsi_remove (&bsi, true);
release_defs (t); release_defs (t);
} }
} }
......
...@@ -180,7 +180,7 @@ remove_ctrl_stmt_and_useless_edges (basic_block bb, basic_block dest_bb) ...@@ -180,7 +180,7 @@ remove_ctrl_stmt_and_useless_edges (basic_block bb, basic_block dest_bb)
&& (TREE_CODE (bsi_stmt (bsi)) == COND_EXPR && (TREE_CODE (bsi_stmt (bsi)) == COND_EXPR
|| TREE_CODE (bsi_stmt (bsi)) == GOTO_EXPR || TREE_CODE (bsi_stmt (bsi)) == GOTO_EXPR
|| TREE_CODE (bsi_stmt (bsi)) == SWITCH_EXPR)) || TREE_CODE (bsi_stmt (bsi)) == SWITCH_EXPR))
bsi_remove (&bsi); bsi_remove (&bsi, true);
for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); ) for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); )
{ {
......
...@@ -735,7 +735,7 @@ eliminate_tail_call (struct tailcall *t) ...@@ -735,7 +735,7 @@ eliminate_tail_call (struct tailcall *t)
if (TREE_CODE (t) == RETURN_EXPR) if (TREE_CODE (t) == RETURN_EXPR)
break; break;
bsi_remove (&bsi); bsi_remove (&bsi, true);
release_defs (t); release_defs (t);
} }
...@@ -825,7 +825,7 @@ eliminate_tail_call (struct tailcall *t) ...@@ -825,7 +825,7 @@ eliminate_tail_call (struct tailcall *t)
SSA_NAME_DEF_STMT (rslt) = build_empty_stmt (); SSA_NAME_DEF_STMT (rslt) = build_empty_stmt ();
} }
bsi_remove (&t->call_bsi); bsi_remove (&t->call_bsi, true);
release_defs (call); release_defs (call);
} }
......
...@@ -2944,7 +2944,7 @@ vect_transform_loop (loop_vec_info loop_vinfo, ...@@ -2944,7 +2944,7 @@ vect_transform_loop (loop_vec_info loop_vinfo,
stmt_ann_t ann = stmt_ann (stmt); stmt_ann_t ann = stmt_ann (stmt);
free (stmt_info); free (stmt_info);
set_stmt_info ((tree_ann_t)ann, NULL); set_stmt_info ((tree_ann_t)ann, NULL);
bsi_remove (&si); bsi_remove (&si, true);
continue; continue;
} }
......
...@@ -805,7 +805,7 @@ slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters) ...@@ -805,7 +805,7 @@ slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters)
bsi_insert_before (&loop_cond_bsi, cond_stmt, BSI_SAME_STMT); bsi_insert_before (&loop_cond_bsi, cond_stmt, BSI_SAME_STMT);
/* Remove old loop exit test: */ /* Remove old loop exit test: */
bsi_remove (&loop_cond_bsi); bsi_remove (&loop_cond_bsi, true);
loop_loc = find_loop_location (loop); loop_loc = find_loop_location (loop);
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
......
...@@ -3026,7 +3026,7 @@ remove_range_assertions (void) ...@@ -3026,7 +3026,7 @@ remove_range_assertions (void)
} }
/* And finally, remove the copy, it is not needed. */ /* And finally, remove the copy, it is not needed. */
bsi_remove (&si); bsi_remove (&si, true);
} }
else else
bsi_next (&si); bsi_next (&si);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment