From patchwork Sat Oct 25 08:57: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: 402989 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 0B3BD140096 for ; Sat, 25 Oct 2014 19:57:22 +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=I4tqqmIbJGDfIzyS7du0EYm6k+yeeHbjqKSCErjsaAJ1oMnHTi YavgAEu+TAWIyqm/kPT2mO2vKcCqA5o1b8Hve8MbOTLxcsmXL7c8ImT4lzYEepd5 wijfVgiknqccChX5WhIp2KsPuKBPIWPRLJgieVM06ciXLJhiM61p490X0= 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=fBuEf6ki36HrA2DfRUoxLqT75B4=; b=O213OwYMNzxdZTrUXqwM 0C/dAjcz7+w/aUU/mC67yPihSMnBEUebziyFs/ICt68w5MjIP7Xn1u3jppCkdhZD ajjUBpbfnpkiZ/BJkkdcEVkHRCvJT6bKJXLHAHPI+sfgR3AzBI3kmiilVyEoETwn Z/7W0zX82azf+wdOH/YM840= Received: (qmail 20139 invoked by alias); 25 Oct 2014 08:57: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 20127 invoked by uid 89); 25 Oct 2014 08:57:14 -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-f177.google.com Received: from mail-wi0-f177.google.com (HELO mail-wi0-f177.google.com) (209.85.212.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 25 Oct 2014 08:57:13 +0000 Received: by mail-wi0-f177.google.com with SMTP id ex7so2919261wid.4 for ; Sat, 25 Oct 2014 01:57:10 -0700 (PDT) X-Received: by 10.194.237.9 with SMTP id uy9mr10079717wjc.69.1414227430136; Sat, 25 Oct 2014 01:57:10 -0700 (PDT) Received: from localhost ([95.144.14.167]) by mx.google.com with ESMTPSA id t16sm8148257wjr.44.2014.10.25.01.57.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Oct 2014 01:57:09 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, trevor_smigiel@playstation.sony.com, dje.gcc@gmail.com, uweigand@de.ibm.com, rdsandiford@googlemail.com Cc: trevor_smigiel@playstation.sony.com, dje.gcc@gmail.com, uweigand@de.ibm.com Subject: [spu] RFA: Use new rtl iterators in ea_symbol_ref_p Date: Sat, 25 Oct 2014 09:57:08 +0100 Message-ID: <87ppdg1q8r.fsf@googlemail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Make spu.c use FOR_EACH_SUBRTX instead of for_each_rtx, as 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 spu-elf. OK to install? Thanks, Richard gcc/ * config/spu/spu.c: Include rtl-iter.h (ea_symbol_ref): Replace with... (ea_symbol_ref_p): ...this new function. (spu_legitimate_address_p): Update call accordingly. (spu_legitimate_constant_p): Likewise. Use FOR_EACH_SUBRTX. Index: gcc/config/spu/spu.c =================================================================== --- gcc/config/spu/spu.c 2014-10-25 09:48:53.108538042 +0100 +++ gcc/config/spu/spu.c 2014-10-25 09:51:14.796788623 +0100 @@ -69,6 +69,7 @@ #include "dumpfile.h" #include "cfgloop.h" #include "builtins.h" +#include "rtl-iter.h" /* Builtin types, data and prototypes. */ @@ -3466,10 +3467,9 @@ exp2_immediate_p (rtx op, enum machine_m /* Return true if X is a SYMBOL_REF to an __ea qualified variable. */ -static int -ea_symbol_ref (rtx *px, void *data ATTRIBUTE_UNUSED) +static bool +ea_symbol_ref_p (const_rtx x) { - rtx x = *px; tree decl; if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS) @@ -3496,13 +3496,15 @@ ea_symbol_ref (rtx *px, void *data ATTRI bool spu_legitimate_constant_p (enum machine_mode mode, rtx x) { + subrtx_iterator::array_type array; if (GET_CODE (x) == HIGH) x = XEXP (x, 0); /* Reject any __ea qualified reference. These can't appear in instructions but must be forced to the constant pool. */ - if (for_each_rtx (&x, ea_symbol_ref, 0)) - return 0; + FOR_EACH_SUBRTX (iter, array, x, ALL) + if (ea_symbol_ref_p (*iter)) + return 0; /* V4SI with all identical symbols is valid. */ if (!flag_pic @@ -3548,7 +3550,7 @@ spu_legitimate_address_p (enum machine_m case CONST: /* Keep __ea references until reload so that spu_expand_mov can see them in MEMs. */ - if (ea_symbol_ref (&x, 0)) + if (ea_symbol_ref_p (x)) return !reload_in_progress && !reload_completed; return !TARGET_LARGE_MEM;