summaryrefslogtreecommitdiff
path: root/gcc/tree-eh.c
diff options
context:
space:
mode:
authormatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-02 16:41:48 +0000
committermatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-02 16:41:48 +0000
commite3a19533c3ba16854e1dc1bb2ac7ce197883e38f (patch)
treea909112c3b26051d56924ebe9435b84f207b2091 /gcc/tree-eh.c
parent93106215b9a003a0f5aa582d4c2b9078cb386d47 (diff)
downloadgcc-e3a19533c3ba16854e1dc1bb2ac7ce197883e38f.tar.gz
* coretypes.h (gimple_seq, const_gimple_seq): Typedef as gimple.
* gimple.h (struct gimple_seq_node_d, struct gimple_seq_d): Remove. (const_gimple_seq_node): Remove. (gimple_seq_node): Typedef as gimple. (struct gimple_statement_base): Add next and prev members, adjust all WORD markers in using structs. (union gimple_statement_d): Link via gsbase.next field for GC and PCH. (gimple_seq_first, gimple_seq_first_stmt, gimple_seq_last, gimple_seq_last_stmt): Adjust as gimple_seq, gimple_seq_node and gimple are the same. (gimple_seq_set_last, gimple_seq_set_first): Don't allocate gimple_seq, adjust. (gimple_init_singleton): New function. (gsi_start_1, gsi_last_1, gsi_end_p, gsi_one_before_end_p): Adjust. (gsi_next, gsi_prev): Adjust, handle prev cyclic list correctly. (gsi_stmt): Adjust. (gsi_stmt_ptr): Remove. (enum gimple_alloc_kind): Remove gimple_alloc_kind_seq member. * gimple-iterator.c (update_bb_for_stmts): Take last parameter again, adjust for above changes. (update_call_edge_frequencies): Adjust for above changes. (gsi_insert_seq_nodes_before): Rewrite for new data structure. (gsi_insert_seq_nodes_after): Ditto. (gsi_split_seq_after): Ditto. (gsi_set_stmt): Ditto. (gsi_split_seq_before): Ditto. (gsi_remove): Ditto. (gsi_insert_seq_before_without_update): Don't free sequence. (gsi_insert_seq_after_without_update): Ditto. (gsi_replace): Assert some more invariants. (gsi_insert_before_without_update, gsi_insert_after_without_update): Tidy. (gsi_for_stmt): Don't search for stmt. (gsi_insert_on_edge_immediate): Tidy. * gimple.c (gimple_alloc_k): Remove "sequences". (gimple_seq_cache): Remove. (gimple_alloc_stat): Make stmt a singleton sequence. (gimple_seq_alloc, gimple_seq_free): Remove. (gimple_assign_set_rhs_with_ops_1): Ensure new stmt is a singleton. (gimple_copy): Ditto. * gimplify.c (gimplify_cleanup_point_expr): Use gsi_set_stmt, create iterator from correct sequence. * tree-phinodes.c (make_phi_node): Make stmt a singleton. * gimple.h (gimple_stmt_iterator <seq>): Make it be pointer to gimple_seq. (gimple_seq_set_last, gimple_seq_set_first): Take pointer to sequence, lazily allocate it. (bb_seq_addr): New function. (gsi_start_1): Rename from gsi_start, but take pointer to sequence. (gsi_start): Macro to wrap gsi_start_1 taking pointer of argument. (gsi_none): New function. (gsi_start_bb): Adjust. (gsi_last_1): Rename from gsi_last, but take pointer to sequence. (gsi_last): Macro to wrap gsi_last_1 taking pointer of argument. (gsi_last_bb): Adjust. (gsi_seq): Adjust. * tree-flow-inline.h (phi_nodes_ptr): New function. * gimple-iterator.c (gsi_insert_seq_nodes_before): Adjust to datastructure and interface change. (gsi_insert_seq_before_without_update): Ditto. (gsi_insert_seq_nodes_after): Ditto. (gsi_insert_seq_after_without_update): Ditto. (gsi_split_seq_after): Ditto, don't use gimple_seq_alloc. (gsi_split_seq_before): Ditto. (gsi_start_phis): Adjust. * tree-vect-loop.c (vect_determine_vectorization_factor): Use gsi_none. (vect_transform_loop): Ditto. * gimple.c (gimple_seq_add_stmt, gimple_seq_add_seq, gimple_seq_copy): Don't use gimple_seq_alloc. * gimplify.c (gimple_seq_add_stmt_without_update): Ditto. (gimplify_seq_add_seq): Ditto. * lto-streamer-in.c (make_new_block): Ditto. * tree-cfg.c (create_bb): Ditto. * tree-sra.c (initialize_parameter_reductions): Ditto. * gimple.h (gimple_seq_first, gimple_seq_first_stmt, gimple_seq_last, gimple_seq_last_stmt, gimple_seq_set_last, gimple_seq_set_first, gimple_seq_empty_p, gimple_seq_alloc_with_stmt, bb_seq, set_bb_seq): Move down to after gimple_statement_d definition. * gimple-fold.c (gimplify_and_update_call_from_tree): Use gsi_replace_with_seq, instead of inserting itself. * gimple-iterator.c (gsi_replace_with_seq): New function. * tree-ssa-forwprop.c (forward_propagate_comparison): Take iterator instead of statement, advance it. (ssa_forward_propagate_and_combine): Adjust call to above. * tree-phinodes.c (add_phi_node_to_bb): Tidy, don't use gimple_seq_alloc. * omp-low.c (finalize_task_copyfn): Don't use gimple_seq_alloc. * tree-nested.c (walk_gimple_omp_for): Ditto. * trans-mem.c (lower_transaction): Ditto. * tree-eh.c (do_return_redirection): Ditto. (do_goto_redirection): Ditto. (lower_try_finally_switch): Ditto. * gimplify.c (gimplify_stmt): Ditto. (gimplify_scan_omp_clauses): Ditto. (gimplify_omp_for): Ditto. (gimplify_function_tree): Ditto. * gimple-fold.c (gimplify_and_update_call_from_tree): Ditto. * tree-mudflap.c (mf_decl_cache_locals): Ditto. (mf_build_check_statement_for): Ditto. (mx_register_decls): Ditto. * graphite-sese-to-poly.c (remove_invariant_phi): Ditto, and don't use itertors to append. (insert_stmts): Ditto. (insert_out_of_ssa_copy): Ditto. (insert_out_of_ssa_copy_on_edge): Ditto. * gimple.h (gimple_bind_body_ptr): New function. (gimple_bind_body): Use it. (gimple_catch_handler): Use gimple_catch_handler_ptr. (gimple_eh_filter_failure_ptr): New function. (gimple_eh_filter_failure): Use it. (gimple_eh_else_n_body_ptr): New function. (gimple_eh_else_n_body): Use it. (gimple_eh_else_e_body_ptr): New function. (gimple_eh_else_e_body): Use it. (gimple_try_eval_ptr): New function. (gimple_try_eval): Use it. (gimple_try_cleanup_ptr): New function. (gimple_try_cleanup): Use it. (gimple_wce_cleanup_ptr): New function. (gimple_wce_cleanup): Use it. (gimple_omp_body_ptr): New function. (gimple_omp_body): Use it. (gimple_omp_for_pre_body_ptr): New function. (gimple_omp_for_pre_body): Use it. (gimple_transaction_body_ptr): New function. (gimple_transaction_body): Use it. (gsi_split_seq_before): Adjust to return nothing and take pointer to sequence. (gsi_set_stmt): Declare. (gsi_replace_with_seq): Declare. (walk_gimple_seq_mod): Declare. * function.h (struct function <gimple_body>): Use typedef gimple_seq. * gimple-iterator.c (gsi_set_stmt): New function. (gsi_split_seq_before): Return new sequence via pointer argument. (gsi_replace): Use gsi_set_stmt. * tree-ssa-loop-im.c (move_computations_stmt): First remove then insert stmt. * tree-complex.c (update_complex_components_on_edge): Don't copy gsi. * tree-phinodes.c (resize_phi_node): Don't resize stmt in-place, return new stmt. (reserve_phi_args_for_new_edge): Change call to above, use gsi_set_stmt. * omp-low.c (lower_omp): Change prototype to take pointer to sequence. (lower_rec_input_clauses): Use gimple_seq_add_seq instead of iterators. Adjust call to lower_omp. (lower_lastprivate_clauses): Adjust call to lower_omp. (lower_reduction_clauses): Ditto. (expand_omp_taskreg): Nullify non-cfg body of child_fn. (lower_omp_sections): Don't explicitely count sequence length, nullify lowered bodies earlier, ensure stmts are part of only one sequence, adjust call to lower_omp. (lower_omp_single): Ensure stmts are part of only one sequence, adjust call to lower_omp. (lower_omp_master): Ditto. (lower_omp_ordered): Ditto. (lower_omp_critical): Ditto. (lower_omp_for): Ditto. (lower_omp_taskreg): Ditto, tidy. (lower_omp_1): Adjust calls to lower_omp. (execute_lower_omp): Ditto. (lower_omp): Adjust to take pointer to sequence. (diagnose_sb_2): Use walk_gimple_seq_mod. (diagnose_omp_structured_block_errors): Ditto and set possibly changed function body. * gimple-low.c (lower_function_body): Set function body after it stabilizes. (lower_sequence): Adjust to take pointer to sequence. (lower_omp_directive): Ensure stmt isn't put twice into the sequence, adjust call to lower_sequence. (lower_stmt): Adjust calls to lower_sequence. (lower_gimple_bind): Ditto. (gimple_try_catch_may_fallthru): Call gsi_start with lvalue. * tree-nested.c (walk_body): Take pointer to sequence, use walk_gimple_seq_mod. (walk_function): Adjust call to walk_body, set possibly changed body. (walk_gimple_omp_for): Adjust calls to walk_body. (convert_nonlocal_omp_clauses): Ditto. (convert_nonlocal_reference_stmt): Ditto. (convert_local_omp_clauses): Ditto. (convert_local_reference_stmt): Ditto. (convert_tramp_reference_stmt): Ditto. (convert_gimple_call): Ditto. (convert_nl_goto_reference): Use local iterator copy. * gimple.c (walk_gimple_seq_mod): Renamed from walk_gimple_seq, but taking pointer to sequence, ensure gsi_start is called with callers lvalue. (walk_gimple_seq): New wrapper around walk_gimple_seq_mod, asserting that the sequence head didn't change. (walk_gimple_stmt): Replace all calls to walk_gimple_seq with walk_gimple_seq_mod. * trans-mem.c (lower_transaction): Use walk_gimple_seq_mod. (execute_lower_tm): Ditto, and set possibly changed body. * tree-eh.c (lower_eh_constructs_1): Take pointer to sequence, call gsi_start with that lvalue. (replace_goto_queue_stmt_list): Ditto. (replace_goto_queue_1): Adjust calls to replace_goto_queue_stmt_list. (replace_goto_queue): Ditto. (lower_try_finally_nofallthru): Adjust calls to lower_eh_constructs_1. (lower_try_finally_onedest): Ditto. (lower_try_finally_copy): Ditto. (lower_try_finally_switch): Ditto. (lower_try_finally): Ditto. (lower_eh_filter): Ditto. (lower_eh_must_not_throw): Ditto. (lower_cleanup): Ditto. (lower_eh_constructs_2): Ditto. (lower_catch): Ditto, and ensure gsi_start is called with lvalue. (lower_eh_constructs): Adjust calls to lower_eh_constructs_1, and set possibly changed body. (optimize_double_finally): Call gsi_start with lvalue. * tree-cfg.c (make_blocks): Adjust call to gsi_split_seq_before. (gimple_split_block): Ditto. (gimple_merge_blocks): Use gsi_start_phis. (move_stmt_r): Use walk_gimple_seq_mod. * tree-ssa-dse.c (dse_enter_block): Use gsi_last_bb. * cgraphbuild.c (build_cgraph_edges): Use gsi_start_phis. (rebuild_cgraph_edges): Ditto. (cgraph_rebuild_references): Ditto. * ipa-prop.c (ipa_analyze_params_uses): Ditto. * tree-inline.c (copy_phis_for_bb): Ditto. * tree-ssa-dce.c: Ditto. * cgraphunit.c (cgraph_analyze_function): Use gimple_has_body_p. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187053 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r--gcc/tree-eh.c88
1 files changed, 42 insertions, 46 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 0241a5f1bc4..ef2b5848569 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -406,7 +406,7 @@ static gimple_seq lower_eh_must_not_throw (struct leh_state *, gimple);
#define LARGE_GOTO_QUEUE 20
-static void lower_eh_constructs_1 (struct leh_state *state, gimple_seq seq);
+static void lower_eh_constructs_1 (struct leh_state *state, gimple_seq *seq);
static gimple_seq
find_goto_replacement (struct leh_tf_state *tf, treemple stmt)
@@ -481,7 +481,7 @@ replace_goto_queue_cond_clause (tree *tp, struct leh_tf_state *tf,
/* The real work of replace_goto_queue. Returns with TSI updated to
point to the next statement. */
-static void replace_goto_queue_stmt_list (gimple_seq, struct leh_tf_state *);
+static void replace_goto_queue_stmt_list (gimple_seq *, struct leh_tf_state *);
static void
replace_goto_queue_1 (gimple stmt, struct leh_tf_state *tf,
@@ -511,18 +511,18 @@ replace_goto_queue_1 (gimple stmt, struct leh_tf_state *tf,
break;
case GIMPLE_TRY:
- replace_goto_queue_stmt_list (gimple_try_eval (stmt), tf);
- replace_goto_queue_stmt_list (gimple_try_cleanup (stmt), tf);
+ replace_goto_queue_stmt_list (gimple_try_eval_ptr (stmt), tf);
+ replace_goto_queue_stmt_list (gimple_try_cleanup_ptr (stmt), tf);
break;
case GIMPLE_CATCH:
- replace_goto_queue_stmt_list (gimple_catch_handler (stmt), tf);
+ replace_goto_queue_stmt_list (gimple_catch_handler_ptr (stmt), tf);
break;
case GIMPLE_EH_FILTER:
- replace_goto_queue_stmt_list (gimple_eh_filter_failure (stmt), tf);
+ replace_goto_queue_stmt_list (gimple_eh_filter_failure_ptr (stmt), tf);
break;
case GIMPLE_EH_ELSE:
- replace_goto_queue_stmt_list (gimple_eh_else_n_body (stmt), tf);
- replace_goto_queue_stmt_list (gimple_eh_else_e_body (stmt), tf);
+ replace_goto_queue_stmt_list (gimple_eh_else_n_body_ptr (stmt), tf);
+ replace_goto_queue_stmt_list (gimple_eh_else_e_body_ptr (stmt), tf);
break;
default:
@@ -536,9 +536,9 @@ replace_goto_queue_1 (gimple stmt, struct leh_tf_state *tf,
/* A subroutine of replace_goto_queue. Handles GIMPLE_SEQ. */
static void
-replace_goto_queue_stmt_list (gimple_seq seq, struct leh_tf_state *tf)
+replace_goto_queue_stmt_list (gimple_seq *seq, struct leh_tf_state *tf)
{
- gimple_stmt_iterator gsi = gsi_start (seq);
+ gimple_stmt_iterator gsi = gsi_start (*seq);
while (!gsi_end_p (gsi))
replace_goto_queue_1 (gsi_stmt (gsi), tf, &gsi);
@@ -551,8 +551,8 @@ replace_goto_queue (struct leh_tf_state *tf)
{
if (tf->goto_queue_active == 0)
return;
- replace_goto_queue_stmt_list (tf->top_p_seq, tf);
- replace_goto_queue_stmt_list (eh_seq, tf);
+ replace_goto_queue_stmt_list (&tf->top_p_seq, tf);
+ replace_goto_queue_stmt_list (&eh_seq, tf);
}
/* Add a new record to the goto queue contained in TF. NEW_STMT is the
@@ -731,9 +731,6 @@ do_return_redirection (struct goto_queue_node *q, tree finlab, gimple_seq mod)
q->cont_stmt = q->stmt.g;
- if (!q->repl_stmt)
- q->repl_stmt = gimple_seq_alloc ();
-
if (mod)
gimple_seq_add_seq (&q->repl_stmt, mod);
@@ -750,8 +747,6 @@ do_goto_redirection (struct goto_queue_node *q, tree finlab, gimple_seq mod,
gimple x;
gcc_assert (q->is_label);
- if (!q->repl_stmt)
- q->repl_stmt = gimple_seq_alloc ();
q->cont_stmt = gimple_build_goto (VEC_index (tree, tf->dest_array, q->index));
@@ -1050,13 +1045,13 @@ lower_try_finally_nofallthru (struct leh_state *state,
if (eh_else)
{
finally = gimple_eh_else_n_body (eh_else);
- lower_eh_constructs_1 (state, finally);
+ lower_eh_constructs_1 (state, &finally);
gimple_seq_add_seq (&tf->top_p_seq, finally);
if (tf->may_throw)
{
finally = gimple_eh_else_e_body (eh_else);
- lower_eh_constructs_1 (state, finally);
+ lower_eh_constructs_1 (state, &finally);
emit_post_landing_pad (&eh_seq, tf->region);
gimple_seq_add_seq (&eh_seq, finally);
@@ -1064,7 +1059,7 @@ lower_try_finally_nofallthru (struct leh_state *state,
}
else
{
- lower_eh_constructs_1 (state, finally);
+ lower_eh_constructs_1 (state, &finally);
gimple_seq_add_seq (&tf->top_p_seq, finally);
if (tf->may_throw)
@@ -1105,7 +1100,7 @@ lower_try_finally_onedest (struct leh_state *state, struct leh_tf_state *tf)
finally = gimple_eh_else_n_body (x);
}
- lower_eh_constructs_1 (state, finally);
+ lower_eh_constructs_1 (state, &finally);
if (tf->may_throw)
{
@@ -1193,7 +1188,7 @@ lower_try_finally_copy (struct leh_state *state, struct leh_tf_state *tf)
if (tf->may_fallthru)
{
seq = lower_try_finally_dup_block (finally, state);
- lower_eh_constructs_1 (state, seq);
+ lower_eh_constructs_1 (state, &seq);
gimple_seq_add_seq (&new_stmt, seq);
tmp = lower_try_finally_fallthru_label (tf);
@@ -1209,7 +1204,7 @@ lower_try_finally_copy (struct leh_state *state, struct leh_tf_state *tf)
seq = gimple_eh_else_e_body (eh_else);
else
seq = lower_try_finally_dup_block (finally, state);
- lower_eh_constructs_1 (state, seq);
+ lower_eh_constructs_1 (state, &seq);
emit_post_landing_pad (&eh_seq, tf->region);
gimple_seq_add_seq (&eh_seq, seq);
@@ -1259,7 +1254,7 @@ lower_try_finally_copy (struct leh_state *state, struct leh_tf_state *tf)
gimple_seq_add_stmt (&new_stmt, x);
seq = lower_try_finally_dup_block (finally, state);
- lower_eh_constructs_1 (state, seq);
+ lower_eh_constructs_1 (state, &seq);
gimple_seq_add_seq (&new_stmt, seq);
gimple_seq_add_stmt (&new_stmt, q->cont_stmt);
@@ -1306,7 +1301,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
int nlabels, ndests, j, last_case_index;
tree last_case;
VEC (tree,heap) *case_label_vec;
- gimple_seq switch_body;
+ gimple_seq switch_body = NULL;
gimple x, eh_else;
tree tmp;
gimple switch_stmt;
@@ -1317,7 +1312,6 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
/* The location of the finally block. */
location_t finally_loc;
- switch_body = gimple_seq_alloc ();
finally = gimple_try_cleanup (tf->top_p);
eh_else = get_eh_else (finally);
@@ -1331,7 +1325,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
: tf_loc;
/* Lower the finally block itself. */
- lower_eh_constructs_1 (state, finally);
+ lower_eh_constructs_1 (state, &finally);
/* Prepare for switch statement generation. */
nlabels = VEC_length (tree, tf->dest_array);
@@ -1382,7 +1376,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
if (tf->may_throw)
{
finally = gimple_eh_else_e_body (eh_else);
- lower_eh_constructs_1 (state, finally);
+ lower_eh_constructs_1 (state, &finally);
emit_post_landing_pad (&eh_seq, tf->region);
gimple_seq_add_seq (&eh_seq, finally);
@@ -1426,12 +1420,10 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
entrance through a particular edge. */
for (; q < qe; ++q)
{
- gimple_seq mod;
+ gimple_seq mod = NULL;
int switch_id;
unsigned int case_index;
- mod = gimple_seq_alloc ();
-
if (q->index < 0)
{
x = gimple_build_assign (finally_tmp,
@@ -1623,7 +1615,7 @@ lower_try_finally (struct leh_state *state, gimple tp)
old_eh_seq = eh_seq;
eh_seq = NULL;
- lower_eh_constructs_1 (&this_state, gimple_try_eval(tp));
+ lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
/* Determine if the try block is escaped through the bottom. */
this_tf.may_fallthru = gimple_seq_may_fallthru (gimple_try_eval (tp));
@@ -1706,7 +1698,7 @@ lower_catch (struct leh_state *state, gimple tp)
struct leh_state this_state = *state;
gimple_stmt_iterator gsi;
tree out_label;
- gimple_seq new_seq;
+ gimple_seq new_seq, cleanup;
gimple x;
location_t try_catch_loc = gimple_location (tp);
@@ -1716,7 +1708,7 @@ lower_catch (struct leh_state *state, gimple tp)
this_state.cur_region = try_region;
}
- lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
+ lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
if (!eh_region_may_contain_throw (try_region))
return gimple_try_eval (tp);
@@ -1729,7 +1721,8 @@ lower_catch (struct leh_state *state, gimple tp)
this_state.ehp_region = try_region;
out_label = NULL;
- for (gsi = gsi_start (gimple_try_cleanup (tp));
+ cleanup = gimple_try_cleanup (tp);
+ for (gsi = gsi_start (cleanup);
!gsi_end_p (gsi);
gsi_next (&gsi))
{
@@ -1741,7 +1734,7 @@ lower_catch (struct leh_state *state, gimple tp)
c = gen_eh_region_catch (try_region, gimple_catch_types (gcatch));
handler = gimple_catch_handler (gcatch);
- lower_eh_constructs_1 (&this_state, handler);
+ lower_eh_constructs_1 (&this_state, &handler);
c->label = create_artificial_label (UNKNOWN_LOCATION);
x = gimple_build_label (c->label);
@@ -1787,7 +1780,7 @@ lower_eh_filter (struct leh_state *state, gimple tp)
this_state.cur_region = this_region;
}
- lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
+ lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
if (!eh_region_may_contain_throw (this_region))
return gimple_try_eval (tp);
@@ -1803,7 +1796,7 @@ lower_eh_filter (struct leh_state *state, gimple tp)
x = gimple_build_label (this_region->u.allowed.label);
gimple_seq_add_stmt (&new_seq, x);
- lower_eh_constructs_1 (&this_state, gimple_eh_filter_failure (inner));
+ lower_eh_constructs_1 (&this_state, gimple_eh_filter_failure_ptr (inner));
gimple_seq_add_seq (&new_seq, gimple_eh_filter_failure (inner));
gimple_try_set_cleanup (tp, new_seq);
@@ -1838,7 +1831,7 @@ lower_eh_must_not_throw (struct leh_state *state, gimple tp)
this_state.cur_region = this_region;
}
- lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
+ lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
return gimple_try_eval (tp);
}
@@ -1861,7 +1854,7 @@ lower_cleanup (struct leh_state *state, gimple tp)
this_state.cur_region = this_region;
}
- lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
+ lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
if (cleanup_dead || !eh_region_may_contain_throw (this_region))
return gimple_try_eval (tp);
@@ -1881,7 +1874,7 @@ lower_cleanup (struct leh_state *state, gimple tp)
{
/* In this case honor_protect_cleanup_actions had nothing to do,
and we should process this normally. */
- lower_eh_constructs_1 (state, gimple_try_cleanup (tp));
+ lower_eh_constructs_1 (state, gimple_try_cleanup_ptr (tp));
result = frob_into_branch_around (tp, this_region,
fake_tf.fallthru_label);
}
@@ -2010,7 +2003,7 @@ lower_eh_constructs_2 (struct leh_state *state, gimple_stmt_iterator *gsi)
if (!x)
{
replace = gimple_try_eval (stmt);
- lower_eh_constructs_1 (state, replace);
+ lower_eh_constructs_1 (state, &replace);
}
else
switch (gimple_code (x))
@@ -2057,10 +2050,10 @@ lower_eh_constructs_2 (struct leh_state *state, gimple_stmt_iterator *gsi)
/* A helper to unwrap a gimple_seq and feed stmts to lower_eh_constructs_2. */
static void
-lower_eh_constructs_1 (struct leh_state *state, gimple_seq seq)
+lower_eh_constructs_1 (struct leh_state *state, gimple_seq *pseq)
{
gimple_stmt_iterator gsi;
- for (gsi = gsi_start (seq); !gsi_end_p (gsi);)
+ for (gsi = gsi_start (*pseq); !gsi_end_p (gsi);)
lower_eh_constructs_2 (state, &gsi);
}
@@ -2079,7 +2072,8 @@ lower_eh_constructs (void)
memset (&null_state, 0, sizeof (null_state));
collect_finally_tree_1 (bodyp, NULL);
- lower_eh_constructs_1 (&null_state, bodyp);
+ lower_eh_constructs_1 (&null_state, &bodyp);
+ gimple_set_body (current_function_decl, bodyp);
/* We assume there's a return statement, or something, at the end of
the function, and thus ploping the EH sequence afterward won't
@@ -2874,8 +2868,10 @@ optimize_double_finally (gimple one, gimple two)
{
gimple oneh;
gimple_stmt_iterator gsi;
+ gimple_seq cleanup;
- gsi = gsi_start (gimple_try_cleanup (one));
+ cleanup = gimple_try_cleanup (one);
+ gsi = gsi_start (cleanup);
if (!gsi_one_before_end_p (gsi))
return;