From: Trevor Saunders Date: Mon, 21 Nov 2016 06:14:52 +0000 (+0000) Subject: use rtx_insn * more places where it is obvious X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d8485bdb18df66b06cfee57503cfbf35cef591e7;p=gcc.git use rtx_insn * more places where it is obvious gcc/ChangeLog: 2016-11-21 Trevor Saunders * config/arm/arm.c (legitimize_pic_address): Change to use rtx_insn * as the type of variables. (arm_pic_static_addr): Likewise. (arm_emit_movpair): Likewise. * config/c6x/c6x.c (reorg_split_calls): Likewise. * config/darwin.c (machopic_legitimize_pic_address): Likewise. * config/frv/frv.c (frv_optimize_membar_local): Likewise. * config/frv/frv.md: Likewise. * config/i386/i386-protos.h: Likewise. * config/i386/i386.c (ix86_expand_split_stack_prologue): Likewise. (ix86_split_fp_branch): Likewise. (predict_jump): Likewise. * config/ia64/ia64.c: Likewise. * config/mcore/mcore.c: Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Likewise. * config/s390/s390.c: Likewise. * config/s390/s390.md: Likewise. * config/spu/spu.md: Likewise. * config/tilegx/tilegx.c (tilegx_legitimize_tls_address): Likewise. * lower-subreg.c (resolve_simple_move): Likewise. From-SVN: r242649 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 40d6f8a5cbb..98151600a30 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,29 @@ +2016-11-21 Trevor Saunders + + * config/arm/arm.c (legitimize_pic_address): Change to use + rtx_insn * as the type of variables. + (arm_pic_static_addr): Likewise. + (arm_emit_movpair): Likewise. + * config/c6x/c6x.c (reorg_split_calls): Likewise. + * config/darwin.c (machopic_legitimize_pic_address): Likewise. + * config/frv/frv.c (frv_optimize_membar_local): Likewise. + * config/frv/frv.md: Likewise. + * config/i386/i386-protos.h: Likewise. + * config/i386/i386.c (ix86_expand_split_stack_prologue): + Likewise. + (ix86_split_fp_branch): Likewise. + (predict_jump): Likewise. + * config/ia64/ia64.c: Likewise. + * config/mcore/mcore.c: Likewise. + * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): + Likewise. + * config/s390/s390.c: Likewise. + * config/s390/s390.md: Likewise. + * config/spu/spu.md: Likewise. + * config/tilegx/tilegx.c (tilegx_legitimize_tls_address): + Likewise. + * lower-subreg.c (resolve_simple_move): Likewise. + 2016-11-20 Jeff Law PR target/48551 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index d7ce87c27ee..1935810d469 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -252,7 +252,7 @@ static bool arm_can_eliminate (const int, const int); static void arm_asm_trampoline_template (FILE *); static void arm_trampoline_init (rtx, tree, rtx); static rtx arm_trampoline_adjust_address (rtx); -static rtx arm_pic_static_addr (rtx orig, rtx reg); +static rtx_insn *arm_pic_static_addr (rtx orig, rtx reg); static bool cortex_a9_sched_adjust_cost (rtx_insn *, int, rtx_insn *, int *); static bool xscale_sched_adjust_cost (rtx_insn *, int, rtx_insn *, int *); static bool fa726te_sched_adjust_cost (rtx_insn *, int, rtx_insn *, int *); @@ -6903,8 +6903,6 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg) if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF) { - rtx insn; - if (reg == 0) { gcc_assert (can_create_pseudo_p ()); @@ -6917,6 +6915,7 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg) same segment as the GOT. Unfortunately, the flexibility of linker scripts means that we can't be sure of that in general, so assume that GOTOFF is never valid on VxWorks. */ + rtx_insn *insn; if ((GET_CODE (orig) == LABEL_REF || (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig))) @@ -7155,10 +7154,10 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED) } /* Generate code to load the address of a static var when flag_pic is set. */ -static rtx +static rtx_insn * arm_pic_static_addr (rtx orig, rtx reg) { - rtx l1, labelno, offset_rtx, insn; + rtx l1, labelno, offset_rtx; gcc_assert (flag_pic); @@ -7175,8 +7174,7 @@ arm_pic_static_addr (rtx orig, rtx reg) UNSPEC_SYMBOL_OFFSET); offset_rtx = gen_rtx_CONST (Pmode, offset_rtx); - insn = emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, labelno)); - return insn; + return emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, labelno)); } /* Return nonzero if X is valid as an ARM state addressing register. */ @@ -16928,8 +16926,6 @@ output_mov_long_double_arm_from_arm (rtx *operands) void arm_emit_movpair (rtx dest, rtx src) { - rtx insn; - /* If the src is an immediate, simplify it. */ if (CONST_INT_P (src)) { @@ -16940,14 +16936,14 @@ arm_emit_movpair (rtx dest, rtx src) emit_set_insn (gen_rtx_ZERO_EXTRACT (SImode, dest, GEN_INT (16), GEN_INT (16)), GEN_INT ((val >> 16) & 0x0000ffff)); - insn = get_last_insn (); + rtx_insn *insn = get_last_insn (); set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src)); } return; } emit_set_insn (dest, gen_rtx_HIGH (SImode, src)); emit_set_insn (dest, gen_rtx_LO_SUM (SImode, dest, src)); - insn = get_last_insn (); + rtx_insn *insn = get_last_insn (); set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src)); } diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c index 6cb9185ca02..4d7dd72f1ca 100644 --- a/gcc/config/c6x/c6x.c +++ b/gcc/config/c6x/c6x.c @@ -4729,7 +4729,7 @@ c6x_gen_bundles (void) /* Emit a NOP instruction for CYCLES cycles after insn AFTER. Return it. */ static rtx_insn * -emit_nop_after (int cycles, rtx after) +emit_nop_after (int cycles, rtx_insn *after) { rtx_insn *insn; @@ -4994,7 +4994,8 @@ reorg_split_calls (rtx_insn **call_labels) else { rtx x1, x2; - rtx after2 = find_next_cycle_insn (after1, this_clock + 2); + rtx_insn *after2 = find_next_cycle_insn (after1, + this_clock + 2); if (after2 == NULL_RTX) after2 = after1; x2 = gen_movsi_lo_sum (reg, reg, labelref); diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index ff8600c7441..e9ce6d2ffda 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -843,7 +843,6 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg) ? reg : gen_reg_rtx (Pmode)); rtx mem; - rtx insn; rtx sum; sum = gen_rtx_HIGH (Pmode, offset); @@ -856,7 +855,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg) gen_rtx_LO_SUM (Pmode, hi_sum_reg, copy_rtx (offset))); - insn = emit_insn (gen_rtx_SET (reg, mem)); + rtx_insn *insn = emit_insn (gen_rtx_SET (reg, mem)); set_unique_reg_note (insn, REG_EQUAL, pic_ref); pic_ref = reg; diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index fb01685fb89..b2177ab4bb7 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -7797,8 +7797,8 @@ frv_optimize_membar_local (basic_block bb, struct frv_io *next_io, rtx_insn **last_membar) { HARD_REG_SET used_regs; - rtx next_membar, set; - rtx_insn *insn; + rtx set; + rtx_insn *insn, *next_membar; bool next_is_end_p; /* NEXT_IO is the next I/O operation to be performed after the current diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md index 931a71ddfa8..d59936de0af 100644 --- a/gcc/config/frv/frv.md +++ b/gcc/config/frv/frv.md @@ -7347,9 +7347,8 @@ "" " { - rtx insn; - - insn = emit_insn (gen_symGOT2reg_i (operands[0], operands[1], operands[2], operands[3])); + rtx_insn *insn = emit_insn (gen_symGOT2reg_i (operands[0], operands[1], + operands[2], operands[3])); MEM_READONLY_P (SET_SRC (PATTERN (insn))) = 1; @@ -7431,7 +7430,8 @@ "" " { - rtx insn = emit_insn (gen_symGOTOFF2reg_i (operands[0], operands[1], operands[2], operands[3])); + rtx_insn *insn = emit_insn (gen_symGOTOFF2reg_i (operands[0], operands[1], + operands[2], operands[3])); set_unique_reg_note (insn, REG_EQUAL, operands[1]); @@ -7457,8 +7457,6 @@ "" " { - rtx insn; - if (!can_create_pseudo_p ()) operands[4] = operands[0]; else @@ -7466,8 +7464,8 @@ emit_insn (frv_gen_GPsym2reg (operands[4], operands[2])); - insn = emit_insn (gen_symGOTOFF2reg_i (operands[0], operands[1], - operands[4], operands[3])); + rtx_insn *insn = emit_insn (gen_symGOTOFF2reg_i (operands[0], operands[1], + operands[4], operands[3])); set_unique_reg_note (insn, REG_EQUAL, operands[1]); @@ -7483,8 +7481,6 @@ "" " { - rtx insn; - if (!can_create_pseudo_p ()) { emit_insn (gen_symGOT2reg (operands[0], operands[1], operands[2], @@ -7496,8 +7492,8 @@ emit_insn (frv_gen_GPsym2reg (operands[4], operands[2])); - insn = emit_insn (gen_symGOTOFF2reg_hilo (operands[0], operands[1], - operands[4], operands[3])); + rtx_insn *insn = emit_insn (gen_symGOTOFF2reg_hilo (operands[0], operands[1], + operands[4], operands[3])); set_unique_reg_note (insn, REG_EQUAL, operands[1]); diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index 8eeb0728e96..edd6cbe2618 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -77,10 +77,10 @@ extern void ix86_print_operand (FILE *, rtx, int); extern void split_double_mode (machine_mode, rtx[], int, rtx[], rtx[]); extern const char *output_set_got (rtx, rtx); -extern const char *output_387_binary_op (rtx, rtx*); -extern const char *output_387_reg_move (rtx, rtx*); +extern const char *output_387_binary_op (rtx_insn *, rtx*); +extern const char *output_387_reg_move (rtx_insn *, rtx*); extern const char *output_fix_trunc (rtx_insn *, rtx*, bool); -extern const char *output_fp_compare (rtx, rtx*, bool, bool); +extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool); extern const char *output_adjust_stack_and_probe (rtx); extern const char *output_probe_stack_range (rtx, rtx); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 2db1e897c18..25f0446a5fd 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -14742,7 +14742,7 @@ ix86_expand_split_stack_prologue (void) HOST_WIDE_INT allocate; unsigned HOST_WIDE_INT args_size; rtx_code_label *label; - rtx limit, current, jump_insn, allocate_rtx, call_insn, call_fusage; + rtx limit, current, allocate_rtx, call_insn, call_fusage; rtx scratch_reg = NULL_RTX; rtx_code_label *varargs_label = NULL; rtx fn; @@ -14802,7 +14802,7 @@ ix86_expand_split_stack_prologue (void) } ix86_expand_branch (GEU, current, limit, label); - jump_insn = get_last_insn (); + rtx_insn *jump_insn = get_last_insn (); JUMP_LABEL (jump_insn) = label; /* Mark the jump as very likely to be taken. */ @@ -18696,7 +18696,7 @@ split_double_mode (machine_mode mode, rtx operands[], #endif const char * -output_387_binary_op (rtx insn, rtx *operands) +output_387_binary_op (rtx_insn *insn, rtx *operands) { static char buf[40]; const char *p; @@ -19434,7 +19434,7 @@ output_387_ffreep (rtx *operands ATTRIBUTE_UNUSED, int opno) should be used. UNORDERED_P is true when fucom should be used. */ const char * -output_fp_compare (rtx insn, rtx *operands, bool eflags_p, bool unordered_p) +output_fp_compare (rtx_insn *insn, rtx *operands, bool eflags_p, bool unordered_p) { int stack_top_dies; rtx cmp_op0, cmp_op1; @@ -22817,7 +22817,7 @@ ix86_split_fp_branch (enum rtx_code code, rtx op1, rtx op2, rtx target1, rtx target2, rtx tmp) { rtx condition; - rtx i; + rtx_insn *i; if (target2 != pc_rtx) { @@ -25876,7 +25876,7 @@ ix86_split_lshr (rtx *operands, rtx scratch, machine_mode mode) static void predict_jump (int prob) { - rtx insn = get_last_insn (); + rtx_insn *insn = get_last_insn (); gcc_assert (JUMP_P (insn)); add_int_reg_note (insn, REG_BR_PROB, prob); } @@ -44193,7 +44193,7 @@ ix86_reverse_condition (enum rtx_code code, machine_mode mode) to OPERANDS[0]. */ const char * -output_387_reg_move (rtx insn, rtx *operands) +output_387_reg_move (rtx_insn *insn, rtx *operands) { if (REG_P (operands[0])) { diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 85571571599..c8dbb4c6ff8 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -7238,7 +7238,7 @@ ia64_adjust_cost (rtx_insn *insn, int dep_type1, rtx_insn *dep_insn, ??? When cycle display notes are implemented, update this. */ static void -ia64_emit_insn_before (rtx insn, rtx before) +ia64_emit_insn_before (rtx insn, rtx_insn *before) { emit_insn_before (insn, before); } diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c index bdb8431edda..2d4a911535a 100644 --- a/gcc/config/mcore/mcore.c +++ b/gcc/config/mcore/mcore.c @@ -2327,7 +2327,7 @@ is_cond_candidate (rtx insn) new one. Return the new insn if emitted. */ static rtx_insn * -emit_new_cond_insn (rtx insn, int cond) +emit_new_cond_insn (rtx_insn *insn, int cond) { rtx c_insn = 0; rtx pat, dst, src; diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index bec49bffea2..84b15b9fa5b 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -9128,7 +9128,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) rs6000_emit_move (got, gsym, Pmode); else { - rtx mem, lab, last; + rtx mem, lab; tmp1 = gen_reg_rtx (Pmode); tmp2 = gen_reg_rtx (Pmode); @@ -9139,7 +9139,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) if (TARGET_LINK_STACK) emit_insn (gen_addsi3 (tmp1, tmp1, GEN_INT (4))); emit_move_insn (tmp2, mem); - last = emit_insn (gen_addsi3 (got, tmp1, tmp2)); + rtx_insn *last = emit_insn (gen_addsi3 (got, tmp1, tmp2)); set_unique_reg_note (last, REG_EQUAL, gsym); } } diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 3f98cd820d5..aeafdd41f0b 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -5566,7 +5566,7 @@ s390_expand_cmpmem (rtx target, rtx op0, rtx op1, rtx len) /* Emit a conditional jump to LABEL for condition code mask MASK using comparsion operator COMPARISON. Return the emitted jump insn. */ -static rtx +static rtx_insn * s390_emit_ccraw_jump (HOST_WIDE_INT mask, enum rtx_code comparison, rtx label) { rtx temp; diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index fedd6f97a98..a449b03480a 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -6643,7 +6643,8 @@ (clobber (match_dup 4))] "TARGET_ZARCH" { - rtx insn, div_equal, mod_equal; + rtx div_equal, mod_equal; + rtx_insn *insn; div_equal = gen_rtx_DIV (DImode, operands[1], operands[2]); mod_equal = gen_rtx_MOD (DImode, operands[1], operands[2]); @@ -6707,7 +6708,8 @@ (clobber (match_dup 4))] "TARGET_ZARCH" { - rtx insn, div_equal, mod_equal, equal; + rtx div_equal, mod_equal, equal; + rtx_insn *insn; div_equal = gen_rtx_UDIV (DImode, operands[1], operands[2]); mod_equal = gen_rtx_UMOD (DImode, operands[1], operands[2]); @@ -6767,7 +6769,8 @@ (clobber (match_dup 4))] "!TARGET_ZARCH" { - rtx insn, div_equal, mod_equal, equal; + rtx div_equal, mod_equal, equal; + rtx_insn *insn; div_equal = gen_rtx_DIV (SImode, operands[1], operands[2]); mod_equal = gen_rtx_MOD (SImode, operands[1], operands[2]); @@ -6825,7 +6828,8 @@ (clobber (match_dup 4))] "!TARGET_ZARCH && TARGET_CPU_ZARCH" { - rtx insn, div_equal, mod_equal, equal; + rtx div_equal, mod_equal, equal; + rtx_insn *insn; div_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]); mod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]); @@ -6879,7 +6883,8 @@ (clobber (match_dup 3))] "!TARGET_ZARCH && !TARGET_CPU_ZARCH" { - rtx insn, udiv_equal, umod_equal, equal; + rtx udiv_equal, umod_equal, equal; + rtx_insn *insn; udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]); umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]); @@ -6965,7 +6970,8 @@ (clobber (match_dup 3))] "!TARGET_ZARCH && !TARGET_CPU_ZARCH" { - rtx insn, udiv_equal, umod_equal, equal; + rtx udiv_equal, umod_equal, equal; + rtx_insn *insn; udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]); umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]); @@ -8599,7 +8605,8 @@ (clz:DI (match_operand:DI 1 "register_operand" "d")))] "TARGET_EXTIMM && TARGET_ZARCH" { - rtx insn, clz_equal; + rtx_insn *insn; + rtx clz_equal; rtx wide_reg = gen_reg_rtx (TImode); rtx msb = gen_rtx_CONST_INT (DImode, (unsigned HOST_WIDE_INT) 1 << 63); diff --git a/gcc/config/spu/spu.md b/gcc/config/spu/spu.md index 6e0cf930831..1061cb830bd 100644 --- a/gcc/config/spu/spu.md +++ b/gcc/config/spu/spu.md @@ -848,7 +848,7 @@ (unsigned_float:DF (match_operand:SI 1 "register_operand" "r")))] "" "{ - rtx value, insns; + rtx value; rtx c0 = spu_const_from_ints (V16QImode, 0x02031011, 0x12138080, 0x06071415, 0x16178080); rtx r0 = gen_reg_rtx (V16QImode); @@ -860,7 +860,7 @@ emit_library_call_value (convert_optab_libfunc (ufloat_optab, DFmode, SImode), NULL_RTX, LCT_NORMAL, DFmode, 1, operands[1], SImode); - insns = get_insns (); + rtx_insn *insns = get_insns (); end_sequence (); emit_libcall_block (insns, operands[0], value, gen_rtx_UNSIGNED_FLOAT (DFmode, operands[1])); @@ -953,7 +953,7 @@ emit_library_call_value (convert_optab_libfunc (ufloat_optab, DFmode, DImode), NULL_RTX, LCT_NORMAL, DFmode, 1, operands[1], DImode); - insns = get_insns (); + rtx_insn *insns = get_insns (); end_sequence (); emit_libcall_block (insns, operands[0], value, gen_rtx_UNSIGNED_FLOAT (DFmode, operands[1])); diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c index 0403e8eeb63..ab12b60567d 100644 --- a/gcc/config/tilegx/tilegx.c +++ b/gcc/config/tilegx/tilegx.c @@ -988,7 +988,7 @@ tilegx_legitimize_tls_address (rtx addr) case TLS_MODEL_GLOBAL_DYNAMIC: case TLS_MODEL_LOCAL_DYNAMIC: { - rtx r0, temp, temp2, temp3, got, last; + rtx r0, temp, temp2, temp3, got; ret = gen_reg_rtx (Pmode); r0 = gen_rtx_REG (Pmode, 0); @@ -1023,6 +1023,7 @@ tilegx_legitimize_tls_address (rtx addr) emit_move_insn (temp3, r0); + rtx_insn *last; if (TARGET_32BIT) last = emit_insn (gen_tls_gd_add_32bit (ret, temp3, addr)); else diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c index 9675eedeca8..6b75f62295c 100644 --- a/gcc/lower-subreg.c +++ b/gcc/lower-subreg.c @@ -935,7 +935,7 @@ resolve_simple_move (rtx set, rtx_insn *insn) if (AUTO_INC_DEC) { - rtx move = emit_move_insn (reg, src); + rtx_insn *move = emit_move_insn (reg, src); if (MEM_P (src)) { rtx note = find_reg_note (insn, REG_INC, NULL_RTX);