From: David Malcolm Date: Mon, 18 Jun 2018 19:59:13 +0000 (+0000) Subject: More rtx to rtx_insn * cleanups X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=df0b55f090b8591746d350a474d5f2291a9202be;p=gcc.git More rtx to rtx_insn * cleanups gcc/ChangeLog: * config/frv/frv-protos.h (frv_ifcvt_modify_insn): Strengthen 3rd param from rtx to rtx_insn *. * config/frv/frv.c (frv_ifcvt_add_insn): Likewise for "insn" param. (frv_ifcvt_modify_insn): Likwise. (frv_ifcvt_modify_final): Likwise for local "existing_insn", adding an as_a cast. Likewise for local "insn". * config/mips/mips.c (r10k_insert_cache_barriers): Add an as_a cast to local "unprotected_region" once it's been established that it's not NULL or pc_rtx. * config/nds32/nds32-relax-opt.c (nds32_group_insns): Strengthen param "sethi" from rtx to rtx_insn *. (nds32_group_float_insns): Likewise for param "insn". * config/vax/vax-protos.h (vax_output_int_add): Likewise for 1st param. (vax_output_int_subtract): Likewise. * config/vax/vax.c (vax_output_int_add): Likewise for param "insn". (vax_output_int_subtract): Likewise. * emit-rtl.c (set_insn_deleted): Likewise, removing cast. (emit_pattern_after): Likewise for param "after". (emit_insn_after): Likewise. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after): Likewise. (emit_pattern_before): Likewise for param "before". (emit_insn_before): Likewise. (emit_jump_insn_before): Likewise. * final.c (get_insn_template): Likewise for param "insn", removing a cast. * output.h (get_insn_template): Likewise for 2nd param. * rtl.h (emit_insn_before): Likewise. (emit_jump_insn_before): Likewise. (emit_debug_insn_before_noloc): Likewise. (emit_insn_after): Likewise. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after): Likewise. (set_insn_deleted): Likewise for param. From-SVN: r261715 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a7359730ef..fa80e8789f2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,45 @@ +2018-06-18 David Malcolm + + * config/frv/frv-protos.h (frv_ifcvt_modify_insn): Strengthen 3rd + param from rtx to rtx_insn *. + * config/frv/frv.c (frv_ifcvt_add_insn): Likewise for "insn" + param. + (frv_ifcvt_modify_insn): Likwise. + (frv_ifcvt_modify_final): Likwise for local "existing_insn", + adding an as_a cast. Likewise for local "insn". + * config/mips/mips.c (r10k_insert_cache_barriers): Add an + as_a cast to local "unprotected_region" once + it's been established that it's not NULL or pc_rtx. + * config/nds32/nds32-relax-opt.c (nds32_group_insns): Strengthen + param "sethi" from rtx to rtx_insn *. + (nds32_group_float_insns): Likewise for param "insn". + * config/vax/vax-protos.h (vax_output_int_add): Likewise for 1st + param. + (vax_output_int_subtract): Likewise. + * config/vax/vax.c (vax_output_int_add): Likewise for param + "insn". + (vax_output_int_subtract): Likewise. + * emit-rtl.c (set_insn_deleted): Likewise, removing cast. + (emit_pattern_after): Likewise for param "after". + (emit_insn_after): Likewise. + (emit_jump_insn_after): Likewise. + (emit_call_insn_after): Likewise. + (emit_debug_insn_after): Likewise. + (emit_pattern_before): Likewise for param "before". + (emit_insn_before): Likewise. + (emit_jump_insn_before): Likewise. + * final.c (get_insn_template): Likewise for param "insn", removing + a cast. + * output.h (get_insn_template): Likewise for 2nd param. + * rtl.h (emit_insn_before): Likewise. + (emit_jump_insn_before): Likewise. + (emit_debug_insn_before_noloc): Likewise. + (emit_insn_after): Likewise. + (emit_jump_insn_after): Likewise. + (emit_call_insn_after): Likewise. + (emit_debug_insn_after): Likewise. + (set_insn_deleted): Likewise for param. + 2018-06-18 Michael Meissner PR target/85358 diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h index 7a8356916db..67c4b097dd9 100644 --- a/gcc/config/frv/frv-protos.h +++ b/gcc/config/frv/frv-protos.h @@ -67,7 +67,7 @@ extern void frv_ifcvt_modify_tests (struct ce_if_block *, rtx *, rtx *); extern void frv_ifcvt_modify_multiple_tests (struct ce_if_block *, basic_block, rtx *, rtx *); -extern rtx frv_ifcvt_modify_insn (struct ce_if_block *, rtx, rtx); +extern rtx frv_ifcvt_modify_insn (struct ce_if_block *, rtx, rtx_insn *); extern void frv_ifcvt_modify_final (struct ce_if_block *); extern void frv_ifcvt_modify_cancel (struct ce_if_block *); #endif diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 56027bd67d9..78f1a80cdf9 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -318,7 +318,7 @@ static rtx frv_expand_mwtacc_builtin (enum insn_code, tree); static rtx frv_expand_noargs_builtin (enum insn_code); static void frv_split_iacc_move (rtx, rtx); static rtx frv_emit_comparison (enum rtx_code, rtx, rtx); -static void frv_ifcvt_add_insn (rtx, rtx, int); +static void frv_ifcvt_add_insn (rtx, rtx_insn *, int); static rtx frv_ifcvt_rewrite_mem (rtx, machine_mode, rtx); static rtx frv_ifcvt_load_value (rtx, rtx); static unsigned int frv_insn_unit (rtx_insn *); @@ -5160,7 +5160,7 @@ frv_ifcvt_machdep_init (void *ce_info ATTRIBUTE_UNUSED) if the conditional execution conversion is successful. */ static void -frv_ifcvt_add_insn (rtx pattern, rtx insn, int before_p) +frv_ifcvt_add_insn (rtx pattern, rtx_insn *insn, int before_p) { rtx link = alloc_EXPR_LIST (VOIDmode, pattern, insn); @@ -5842,7 +5842,7 @@ single_set_pattern (rtx pattern) rtx frv_ifcvt_modify_insn (ce_if_block *ce_info, rtx pattern, - rtx insn) + rtx_insn *insn) { rtx orig_ce_pattern = pattern; rtx set; @@ -6106,7 +6106,7 @@ frv_ifcvt_modify_insn (ce_if_block *ce_info, void frv_ifcvt_modify_final (ce_if_block *ce_info ATTRIBUTE_UNUSED) { - rtx existing_insn; + rtx_insn *existing_insn; rtx check_insn; rtx p = frv_ifcvt.added_insns_list; int i; @@ -6121,7 +6121,7 @@ frv_ifcvt_modify_final (ce_if_block *ce_info ATTRIBUTE_UNUSED) rtx old_p = p; check_insn = XEXP (check_and_insert_insns, 0); - existing_insn = XEXP (check_and_insert_insns, 1); + existing_insn = as_a (XEXP (check_and_insert_insns, 1)); p = XEXP (p, 1); /* The jump bit is used to say that the new insn is to be inserted BEFORE @@ -6142,7 +6142,7 @@ frv_ifcvt_modify_final (ce_if_block *ce_info ATTRIBUTE_UNUSED) /* Load up any constants needed into temp gprs */ for (i = 0; i < frv_ifcvt.cur_scratch_regs; i++) { - rtx insn = emit_insn_before (frv_ifcvt.scratch_regs[i], existing_insn); + rtx_insn *insn = emit_insn_before (frv_ifcvt.scratch_regs[i], existing_insn); if (! frv_ifcvt.scratch_insns_bitmap) frv_ifcvt.scratch_insns_bitmap = BITMAP_ALLOC (NULL); bitmap_set_bit (frv_ifcvt.scratch_insns_bitmap, INSN_UID (insn)); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index ad2c1d991a0..ad393040bee 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -17823,7 +17823,7 @@ r10k_insert_cache_barriers (void) if (r10k_needs_protection_p (insn)) { emit_insn_before (gen_r10k_cache_barrier (), - unprotected_region); + as_a (unprotected_region)); unprotected_region = NULL_RTX; } } diff --git a/gcc/config/nds32/nds32-relax-opt.c b/gcc/config/nds32/nds32-relax-opt.c index e54bd978c2e..e6609a09293 100644 --- a/gcc/config/nds32/nds32-relax-opt.c +++ b/gcc/config/nds32/nds32-relax-opt.c @@ -304,7 +304,7 @@ nds32_pic_tls_symbol_type (rtx x) /* Group the relax candidates with group id. */ static void -nds32_group_insns (rtx sethi) +nds32_group_insns (rtx_insn *sethi) { df_ref def_record, use_record; df_link *link; @@ -435,7 +435,7 @@ nds32_float_reg_load_store_p (rtx_insn *insn) flsi $rt, [$ra + offset] */ static void -nds32_group_float_insns (rtx insn) +nds32_group_float_insns (rtx_insn *insn) { df_ref def_record, use_record; df_link *link; diff --git a/gcc/config/vax/vax-protos.h b/gcc/config/vax/vax-protos.h index 3de4687b1f2..a5260174999 100644 --- a/gcc/config/vax/vax-protos.h +++ b/gcc/config/vax/vax-protos.h @@ -29,8 +29,8 @@ extern void print_operand (FILE *, rtx, int); extern void vax_notice_update_cc (rtx, rtx); extern void vax_expand_addsub_di_operands (rtx *, enum rtx_code); extern const char * vax_output_int_move (rtx, rtx *, machine_mode); -extern const char * vax_output_int_add (rtx, rtx *, machine_mode); -extern const char * vax_output_int_subtract (rtx, rtx *, machine_mode); +extern const char * vax_output_int_add (rtx_insn *, rtx *, machine_mode); +extern const char * vax_output_int_subtract (rtx_insn *, rtx *, machine_mode); extern const char * vax_output_movmemsi (rtx, rtx *); #endif /* RTX_CODE */ diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 927b82fd90d..631c598d3b2 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -1354,7 +1354,7 @@ vax_output_int_move (rtx insn ATTRIBUTE_UNUSED, rtx *operands, which are not modified very often. */ const char * -vax_output_int_add (rtx insn, rtx *operands, machine_mode mode) +vax_output_int_add (rtx_insn *insn, rtx *operands, machine_mode mode) { switch (mode) { @@ -1564,7 +1564,7 @@ vax_output_int_add (rtx insn, rtx *operands, machine_mode mode) } const char * -vax_output_int_subtract (rtx insn, rtx *operands, machine_mode mode) +vax_output_int_subtract (rtx_insn *insn, rtx *operands, machine_mode mode) { switch (mode) { diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index a327ff2da08..e4b070486e8 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -4282,10 +4282,10 @@ add_insn_before (rtx_insn *insn, rtx_insn *before, basic_block bb) /* Replace insn with an deleted instruction note. */ void -set_insn_deleted (rtx insn) +set_insn_deleted (rtx_insn *insn) { if (INSN_P (insn)) - df_insn_delete (as_a (insn)); + df_insn_delete (insn); PUT_CODE (insn, NOTE); NOTE_KIND (insn) = NOTE_INSN_DELETED; } @@ -4861,10 +4861,9 @@ emit_pattern_after_setloc (rtx pattern, rtx_insn *after, location_t loc, any DEBUG_INSNs. */ static rtx_insn * -emit_pattern_after (rtx pattern, rtx uncast_after, bool skip_debug_insns, +emit_pattern_after (rtx pattern, rtx_insn *after, bool skip_debug_insns, rtx_insn *(*make_raw) (rtx)) { - rtx_insn *after = safe_as_a (uncast_after); rtx_insn *prev = after; if (skip_debug_insns) @@ -4887,7 +4886,7 @@ emit_insn_after_setloc (rtx pattern, rtx_insn *after, location_t loc) /* Like emit_insn_after_noloc, but set INSN_LOCATION according to AFTER. */ rtx_insn * -emit_insn_after (rtx pattern, rtx after) +emit_insn_after (rtx pattern, rtx_insn *after) { return emit_pattern_after (pattern, after, true, make_insn_raw); } @@ -4902,7 +4901,7 @@ emit_jump_insn_after_setloc (rtx pattern, rtx_insn *after, location_t loc) /* Like emit_jump_insn_after_noloc, but set INSN_LOCATION according to AFTER. */ rtx_jump_insn * -emit_jump_insn_after (rtx pattern, rtx after) +emit_jump_insn_after (rtx pattern, rtx_insn *after) { return as_a ( emit_pattern_after (pattern, after, true, make_jump_insn_raw)); @@ -4917,7 +4916,7 @@ emit_call_insn_after_setloc (rtx pattern, rtx_insn *after, location_t loc) /* Like emit_call_insn_after_noloc, but set INSN_LOCATION according to AFTER. */ rtx_insn * -emit_call_insn_after (rtx pattern, rtx after) +emit_call_insn_after (rtx pattern, rtx_insn *after) { return emit_pattern_after (pattern, after, true, make_call_insn_raw); } @@ -4931,7 +4930,7 @@ emit_debug_insn_after_setloc (rtx pattern, rtx_insn *after, location_t loc) /* Like emit_debug_insn_after_noloc, but set INSN_LOCATION according to AFTER. */ rtx_insn * -emit_debug_insn_after (rtx pattern, rtx after) +emit_debug_insn_after (rtx pattern, rtx_insn *after) { return emit_pattern_after (pattern, after, false, make_debug_insn_raw); } @@ -4976,10 +4975,9 @@ emit_pattern_before_setloc (rtx pattern, rtx_insn *before, location_t loc, INSN as opposed to a JUMP_INSN, CALL_INSN, etc. */ static rtx_insn * -emit_pattern_before (rtx pattern, rtx uncast_before, bool skip_debug_insns, +emit_pattern_before (rtx pattern, rtx_insn *before, bool skip_debug_insns, bool insnp, rtx_insn *(*make_raw) (rtx)) { - rtx_insn *before = safe_as_a (uncast_before); rtx_insn *next = before; if (skip_debug_insns) @@ -5005,7 +5003,7 @@ emit_insn_before_setloc (rtx pattern, rtx_insn *before, location_t loc) /* Like emit_insn_before_noloc, but set INSN_LOCATION according to BEFORE. */ rtx_insn * -emit_insn_before (rtx pattern, rtx before) +emit_insn_before (rtx pattern, rtx_insn *before) { return emit_pattern_before (pattern, before, true, true, make_insn_raw); } @@ -5021,7 +5019,7 @@ emit_jump_insn_before_setloc (rtx pattern, rtx_insn *before, location_t loc) /* Like emit_jump_insn_before_noloc, but set INSN_LOCATION according to BEFORE. */ rtx_jump_insn * -emit_jump_insn_before (rtx pattern, rtx before) +emit_jump_insn_before (rtx pattern, rtx_insn *before) { return as_a ( emit_pattern_before (pattern, before, true, false, diff --git a/gcc/final.c b/gcc/final.c index 4c600f0edf2..a17a3a67b54 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -2128,7 +2128,7 @@ final (rtx_insn *first, FILE *file, int optimize_p) } const char * -get_insn_template (int code, rtx insn) +get_insn_template (int code, rtx_insn *insn) { switch (insn_data[code].output_format) { @@ -2138,8 +2138,7 @@ get_insn_template (int code, rtx insn) return insn_data[code].output.multi[which_alternative]; case INSN_OUTPUT_FORMAT_FUNCTION: gcc_assert (insn); - return (*insn_data[code].output.function) (recog_data.operand, - as_a (insn)); + return (*insn_data[code].output.function) (recog_data.operand, insn); default: gcc_unreachable (); diff --git a/gcc/output.h b/gcc/output.h index f708cc75fa7..afe72bece31 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -149,7 +149,7 @@ extern int only_leaf_regs_used (void); extern void leaf_renumber_regs_insn (rtx); /* Locate the proper template for the given insn-code. */ -extern const char *get_insn_template (int, rtx); +extern const char *get_insn_template (int, rtx_insn *); /* Functions in varasm.c. */ diff --git a/gcc/rtl.h b/gcc/rtl.h index 5ae58b432ed..565ce3abbe4 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -3214,10 +3214,10 @@ extern rtx simplify_subtraction (rtx); extern void decide_function_section (tree); /* In emit-rtl.c */ -extern rtx_insn *emit_insn_before (rtx, rtx); +extern rtx_insn *emit_insn_before (rtx, rtx_insn *); extern rtx_insn *emit_insn_before_noloc (rtx, rtx_insn *, basic_block); extern rtx_insn *emit_insn_before_setloc (rtx, rtx_insn *, location_t); -extern rtx_jump_insn *emit_jump_insn_before (rtx, rtx); +extern rtx_jump_insn *emit_jump_insn_before (rtx, rtx_insn *); extern rtx_jump_insn *emit_jump_insn_before_noloc (rtx, rtx_insn *); extern rtx_jump_insn *emit_jump_insn_before_setloc (rtx, rtx_insn *, location_t); @@ -3225,21 +3225,21 @@ extern rtx_insn *emit_call_insn_before (rtx, rtx_insn *); extern rtx_insn *emit_call_insn_before_noloc (rtx, rtx_insn *); extern rtx_insn *emit_call_insn_before_setloc (rtx, rtx_insn *, location_t); extern rtx_insn *emit_debug_insn_before (rtx, rtx_insn *); -extern rtx_insn *emit_debug_insn_before_noloc (rtx, rtx); +extern rtx_insn *emit_debug_insn_before_noloc (rtx, rtx_insn *); extern rtx_insn *emit_debug_insn_before_setloc (rtx, rtx_insn *, location_t); extern rtx_barrier *emit_barrier_before (rtx_insn *); extern rtx_code_label *emit_label_before (rtx_code_label *, rtx_insn *); extern rtx_note *emit_note_before (enum insn_note, rtx_insn *); -extern rtx_insn *emit_insn_after (rtx, rtx); +extern rtx_insn *emit_insn_after (rtx, rtx_insn *); extern rtx_insn *emit_insn_after_noloc (rtx, rtx_insn *, basic_block); extern rtx_insn *emit_insn_after_setloc (rtx, rtx_insn *, location_t); -extern rtx_jump_insn *emit_jump_insn_after (rtx, rtx); +extern rtx_jump_insn *emit_jump_insn_after (rtx, rtx_insn *); extern rtx_jump_insn *emit_jump_insn_after_noloc (rtx, rtx_insn *); extern rtx_jump_insn *emit_jump_insn_after_setloc (rtx, rtx_insn *, location_t); -extern rtx_insn *emit_call_insn_after (rtx, rtx); +extern rtx_insn *emit_call_insn_after (rtx, rtx_insn *); extern rtx_insn *emit_call_insn_after_noloc (rtx, rtx_insn *); extern rtx_insn *emit_call_insn_after_setloc (rtx, rtx_insn *, location_t); -extern rtx_insn *emit_debug_insn_after (rtx, rtx); +extern rtx_insn *emit_debug_insn_after (rtx, rtx_insn *); extern rtx_insn *emit_debug_insn_after_noloc (rtx, rtx_insn *); extern rtx_insn *emit_debug_insn_after_setloc (rtx, rtx_insn *, location_t); extern rtx_barrier *emit_barrier_after (rtx_insn *); @@ -3355,7 +3355,7 @@ extern const HARD_REG_SET &simplifiable_subregs (const subreg_shape &); extern rtx set_for_reg_notes (rtx); extern rtx set_unique_reg_note (rtx, enum reg_note, rtx); extern rtx set_dst_reg_note (rtx, enum reg_note, rtx, rtx); -extern void set_insn_deleted (rtx); +extern void set_insn_deleted (rtx_insn *); /* Functions in rtlanal.c */