This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING, testsuite] Add dot-file scan to test-case
- From: Richard Biener <rguenther at suse dot de>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Mon, 18 Apr 2016 09:30:06 +0200 (CEST)
- Subject: Re: [PING, testsuite] Add dot-file scan to test-case
- Authentication-results: sourceware.org; auth=none
- References: <56E6D97F dot 3030606 at mentor dot com> <alpine dot LSU dot 2 dot 11 dot 1603151237080 dot 15580 at t29 dot fhfr dot qr> <56EBC8F6 dot 4010704 at mentor dot com> <56EBCBF5 dot 8060302 at mentor dot com> <5713281A dot 3070806 at mentor dot com>
On Sun, 17 Apr 2016, Tom de Vries wrote:
> [ 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 <tom@codesourcery.com>
> >
> > * 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]
Does that even work? For t.c.012t.foo the first "." is after 't'.
Richard.
> > return [string range $arg $idx end]
> > }
> >
> >
>
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)