From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12747 invoked by alias); 17 Apr 2016 06:09:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 11233 invoked by uid 89); 17 Apr 2016 06:08:08 -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,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=alongside, scandumpexp, scandump.exp, UD:scandump.exp X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 17 Apr 2016 06:07:32 +0000 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 1arfrj-0006yp-VV from Tom_deVries@mentor.com ; Sat, 16 Apr 2016 23:07:28 -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; Sun, 17 Apr 2016 07:07:26 +0100 Subject: [PING, testsuite] Add dot-file scan to test-case To: Richard Biener References: <56E6D97F.3030606@mentor.com> <56EBC8F6.4010704@mentor.com> <56EBCBF5.8060302@mentor.com> CC: GCC Patches , Jan Hubicka From: Tom de Vries Message-ID: <5713281A.3070806@mentor.com> Date: Sun, 17 Apr 2016 06:09:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56EBCBF5.8060302@mentor.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-04/txt/msg00783.txt.bz2 [ was: PATCH, PR70161] Fix fdump-ipa-all-graph ] On 18/03/16 10:35, Tom de Vries wrote: > On 18/03/16 10:23, Tom de Vries wrote: >> On 15/03/16 12:37, Richard Biener wrote: >>> On Mon, 14 Mar 2016, Tom de Vries wrote: >>> >>>> Hi, >>>> >>>> this patch fixes PR70161, a 4.9/5/6 regression. >>>> >>>> Currently when using -fdump-ipa-all-graph, the compiler ICEs in >>>> execute_function_dump when testing for pass->graph_dump_initialized, >>>> because >>>> pass == NULL. >>>> >>>> The patch fixes: >>>> - the ICE by setting the pass argument in the call to >>>> execute_function_dump in execute_one_ipa_transform_pass >>>> - a subsequent ICE (triggered with -fipa-pta) by saving, resetting and >>>> restoring dump_file_name in cgraph_node::get_body, alongside the >>>> saving and restoring of the dump_file variable. >>>> - the duplicate edges in the subsequently generated dot file by >>>> ensuring that execute_function_dump is called only once per function >>>> per pass. [ Note that this bit also has an effect for the normal >>>> dump >>>> files for the ipa passes with transform function. For those >>>> functions, >>>> atm execute_function_dump is called both after execute and after >>>> transform. With the patch, it's only called after transform. ] >>>> >>>> Bootstrapped and reg-tested on x86_64. >>>> >>>> OK for stage4? >>> >>> Ok. >>> >> >> I've added these two test-cases that test the first two fixes. >> >> Committed to trunk as obvious. >> > > This patch adds testing for the last fix. > > In order to make scanning lines in a .dot file work, I needed a fix in > dump-suffix to show cp.dot and inline.dot in the test summary: > ... > PASS: gcc.dg/pr70161.c scan-ipa-dump-times cp.dot "subgraph" 1 > PASS: gcc.dg/pr70161.c scan-ipa-dump-times inline.dot "subgraph" 1 > ... > Otherwise it would just show 'dot'. > > Bootstrapped and reg-tested on x86_64. > > OK for stage4 trunk, 4.9/5 release branches? > Ping. Thanks, - Tom > 0004-Add-dot-file-scans-to-pr70161.c.patch > > > Add dot-file scans to pr70161.c > > 2016-03-18 Tom de Vries > > * gcc.dg/pr70161.c: Add dot-file scans. > * lib/scandump.exp (dump-suffix): Return suffix after first dot char, > instead of after last dot char. > > --- > gcc/testsuite/gcc.dg/pr70161.c | 3 +++ > gcc/testsuite/lib/scandump.exp | 2 +- > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/gcc/testsuite/gcc.dg/pr70161.c b/gcc/testsuite/gcc.dg/pr70161.c > index 0b173c7..9b77d90 100644 > --- a/gcc/testsuite/gcc.dg/pr70161.c > +++ b/gcc/testsuite/gcc.dg/pr70161.c > @@ -5,3 +5,6 @@ void > foo (void) > { > } > + > +/* { dg-final { scan-ipa-dump-times "subgraph" 1 "inline.dot" } } */ > +/* { dg-final { scan-ipa-dump-times "subgraph" 1 "cp.dot" } } */ > diff --git a/gcc/testsuite/lib/scandump.exp b/gcc/testsuite/lib/scandump.exp > index 74d27cc..89b3944 100644 > --- a/gcc/testsuite/lib/scandump.exp > +++ b/gcc/testsuite/lib/scandump.exp > @@ -22,7 +22,7 @@ > # Extract the constant part of the dump file suffix from the regexp. > # Argument 0 is the regular expression. > proc dump-suffix { arg } { > - set idx [expr [string last "." $arg] + 1] > + set idx [expr [string first "." $arg] + 1] > return [string range $arg $idx end] > } > >