From 466d19802ad8b2d36609934e788326ef51c1d272 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Wed, 2 Nov 2016 03:45:59 +0000 Subject: [PATCH] remove cast to rtx_insn * in remove_note gcc/ChangeLog: 2016-11-01 Trevor Saunders * config/rl78/rl78.c (gen-and_emit_move): Change argument type to rtx_insn *. (transcode_memory_rtx): Likewise. (move_to_acc): Likewise. (move_from_acc): Likewise. (move_acc_to_reg): Likewise. (move_to_x): Likewise. (move_to_hl): Likewise. (move_to_de): Likewise. * config/rs6000/rs6000.c (emit_frame_save): Likewise. (rs6000_emit_savres_rtx): Likewise. (rs6000_emit_prologue): Likewise. * reorg.c (update_reg_unused_notes): Likewise. * rtl.h (remove_note): Adjust prototype. * rtlanal.c (remove_note): Make argument type rtx_insn *. From-SVN: r241771 --- gcc/ChangeLog | 18 ++++++++++++++++++ gcc/config/rl78/rl78.c | 16 ++++++++-------- gcc/config/rs6000/rs6000.c | 26 ++++++++++++++------------ gcc/reorg.c | 4 ++-- gcc/rtl.h | 2 +- gcc/rtlanal.c | 4 ++-- 6 files changed, 45 insertions(+), 25 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9728d9d..fa3df16 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,23 @@ 2016-11-01 Trevor Saunders + * config/rl78/rl78.c (gen-and_emit_move): Change argument type + to rtx_insn *. + (transcode_memory_rtx): Likewise. + (move_to_acc): Likewise. + (move_from_acc): Likewise. + (move_acc_to_reg): Likewise. + (move_to_x): Likewise. + (move_to_hl): Likewise. + (move_to_de): Likewise. + * config/rs6000/rs6000.c (emit_frame_save): Likewise. + (rs6000_emit_savres_rtx): Likewise. + (rs6000_emit_prologue): Likewise. + * reorg.c (update_reg_unused_notes): Likewise. + * rtl.h (remove_note): Adjust prototype. + * rtlanal.c (remove_note): Make argument type rtx_insn *. + +2016-11-01 Trevor Saunders + * config/alpha/alpha.c (alpha_legitimize_address_1): Split up variables so some can be rtx_insn *. (alpha_emit_xfloating_libcall): Likewise. diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c index 30ce349..b8fe4c9 100644 --- a/gcc/config/rl78/rl78.c +++ b/gcc/config/rl78/rl78.c @@ -2778,7 +2778,7 @@ process_postponed_content_update (void) after WHERE. If TO already contains FROM then do nothing. Returns TO if BEFORE is true, FROM otherwise. */ static rtx -gen_and_emit_move (rtx to, rtx from, rtx where, bool before) +gen_and_emit_move (rtx to, rtx from, rtx_insn *where, bool before) { machine_mode mode = GET_MODE (to); @@ -2833,7 +2833,7 @@ gen_and_emit_move (rtx to, rtx from, rtx where, bool before) copy it into NEWBASE and return the updated MEM. Otherwise just return M. Any needed insns are emitted before BEFORE. */ static rtx -transcode_memory_rtx (rtx m, rtx newbase, rtx before) +transcode_memory_rtx (rtx m, rtx newbase, rtx_insn *before) { rtx base, index, addendr; int addend = 0; @@ -2934,7 +2934,7 @@ transcode_memory_rtx (rtx m, rtx newbase, rtx before) /* Copy SRC to accumulator (A or AX), placing any generated insns before BEFORE. Returns accumulator RTX. */ static rtx -move_to_acc (int opno, rtx before) +move_to_acc (int opno, rtx_insn *before) { rtx src = OP (opno); machine_mode mode = GET_MODE (src); @@ -2968,7 +2968,7 @@ force_into_acc (rtx src, rtx_insn *before) /* Copy accumulator (A or AX) to DEST, placing any generated insns after AFTER. Returns accumulator RTX. */ static rtx -move_from_acc (unsigned int opno, rtx after) +move_from_acc (unsigned int opno, rtx_insn *after) { rtx dest = OP (opno); machine_mode mode = GET_MODE (dest); @@ -2982,7 +2982,7 @@ move_from_acc (unsigned int opno, rtx after) /* Copy accumulator (A or AX) to REGNO, placing any generated insns before BEFORE. Returns reg RTX. */ static rtx -move_acc_to_reg (rtx acc, int regno, rtx before) +move_acc_to_reg (rtx acc, int regno, rtx_insn *before) { machine_mode mode = GET_MODE (acc); rtx reg; @@ -2995,7 +2995,7 @@ move_acc_to_reg (rtx acc, int regno, rtx before) /* Copy SRC to X, placing any generated insns before BEFORE. Returns X RTX. */ static rtx -move_to_x (int opno, rtx before) +move_to_x (int opno, rtx_insn *before) { rtx src = OP (opno); machine_mode mode = GET_MODE (src); @@ -3018,7 +3018,7 @@ move_to_x (int opno, rtx before) /* Copy OP (opno) to H or HL, placing any generated insns before BEFORE. Returns H/HL RTX. */ static rtx -move_to_hl (int opno, rtx before) +move_to_hl (int opno, rtx_insn *before) { rtx src = OP (opno); machine_mode mode = GET_MODE (src); @@ -3041,7 +3041,7 @@ move_to_hl (int opno, rtx before) /* Copy OP (opno) to E or DE, placing any generated insns before BEFORE. Returns E/DE RTX. */ static rtx -move_to_de (int opno, rtx before) +move_to_de (int opno, rtx_insn *before) { rtx src = OP (opno); machine_mode mode = GET_MODE (src); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index f9e4739..39ac469 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -26996,8 +26996,8 @@ output_probe_stack_range (rtx reg1, rtx reg2) pointer. That fails when saving regs off r1, and sched moves the r31 setup past the reg saves. */ -static rtx -rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val, +static rtx_insn * +rs6000_frame_related (rtx_insn *insn, rtx reg, HOST_WIDE_INT val, rtx reg2, rtx repl2) { rtx repl; @@ -27161,11 +27161,11 @@ gen_frame_store (rtx reg, rtx frame_reg, int offset) /* Save a register into the frame, and emit RTX_FRAME_RELATED_P notes. Save REGNO into [FRAME_REG + OFFSET] in mode MODE. */ -static rtx +static rtx_insn * emit_frame_save (rtx frame_reg, machine_mode mode, unsigned int regno, int offset, HOST_WIDE_INT frame_reg_to_sp) { - rtx reg, insn; + rtx reg; /* Some cases that need register indexed addressing. */ gcc_checking_assert (!((TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode)) @@ -27176,7 +27176,7 @@ emit_frame_save (rtx frame_reg, machine_mode mode, && !SPE_CONST_OFFSET_OK (offset)))); reg = gen_rtx_REG (mode, regno); - insn = emit_insn (gen_frame_store (reg, frame_reg, offset)); + rtx_insn *insn = emit_insn (gen_frame_store (reg, frame_reg, offset)); return rs6000_frame_related (insn, frame_reg, frame_reg_to_sp, NULL_RTX, NULL_RTX); } @@ -27444,7 +27444,7 @@ ptr_regno_for_savres (int sel) out-of-line register save/restore routine, and emit the insn or jump_insn as appropriate. */ -static rtx +static rtx_insn * rs6000_emit_savres_rtx (rs6000_stack_t *info, rtx frame_reg_rtx, int save_area_offset, int lr_offset, machine_mode reg_mode, int sel) @@ -27454,7 +27454,8 @@ rs6000_emit_savres_rtx (rs6000_stack_t *info, int reg_size = GET_MODE_SIZE (reg_mode); rtx sym; rtvec p; - rtx par, insn; + rtx par; + rtx_insn *insn; offset = 0; start_reg = ((sel & SAVRES_REG) == SAVRES_GPR @@ -27854,7 +27855,7 @@ rs6000_emit_prologue (void) rtx frame_reg_rtx = sp_reg_rtx; unsigned int cr_save_regno; rtx cr_save_rtx = NULL_RTX; - rtx insn; + rtx_insn *insn; int strategy; int using_static_chain_p = (cfun->static_chain_decl != NULL_TREE && df_regs_ever_live_p (STATIC_CHAIN_REGNUM) @@ -28360,12 +28361,12 @@ rs6000_emit_prologue (void) if (regno == INVALID_REGNUM) break; - insn + rtx set = gen_frame_store (gen_rtx_REG (reg_mode, regno), sp_reg_rtx, info->ehrd_offset + sp_off + reg_size * (int) i); - RTVEC_ELT (p, i) = insn; - RTX_FRAME_RELATED_P (insn) = 1; + RTVEC_ELT (p, i) = set; + RTX_FRAME_RELATED_P (set) = 1; } insn = emit_insn (gen_blockage ()); @@ -28377,7 +28378,8 @@ rs6000_emit_prologue (void) if (TARGET_AIX && crtl->calls_eh_return) { rtx tmp_reg, tmp_reg_si, hi, lo, compare_result, toc_save_done, jump; - rtx save_insn, join_insn, note; + rtx join_insn, note; + rtx_insn *save_insn; long toc_restore_insn; tmp_reg = gen_rtx_REG (Pmode, 11); diff --git a/gcc/reorg.c b/gcc/reorg.c index da4d7c6..caad82a 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -226,7 +226,7 @@ static void update_block (rtx_insn *, rtx_insn *); static int reorg_redirect_jump (rtx_jump_insn *, rtx); static void update_reg_dead_notes (rtx_insn *, rtx_insn *); static void fix_reg_dead_note (rtx_insn *, rtx); -static void update_reg_unused_notes (rtx, rtx); +static void update_reg_unused_notes (rtx_insn *, rtx); static void fill_simple_delay_slots (int); static void fill_slots_from_thread (rtx_jump_insn *, rtx, rtx, rtx, int, int, int, int, @@ -1805,7 +1805,7 @@ fix_reg_dead_note (rtx_insn *start_insn, rtx stop_insn) does. */ static void -update_reg_unused_notes (rtx insn, rtx redundant_insn) +update_reg_unused_notes (rtx_insn *insn, rtx redundant_insn) { rtx link, next; diff --git a/gcc/rtl.h b/gcc/rtl.h index d054c6c..e94e070 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -3019,7 +3019,7 @@ extern rtx alloc_reg_note (enum reg_note, rtx, rtx); extern void add_reg_note (rtx, enum reg_note, rtx); extern void add_int_reg_note (rtx, enum reg_note, int); extern void add_shallow_copy_of_reg_note (rtx_insn *, rtx); -extern void remove_note (rtx, const_rtx); +extern void remove_note (rtx_insn *, const_rtx); extern void remove_reg_equal_equiv_notes (rtx_insn *); extern void remove_reg_equal_equiv_notes_for_regno (unsigned int); extern int side_effects_p (const_rtx); diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 4e600c0..508c663 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -2307,7 +2307,7 @@ add_shallow_copy_of_reg_note (rtx_insn *insn, rtx note) /* Remove register note NOTE from the REG_NOTES of INSN. */ void -remove_note (rtx insn, const_rtx note) +remove_note (rtx_insn *insn, const_rtx note) { rtx link; @@ -2328,7 +2328,7 @@ remove_note (rtx insn, const_rtx note) { case REG_EQUAL: case REG_EQUIV: - df_notes_rescan (as_a (insn)); + df_notes_rescan (insn); break; default: break; -- 2.7.4