diff options
Diffstat (limited to 'gcc/config/i386/i386.c')
-rw-r--r-- | gcc/config/i386/i386.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index bb013a144f6..593ea84ffa6 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -9090,13 +9090,6 @@ ix86_cannot_force_const_mem (rtx x) return !legitimate_constant_p (x); } -/* Determine if a given RTX is a valid constant address. */ - -bool -constant_address_p (rtx x) -{ - return CONSTANT_P (x) && legitimate_address_p (Pmode, x, 1); -} /* Nonzero if the constant value X is a legitimate general operand when generating PIC code. It is given that flag_pic is on and @@ -9273,9 +9266,9 @@ legitimate_pic_address_disp_p (rtx disp) convert common non-canonical forms to canonical form so that they will be recognized. */ -int -legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, - rtx addr, int strict) +static bool +ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, + rtx addr, bool strict) { struct ix86_address parts; rtx base, index, disp; @@ -9499,6 +9492,14 @@ legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, report_error: return FALSE; } + +/* Determine if a given RTX is a valid constant address. */ + +bool +constant_address_p (rtx x) +{ + return CONSTANT_P (x) && ix86_legitimate_address_p (Pmode, x, 1); +} /* Return a unique alias set for the GOT. */ @@ -10154,7 +10155,7 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, } } - if (changed && legitimate_address_p (mode, x, FALSE)) + if (changed && ix86_legitimate_address_p (mode, x, FALSE)) return x; if (GET_CODE (XEXP (x, 0)) == MULT) @@ -10180,7 +10181,7 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, x = legitimize_pic_address (x, 0); } - if (changed && legitimate_address_p (mode, x, FALSE)) + if (changed && ix86_legitimate_address_p (mode, x, FALSE)) return x; if (REG_P (XEXP (x, 0))) @@ -30267,6 +30268,9 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree) #undef TARGET_EXPAND_TO_RTL_HOOK #define TARGET_EXPAND_TO_RTL_HOOK ix86_maybe_switch_abi +#undef TARGET_LEGITIMATE_ADDRESS_P +#define TARGET_LEGITIMATE_ADDRESS_P ix86_legitimate_address_p + struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-i386.h" |