This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [altivec] patch for gcc.dg/altivec-5.c
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: Aldy Hernandez <aldyh at redhat dot com>, Segher Boessenkool <segher at koffie dot nl>, gcc-patches at gcc dot gnu dot org, geoffk at geoffk dot org
- Date: Tue, 07 Jan 2003 13:21:50 -0500
- Subject: Re: [altivec] patch for gcc.dg/altivec-5.c
GCC may generate an offsettable address which will not be
translated into an indexed address until after reload. The current
definition of the macro incorrectly will reject the address. See Alpha
for instance:
#define CONSTANT_ADDRESS_P(X) \
(GET_CODE (X) == CONST_INT \
&& (unsigned HOST_WIDE_INT) (INTVAL (X) + 0x8000) < 0x10000)
/* Register plus a small constant offset is valid. */
if (GET_CODE (x) == PLUS)
{
rtx ofs = XEXP (x, 1);
x = XEXP (x, 0);
/* Discard non-paradoxical subregs. */
if (GET_CODE (x) == SUBREG
&& (GET_MODE_SIZE (GET_MODE (x))
< GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))))
x = SUBREG_REG (x);
if (REG_P (x))
{
if (! strict
&& NONSTRICT_REG_OK_FP_BASE_P (x)
&& GET_CODE (ofs) == CONST_INT)
return true;
if ((strict
? STRICT_REG_OK_FOR_BASE_P (x)
: NONSTRICT_REG_OK_FOR_BASE_P (x))
&& CONSTANT_ADDRESS_P (ofs))
return true;
}
Alpha CONSTANT_ADDRESS_P is the same as PowerPC
LEGITIMATE_ADDRESS_INTEGER_P. When not strict, any CONST_INT is
accepted. GO_IF_LEGITIMATE_ADDRESS probably should not reject an
offsettable address until they can be transformed into valid addresses.
David