diff mbox

[PR70161] Fix fdump-ipa-all-graph

Message ID 56EBC8F6.4010704@mentor.com
State New
Headers show

Commit Message

Tom de Vries March 18, 2016, 9:23 a.m. UTC
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
diff mbox

Patch

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)
+{
+}