+2012-04-21 Richard Sandiford <rdsandiford@googlemail.com>
+
+ PR bootstrap/53021
+ * rtl.def (ADDRESS): Use "i" rather than "w".
+ * rtl.h (find_base_term): Delete.
+ (may_be_sp_based_p): Declare.
+ * rtl.c (rtx_code_size): Remove ADDRESS special case.
+ * alias.h (UNIQUE_BASE_VALUE_SP, UNIQUE_BASE_VALUE_ARGP)
+ (UNIQUE_BASE_VALUE_FP, UNIQUE_BASE_VALUE_HFP): Move to...
+ * alias.c: ...here.
+ (find_base_term): Make static.
+ (may_be_sp_based_p): New function.
+ * dse.c (record_store): Use it.
+ * store-motion.c (store_killed_in_insn): Likewise.
+
2012-04-21 Richard Sandiford <rdsandiford@googlemail.com>
* fold-const.c (fold_checksum_tree): Fix VECTOR_CST case.
array. */
static GTY((deletable)) VEC(rtx,gc) *old_reg_base_value;
+/* Values of XINT (address, 0) of Pmode ADDRESS rtxes for special
+ registers. */
+#define UNIQUE_BASE_VALUE_SP -1
+#define UNIQUE_BASE_VALUE_ARGP -2
+#define UNIQUE_BASE_VALUE_FP -3
+#define UNIQUE_BASE_VALUE_HFP -4
+
#define static_reg_base_value \
(this_target_rtl->x_static_reg_base_value)
return 1;
}
-rtx
+static rtx
find_base_term (rtx x)
{
cselib_val *val;
}
}
+/* Return true if accesses to address X may alias accesses based
+ on the stack pointer. */
+
+bool
+may_be_sp_based_p (rtx x)
+{
+ rtx base = find_base_term (x);
+ return !base || base == static_reg_base_value[STACK_POINTER_REGNUM];
+}
+
/* Return 0 if the addresses X and Y are known to point to different
objects, 1 if they might be pointers to the same object. */
memory barriers, including an address of SCRATCH. */
#define ALIAS_SET_MEMORY_BARRIER ((alias_set_type) -1)
-/* Values of XWINT (address, 0) of Pmode ADDRESS rtxes for special
- registers. */
-#define UNIQUE_BASE_VALUE_SP -1
-#define UNIQUE_BASE_VALUE_ARGP -2
-#define UNIQUE_BASE_VALUE_FP -3
-#define UNIQUE_BASE_VALUE_HFP -4
-
#endif /* GCC_ALIAS_H */
}
else
{
- rtx base_term = find_base_term (XEXP (mem, 0));
- if (!base_term
- || (GET_CODE (base_term) == ADDRESS
- && GET_MODE (base_term) == Pmode
- && XWINT (base_term, 0) == UNIQUE_BASE_VALUE_SP))
+ if (may_be_sp_based_p (XEXP (mem, 0)))
insn_info->stack_pointer_based = true;
insn_info->contains_cselib_groups = true;
const unsigned char rtx_code_size[NUM_RTX_CODE] = {
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) \
(((ENUM) == CONST_INT || (ENUM) == CONST_DOUBLE \
- || (ENUM) == CONST_FIXED || (ENUM) == ADDRESS) \
+ || (ENUM) == CONST_FIXED) \
? RTX_HDR_SIZE + (sizeof FORMAT - 1) * sizeof (HOST_WIDE_INT) \
: RTX_HDR_SIZE + (sizeof FORMAT - 1) * sizeof (rtunion)),
DEF_RTL_EXPR(SEQUENCE, "sequence", "E", RTX_EXTRA)
/* Represents a non-global base address. This is only used in alias.c. */
-DEF_RTL_EXPR(ADDRESS, "address", "w", RTX_EXTRA)
+DEF_RTL_EXPR(ADDRESS, "address", "i", RTX_EXTRA)
/* ----------------------------------------------------------------------
Expression types used for things in the instruction chain.
extern void end_alias_analysis (void);
extern void vt_equate_reg_base_value (const_rtx, const_rtx);
extern bool memory_modified_in_insn_p (const_rtx, const_rtx);
-extern rtx find_base_term (rtx);
+extern bool may_be_sp_based_p (rtx);
extern rtx gen_hard_reg_clobber (enum machine_mode, unsigned int);
extern rtx get_reg_known_value (unsigned int);
extern bool get_reg_known_equiv_p (unsigned int);
static bool
store_killed_in_insn (const_rtx x, const_rtx x_regs, const_rtx insn, int after)
{
- const_rtx reg, base, note, pat;
+ const_rtx reg, note, pat;
if (! NONDEBUG_INSN_P (insn))
return false;
/* But even a const call reads its parameters. Check whether the
base of some of registers used in mem is stack pointer. */
for (reg = x_regs; reg; reg = XEXP (reg, 1))
- {
- base = find_base_term (XEXP (reg, 0));
- if (!base
- || (GET_CODE (base) == ADDRESS
- && GET_MODE (base) == Pmode
- && XEXP (base, 0) == stack_pointer_rtx))
- return true;
- }
+ if (may_be_sp_based_p (XEXP (reg, 0)))
+ return true;
return false;
}