From patchwork Sat Oct 25 10:15:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 403025 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 CD81F140096 for ; Sat, 25 Oct 2014 21:15:33 +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=mMIICXj5L77jQFx3bbYDeH9KUK6XQAEiLUZlhC7AniGBCdRTbt kquHTjgUCsq91aeDMBg7+qNqhTyq+GbPKerzyNrvYlfh33Jw9/3zespHNmXFRcFw w53ny+wtLWKjr7ujyEFFn+0WmJC4DCOQaiUL/H4nLu94yeDLHk6fr5Kmw= 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=B3YaZU7ycMImFL1JQ66jtMgnOrc=; b=VfWqjgBoeS3tsfBOuH15 DQs7MO/3SS62DddSzaeegkgWKAIt+1jEIEOuMRZjS9Y3Xw7EuDDovnff7yLmmLVy rUQS1eRd2vA5yoS5vAHk47yhbmGuPSlFh4qBFZvQh/nid17NuYzPCZJV6RDdWLLV gfo9A0T53GjIiFhQ/axMp0k= Received: (qmail 24628 invoked by alias); 25 Oct 2014 10:15:27 -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 24611 invoked by uid 89); 25 Oct 2014 10:15:24 -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-wi0-f181.google.com Received: from mail-wi0-f181.google.com (HELO mail-wi0-f181.google.com) (209.85.212.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 25 Oct 2014 10:15:23 +0000 Received: by mail-wi0-f181.google.com with SMTP id n3so3004585wiv.2 for ; Sat, 25 Oct 2014 03:15:20 -0700 (PDT) X-Received: by 10.194.63.145 with SMTP id g17mr10124918wjs.80.1414232120485; Sat, 25 Oct 2014 03:15:20 -0700 (PDT) Received: from localhost ([95.144.14.167]) by mx.google.com with ESMTPSA id fa16sm4704643wid.5.2014.10.25.03.15.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Oct 2014 03:15:19 -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 alpha_find_lo_sum_using_gp Date: Sat, 25 Oct 2014 11:15:19 +0100 Message-ID: <877fzov4js.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-protos.h (alpha_find_lo_sum_using_gp): Return a bool. * config/alpha/alpha.c (find_lo_sum_using_gp): Delete. (alpha_find_lo_sum_using_gp): Use FOR_EACH_SUBRTX. Return a bool. Index: gcc/config/alpha/alpha-protos.h =================================================================== --- gcc/config/alpha/alpha-protos.h 2014-10-25 09:40:37.813515264 +0100 +++ gcc/config/alpha/alpha-protos.h 2014-10-25 09:51:29.781922193 +0100 @@ -75,7 +75,7 @@ extern rtx function_value (const_tree, c extern void alpha_start_function (FILE *, const char *, tree); extern void alpha_end_function (FILE *, const char *, tree); -extern int alpha_find_lo_sum_using_gp (rtx); +extern bool alpha_find_lo_sum_using_gp (rtx); #ifdef REAL_VALUE_TYPE extern int check_float_value (enum machine_mode, REAL_VALUE_TYPE *, int); Index: gcc/config/alpha/alpha.c =================================================================== --- gcc/config/alpha/alpha.c 2014-10-25 09:51:29.394918743 +0100 +++ gcc/config/alpha/alpha.c 2014-10-25 09:51:29.783922210 +0100 @@ -7554,16 +7554,17 @@ vms_output_aligned_decl_common(FILE *fil #endif -static int -find_lo_sum_using_gp (rtx *px, void *data ATTRIBUTE_UNUSED) -{ - return GET_CODE (*px) == LO_SUM && XEXP (*px, 0) == pic_offset_table_rtx; -} - -int +bool alpha_find_lo_sum_using_gp (rtx insn) { - return for_each_rtx (&PATTERN (insn), find_lo_sum_using_gp, NULL) > 0; + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, PATTERN (insn), NONCONST) + { + const_rtx x = *iter; + if (GET_CODE (x) == LO_SUM && XEXP (x, 0) == pic_offset_table_rtx) + return true; + } + return false; } static int