aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2014-08-28 06:24:40 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-08-28 06:24:40 +0000
commit6180e3d8705e54db209efe706a778e79965be34c (patch)
treeff3a999faab06864d0dc71315f1ceadd4bd5c761
parent8d8e205b922741ad452fbe0750d2d8af8515c967 (diff)
downloadgcc-6180e3d8705e54db209efe706a778e79965be34c.zip
gcc-6180e3d8705e54db209efe706a778e79965be34c.tar.gz
gcc-6180e3d8705e54db209efe706a778e79965be34c.tar.bz2
rtl.h (tls_referenced_p): Take a const_rtx rather than an rtx.
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. From-SVN: r214658
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/rtlanal.c16
3 files changed, 14 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 00e4bce..20915cb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
+ * 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.
+
+2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
+
* rtl.h (for_each_inc_dec_fn): Remove special case for -1.
(for_each_inc_dec): Take an rtx rather than an rtx *.
* cselib.c (cselib_record_autoinc_cb): Update accordingly.
diff --git a/gcc/rtl.h b/gcc/rtl.h
index b18f2e1..0b617a3 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2797,7 +2797,7 @@ extern void replace_label_in_insn (rtx_insn *, rtx, rtx, bool);
extern bool rtx_referenced_p (const_rtx, const_rtx);
extern bool tablejump_p (const_rtx, rtx *, rtx_jump_table_data **);
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 *);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 3e3af72..ceaa7ab 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -6075,21 +6075,17 @@ get_index_code (const struct address_info *info)
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;
}