From patchwork Wed Oct 28 15:12:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 537405 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 2C1D2141303 for ; Thu, 29 Oct 2015 02:12:53 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=XT1pzkgp; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=xlKNUIyQTPPMpkdgm gMU0FWzBa/DqUbIIaPiXBFACFmN7phN5gN8dnHNg3ro/qPbZCXM6uQjnUhrQb7MV uFSetv/FKOXV6h7AMLa9rMaqcd4t/SV8inn3z7A1JiFGLZVuU0firZs2hmoxs+7B Ih+oOrLH01xC8oi0cxCZpi5eWM= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=dzDUTVm1nL+bNUb8dRROi/w 3xA8=; b=XT1pzkgpnsg20OoBOA/k3iwkSG3Pkw53U2f6laGc23sOhc8tHp5cgAA IF+SfRYy0ZyBJjEXbXErRq/zRlhf2620fHmx8dfu7mImSSXxM1sj37M65pf6tCyX W4AJv6BcJs7BEpSlWSO/xqbkFAzHuBlL5T7IBEAiWT67mJlllgBg= Received: (qmail 79502 invoked by alias); 28 Oct 2015 15:12: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 79484 invoked by uid 89); 28 Oct 2015 15:12:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 28 Oct 2015 15:12:44 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45664) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ZrSP3-0005bo-RB for gcc-patches@gnu.org; Wed, 28 Oct 2015 11:12:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrSP0-0006X6-4N for gcc-patches@gnu.org; Wed, 28 Oct 2015 11:12:41 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:58670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrSOz-0006Uj-Us for gcc-patches@gnu.org; Wed, 28 Oct 2015 11:12:38 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ZrSOw-0005Lk-Gi from Tom_deVries@mentor.com ; Wed, 28 Oct 2015 08:12:34 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Wed, 28 Oct 2015 15:12:33 +0000 Subject: Re: [PATCH] Improving alias dumps To: Richard Biener References: <562E1BF2.7060304@mentor.com> <5630B9D3.8090303@mentor.com> CC: "gcc-patches@gnu.org" From: Tom de Vries Message-ID: <5630E5DE.2020306@mentor.com> Date: Wed, 28 Oct 2015 16:12:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 On 28/10/15 14:01, Richard Biener wrote: > On Wed, Oct 28, 2015 at 1:04 PM, Tom de Vries wrote: >> On 26/10/15 14:29, Richard Biener wrote: >>> >>> On Mon, Oct 26, 2015 at 1:26 PM, Tom de Vries >>> wrote: >>>> >>>> Hi, >>>> >>>> After spending some time looking at ealias/pta dumps, I realized that >>>> they're hard to understand because we use varinfo names to identify >>>> varinfos, while those names are not necessarily unique. >>>> >>>> F.i., for a function f: >>>> ... >>>> void >>>> f (int *__restrict__ a, int *__restrict__ b) >>>> { >>>> *a = 1; >>>> *b = 2; >>>> } >>>> ... >>>> >>>> we have at ealias the constraints: >>>> ... >>>> a = &PARM_NOALIAS >>>> PARM_NOALIAS = NONLOCAL >>>> b = &PARM_NOALIAS >>>> PARM_NOALIAS = NONLOCAL >>>> derefaddrtmp = &NONLOCAL >>>> *a = derefaddrtmp >>>> derefaddrtmp = &NONLOCAL >>>> *b = derefaddrtmp >>>> ... >>>> F.i. PARM_NOALIAS occurs several times, and it's not clear if there are >>>> one >>>> or two varinfos with that name. >>>> >>>> Using attached patch, it's clearer what varinfos the constraints relate >>>> to: >>>> ... >>>> a(8) = &PARM_NOALIAS(9) >>>> PARM_NOALIAS(9) = NONLOCAL(5) >>>> b(10) = &PARM_NOALIAS(11) >>>> PARM_NOALIAS(11) = NONLOCAL(5) >>>> derefaddrtmp(12) = &NONLOCAL(5) >>>> *a(8) = derefaddrtmp(12) >>>> derefaddrtmp(13) = &NONLOCAL(5) >>>> *b(10) = derefaddrtmp(13) >>>> ... >>>> >>>> It this a good idea, f.i. guarded by (dump_flags & TDF_DETAILS) not to >>>> disturb scans of current tests? >>>> >>>> Or, do we f.i. want to fix the names themselves to be unique? >>> >>> >>> I think so, on most cases the (n) adds clutter without extra info. >>> >> >> Attached patch implements that approach. We get: >> >> a = &PARM_NOALIAS(9) >> PARM_NOALIAS(9) = NONLOCAL >> b = &PARM_NOALIAS(11) >> PARM_NOALIAS(11) = NONLOCAL >> derefaddrtmp(12) = &NONLOCAL >> *a = derefaddrtmp(12) >> derefaddrtmp(13) = &NONLOCAL >> *b = derefaddrtmp(13) >> >> OK for trunk if bootstrap and reg-test succeeds? > > Ok. > Committed with this test-case patch added on. Thanks, - Tom 2015-10-28 Tom de Vries * gcc.dg/tree-ssa/pta-callused.c: Update to scan for CALLUSED(id). --- gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c | 2 +- gcc/tree-ssa-structalias.c | 112 +++++++++++++++------------ 2 files changed, 63 insertions(+), 51 deletions(-) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c b/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c index 59408fa..b9a57d8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c @@ -22,5 +22,5 @@ int bar (int b) return *foo (&q); } -/* { dg-final { scan-tree-dump "CALLUSED = { ESCAPED NONLOCAL f.* i q }" "alias" } } */ +/* { dg-final { scan-tree-dump "CALLUSED\\(\[0-9\]+\\) = { ESCAPED NONLOCAL f.* i q }" "alias" } } */