aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorTrevor Saunders <tbsaunde+gcc@tbsaunde.org>2016-10-21 12:32:56 +0000
committerTrevor Saunders <tbsaunde@gcc.gnu.org>2016-10-21 12:32:56 +0000
commit04a121a757f20a4807d47e1d0c7418145b147d69 (patch)
tree4a775485f6f8a9a86ec778a975da372fc9d35d4b /gcc/cse.c
parent1d64ceb0579f2da8fec5f26932d5b182653c60d7 (diff)
downloadgcc-04a121a757f20a4807d47e1d0c7418145b147d69.zip
gcc-04a121a757f20a4807d47e1d0c7418145b147d69.tar.gz
gcc-04a121a757f20a4807d47e1d0c7418145b147d69.tar.bz2
make LABEL_REF_LABEL a rtx_insn *
While changing LABEL_REF_LABEL it might as well become an inline function, so that its clearer what types are involved. Unfortunately because it is still possible to use XEXP and related macros on a LABEL_REF rtx you can still set the field to be a non insn rtx. The other unfortunate thing is that the generators actually create LABEL_REF rtx that refer to MATCH_x rtx, so there we actually need to use XEXP to bypass the checking this patch adds. gcc/ChangeLog: 2016-10-21 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * rtl.h (label_ref_label): New function. (set_label_ref_label): New function. (LABEL_REF_LABEL): Delete. * alias.c (rtx_equal_for_memref_p): Adjust. * cfgbuild.c (make_edges): Likewise. (purge_dead_tablejump_edges): Likewise. * cfgexpand.c (convert_debug_memory_address): Likewise. * cfgrtl.c (patch_jump_insn): Likewise. * combine.c (distribute_notes): Likewise. * cse.c (hash_rtx_cb): Likewise. (exp_equiv_p): Likewise. (fold_rtx): Likewise. (check_for_label_ref): Likewise. * cselib.c (rtx_equal_for_cselib_1): Likewise. (cselib_hash_rtx): Likewise. * emit-rtl.c (mark_label_nuses): Likewise. * explow.c (convert_memory_address_addr_space_1): Likewise. * final.c (output_asm_label): Likewise. (output_addr_const): Likewise. * gcse.c (add_label_notes): Likewise. * genconfig.c (walk_insn_part): Likewise. * genrecog.c (validate_pattern): Likewise. * ifcvt.c (cond_exec_get_condition): Likewise. (noce_emit_store_flag): Likewise. (noce_get_alt_condition): Likewise. (noce_get_condition): Likewise. * jump.c (maybe_propagate_label_ref): Likewise. (mark_jump_label_1): Likewise. (redirect_exp_1): Likewise. (rtx_renumbered_equal_p): Likewise. * lra-constraints.c (operands_match_p): Likewise. * print-rtl.c (print_value): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (set_label_offsets): Likewise. * reorg.c (get_branch_condition): Likewise. * rtl-tests.c (test_uncond_jump): Likewise. * rtl.c (rtx_equal_p_cb): Likewise. (rtx_equal_p): Likewise. * rtlanal.c (reg_mentioned_p): Likewise. (rtx_referenced_p): Likewise. (get_condition): Likewise. * varasm.c (const_hash_1): Likewise. (compare_constant): Likewise. (const_rtx_hash_1): Likewise. (output_constant_pool_1): Likewise. From-SVN: r241401
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 8b9e4a1..4b3cd2e 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2365,7 +2365,7 @@ hash_rtx_cb (const_rtx x, machine_mode mode,
/* We don't hash on the address of the CODE_LABEL to avoid bootstrap
differences and differences between each stage's debugging dumps. */
hash += (((unsigned int) LABEL_REF << 7)
- + CODE_LABEL_NUMBER (LABEL_REF_LABEL (x)));
+ + CODE_LABEL_NUMBER (label_ref_label (x)));
return hash;
case SYMBOL_REF:
@@ -2618,7 +2618,7 @@ exp_equiv_p (const_rtx x, const_rtx y, int validate, bool for_gcse)
return x == y;
case LABEL_REF:
- return LABEL_REF_LABEL (x) == LABEL_REF_LABEL (y);
+ return label_ref_label (x) == label_ref_label (y);
case SYMBOL_REF:
return XSTR (x, 0) == XSTR (y, 0);
@@ -3507,7 +3507,7 @@ fold_rtx (rtx x, rtx_insn *insn)
: lookup_as_function (folded_arg0, MINUS);
if (y != 0 && GET_CODE (XEXP (y, 1)) == LABEL_REF
- && LABEL_REF_LABEL (XEXP (y, 1)) == LABEL_REF_LABEL (const_arg1))
+ && label_ref_label (XEXP (y, 1)) == label_ref_label (const_arg1))
return XEXP (y, 0);
/* Now try for a CONST of a MINUS like the above. */
@@ -3515,7 +3515,7 @@ fold_rtx (rtx x, rtx_insn *insn)
: lookup_as_function (folded_arg0, CONST))) != 0
&& GET_CODE (XEXP (y, 0)) == MINUS
&& GET_CODE (XEXP (XEXP (y, 0), 1)) == LABEL_REF
- && LABEL_REF_LABEL (XEXP (XEXP (y, 0), 1)) == LABEL_REF_LABEL (const_arg1))
+ && label_ref_label (XEXP (XEXP (y, 0), 1)) == label_ref_label (const_arg1))
return XEXP (XEXP (y, 0), 0);
}
@@ -3527,7 +3527,7 @@ fold_rtx (rtx x, rtx_insn *insn)
: lookup_as_function (folded_arg1, MINUS);
if (y != 0 && GET_CODE (XEXP (y, 1)) == LABEL_REF
- && LABEL_REF_LABEL (XEXP (y, 1)) == LABEL_REF_LABEL (const_arg0))
+ && label_ref_label (XEXP (y, 1)) == label_ref_label (const_arg0))
return XEXP (y, 0);
/* Now try for a CONST of a MINUS like the above. */
@@ -3535,7 +3535,7 @@ fold_rtx (rtx x, rtx_insn *insn)
: lookup_as_function (folded_arg1, CONST))) != 0
&& GET_CODE (XEXP (y, 0)) == MINUS
&& GET_CODE (XEXP (XEXP (y, 0), 1)) == LABEL_REF
- && LABEL_REF_LABEL (XEXP (XEXP (y, 0), 1)) == LABEL_REF_LABEL (const_arg0))
+ && label_ref_label (XEXP (XEXP (y, 0), 1)) == label_ref_label (const_arg0))
return XEXP (XEXP (y, 0), 0);
}
@@ -6497,10 +6497,10 @@ check_for_label_ref (rtx_insn *insn)
if (GET_CODE (x) == LABEL_REF
&& !LABEL_REF_NONLOCAL_P (x)
&& (!JUMP_P (insn)
- || !label_is_jump_target_p (LABEL_REF_LABEL (x), insn))
- && LABEL_P (LABEL_REF_LABEL (x))
- && INSN_UID (LABEL_REF_LABEL (x)) != 0
- && !find_reg_note (insn, REG_LABEL_OPERAND, LABEL_REF_LABEL (x)))
+ || !label_is_jump_target_p (label_ref_label (x), insn))
+ && LABEL_P (label_ref_label (x))
+ && INSN_UID (label_ref_label (x)) != 0
+ && !find_reg_note (insn, REG_LABEL_OPERAND, label_ref_label (x)))
return true;
}
return false;