This fixes 'non-delegitimized UNSPEC 3 found in variable location' notes issued when building libraries which interferes with running tests.
2020-05-24 Max Filippov <jcmvb...@gmail.com> gcc/ * config/xtensa/xtensa.c (xtensa_delegitimize_address): New function. (TARGET_DELEGITIMIZE_ADDRESS): New macro. --- gcc/config/xtensa/xtensa.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 5696951fb655..e3afb70cdf04 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -188,6 +188,8 @@ static bool xtensa_can_eliminate (const int from ATTRIBUTE_UNUSED, static HOST_WIDE_INT xtensa_starting_frame_offset (void); static unsigned HOST_WIDE_INT xtensa_asan_shadow_offset (void); +static rtx xtensa_delegitimize_address (rtx); + /* These hooks specify assembly directives for creating certain kinds @@ -338,6 +340,9 @@ static unsigned HOST_WIDE_INT xtensa_asan_shadow_offset (void); #undef TARGET_HAVE_SPECULATION_SAFE_VALUE #define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_needed +#undef TARGET_DELEGITIMIZE_ADDRESS +#define TARGET_DELEGITIMIZE_ADDRESS xtensa_delegitimize_address + struct gcc_target targetm = TARGET_INITIALIZER; @@ -4440,4 +4445,23 @@ xtensa_asan_shadow_offset (void) return HOST_WIDE_INT_UC (0x10000000); } +static rtx +xtensa_delegitimize_address (rtx op) +{ + switch (GET_CODE (op)) + { + case CONST: + return xtensa_delegitimize_address (XEXP (op, 0)); + + case UNSPEC: + if (XINT (op, 1) == UNSPEC_PLT) + return XVECEXP(op, 0, 0); + break; + + default: + break; + } + return op; +} + #include "gt-xtensa.h" -- 2.20.1