Commit 9e412ca3 by Richard Sandiford Committed by Richard Sandiford

re PR bootstrap/53021 (bootstrap failure on Linux/ia32)

gcc/
	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.

From-SVN: r186657
parent 1410c222
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.
2012-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
......
......@@ -228,6 +228,13 @@ static int unique_id;
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)
......@@ -1584,7 +1591,7 @@ rtx_equal_for_memref_p (const_rtx x, const_rtx y)
return 1;
}
rtx
static rtx
find_base_term (rtx x)
{
cselib_val *val;
......@@ -1740,6 +1747,16 @@ find_base_term (rtx x)
}
}
/* 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. */
......
......@@ -51,11 +51,4 @@ extern int nonoverlapping_memrefs_p (const_rtx, const_rtx, bool);
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 */
......@@ -1499,11 +1499,7 @@ record_store (rtx body, bb_info_t bb_info)
}
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;
......
......@@ -111,7 +111,7 @@ const enum rtx_class rtx_class[NUM_RTX_CODE] = {
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)),
......
......@@ -110,7 +110,7 @@ DEF_RTL_EXPR(INSN_LIST, "insn_list", "ue", RTX_EXTRA)
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.
......
......@@ -2597,7 +2597,7 @@ extern void init_alias_analysis (void);
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);
......
......@@ -395,7 +395,7 @@ store_killed_in_pat (const_rtx x, const_rtx pat, int after)
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;
......@@ -410,14 +410,8 @@ store_killed_in_insn (const_rtx x, const_rtx x_regs, const_rtx insn, int after)
/* 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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment