public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, PR70161] Fix fdump-ipa-all-graph
@ 2016-03-14 15:33 Tom de Vries
  2016-03-15 11:37 ` Richard Biener
  0 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2016-03-14 15:33 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Jan Hubicka

[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]

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?

Thanks,
- Tom

[-- Attachment #2: 0002-Fix-fdump-ipa-all-graph.patch --]
[-- Type: text/x-patch, Size: 2449 bytes --]

Fix fdump-ipa-all-graph

2016-03-14  Tom de Vries  <tom@codesourcery.com>

	PR ipa/70161
	* cgraph.c (cgraph_node::get_body): Save, reset and restore
	dump_file_name.
	* passes.c (execute_one_ipa_transform_pass): Add missing argument to
	execute_function_dump.
	(execute_one_pass): Don't dump function if it will be dumped after ipa
	transform.

---
 gcc/cgraph.c |  3 +++
 gcc/passes.c | 14 +++++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 7727313..f187913 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -3365,7 +3365,9 @@ cgraph_node::get_body (void)
     {
       opt_pass *saved_current_pass = current_pass;
       FILE *saved_dump_file = dump_file;
+      const char *saved_dump_file_name = dump_file_name;
       int saved_dump_flags = dump_flags;
+      dump_file_name = NULL;
 
       push_cfun (DECL_STRUCT_FUNCTION (decl));
       execute_all_ipa_transforms ();
@@ -3377,6 +3379,7 @@ cgraph_node::get_body (void)
 
       current_pass = saved_current_pass;
       dump_file = saved_dump_file;
+      dump_file_name = saved_dump_file_name;
       dump_flags = saved_dump_flags;
     }
   return updated;
diff --git a/gcc/passes.c b/gcc/passes.c
index bbe35b3..5aa2b32 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -2219,7 +2219,7 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
     check_profile_consistency (pass->static_pass_number, 1, true);
 
   if (dump_file)
-    do_per_function (execute_function_dump, NULL);
+    do_per_function (execute_function_dump, pass);
   pass_fini_dump_file (pass);
 
   current_pass = NULL;
@@ -2356,15 +2356,15 @@ execute_one_pass (opt_pass *pass)
     check_profile_consistency (pass->static_pass_number, 1, true);
 
   verify_interpass_invariants ();
-  if (dump_file)
-    do_per_function (execute_function_dump, pass);
-  if (pass->type == IPA_PASS)
+  if (pass->type == IPA_PASS
+      && ((ipa_opt_pass_d *)pass)->function_transform)
     {
       struct cgraph_node *node;
-      if (((ipa_opt_pass_d *)pass)->function_transform)
-	FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
-	  node->ipa_transforms_to_apply.safe_push ((ipa_opt_pass_d *)pass);
+      FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
+	node->ipa_transforms_to_apply.safe_push ((ipa_opt_pass_d *)pass);
     }
+  else if (dump_file)
+    do_per_function (execute_function_dump, pass);
 
   if (!current_function_decl)
     symtab->process_new_functions ();

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH, PR70161] Fix fdump-ipa-all-graph
  2016-03-14 15:33 [PATCH, PR70161] Fix fdump-ipa-all-graph Tom de Vries
@ 2016-03-15 11:37 ` Richard Biener
  2016-03-17 11:16   ` Tom de Vries
  2016-03-18  9:33   ` Tom de Vries
  0 siblings, 2 replies; 10+ messages in thread
From: Richard Biener @ 2016-03-15 11:37 UTC (permalink / raw)
  To: Tom de Vries; +Cc: GCC Patches, Jan Hubicka

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.

Thanks,
Richard.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH, PR70161] Fix fdump-ipa-all-graph
  2016-03-15 11:37 ` Richard Biener
@ 2016-03-17 11:16   ` Tom de Vries
  2016-03-17 11:19     ` Richard Biener
  2016-03-18  9:33   ` Tom de Vries
  1 sibling, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2016-03-17 11:16 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Jan Hubicka

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.

All of the patch also OK for 4.9/5 branch?

[ The first 2 bits fix ICES. The last part fixes a duplicate edges 
problem in the dot file, I'm not sure if that's needed in the release 
branches. ]

Thanks,
- Tom



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH, PR70161] Fix fdump-ipa-all-graph
  2016-03-17 11:16   ` Tom de Vries
@ 2016-03-17 11:19     ` Richard Biener
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Biener @ 2016-03-17 11:19 UTC (permalink / raw)
  To: Tom de Vries; +Cc: GCC Patches, Jan Hubicka

On Thu, 17 Mar 2016, 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.
> 
> All of the patch also OK for 4.9/5 branch?

Yes, after a few days on trunk w/o issues.

Richard.

> [ The first 2 bits fix ICES. The last part fixes a duplicate edges problem in
> the dot file, I'm not sure if that's needed in the release branches. ]
> 
> Thanks,
> - Tom
> 
> 
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH, PR70161] Fix fdump-ipa-all-graph
  2016-03-15 11:37 ` Richard Biener
  2016-03-17 11:16   ` Tom de Vries
@ 2016-03-18  9:33   ` Tom de Vries
  2016-03-18  9:45     ` Tom de Vries
  1 sibling, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2016-03-18  9:33 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Jan Hubicka

