This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]