From b47aae36689619e02362c972793cdd4f4eeb4e22 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 19 Aug 2014 19:52:55 +0000 Subject: [PATCH] cfgexpand.c: Use rtx_insn 2014-08-19 David Malcolm * cfgexpand.c (expand_used_vars): Strengthen return type from rtx to rtx_insn *; also for local "var_end_seq". (maybe_dump_rtl_for_gimple_stmt): Likewise for param "since". (maybe_cleanup_end_of_block): Likewise for param "last" and local "insn". (expand_gimple_cond): Likewise for locals "last2" and "last". (mark_transaction_restart_calls): Likewise for local "insn". (expand_gimple_stmt): Likewise for return type and locals "last" and "insn". (expand_gimple_tailcall): Likewise for locals "last2" and "last". (avoid_complex_debug_insns): Likewise for param "insn". (expand_debug_locations): Likewise for locals "insn", "last", "prev_insn" and "insn2". (expand_gimple_basic_block): Likewise for local "last". (construct_exit_block): Likewise for locals "head", "end", "orig_end". (pass_expand::execute): Likewise for locals "var_seq", "var_ret_seq", "next". From-SVN: r214190 --- gcc/ChangeLog | 21 +++++++++++++++++++++ gcc/cfgexpand.c | 44 +++++++++++++++++++++++--------------------- 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 027c4ad..bd2089e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,26 @@ 2014-08-19 David Malcolm + * cfgexpand.c (expand_used_vars): Strengthen return type from rtx + to rtx_insn *; also for local "var_end_seq". + (maybe_dump_rtl_for_gimple_stmt): Likewise for param "since". + (maybe_cleanup_end_of_block): Likewise for param "last" and local + "insn". + (expand_gimple_cond): Likewise for locals "last2" and "last". + (mark_transaction_restart_calls): Likewise for local "insn". + (expand_gimple_stmt): Likewise for return type and locals "last" + and "insn". + (expand_gimple_tailcall): Likewise for locals "last2" and "last". + (avoid_complex_debug_insns): Likewise for param "insn". + (expand_debug_locations): Likewise for locals "insn", "last", + "prev_insn" and "insn2". + (expand_gimple_basic_block): Likewise for local "last". + (construct_exit_block): Likewise for locals "head", "end", + "orig_end". + (pass_expand::execute): Likewise for locals "var_seq", + "var_ret_seq", "next". + +2014-08-19 David Malcolm + * asan.h (asan_emit_stack_protection): Strengthen return type from rtx to rtx_insn *. * asan.c (asan_emit_stack_protection): Likewise. Add local diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 1235ff1..77ead1b 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1674,12 +1674,12 @@ stack_protect_return_slot_p () /* Expand all variables used in the function. */ -static rtx +static rtx_insn * expand_used_vars (void) { tree var, outer_block = DECL_INITIAL (current_function_decl); vec maybe_local_decls = vNULL; - rtx var_end_seq = NULL_RTX; + rtx_insn *var_end_seq = NULL; unsigned i; unsigned len; bool gen_stack_protect_signal = false; @@ -1954,7 +1954,7 @@ expand_used_vars (void) generated for STMT should have been appended. */ static void -maybe_dump_rtl_for_gimple_stmt (gimple stmt, rtx since) +maybe_dump_rtl_for_gimple_stmt (gimple stmt, rtx_insn *since) { if (dump_file && (dump_flags & TDF_DETAILS)) { @@ -2014,7 +2014,7 @@ label_rtx_for_bb (basic_block bb ATTRIBUTE_UNUSED) last instruction before the just emitted jump sequence. */ static void -maybe_cleanup_end_of_block (edge e, rtx last) +maybe_cleanup_end_of_block (edge e, rtx_insn *last) { /* Special case: when jumpif decides that the condition is trivial it emits an unconditional jump (and the necessary @@ -2029,7 +2029,7 @@ maybe_cleanup_end_of_block (edge e, rtx last) normally isn't there in a cleaned CFG), fix it here. */ if (BARRIER_P (get_last_insn ())) { - rtx insn; + rtx_insn *insn; remove_edge (e); /* Now, we have a single successor block, if we have insns to insert on the remaining edge we potentially will insert @@ -2071,7 +2071,7 @@ expand_gimple_cond (basic_block bb, gimple stmt) edge new_edge; edge true_edge; edge false_edge; - rtx last2, last; + rtx_insn *last2, *last; enum tree_code code; tree op0, op1; @@ -2217,7 +2217,7 @@ mark_transaction_restart_calls (gimple stmt) { struct tm_restart_node *n = (struct tm_restart_node *) *slot; tree list = n->label_or_list; - rtx insn; + rtx_insn *insn; for (insn = next_real_insn (get_last_insn ()); !CALL_P (insn); @@ -3352,11 +3352,11 @@ expand_gimple_stmt_1 (gimple stmt) sets REG_EH_REGION notes if necessary and sets the current source location for diagnostics. */ -static rtx +static rtx_insn * expand_gimple_stmt (gimple stmt) { location_t saved_location = input_location; - rtx last = get_last_insn (); + rtx_insn *last = get_last_insn (); int lp_nr; gcc_assert (cfun); @@ -3379,7 +3379,7 @@ expand_gimple_stmt (gimple stmt) lp_nr = lookup_stmt_eh_lp (stmt); if (lp_nr) { - rtx insn; + rtx_insn *insn; for (insn = next_real_insn (last); insn; insn = next_real_insn (insn)) { @@ -3409,7 +3409,7 @@ expand_gimple_stmt (gimple stmt) static basic_block expand_gimple_tailcall (basic_block bb, gimple stmt, bool *can_fallthru) { - rtx last2, last; + rtx_insn *last2, *last; edge e; edge_iterator ei; int probability; @@ -4782,7 +4782,7 @@ expand_debug_source_expr (tree exp) deeper than that, create DEBUG_EXPRs and emit DEBUG_INSNs before INSN. */ static void -avoid_complex_debug_insns (rtx insn, rtx *exp_p, int depth) +avoid_complex_debug_insns (rtx_insn *insn, rtx *exp_p, int depth) { rtx exp = *exp_p; @@ -4834,8 +4834,8 @@ avoid_complex_debug_insns (rtx insn, rtx *exp_p, int depth) static void expand_debug_locations (void) { - rtx insn; - rtx last = get_last_insn (); + rtx_insn *insn; + rtx_insn *last = get_last_insn (); int save_strict_alias = flag_strict_aliasing; /* New alias sets while setting up memory attributes cause @@ -4847,7 +4847,8 @@ expand_debug_locations (void) if (DEBUG_INSN_P (insn)) { tree value = (tree)INSN_VAR_LOCATION_LOC (insn); - rtx val, prev_insn, insn2; + rtx val; + rtx_insn *prev_insn, *insn2; enum machine_mode mode; if (value == NULL_TREE) @@ -4892,7 +4893,8 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls) gimple_stmt_iterator gsi; gimple_seq stmts; gimple stmt = NULL; - rtx note, last; + rtx note; + rtx_insn *last; edge e; edge_iterator ei; @@ -5324,14 +5326,14 @@ set_block_levels (tree block, int level) static void construct_exit_block (void) { - rtx head = get_last_insn (); - rtx end; + rtx_insn *head = get_last_insn (); + rtx_insn *end; basic_block exit_block; edge e, e2; unsigned ix; edge_iterator ei; basic_block prev_bb = EXIT_BLOCK_PTR_FOR_FN (cfun)->prev_bb; - rtx orig_end = BB_END (prev_bb); + rtx_insn *orig_end = BB_END (prev_bb); rtl_profile_for_bb (EXIT_BLOCK_PTR_FOR_FN (cfun)); @@ -5624,7 +5626,7 @@ pass_expand::execute (function *fun) sbitmap blocks; edge_iterator ei; edge e; - rtx var_seq, var_ret_seq; + rtx_insn *var_seq, *var_ret_seq; unsigned i; timevar_push (TV_OUT_OF_SSA); @@ -5841,7 +5843,7 @@ pass_expand::execute (function *fun) if (var_ret_seq) { rtx after = return_label; - rtx next = NEXT_INSN (after); + rtx_insn *next = NEXT_INSN (after); if (next && NOTE_INSN_BASIC_BLOCK_P (next)) after = next; emit_insn_after (var_ret_seq, after); -- 2.7.4