[-- Attachment #1: Type: text/plain, Size: 1278 bytes --]

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.

Thanks,
- Tom


[-- Attachment #2: 0003-Add-testcases-for-pr70161.patch --]
[-- Type: text/x-patch, Size: 866 bytes --]

Add testcases for pr70161

2016-03-18  Tom de Vries  <tom@codesourcery.com>

	* gcc.dg/pr70161-2.c: New test.
	* gcc.dg/pr70161.c: New test.

---
 gcc/testsuite/gcc.dg/pr70161-2.c | 7 +++++++
 gcc/testsuite/gcc.dg/pr70161.c   | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/pr70161-2.c b/gcc/testsuite/gcc.dg/pr70161-2.c
new file mode 100644
index 0000000..d2cb221
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70161-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-all-graph -fipa-pta" } */
+
+void
+foo (void)
+{
+}
diff --git a/gcc/testsuite/gcc.dg/pr70161.c b/gcc/testsuite/gcc.dg/pr70161.c
new file mode 100644
index 0000000..0b173c7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70161.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-all-graph" } */
+
+void
+foo (void)
+{
+}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH, PR70161] Fix fdump-ipa-all-graph
  2016-03-18  9:33   ` Tom de Vries
@ 2016-03-18  9:45     ` Tom de Vries
  2016-04-17  6:09       ` [PING, testsuite] Add dot-file scan to test-case Tom de Vries
  0 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2016-03-18  9:45 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Jan Hubicka

[-- Attachment #1: Type: text/plain, Size: 1802 bytes --]

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?

Thanks,
- Tom

[-- Attachment #2: 0004-Add-dot-file-scans-to-pr70161.c.patch --]
[-- Type: text/x-patch, Size: 1199 bytes --]

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]
     return [string range $arg $idx end]
 }
 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PING, testsuite] Add dot-file scan to test-case
  2016-03-18  9:45     ` Tom de Vries
@ 2016-04-17  6:09       ` Tom de Vries
  2016-04-18  7:30         ` Richard Biener
  0 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2016-04-17  6:09 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Jan Hubicka

[ 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]
>       return [string range $arg $idx end]
>   }
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PING, testsuite] Add dot-file scan to test-case
  2016-04-17  6:09       ` [PING, testsuite] Add dot-file scan to test-case Tom de Vries
@ 2016-04-18  7:30         ` Richard Biener
  2016-04-18  7:59           ` Tom de Vries
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Biener @ 2016-04-18  7:30 UTC (permalink / raw)
  To: Tom de Vries; +Cc: GCC Patches, Jan Hubicka

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)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PING, testsuite] Add dot-file scan to test-case
  2016-04-18  7:30         ` Richard Biener
@ 2016-04-18  7:59           ` Tom de Vries
  2016-04-18  8:40             ` Richard Biener
  0 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2016-04-18  7:59 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Jan Hubicka

On 18-04-16 09:30, Richard Biener wrote:
>>> 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'.

With this patch:
....
diff --git a/gcc/testsuite/lib/scandump.exp b/gcc/testsuite/lib/scandump.exp
index 89b3944..89e5754 100644
--- a/gcc/testsuite/lib/scandump.exp
+++ b/gcc/testsuite/lib/scandump.exp
@@ -22,6 +22,7 @@
  # Extract the constant part of the dump file suffix from the regexp.
  # Argument 0 is the regular expression.
  proc dump-suffix { arg } {
+    puts "dump-suffix arg: $arg"
      set idx [expr [string first "." $arg] + 1]
      return [string range $arg $idx end]
  }
...

I see:
...
dump-suffix arg: [0-9][0-9][0-9]i.inline.dot
dump-suffix arg: [0-9][0-9][0-9]i.cp.dot
...

So, by cutting off after the first dot, we find 'inline.dot' and 'cp.dot', 
instead of just 'dot'.

Thanks,
- Tom

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PING, testsuite] Add dot-file scan to test-case
  2016-04-18  7:59           ` Tom de Vries
@ 2016-04-18  8:40             ` Richard Biener
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Biener @ 2016-04-18  8:40 UTC (permalink / raw)
  To: Tom de Vries; +Cc: GCC Patches, Jan Hubicka

On Mon, 18 Apr 2016, Tom de Vries wrote:

> On 18-04-16 09:30, Richard Biener wrote:
> > > > 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'.
> 
> With this patch:
> ....
> diff --git a/gcc/testsuite/lib/scandump.exp b/gcc/testsuite/lib/scandump.exp
> index 89b3944..89e5754 100644
> --- a/gcc/testsuite/lib/scandump.exp
> +++ b/gcc/testsuite/lib/scandump.exp
> @@ -22,6 +22,7 @@
>  # Extract the constant part of the dump file suffix from the regexp.
>  # Argument 0 is the regular expression.
>  proc dump-suffix { arg } {
> +    puts "dump-suffix arg: $arg"
>      set idx [expr [string first "." $arg] + 1]
>      return [string range $arg $idx end]
>  }
> ...
> 
> I see:
> ...
> dump-suffix arg: [0-9][0-9][0-9]i.inline.dot
> dump-suffix arg: [0-9][0-9][0-9]i.cp.dot
> ...
> 
> So, by cutting off after the first dot, we find 'inline.dot' and 'cp.dot',
> instead of just 'dot'.

Ah, I see.  Patch is ok for trunk then.

Richard.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-04-18  8:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-14 15:33 [PATCH, PR70161] Fix fdump-ipa-all-graph Tom de Vries
2016-03-15 11:37 ` Richard Biener
2016-03-17 11:16   ` Tom de Vries
2016-03-17 11:19     ` Richard Biener
2016-03-18  9:33   ` Tom de Vries
2016-03-18  9:45     ` Tom de Vries
2016-04-17  6:09       ` [PING, testsuite] Add dot-file scan to test-case Tom de Vries
2016-04-18  7:30         ` Richard Biener
2016-04-18  7:59           ` Tom de Vries
2016-04-18  8:40             ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).