From: Richard Sandiford Date: Sun, 26 Oct 2014 10:40:29 +0000 (+0000) Subject: xtensa.c: Include rtl-iter.h. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f36a994a6c1c31c095f23dcdb14ef2d6ce3ead7;p=gcc.git xtensa.c: Include rtl-iter.h. gcc/ * config/xtensa/xtensa.c: Include rtl-iter.h. (xtensa_tls_referenced_p_1): Delete. (xtensa_tls_referenced_p): Use FOR_EACH_SUBRTX. From-SVN: r216703 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b7a51a41879..23405db9177 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-10-26 Richard Sandiford + + * config/xtensa/xtensa.c: Include rtl-iter.h. + (xtensa_tls_referenced_p_1): Delete. + (xtensa_tls_referenced_p): Use FOR_EACH_SUBRTX. + 2014-10-26 Richard Sandiford * config/sh/sh.c (sh_contains_memref_p_1): Delete. diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index a4184d92264..5c29bfa32d4 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -66,6 +66,7 @@ along with GCC; see the file COPYING3. If not see #include "gimplify.h" #include "df.h" #include "builtins.h" +#include "rtl-iter.h" /* Enumeration for all of the relational tests, so that we can build @@ -1986,34 +1987,6 @@ xtensa_mode_dependent_address_p (const_rtx addr, return constantpool_address_p (addr); } -/* Helper for xtensa_tls_referenced_p. */ - -static int -xtensa_tls_referenced_p_1 (rtx *x, void *data ATTRIBUTE_UNUSED) -{ - if (GET_CODE (*x) == SYMBOL_REF) - return SYMBOL_REF_TLS_MODEL (*x) != 0; - - /* Ignore TLS references that have already been legitimized. */ - if (GET_CODE (*x) == UNSPEC) - { - switch (XINT (*x, 1)) - { - case UNSPEC_TPOFF: - case UNSPEC_DTPOFF: - case UNSPEC_TLS_FUNC: - case UNSPEC_TLS_ARG: - case UNSPEC_TLS_CALL: - return -1; - default: - break; - } - } - - return 0; -} - - /* Return TRUE if X contains any TLS symbol references. */ bool @@ -2022,7 +1995,29 @@ xtensa_tls_referenced_p (rtx x) if (! TARGET_HAVE_TLS) return false; - return for_each_rtx (&x, xtensa_tls_referenced_p_1, NULL); + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, x, ALL) + { + const_rtx x = *iter; + if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0) + return true; + + /* Ignore TLS references that have already been legitimized. */ + if (GET_CODE (x) == UNSPEC) + switch (XINT (x, 1)) + { + case UNSPEC_TPOFF: + case UNSPEC_DTPOFF: + case UNSPEC_TLS_FUNC: + case UNSPEC_TLS_ARG: + case UNSPEC_TLS_CALL: + iter.skip_subrtxes (); + break; + default: + break; + } + } + return false; }