diff options
author | David Malcolm <dmalcolm@redhat.com> | 2014-08-22 20:49:31 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2014-08-22 20:49:31 +0000 |
commit | 5d86f5f999de9315fc3b2220d7a04577662fbf20 (patch) | |
tree | 532a948321aba61df69e0c9c2333f8510d4068ff /gcc/reload.c | |
parent | 7839a073c18dbc7b9e3f7539c87ed064914ddfd3 (diff) | |
download | gcc-5d86f5f999de9315fc3b2220d7a04577662fbf20.zip gcc-5d86f5f999de9315fc3b2220d7a04577662fbf20.tar.gz gcc-5d86f5f999de9315fc3b2220d7a04577662fbf20.tar.bz2 |
reload: Use rtx_insn (also touches caller-save.c and config/arc/arc)
gcc/
* reload.h (struct insn_chain): Strengthen field "insn" from rtx
to rtx_insn *.
(find_reloads): Likewise for param 1.
(subst_reloads): Likewise for sole param.
(find_equiv_reg): Likwise for param 2.
(regno_clobbered_p): Likwise for param 2.
(reload): Likewise for param 1.
* caller-save.c (save_call_clobbered_regs): Strengthen local
"insn" from rtx to rtx_insn *.
(insert_one_insn): Likewise for local "insn".
* reload.c (this_insn): Likewise for this global.
(find_reloads): Likewise for param "insn".
(find_reloads_toplev): Likewise.
(find_reloads_address): Likewise.
(subst_reg_equivs): Likewise.
(update_auto_inc_notes): Likewise.
(find_reloads_address_1): Likewise.
(find_reloads_subreg_address): Likewise.
(subst_reloads): Likewise.
(find_equiv_reg): Likewise, also for local "p".
(regno_clobbered_p): Likewise for param "insn".
* reload1.c (reg_reloaded_insn): Likewise for the elements of this
array.
(spill_reg_store): Likewise for the elements of this array.
(remove_init_insns): Likewise for local "equiv_insn".
(will_delete_init_insn_p): Likewise for param "insn".
(reload): Likewise for param ""first" and local "insn".
(calculate_needs_all_insns): Strengthen local "insn" from rtx to
rtx_insn *.
(calculate_elim_costs_all_insns): Likewise.
(delete_caller_save_insns): Likewise.
(spill_failure): Likewise for param "insn".
(delete_dead_insn): Likewise.
(set_label_offsets): Likewise.
(eliminate_regs_in_insn): Likewise, also for locals "base_insn" and
"prev_insn".
(elimination_costs_in_insn): Likewise for param "insn".
(set_initial_eh_label_offset): Replace use of NULL_RTX with NULL
when referring to an insn.
(set_initial_label_offsets): Likewise.
(set_offsets_for_label): Strengthen param "insn" from rtx to
rtx_insn *.
(init_eliminable_invariants): Likewise for param "first" and local
"insn".
(fixup_eh_region_note): Likewise for param "insn".
(reload_as_needed): Likewise for locals "prev", "insn",
"old_next", "old_prev", "next".
(gen_reload_chain_without_interm_reg_p): Likewise for locals "insn",
"last".
(reload_inheritance_insn): Strengthen elements of this array from
rtx to rtx_insn *.
(failed_reload): Likewise for param "insn".
(choose_reload_regs): Likewise for local "insn". Replace use of
NULL_RTX with NULL when referring to an insn.
(input_reload_insns): Strengthen elements of this array from rtx
to rtx_insn *.
(other_input_address_reload_insns): Likewise for this global.
(other_input_reload_insns): Likewise for this global.
(input_address_reload_insns): Likwise for the elements of this
array.
(inpaddr_address_reload_insns): Likwise for the elements of this
array.
(output_reload_insns): Likewise for the elements of this array.
(output_address_reload_insns): Likewise for the elements of this
array.
(outaddr_address_reload_insns): Likewise for the elements of this
array.
(operand_reload_insns): Likewise for this global.
(other_operand_reload_insns): Likewise for this global.
(other_output_reload_insns): Likewise for the elements of this
array.
(new_spill_reg_store): Likewise for the elements of this
array.
(emit_input_reload_insns): Likewise for locals "insn", "temp".
Strengthen local "where" from rtx * to rtx_insn **.
(emit_output_reload_insns): Strengthen locals "insn", "p", "next"
from rtx to rtx_insn *.
(do_input_reload): Likewise for local "insn".
(do_output_reload): Likewise for local "insn".
(emit_reload_insns): Likewise for locals "insn" and "store_insn".
(emit_insn_if_valid_for_reload): Likewise for return type and local
"last". Add checked cast to rtx_insn when returning "insn" since
this has been through emit_insn.
(gen_reload): Strengthen return type and locals "last", "insn", "set"
from rtx to rtx_insn *. Add checked cast to rtx_insn when
returning "insn" since it's been through
emit_insn_if_valid_for_reload at this point.
(delete_output_reload): Strengthen param "insn" and locals
"output_reload_insn", "i2" from rtx to rtx_insn *.
(delete_address_reloads): Likewise for params "dead_insn",
"current_insn" and locals "prev", "next".
(delete_address_reloads_1): Likewise for params "dead_insn",
"current_insn" and locals "prev", "i2".
(inc_for_reload): Likewise for locals "last", "add_insn".
(add_auto_inc_notes): Strengthen param "insn" from rtx to
rtx_insn *.
* config/arc/arc-protos.h (regno_clobbered_p): Likewise for 2nd
param of this duplicate of the prototype from reload.h
From-SVN: r214370
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index e55968e..e27635b 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -191,7 +191,7 @@ static int secondary_memlocs_elim_used = 0; /* The instruction we are doing reloads for; so we can test whether a register dies in it. */ -static rtx this_insn; +static rtx_insn *this_insn; /* Nonzero if this instruction is a user-specified asm with operands. */ static int this_insn_is_asm; @@ -264,24 +264,24 @@ static int hard_reg_set_here_p (unsigned int, unsigned int, rtx); static struct decomposition decompose (rtx); static int immune_p (rtx, rtx, struct decomposition); static bool alternative_allows_const_pool_ref (rtx, const char *, int); -static rtx find_reloads_toplev (rtx, int, enum reload_type, int, int, rtx, - int *); +static rtx find_reloads_toplev (rtx, int, enum reload_type, int, int, + rtx_insn *, int *); static rtx make_memloc (rtx, int); static int maybe_memory_address_addr_space_p (enum machine_mode, rtx, addr_space_t, rtx *); static int find_reloads_address (enum machine_mode, rtx *, rtx, rtx *, - int, enum reload_type, int, rtx); -static rtx subst_reg_equivs (rtx, rtx); + int, enum reload_type, int, rtx_insn *); +static rtx subst_reg_equivs (rtx, rtx_insn *); static rtx subst_indexed_address (rtx); -static void update_auto_inc_notes (rtx, int, int); +static void update_auto_inc_notes (rtx_insn *, int, int); static int find_reloads_address_1 (enum machine_mode, addr_space_t, rtx, int, enum rtx_code, enum rtx_code, rtx *, - int, enum reload_type,int, rtx); + int, enum reload_type,int, rtx_insn *); static void find_reloads_address_part (rtx, rtx *, enum reg_class, enum machine_mode, int, enum reload_type, int); static rtx find_reloads_subreg_address (rtx, int, enum reload_type, - int, rtx, int *); + int, rtx_insn *, int *); static void copy_replacements_1 (rtx *, rtx *, int); static int find_inc_amount (rtx, rtx); static int refers_to_mem_for_reload_p (rtx); @@ -2609,7 +2609,7 @@ safe_from_earlyclobber (rtx op, rtx clobber) commutative operands, reg_equiv_address substitution, or whatever. */ int -find_reloads (rtx insn, int replace, int ind_levels, int live_known, +find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known, short *reload_reg_p) { int insn_code_number; @@ -4667,7 +4667,7 @@ alternative_allows_const_pool_ref (rtx mem ATTRIBUTE_UNUSED, static rtx find_reloads_toplev (rtx x, int opnum, enum reload_type type, - int ind_levels, int is_set_dest, rtx insn, + int ind_levels, int is_set_dest, rtx_insn *insn, int *address_reloaded) { RTX_CODE code = GET_CODE (x); @@ -4875,7 +4875,7 @@ maybe_memory_address_addr_space_p (enum machine_mode mode, rtx ad, static int find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad, rtx *loc, int opnum, enum reload_type type, - int ind_levels, rtx insn) + int ind_levels, rtx_insn *insn) { addr_space_t as = memrefloc? MEM_ADDR_SPACE (*memrefloc) : ADDR_SPACE_GENERIC; @@ -5277,7 +5277,7 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad, front of it for pseudos that we have to replace with stack slots. */ static rtx -subst_reg_equivs (rtx ad, rtx insn) +subst_reg_equivs (rtx ad, rtx_insn *insn) { RTX_CODE code = GET_CODE (ad); int i; @@ -5453,7 +5453,7 @@ subst_indexed_address (rtx addr) RELOADNUM is the reload number. */ static void -update_auto_inc_notes (rtx insn ATTRIBUTE_UNUSED, int regno ATTRIBUTE_UNUSED, +update_auto_inc_notes (rtx_insn *insn ATTRIBUTE_UNUSED, int regno ATTRIBUTE_UNUSED, int reloadnum ATTRIBUTE_UNUSED) { #ifdef AUTO_INC_DEC @@ -5501,7 +5501,7 @@ find_reloads_address_1 (enum machine_mode mode, addr_space_t as, rtx x, int context, enum rtx_code outer_code, enum rtx_code index_code, rtx *loc, int opnum, enum reload_type type, - int ind_levels, rtx insn) + int ind_levels, rtx_insn *insn) { #define REG_OK_FOR_CONTEXT(CONTEXT, REGNO, MODE, AS, OUTER, INDEX) \ ((CONTEXT) == 0 \ @@ -6135,7 +6135,8 @@ find_reloads_address_part (rtx x, rtx *loc, enum reg_class rclass, static rtx find_reloads_subreg_address (rtx x, int opnum, enum reload_type type, - int ind_levels, rtx insn, int *address_reloaded) + int ind_levels, rtx_insn *insn, + int *address_reloaded) { enum machine_mode outer_mode = GET_MODE (x); enum machine_mode inner_mode = GET_MODE (SUBREG_REG (x)); @@ -6244,7 +6245,7 @@ find_reloads_subreg_address (rtx x, int opnum, enum reload_type type, Return the rtx that X translates into; usually X, but modified. */ void -subst_reloads (rtx insn) +subst_reloads (rtx_insn *insn) { int i; @@ -6671,10 +6672,10 @@ refers_to_mem_for_reload_p (rtx x) as if it were a constant except that sp is required to be unchanging. */ rtx -find_equiv_reg (rtx goal, rtx insn, enum reg_class rclass, int other, +find_equiv_reg (rtx goal, rtx_insn *insn, enum reg_class rclass, int other, short *reload_reg_p, int goalreg, enum machine_mode mode) { - rtx p = insn; + rtx_insn *p = insn; rtx goaltry, valtry, value, where; rtx pat; int regno = -1; @@ -7207,7 +7208,7 @@ reg_inc_found_and_valid_p (unsigned int regno, unsigned int endregno, REG_INC. REGNO must refer to a hard register. */ int -regno_clobbered_p (unsigned int regno, rtx insn, enum machine_mode mode, +regno_clobbered_p (unsigned int regno, rtx_insn *insn, enum machine_mode mode, int sets) { unsigned int nregs, endregno; |