This is the mail archive of the gcc@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]

CONSTANT_ADDRESS_P for i386/x86-64


Hi,
currently constant_address_p on i386/x86-64 is defined as follows:

bool
constant_address_p (x)
     rtx x;
{
  switch (GET_CODE (x))
    {
    case LABEL_REF:
    case CONST_INT:
      return true;

    case CONST_DOUBLE:
      return TARGET_64BIT;

    case CONST:
      /* For Mach-O, really believe the CONST.  */
      if (TARGET_MACHO)
	return true;
      /* Otherwise fall through.  */
    case SYMBOL_REF:
      return !flag_pic && legitimate_constant_p (x);

    default:
      return false;
    }
}

This does not make sense for me.  Why for -fpic symbol_ref is refused,
byt label_ref is accepted?
should we accept the static SYMBOL_REFs too on x86-64?
What makes this beast different from calling legitimate_address_p on the
operand?

Honza


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