From patchwork Sat Oct 25 10:13:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 403023 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 AA81C140096 for ; Sat, 25 Oct 2014 21:13:20 +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:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=Y2tkeEs92cRSagdHJDS9bu8MzfTIuESGeZ1VwifTxX3GxvKUEg 9Jt8NU+8OdjOWtlKgSRnoid3AO3JNXV9BopFRm1h9qQAtRLpVyV1J2pNtw2Lfu8A 9pXsDnSrPzuFSWMIZWE+UhZcKdy9WOUw1fRkjiNnxxMSiMoijCF9+L+uY= 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:cc:subject:date:message-id:mime-version:content-type; s= default; bh=dFSAvkI5avKXER0d7/7HGmKdM2w=; b=jTbIh9aVcdzpTZrKWT/e R4XvKCI1qEQiN5dxNq6hF7ouJw2SziCZ7ITPOkmpq91ElR12M99cJVzaNw98kvmi 02RGvT1gtOmb5fWuBKZrg1oOlVSLgCOBR6Lsrt7/VvfWMv90vcqlGm5/x7Lu0wXr 7LmuvkEBhoYR+GPMRF8thyw= Received: (qmail 21475 invoked by alias); 25 Oct 2014 10:13:14 -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 21462 invoked by uid 89); 25 Oct 2014 10:13:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f46.google.com Received: from mail-wg0-f46.google.com (HELO mail-wg0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 25 Oct 2014 10:13:12 +0000 Received: by mail-wg0-f46.google.com with SMTP id l18so2613419wgh.29 for ; Sat, 25 Oct 2014 03:13:09 -0700 (PDT) X-Received: by 10.194.185.167 with SMTP id fd7mr1969882wjc.108.1414231989448; Sat, 25 Oct 2014 03:13:09 -0700 (PDT) Received: from localhost ([95.144.14.167]) by mx.google.com with ESMTPSA id ic4sm4680573wid.19.2014.10.25.03.13.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Oct 2014 03:13:09 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rth@redhat.com, rdsandiford@googlemail.com Cc: rth@redhat.com Subject: [alpha] RFA: Use new rtl iterators in split_small_symbolic_operand Date: Sat, 25 Oct 2014 11:13:08 +0100 Message-ID: <87fvecv4nf.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 alpha-linux-gnu. OK to install? Thanks, Richard gcc/ * config/alpha/alpha.c: Include rtl-iter.h. (split_small_symbolic_operand_1): Delete. (split_small_symbolic_operand): Use FOR_EACH_SUBRTX_PTR. Index: gcc/config/alpha/alpha.c =================================================================== --- gcc/config/alpha/alpha.c 2014-10-25 09:40:37.907516019 +0100 +++ gcc/config/alpha/alpha.c 2014-10-25 09:51:29.006915284 +0100 @@ -80,6 +80,7 @@ the Free Software Foundation; either ver #include "opts.h" #include "params.h" #include "builtins.h" +#include "rtl-iter.h" /* Specify which cpu to schedule for. */ enum processor_type alpha_tune; @@ -1236,30 +1237,24 @@ some_small_symbolic_operand_int (rtx *px return small_symbolic_operand (x, Pmode) != 0; } -static int -split_small_symbolic_operand_1 (rtx *px, void *data ATTRIBUTE_UNUSED) -{ - rtx x = *px; - - /* Don't re-split. */ - if (GET_CODE (x) == LO_SUM) - return -1; - - if (small_symbolic_operand (x, Pmode)) - { - x = gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, x); - *px = x; - return -1; - } - - return 0; -} - rtx split_small_symbolic_operand (rtx x) { x = copy_insn (x); - for_each_rtx (&x, split_small_symbolic_operand_1, NULL); + subrtx_ptr_iterator::array_type array; + FOR_EACH_SUBRTX_PTR (iter, array, &x, ALL) + { + rtx *ptr = *iter; + rtx x = *ptr; + /* Don't re-split. */ + if (GET_CODE (x) == LO_SUM) + iter.skip_subrtxes (); + else if (small_symbolic_operand (x, Pmode)) + { + *ptr = gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, x); + iter.skip_subrtxes (); + } + } return x; }