From patchwork Sat Oct 25 10:03:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 403020 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 81958140080 for ; Sat, 25 Oct 2014 21:03:57 +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=Al5lQ4Tak2AWcFysSe/6WQaBvW7oWOweLqe7ZpNin2Amq48hKC 2W1190euAOuLwSOzYi3Cvk5/NPUCaDBRPdpgKsAYRExKpohXAGG70P6pQesiBN3B gjBU/8JwR700TCN8z+p4FJXoEGZN600PdD4Ih5rE3Gd/lioRFFEn/k8Ps= 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=OG1eAkfb8CS8PuyvaDZ2sJoTT4E=; b=uBkHgs9Z+OHE49zj556S LAvyBlShAG3sAY0g+IFJNrtbDblosseEukd3ApyADKA6vsfYbheiQ7VYyqwiosiE Mf31V12vKxJnfk5nK7E+TRTWBC2t4eB/4KJAPT4QMN9PCFPLCFgzA6z7anMdX9Vc cWeSjH/IgqbZZ6p3YHUXJtQ= Received: (qmail 15196 invoked by alias); 25 Oct 2014 10:03:51 -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 15178 invoked by uid 89); 25 Oct 2014 10:03:50 -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-Spam-User: qpsmtpd, 3 recipients X-HELO: mail-wi0-f170.google.com Received: from mail-wi0-f170.google.com (HELO mail-wi0-f170.google.com) (209.85.212.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 25 Oct 2014 10:03:49 +0000 Received: by mail-wi0-f170.google.com with SMTP id n3so2797017wiv.3 for ; Sat, 25 Oct 2014 03:03:46 -0700 (PDT) X-Received: by 10.194.78.113 with SMTP id a17mr383720wjx.120.1414231426379; Sat, 25 Oct 2014 03:03:46 -0700 (PDT) Received: from localhost ([95.144.14.167]) by mx.google.com with ESMTPSA id td9sm4670338wic.15.2014.10.25.03.03.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Oct 2014 03:03:45 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, kkojima@gcc.gnu.org, olegendo@gcc.gnu.org, rdsandiford@googlemail.com Cc: kkojima@gcc.gnu.org, olegendo@gcc.gnu.org Subject: [SH] RFA: Use new rtl iterators in sh_contains_memref_p Date: Sat, 25 Oct 2014 11:03:45 +0100 Message-ID: <87tx2sv532.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 sh-elf. OK to install? Thanks, Richard gcc/ * config/sh/sh.c (sh_contains_memref_p_1): Delete. (sh_contains_memref_p): Use FOR_EACH_SUBRTX. Index: gcc/config/sh/sh.c =================================================================== --- gcc/config/sh/sh.c 2014-10-25 09:51:27.049897841 +0100 +++ gcc/config/sh/sh.c 2014-10-25 09:51:27.492901789 +0100 @@ -12972,18 +12972,15 @@ shmedia_cleanup_truncate (rtx x) so we must look at the rtl ourselves to see if any of the feeding registers is used in a memref. - Called by sh_contains_memref_p via for_each_rtx. */ -static int -sh_contains_memref_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) -{ - return (MEM_P (*loc)); -} - -/* Return true iff INSN contains a MEM. */ + Return true iff INSN contains a MEM. */ bool sh_contains_memref_p (rtx insn) { - return for_each_rtx (&PATTERN (insn), &sh_contains_memref_p_1, NULL); + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, PATTERN (insn), NONCONST) + if (MEM_P (*iter)) + return true; + return false; } /* Return true iff INSN loads a banked register. */