From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3509 invoked by alias); 5 Nov 2014 11:51:56 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 3499 invoked by uid 89); 5 Nov 2014 11:51:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-wi0-f178.google.com Received: from mail-wi0-f178.google.com (HELO mail-wi0-f178.google.com) (209.85.212.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 05 Nov 2014 11:51:54 +0000 Received: by mail-wi0-f178.google.com with SMTP id q5so1742725wiv.11 for ; Wed, 05 Nov 2014 03:51:51 -0800 (PST) X-Received: by 10.195.13.14 with SMTP id eu14mr62431225wjd.31.1415188311676; Wed, 05 Nov 2014 03:51:51 -0800 (PST) Received: from localhost ([2.25.234.66]) by mx.google.com with ESMTPSA id l10sm15523043wif.20.2014.11.05.03.51.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Nov 2014 03:51:51 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: [ARM] RFA: Use new rtl iterators in arm_tls_referenced_p Date: Wed, 05 Nov 2014 11:51:00 -0000 Message-ID: <87y4rpkgq1.fsf@googlemail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-11/txt/msg00286.txt.bz2 Tested in the same way as the aarch-common.c patch. OK to install? Thanks, Richard gcc/ * config/arm/arm.c: Include rtl-iter.h. (arm_tls_referenced_p_1): Delete. (arm_tls_referenced_p): Use FOR_EACH_SUBRTX. Index: gcc/config/arm/arm.c =================================================================== --- gcc/config/arm/arm.c 2014-11-02 19:59:27.588237213 +0000 +++ gcc/config/arm/arm.c 2014-11-05 11:48:55.030053470 +0000 @@ -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; @@ -8078,25 +8079,6 @@ thumb_legitimize_reload_address (rtx *x_ 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 @@ -8105,7 +8087,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.