summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-08 11:25:17 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-08 11:25:17 +0000
commiteb94d85213fe7c25904bbec40116713db7cb33ce (patch)
tree8b7d6ea5d928f78892f47a6634cd5c492a958f8d
parentfad99894f509123ce40905b2cf2c72254fb97903 (diff)
downloadgcc-eb94d85213fe7c25904bbec40116713db7cb33ce.tar.gz
gcc/
* config/arm/arm.c: Include rtl-iter.h. (arm_tls_referenced_p_1): Delete. (arm_tls_referenced_p): Use FOR_EACH_SUBRTX. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217254 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/arm/arm.c34
2 files changed, 20 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 57e2a0e4c50..d0e0c9eebbe 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2014-11-08 Richard Sandiford <richard.sandiford@arm.com>
+ * config/arm/arm.c: Include rtl-iter.h.
+ (arm_tls_referenced_p_1): Delete.
+ (arm_tls_referenced_p): Use FOR_EACH_SUBRTX.
+
+2014-11-08 Richard Sandiford <richard.sandiford@arm.com>
+
* config/arm/aarch-common.c: Include rtl-iter.h.
(search_term, arm_find_sub_rtx_with_search_term): Delete.
(arm_find_sub_rtx_with_code): Use FOR_EACH_SUBRTX_VAR.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 05529520648..2e7c77b8bc1 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -82,6 +82,7 @@
#include "gimple-expr.h"
#include "builtins.h"
#include "tm-constrs.h"
+#include "rtl-iter.h"
/* Forward definitions of types. */
typedef struct minipool_node Mnode;
@@ -8110,25 +8111,6 @@ thumb_legitimize_reload_address (rtx *x_p,
return NULL;
}
-/* Test for various thread-local symbols. */
-
-/* Helper for arm_tls_referenced_p. */
-
-static int
-arm_tls_operand_p_1 (rtx *x, void *data ATTRIBUTE_UNUSED)
-{
- if (GET_CODE (*x) == SYMBOL_REF)
- return SYMBOL_REF_TLS_MODEL (*x) != 0;
-
- /* Don't recurse into UNSPEC_TLS looking for TLS symbols; these are
- TLS offsets, not real symbol references. */
- if (GET_CODE (*x) == UNSPEC
- && XINT (*x, 1) == UNSPEC_TLS)
- return -1;
-
- return 0;
-}
-
/* Return TRUE if X contains any TLS symbol references. */
bool
@@ -8137,7 +8119,19 @@ arm_tls_referenced_p (rtx x)
if (! TARGET_HAVE_TLS)
return false;
- return for_each_rtx (&x, arm_tls_operand_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;
+
+ /* Don't recurse into UNSPEC_TLS looking for TLS symbols; these are
+ TLS offsets, not real symbol references. */
+ if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_TLS)
+ iter.skip_subrtxes ();
+ }
+ return false;
}
/* Implement TARGET_LEGITIMATE_CONSTANT_P.