From patchwork Wed Nov 5 11:53:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 406955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 69EE314008C for ; Wed, 5 Nov 2014 22:54:06 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=AOmIwFu8eYia/ncDZSFX9SrbClwJs0b+sqITapTSg/yBvaPAqj5rq dFoxyHCqAktE5hiyx0fgr1mQo3iJGi/000H0TNR8ONVyEttmX9eNraHy2JEliBSO 2z49HEe35LpyHVyEJc7H60M+6pWVAr7eSNurr2Pm1R8UhNf7x+3aUs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=sWzexR1NP5DHCAHYykZlJxUUxew=; b=wztvqGjn+JTwM3x9Jfpp emdzJ7Wn3D9lo+fz99cf/GMQif7sXbDIQEqNlad0e6zThST8A9iwfdF+y5xPy+Q3 3b3qMwvylVj77IywwALp8GhuHgFs2t3f0rV8H+gUiFiAQwhs93TU0GyzDBqT6TMW Z1LOdvIKjGAYCmIUcrhlBOk= Received: (qmail 6651 invoked by alias); 5 Nov 2014 11:53:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 6638 invoked by uid 89); 5 Nov 2014 11:53:59 -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-f176.google.com Received: from mail-wi0-f176.google.com (HELO mail-wi0-f176.google.com) (209.85.212.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 05 Nov 2014 11:53:58 +0000 Received: by mail-wi0-f176.google.com with SMTP id h11so12145058wiw.3 for ; Wed, 05 Nov 2014 03:53:55 -0800 (PST) X-Received: by 10.194.110.161 with SMTP id ib1mr36620160wjb.78.1415188435505; Wed, 05 Nov 2014 03:53:55 -0800 (PST) Received: from localhost ([2.25.234.66]) by mx.google.com with ESMTPSA id l10sm15529339wif.20.2014.11.05.03.53.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Nov 2014 03:53:54 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: [AArch64] RFA: Use new rtl iterators in arm_cannot_copy_insn Date: Wed, 05 Nov 2014 11:53:54 +0000 Message-ID: <87oaslkgml.fsf@googlemail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 This is part of a series to remove uses of for_each_rtx from the ports. Tested by making sure there were no code changes for gcc.dg, gcc.c-torture and g++.dg for aarch64-linux-gnu. OK to install? Thanks, Richard gcc/ * config/aarch64/aarch64.c: Include rtl-iter.h. (aarch64_tls_operand_p_1): Delete. (aarch64_tls_operand_p): Use FOR_EACH_SUBRTX. Index: gcc/config/aarch64/aarch64.c =================================================================== --- gcc/config/aarch64/aarch64.c 2014-11-02 19:59:26.977231633 +0000 +++ gcc/config/aarch64/aarch64.c 2014-11-05 11:48:59.982095520 +0000 @@ -2791,28 +2791,23 @@ aarch64_output_mi_thunk (FILE *file, tre reload_completed = 0; } -static int -aarch64_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; -} - static bool aarch64_tls_referenced_p (rtx x) { if (!TARGET_HAVE_TLS) return false; - - return for_each_rtx (&x, aarch64_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; }