This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, lto, PR85422] Fixup loops before lto write-out


[ was: Re: [PATCH] Handle empty infinite loops in OpenACC for PR84955 ]

On 04/16/2018 08:13 PM, Tom de Vries wrote:
On 04/12/2018 08:58 PM, Jakub Jelinek wrote:
On Thu, Apr 12, 2018 at 11:39:43AM -0700, Cesar Philippidis wrote:
Strange. I didn't observe any regressions when I tested it. But, then
again, I was testing against revision

r259092 | jason | 2018-04-04 09:42:55 -0700 (Wed, 04 Apr 2018) | 4 lines

which is over a week old. I'll revert that patch for now, and revisit
this issue in stage1.

You should have kept the omp-expand.c chunk, that is correct and shouldn't
cause issues.

Committed as attached (with correct changelog entry, the previously committed patch had an incorrect one).

I've filed the lto ICE (described as "the second problem" in this thread) as PR85422 - "[openacc] ICE at cfgloop.c:468: segfault in flow_loops_find".


Hi,

your updated patch [ as posted here ( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85422#c9 ) ] fixes the flow_loops_find segfault, without causing the regressions mentioned here ( https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00628.html ).

Build x86_64 with nvptx accelerator, ran libgomp testsuite.

Bootstrapped and reg-tested x86_64 with -m64/-m32.

OK for stage4/stage1 trunk?

Thanks,
- Tom
[lto] Fixup loops before lto write-out

2018-04-23  Richard Biener <rguenther@suse.de>
	    Tom de Vries  <tom@codesourcery.com>

	PR lto/85422
	* lto-streamer-out.c (output_function): Fixup loops if required to match
	discovery done in the reader.

	* testsuite/libgomp.oacc-c-c++-common/pr85422.c: New test.

---
 gcc/lto-streamer-out.c                                |  4 ++++
 libgomp/testsuite/libgomp.oacc-c-c++-common/pr85422.c | 13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 1d2ab97..70476dc 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -2120,6 +2120,9 @@ output_function (struct cgraph_node *node)
      debug info.  */
   if (gimple_has_body_p (function))
     {
+      /* Fixup loops if required to match discovery done in the reader.  */
+      loop_optimizer_init (AVOID_CFG_MODIFICATIONS);
+
       streamer_write_uhwi (ob, 1);
       output_struct_function_base (ob, fn);
 
@@ -2177,6 +2180,7 @@ output_function (struct cgraph_node *node)
 
       output_cfg (ob, fn);
 
+      loop_optimizer_finalize ();
       pop_cfun ();
    }
   else
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85422.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85422.c
new file mode 100644
index 0000000..bcc551d
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85422.c
@@ -0,0 +1,13 @@
+/* { dg-do link } */
+
+int
+main (void)
+{
+  #pragma acc parallel
+  #pragma acc loop
+  for (int i = 1; i < 10; i++)
+    for (;;)
+      ;
+
+  return 0;
+}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]