From patchwork Sun Aug 3 13:40:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 376007 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 23D9B14009C for ; Sun, 3 Aug 2014 23:40:51 +1000 (EST) 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:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=WxBnJJwPAogXvqodzE9DOr4JnT+Zk QXhHx5iH0tGWAfHiIz1o5hvJbvNACV77X5MQ+TRdgT0GeWf6d8Y/fwCyEm16SfxQ tAIrJPVSYNsqr2a+JAGyGzFsP85dTH0evMECt9EIdzn+APKyZNUYxDQ8ZGS/XI72 3p5huj+Doniexs= 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:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=pVdpwdh0gFZaQBSrLHd6+uRWdkU=; b=vKD tr1RBRJn11RRJ1tdbyCkYNoT32x//2VunqhvBtuOJEUWuwspwOpQgjtjEV7zPSI2 32Xcqs+FdmKqozUTjC9f4FdnvffXe9Y4U4zU7TNwr8Y2azDtFQQwrwsNduPpZVJg 7OnBFNgpB0cXxpp9jGdYFwuky+iYtNqQUuqwqpyk= Received: (qmail 1275 invoked by alias); 3 Aug 2014 13:40:46 -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 1262 invoked by uid 89); 3 Aug 2014 13:40:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f181.google.com Received: from mail-we0-f181.google.com (HELO mail-we0-f181.google.com) (74.125.82.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 03 Aug 2014 13:40:37 +0000 Received: by mail-we0-f181.google.com with SMTP id k48so6516557wev.12 for ; Sun, 03 Aug 2014 06:40:34 -0700 (PDT) X-Received: by 10.180.205.212 with SMTP id li20mr22116699wic.2.1407073234309; Sun, 03 Aug 2014 06:40:34 -0700 (PDT) Received: from localhost ([95.145.138.172]) by mx.google.com with ESMTPSA id x11sm35934340wjr.15.2014.08.03.06.40.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Aug 2014 06:40:33 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: [PATCH 02/50] alias.c:refs_newer_value_p References: <87y4v5d77q.fsf@googlemail.com> Date: Sun, 03 Aug 2014 14:40:33 +0100 In-Reply-To: <87y4v5d77q.fsf@googlemail.com> (Richard Sandiford's message of "Sun, 03 Aug 2014 14:38:01 +0100") Message-ID: <87ppghd73i.fsf@googlemail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 gcc/ * alias.c: Include rtl-iter.h. (refs_newer_value_cb): Delete. (refs_newer_value_p): Use FOR_EACH_SUBRTX instead of for_each_rtx. Index: gcc/alias.c =================================================================== --- gcc/alias.c 2014-08-03 11:25:10.551960499 +0100 +++ gcc/alias.c 2014-08-03 11:25:20.611059950 +0100 @@ -48,6 +48,7 @@ Software Foundation; either version 3, o #include "is-a.h" #include "gimple.h" #include "gimple-ssa.h" +#include "rtl-iter.h" /* The aliasing API provided here solves related but different problems: @@ -1853,27 +1854,18 @@ base_alias_check (rtx x, rtx x_base, rtx return 1; } -/* Callback for for_each_rtx, that returns 1 upon encountering a VALUE - whose UID is greater than the int uid that D points to. */ - -static int -refs_newer_value_cb (rtx *x, void *d) -{ - if (GET_CODE (*x) == VALUE && CSELIB_VAL_PTR (*x)->uid > *(int *)d) - return 1; - - return 0; -} - /* Return TRUE if EXPR refers to a VALUE whose uid is greater than that of V. */ static bool -refs_newer_value_p (rtx expr, rtx v) +refs_newer_value_p (const_rtx expr, rtx v) { int minuid = CSELIB_VAL_PTR (v)->uid; - - return for_each_rtx (&expr, refs_newer_value_cb, &minuid); + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, expr, NONCONST) + if (GET_CODE (*iter) == VALUE && CSELIB_VAL_PTR (*iter)->uid > minuid) + return true; + return false; } /* Convert the address X into something we can use. This is done by returning