This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 41/50] rtlanal.c:tls_referenced_p
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 03 Aug 2014 15:33:15 +0100
- Subject: [PATCH 41/50] rtlanal.c:tls_referenced_p
- Authentication-results: sourceware.org; auth=none
- References: <87y4v5d77q dot fsf at googlemail dot com>
gcc/
* rtl.h (tls_referenced_p): Take a const_rtx rather than an rtx.
* rtlanal.c (tls_referenced_p_1): Delete.
(tls_referenced_p): Take a const_rtx rather than an rtx.
Use FOR_EACH_SUBRTX rather than for_each_rtx.
Index: gcc/rtl.h
===================================================================
--- gcc/rtl.h 2014-08-03 11:25:31.324165866 +0100
+++ gcc/rtl.h 2014-08-03 11:25:31.649169079 +0100
@@ -2284,7 +2284,7 @@ extern void replace_label (rtx *, rtx, r
extern bool rtx_referenced_p (const_rtx, const_rtx);
extern bool tablejump_p (const_rtx, rtx *, rtx *);
extern int computed_jump_p (const_rtx);
-extern bool tls_referenced_p (rtx);
+extern bool tls_referenced_p (const_rtx);
typedef int (*rtx_function) (rtx *, void *);
extern int for_each_rtx (rtx *, rtx_function, void *);
Index: gcc/rtlanal.c
===================================================================
--- gcc/rtlanal.c 2014-08-03 11:25:31.325165876 +0100
+++ gcc/rtlanal.c 2014-08-03 11:25:31.650169089 +0100
@@ -6048,21 +6048,17 @@ get_index_code (const struct address_inf
return SCRATCH;
}
-/* Return 1 if *X is a thread-local symbol. */
-
-static int
-tls_referenced_p_1 (rtx *x, void *)
-{
- return GET_CODE (*x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (*x) != 0;
-}
-
/* Return true if X contains a thread-local symbol. */
bool
-tls_referenced_p (rtx x)
+tls_referenced_p (const_rtx x)
{
if (!targetm.have_tls)
return false;
- return for_each_rtx (&x, &tls_referenced_p_1, 0);
+ subrtx_iterator::array_type array;
+ FOR_EACH_SUBRTX (iter, array, x, NONCONST)
+ if (GET_CODE (*iter) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (*iter) != 0)
+ return true;
+ return false;
}