diff options
author | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-16 01:23:42 +0000 |
---|---|---|
committer | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-16 01:23:42 +0000 |
commit | dd1286fb158d55badf7feee4637c8ee21123f890 (patch) | |
tree | afa1d791e1a24bd21d9981f0b69fd768831df3cd | |
parent | c6d14fbf7c49e5ffc306141619b9699113d9d0aa (diff) | |
download | gcc-dd1286fb158d55badf7feee4637c8ee21123f890.tar.gz |
Replace INSN_DELETED_P with rtx_insn member functions
gcc/
* cfgrtl.c, combine.c, config/arc/arc.c, config/mcore/mcore.c,
config/rs6000/rs6000.c, config/sh/sh.c, cprop.c, dwarf2out.c,
emit-rtl.c, final.c, function.c, gcse.c, jump.c, reg-stack.c,
reload1.c, reorg.c, resource.c, sel-sched-ir.c: Replace INSN_DELETED_P
macro with statically checked member functions.
* rtl.h (rtx_insn::deleted): New method.
(rtx_insn::set_deleted): Likewise.
(rtx_insn::set_undeleted): Likewise.
(INSN_DELETED_P): Remove.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215282 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/cfgrtl.c | 8 | ||||
-rw-r--r-- | gcc/combine.c | 2 | ||||
-rw-r--r-- | gcc/config/arc/arc.c | 8 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.md | 2 | ||||
-rw-r--r-- | gcc/config/mcore/mcore.c | 2 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 4 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 2 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 12 | ||||
-rw-r--r-- | gcc/config/v850/v850.c | 11 | ||||
-rw-r--r-- | gcc/cprop.c | 6 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 4 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 6 | ||||
-rw-r--r-- | gcc/final.c | 4 | ||||
-rw-r--r-- | gcc/function.c | 2 | ||||
-rw-r--r-- | gcc/gcse.c | 2 | ||||
-rw-r--r-- | gcc/jump.c | 24 | ||||
-rw-r--r-- | gcc/reg-stack.c | 2 | ||||
-rw-r--r-- | gcc/reload1.c | 2 | ||||
-rw-r--r-- | gcc/reorg.c | 12 | ||||
-rw-r--r-- | gcc/resource.c | 3 | ||||
-rw-r--r-- | gcc/rtl.h | 17 | ||||
-rw-r--r-- | gcc/sel-sched-ir.c | 4 | ||||
-rw-r--r-- | gcc/varasm.c | 4 |
24 files changed, 89 insertions, 66 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed78680fd98..94f2d9cbf5c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,16 @@ 2014-09-15 Trevor Saunders <tsaunders@mozilla.com> + + * cfgrtl.c, combine.c, config/arc/arc.c, config/mcore/mcore.c, + config/rs6000/rs6000.c, config/sh/sh.c, cprop.c, dwarf2out.c, + emit-rtl.c, final.c, function.c, gcse.c, jump.c, reg-stack.c, + reload1.c, reorg.c, resource.c, sel-sched-ir.c: Replace INSN_DELETED_P + macro with statically checked member functions. + * rtl.h (rtx_insn::deleted): New method. + (rtx_insn::set_deleted): Likewise. + (rtx_insn::set_undeleted): Likewise. + (INSN_DELETED_P): Remove. + +2014-09-15 Trevor Saunders <tsaunders@mozilla.com> * config/mn10300/mn10300.c (mn10300_insert_setlb_lcc): Assign the result of emit_jump_insn_before to a new variable. diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 04c7d63e117..8eb337e9377 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -165,11 +165,11 @@ delete_insn (rtx uncast_insn) if (really_delete) { /* If this insn has already been deleted, something is very wrong. */ - gcc_assert (!INSN_DELETED_P (insn)); + gcc_assert (!insn->deleted ()); if (INSN_P (insn)) df_insn_delete (insn); remove_insn (insn); - INSN_DELETED_P (insn) = 1; + insn->set_deleted (); } /* If deleting a jump, decrement the use count of the label. Deleting @@ -254,7 +254,7 @@ delete_insn_chain (rtx start, rtx finish, bool clear_bb) else delete_insn (current); - if (clear_bb && !INSN_DELETED_P (current)) + if (clear_bb && !current->deleted ()) set_block_for_insn (current, NULL); if (current == start) @@ -3278,7 +3278,7 @@ fixup_abnormal_edges (void) if (GET_CODE (PATTERN (insn)) != USE) { /* We're not deleting it, we're moving it. */ - INSN_DELETED_P (insn) = 0; + insn->set_undeleted (); SET_PREV_INSN (insn) = NULL_RTX; SET_NEXT_INSN (insn) = NULL_RTX; diff --git a/gcc/combine.c b/gcc/combine.c index 151e948ab7a..bce55450993 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1238,7 +1238,7 @@ combine_instructions (rtx_insn *f, unsigned int nregs) continue; while (last_combined_insn - && INSN_DELETED_P (last_combined_insn)) + && last_combined_insn->deleted ()) last_combined_insn = PREV_INSN (last_combined_insn); if (last_combined_insn == NULL_RTX || BARRIER_P (last_combined_insn) diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 3e808ea7f78..bae1a05f8c2 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -2823,7 +2823,7 @@ arc_print_operand (FILE *file, rtx x, int code) rtx_insn *delay = final_sequence->insn (1); /* For TARGET_PAD_RETURN we might have grabbed the delay insn. */ - if (INSN_DELETED_P (delay)) + if (delay->deleted ()) return; if (JUMP_P (jump) && INSN_ANNULLED_BRANCH_P (jump)) fputs (INSN_FROM_TARGET_P (delay) ? ".d" @@ -3748,7 +3748,7 @@ arc_ccfsm_record_condition (rtx cond, bool reverse, rtx_insn *jump, { rtx insn = XVECEXP (PATTERN (seq_insn), 0, 1); - if (!INSN_DELETED_P (insn) + if (!as_a<rtx_insn *> (insn)->deleted () && INSN_ANNULLED_BRANCH_P (jump) && (TARGET_AT_DBR_CONDEXEC || INSN_FROM_TARGET_P (insn))) { @@ -8627,7 +8627,7 @@ arc_unalign_branch_p (rtx branch) return 0; /* Do not do this if we have a filled delay slot. */ if (get_attr_delay_slot_filled (branch) == DELAY_SLOT_FILLED_YES - && !INSN_DELETED_P (NEXT_INSN (branch))) + && !NEXT_INSN (branch)->deleted ()) return 0; note = find_reg_note (branch, REG_BR_PROB, 0); return (!note @@ -8709,7 +8709,7 @@ arc_pad_return (void) rtx save_pred = current_insn_predicate; final_scan_insn (prev, asm_out_file, optimize, 1, NULL); cfun->machine->force_short_suffix = -1; - INSN_DELETED_P (prev) = 1; + prev->set_deleted (); current_output_insn = insn; current_insn_predicate = save_pred; } diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index cb10203f161..babb37b5bf4 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -2411,7 +2411,7 @@ final_sequence = 0; final_scan_insn (seq->insn (1), asm_out_file, optimize, 1, & seen); final_scan_insn (seq->insn (0), asm_out_file, optimize, 1, & seen); - INSN_DELETED_P (seq->insn (1)) = 1; + seq->insn (1)->set_deleted (); return ""; } } diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c index aad0f1a434b..e2208b7af6b 100644 --- a/gcc/config/mcore/mcore.c +++ b/gcc/config/mcore/mcore.c @@ -2536,7 +2536,7 @@ conditionalize_block (rtx_insn *first) { rtx_insn *newinsn; - if (INSN_DELETED_P (insn)) + if (insn->deleted ()) continue; /* Try to form a conditional variant of the instruction and emit it. */ diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 98652f634f5..723057eb9bd 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -12498,7 +12498,7 @@ mips_output_conditional_branch (rtx_insn *insn, rtx *operands, { final_scan_insn (final_sequence->insn (1), asm_out_file, optimize, 1, NULL); - INSN_DELETED_P (final_sequence->insn (1)) = 1; + final_sequence->insn (1)->set_deleted (); } else output_asm_insn ("nop", 0); @@ -12523,7 +12523,7 @@ mips_output_conditional_branch (rtx_insn *insn, rtx *operands, { final_scan_insn (final_sequence->insn (1), asm_out_file, optimize, 1, NULL); - INSN_DELETED_P (final_sequence->insn (1)) = 1; + final_sequence->insn (1)->set_deleted (); } else output_asm_insn ("nop", 0); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 770aa6250a4..7554fcc9366 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -34222,7 +34222,7 @@ replace_swap_with_copy (swap_web_entry *insn_entry, unsigned i) df_insn_delete (insn); remove_insn (insn); - INSN_DELETED_P (insn) = 1; + insn->set_deleted (); } /* Dump the swap table to DUMP_FILE. */ diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 9456d8bc232..c4b026038a7 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -2645,7 +2645,7 @@ print_slot (rtx_sequence *seq) { final_scan_insn (seq->insn (1), asm_out_file, optimize, 1, NULL); - INSN_DELETED_P (seq->insn (1)) = 1; + seq->insn (1)->set_deleted (); } const char * @@ -5572,7 +5572,7 @@ gen_block_redirect (rtx_insn *jump, int addr, int need_block) rtx dest; /* First, check if we already have an instruction that satisfies our need. */ - if (prev && NONJUMP_INSN_P (prev) && ! INSN_DELETED_P (prev)) + if (prev && NONJUMP_INSN_P (prev) && ! prev->deleted ()) { if (INSN_CODE (prev) == CODE_FOR_indirect_jump_scratch) return prev; @@ -5615,7 +5615,7 @@ gen_block_redirect (rtx_insn *jump, int addr, int need_block) { enum rtx_code code; - if (INSN_DELETED_P (scan)) + if (scan->deleted ()) continue; code = GET_CODE (scan); if (code == CODE_LABEL || code == JUMP_INSN) @@ -5634,7 +5634,7 @@ gen_block_redirect (rtx_insn *jump, int addr, int need_block) { enum rtx_code code; - if (INSN_DELETED_P (scan)) + if (scan->deleted ()) continue; code = GET_CODE (scan); if (INSN_P (scan)) @@ -6495,7 +6495,7 @@ split_branches (rtx_insn *first) for (insn = first; insn; insn = NEXT_INSN (insn)) if (! INSN_P (insn)) continue; - else if (INSN_DELETED_P (insn)) + else if (insn->deleted ()) { /* Shorten_branches would split this instruction again, so transform it into a note. */ @@ -10704,7 +10704,7 @@ mark_constant_pool_use (rtx x) } for (rtx insn = LABEL_REFS (lab); insn; insn = LABEL_REFS (insn)) - INSN_DELETED_P (insn) = 1; + as_a<rtx_insn *> (insn)->set_deleted (); /* Mark constants in a window. */ for (insn = NEXT_INSN (as_a <rtx_insn *> (x)); insn; insn = NEXT_INSN (insn)) diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index dca82b9ccac..45312fa1d4a 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -792,10 +792,13 @@ v850_output_addr_const_extra (FILE * file, rtx x) nothing, since the table will not be used. (cf gcc.c-torture/compile/990801-1.c). */ if (GET_CODE (x) == MINUS - && GET_CODE (XEXP (x, 0)) == LABEL_REF - && GET_CODE (XEXP (XEXP (x, 0), 0)) == CODE_LABEL - && INSN_DELETED_P (XEXP (XEXP (x, 0), 0))) - return true; + && GET_CODE (XEXP (x, 0)) == LABEL_REF) + { + rtx_code_label *label + = dyn_cast<rtx_code_label *> (XEXP (XEXP (x, 0), 0)); + if (label && label->deleted ()) + return true; + } output_addr_const (file, x); return true; diff --git a/gcc/cprop.c b/gcc/cprop.c index fa77faac51f..37115089b21 100644 --- a/gcc/cprop.c +++ b/gcc/cprop.c @@ -1071,7 +1071,7 @@ retry: print_rtl (dump_file, src); fprintf (dump_file, "\n"); } - if (INSN_DELETED_P (insn)) + if (insn->deleted ()) return 1; } } @@ -1257,7 +1257,7 @@ local_cprop_pass (void) break; } } - if (INSN_DELETED_P (insn)) + if (insn->deleted ()) break; } while (i < reg_use_count); @@ -1854,7 +1854,7 @@ one_cprop_pass (void) /* ??? Need to be careful w.r.t. mods done to INSN. Don't call mark_oprs_set if we turned the insn into a NOTE, or deleted the insn. */ - if (! NOTE_P (insn) && ! INSN_DELETED_P (insn)) + if (! NOTE_P (insn) && ! insn->deleted ()) mark_oprs_set (insn); } } diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 0d5896cc563..9dd2f880d07 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -19051,7 +19051,7 @@ gen_label_die (tree decl, dw_die_ref context_die) represent source-level labels which were explicitly declared by the user. This really shouldn't be happening though, so catch it if it ever does happen. */ - gcc_assert (!INSN_DELETED_P (insn)); + gcc_assert (!as_a<rtx_insn *> (insn)->deleted ()); ASM_GENERATE_INTERNAL_LABEL (label, "L", CODE_LABEL_NUMBER (insn)); add_AT_lbl_id (lbl_die, DW_AT_low_pc, label); @@ -21328,7 +21328,7 @@ dwarf2out_var_location (rtx_insn *loc_note) next_note = NEXT_INSN (loc_note); if (! next_note - || INSN_DELETED_P (next_note) + || next_note->deleted () || ! NOTE_P (next_note) || (NOTE_KIND (next_note) != NOTE_INSN_VAR_LOCATION && NOTE_KIND (next_note) != NOTE_INSN_CALL_ARG_LOCATION)) diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 99cd2094ed3..c0da65f0711 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3807,7 +3807,7 @@ try_split (rtx pat, rtx uncast_trial, int last) We can't use next_active_insn here since AFTER may be a note. Ignore deleted insns, which can be occur if not optimizing. */ for (tem = NEXT_INSN (before); tem != after; tem = NEXT_INSN (tem)) - if (! INSN_DELETED_P (tem) && INSN_P (tem)) + if (! tem->deleted () && INSN_P (tem)) tem = try_split (PATTERN (tem), tem, 1); /* Return either the first or the last insn, depending on which was @@ -3984,7 +3984,7 @@ add_insn_after_nobb (rtx_insn *insn, rtx_insn *after) { rtx_insn *next = NEXT_INSN (after); - gcc_assert (!optimize || !INSN_DELETED_P (after)); + gcc_assert (!optimize || !after->deleted ()); link_insn_into_chain (insn, after, next); @@ -4013,7 +4013,7 @@ add_insn_before_nobb (rtx_insn *insn, rtx_insn *before) { rtx_insn *prev = PREV_INSN (before); - gcc_assert (!optimize || !INSN_DELETED_P (before)); + gcc_assert (!optimize || !before->deleted ()); link_insn_into_chain (insn, prev, before); diff --git a/gcc/final.c b/gcc/final.c index 3b2d5e3ca3f..a923d163e6b 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1132,7 +1132,7 @@ shorten_branches (rtx_insn *first) if (NOTE_P (insn) || BARRIER_P (insn) || LABEL_P (insn) || DEBUG_INSN_P (insn)) continue; - if (INSN_DELETED_P (insn)) + if (insn->deleted ()) continue; body = PATTERN (insn); @@ -2183,7 +2183,7 @@ final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, /* Ignore deleted insns. These can occur when we split insns (due to a template of "#") while not optimizing. */ - if (INSN_DELETED_P (insn)) + if (insn->deleted ()) return NEXT_INSN (insn); switch (GET_CODE (insn)) diff --git a/gcc/function.c b/gcc/function.c index c8daf95104a..26d25b9b4bf 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1933,7 +1933,7 @@ instantiate_virtual_regs (void) else instantiate_virtual_regs_in_insn (insn); - if (INSN_DELETED_P (insn)) + if (insn->deleted ()) continue; instantiate_virtual_regs_in_rtx (®_NOTES (insn)); diff --git a/gcc/gcse.c b/gcc/gcse.c index 15d026b2a56..810d7d6a12e 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -2486,7 +2486,7 @@ pre_insert_copies (void) continue; /* Don't handle this one if it's a redundant one. */ - if (INSN_DELETED_P (insn)) + if (insn->deleted ()) continue; /* Or if the expression doesn't reach the deleted one. */ diff --git a/gcc/jump.c b/gcc/jump.c index cad44d8a043..8e85f5f191b 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -291,7 +291,7 @@ mark_all_labels (rtx_insn *f) handled by other optimizers using better algorithms. */ FOR_BB_INSNS (bb, insn) { - gcc_assert (! INSN_DELETED_P (insn)); + gcc_assert (! insn->deleted ()); if (NONDEBUG_INSN_P (insn)) mark_jump_label (PATTERN (insn), insn, 0); } @@ -312,7 +312,7 @@ mark_all_labels (rtx_insn *f) rtx_insn *prev_nonjump_insn = NULL; for (insn = f; insn; insn = NEXT_INSN (insn)) { - if (INSN_DELETED_P (insn)) + if (insn->deleted ()) ; else if (LABEL_P (insn)) prev_nonjump_insn = NULL; @@ -1156,7 +1156,7 @@ mark_jump_label_1 (rtx x, rtx_insn *insn, bool in_mem, bool is_target) break; LABEL_REF_LABEL (x) = label; - if (! insn || ! INSN_DELETED_P (insn)) + if (! insn || ! insn->deleted ()) ++LABEL_NUSES (label); if (insn) @@ -1187,7 +1187,7 @@ mark_jump_label_1 (rtx x, rtx_insn *insn, bool in_mem, bool is_target) ADDR_DIFF_VEC. Don't set the JUMP_LABEL of a vector. */ case ADDR_VEC: case ADDR_DIFF_VEC: - if (! INSN_DELETED_P (insn)) + if (! insn->deleted ()) { int eltnum = code == ADDR_DIFF_VEC ? 1 : 0; @@ -1254,11 +1254,11 @@ delete_related_insns (rtx uncast_insn) rtx note; rtx_insn *next = NEXT_INSN (insn), *prev = PREV_INSN (insn); - while (next && INSN_DELETED_P (next)) + while (next && next->deleted ()) next = NEXT_INSN (next); /* This insn is already deleted => return first following nondeleted. */ - if (INSN_DELETED_P (insn)) + if (insn->deleted ()) return next; delete_insn (insn); @@ -1279,7 +1279,7 @@ delete_related_insns (rtx uncast_insn) { rtx_insn *p; - for (p = next && INSN_DELETED_P (next) ? NEXT_INSN (next) : next; + for (p = next && next->deleted () ? NEXT_INSN (next) : next; p && NOTE_P (p); p = NEXT_INSN (p)) if (NOTE_KIND (p) == NOTE_INSN_CALL_ARG_LOCATION) @@ -1323,7 +1323,7 @@ delete_related_insns (rtx uncast_insn) for (i = 0; i < len; i++) if (LABEL_NUSES (XEXP (RTVEC_ELT (labels, i), 0)) == 0) delete_related_insns (XEXP (RTVEC_ELT (labels, i), 0)); - while (next && INSN_DELETED_P (next)) + while (next && next->deleted ()) next = NEXT_INSN (next); return next; } @@ -1339,7 +1339,7 @@ delete_related_insns (rtx uncast_insn) if (LABEL_NUSES (XEXP (note, 0)) == 0) delete_related_insns (XEXP (note, 0)); - while (prev && (INSN_DELETED_P (prev) || NOTE_P (prev))) + while (prev && (prev->deleted () || NOTE_P (prev))) prev = PREV_INSN (prev); /* If INSN was a label and a dispatch table follows it, @@ -1362,7 +1362,7 @@ delete_related_insns (rtx uncast_insn) if (code == NOTE) next = NEXT_INSN (next); /* Keep going past other deleted labels to delete what follows. */ - else if (code == CODE_LABEL && INSN_DELETED_P (next)) + else if (code == CODE_LABEL && next->deleted ()) next = NEXT_INSN (next); /* Keep the (use (insn))s created by dbr_schedule, which needs them in order to track liveness relative to a previous @@ -1386,7 +1386,7 @@ delete_related_insns (rtx uncast_insn) but I see no clean and sure alternative way to find the first insn after INSN that is not now deleted. I hope this works. */ - while (next && INSN_DELETED_P (next)) + while (next && next->deleted ()) next = NEXT_INSN (next); return next; } @@ -1408,7 +1408,7 @@ delete_for_peephole (rtx_insn *from, rtx_insn *to) if (!NOTE_P (insn)) { - INSN_DELETED_P (insn) = 1; + insn->set_deleted(); /* Patch this insn out of the chain. */ /* We don't do this all at once, because we diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index af8e3cd7ec3..8c0a5c8748b 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -2341,7 +2341,7 @@ subst_stack_regs (rtx_insn *insn, stack_ptr regstack) /* subst_stack_regs_pat may have deleted a no-op insn. If so, any REG_UNUSED will already have been dealt with, so just return. */ - if (NOTE_P (insn) || INSN_DELETED_P (insn)) + if (NOTE_P (insn) || insn->deleted ()) return control_flow_insn_deleted; /* If this a noreturn call, we can't insert pop insns after it. diff --git a/gcc/reload1.c b/gcc/reload1.c index 13dcd4f0aee..22d3e8e1e59 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -8847,7 +8847,7 @@ delete_output_reload (rtx_insn *insn, int j, int last_reload_reg, /* It is possible that this reload has been only used to set another reload we eliminated earlier and thus deleted this instruction too. */ - if (INSN_DELETED_P (output_reload_insn)) + if (output_reload_insn->deleted ()) return; /* Get the raw pseudo-register referred to. */ diff --git a/gcc/reorg.c b/gcc/reorg.c index 3f4defd0cf7..ac6eaa03315 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -536,7 +536,7 @@ emit_delay_sequence (rtx_insn *insn, rtx_insn_list *list, int length) rtx note, next; /* Show that this copy of the insn isn't deleted. */ - INSN_DELETED_P (tem) = 0; + tem->set_undeleted (); /* Unlink insn from its original place, and re-emit it into the sequence. */ @@ -1426,7 +1426,7 @@ try_merge_delay_insns (rtx insn, rtx_insn *thread) update_block (dtrial, thread); new_rtx = delete_from_delay_slot (dtrial); - if (INSN_DELETED_P (thread)) + if (thread->deleted ()) thread = new_rtx; INSN_FROM_TARGET_P (next_to_match) = 0; } @@ -1464,7 +1464,7 @@ try_merge_delay_insns (rtx insn, rtx_insn *thread) update_block (merged_insns->insn (), thread); new_rtx = delete_from_delay_slot (merged_insns->insn ()); - if (INSN_DELETED_P (thread)) + if (thread->deleted ()) thread = new_rtx; } else @@ -1947,7 +1947,7 @@ fill_simple_delay_slots (int non_jumps_p) insn = unfilled_slots_base[i]; if (insn == 0 - || INSN_DELETED_P (insn) + || insn->deleted () || (NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE) || (JUMP_P (insn) && non_jumps_p) @@ -2861,7 +2861,7 @@ fill_eager_delay_slots (void) insn = unfilled_slots_base[i]; if (insn == 0 - || INSN_DELETED_P (insn) + || insn->deleted () || !JUMP_P (insn) || ! (condjump_p (insn) || condjump_in_parallel_p (insn))) continue; @@ -3837,7 +3837,7 @@ dbr_schedule (rtx_insn *first) memset (total_annul_slots, 0, sizeof total_annul_slots); for (insn = first; insn; insn = NEXT_INSN (insn)) { - if (! INSN_DELETED_P (insn) + if (! insn->deleted () && NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) != USE && GET_CODE (PATTERN (insn)) != CLOBBER) diff --git a/gcc/resource.c b/gcc/resource.c index 3bc422cc212..6acc71846b8 100644 --- a/gcc/resource.c +++ b/gcc/resource.c @@ -931,8 +931,7 @@ mark_target_live_regs (rtx_insn *insns, rtx target_maybe_return, struct resource information, we can get it from there unless the insn at the start of the basic block has been deleted. */ if (tinfo && tinfo->block != -1 - && ! INSN_DELETED_P (BB_HEAD (BASIC_BLOCK_FOR_FN (cfun, - tinfo->block)))) + && ! BB_HEAD (BASIC_BLOCK_FOR_FN (cfun, tinfo->block))->deleted ()) b = tinfo->block; } diff --git a/gcc/rtl.h b/gcc/rtl.h index 2b9da813029..e919aaeca93 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -490,6 +490,7 @@ is_a_helper <const rtx_sequence *>::test (const_rtx rt) class GTY(()) rtx_insn : public rtx_def { +public: /* No extra fields, but adds the invariant: (INSN_P (X) @@ -505,6 +506,18 @@ class GTY(()) rtx_insn : public rtx_def i.e. we have an rtx that has an INSN_UID field and can be part of a linked list of insns. */ + + /* Returns true if this insn has been deleted. */ + + bool deleted () const { return volatil; } + + /* Mark this insn as deleted. */ + + void set_deleted () { volatil = true; } + + /* Mark this insn as not deleted. */ + + void set_undeleted () { volatil = false; } }; /* Subclasses of rtx_insn. */ @@ -1406,10 +1419,6 @@ inline rtvec rtx_jump_table_data::get_labels () const (RTL_FLAG_CHECK6 ("RTX_FRAME_RELATED_P", (RTX), DEBUG_INSN, INSN, \ CALL_INSN, JUMP_INSN, BARRIER, SET)->frame_related) -/* 1 if RTX is an insn that has been deleted. */ -#define INSN_DELETED_P(RTX) \ - (RTL_INSN_CHAIN_FLAG_CHECK ("INSN_DELETED_P", (RTX))->volatil) - /* 1 if JUMP RTX is a crossing jump. */ #define CROSSING_JUMP_P(RTX) \ (RTL_FLAG_CHECK1 ("CROSSING_JUMP_P", (RTX), JUMP_INSN)->jump) diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index ca3596643dc..3bc7d848e9a 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -1069,7 +1069,7 @@ return_nop_to_pool (insn_t nop, bool full_tidying) sel_remove_insn (nop, false, full_tidying); /* We'll recycle this nop. */ - INSN_DELETED_P (nop) = 0; + nop->set_undeleted (); if (nop_pool.n == nop_pool.s) nop_pool.v = XRESIZEVEC (rtx_insn *, nop_pool.v, @@ -1404,7 +1404,7 @@ sel_gen_insn_from_expr_after (expr_t expr, vinsn_t vinsn, int seqno, /* The insn may come from the transformation cache, which may hold already deleted insns, so mark it as not deleted. */ - INSN_DELETED_P (insn) = 0; + insn->set_undeleted (); add_insn_after (insn, after, BLOCK_FOR_INSN (insn)); diff --git a/gcc/varasm.c b/gcc/varasm.c index cd4a2306925..62a6b0f0c48 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -3823,7 +3823,7 @@ output_constant_pool_1 (struct constant_descriptor_rtx *desc, CODE_LABEL into a NOTE. */ /* ??? This seems completely and utterly wrong. Certainly it's not true for NOTE_INSN_DELETED_LABEL, but I disbelieve proper - functioning even with INSN_DELETED_P and friends. */ + functioning even with rtx_insn::deleted and friends. */ tmp = x; switch (GET_CODE (tmp)) @@ -3837,7 +3837,7 @@ output_constant_pool_1 (struct constant_descriptor_rtx *desc, case LABEL_REF: tmp = LABEL_REF_LABEL (tmp); - gcc_assert (!INSN_DELETED_P (tmp)); + gcc_assert (!as_a<rtx_insn *> (tmp)->deleted ()); gcc_assert (!NOTE_P (tmp) || NOTE_KIND (tmp) != NOTE_INSN_DELETED); break; |