From 23487675cd29d1702f44c9bc60885c1602a401f1 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Sun, 26 Oct 2014 19:47:22 +0000 Subject: [PATCH] microblaze.c: Include rtl-iter.h. gcc/ * config/microblaze/microblaze.c: Include rtl-iter.h. (microblaze_tls_referenced_p_1): Delete. (microblaze_tls_referenced_p): Use FOR_EACH_SUBRTX. From-SVN: r216719 --- gcc/ChangeLog | 6 ++++++ gcc/config/microblaze/microblaze.c | 29 +++++++++++++---------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 89f29edc6d4..b67d906bac5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-10-26 Richard Sandiford + + * config/microblaze/microblaze.c: Include rtl-iter.h. + (microblaze_tls_referenced_p_1): Delete. + (microblaze_tls_referenced_p): Use FOR_EACH_SUBRTX. + 2014-10-26 Richard Sandiford * config/mips/mips.c (mips_at_reg_p): Delete. diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c index 3992a28b0e0..a3ed72d1c3c 100644 --- a/gcc/config/microblaze/microblaze.c +++ b/gcc/config/microblaze/microblaze.c @@ -56,6 +56,7 @@ #include "diagnostic-core.h" #include "cgraph.h" #include "builtins.h" +#include "rtl-iter.h" #define MICROBLAZE_VERSION_COMPARE(VA,VB) strcasecmp (VA, VB) @@ -444,20 +445,6 @@ microblaze_tls_symbol_p (rtx x) return SYMBOL_REF_TLS_MODEL (x) != 0; } -static int -microblaze_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 @@ -465,8 +452,18 @@ microblaze_tls_referenced_p (rtx x) { if (!TARGET_HAVE_TLS) return false; - - return for_each_rtx (&x, microblaze_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; } bool -- 2.30.2