public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom de Vries <Tom_deVries@mentor.com>
To: Richard Biener <rguenther@suse.de>
Cc: Jakub Jelinek <jakub@redhat.com>,
	Cesar Philippidis	<cesar@codesourcery.com>,
	"H.J. Lu" <hjl.tools@gmail.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [PATCH, lto, PR85422] Fixup loops before lto write-out
Date: Mon, 23 Apr 2018 12:07:00 -0000	[thread overview]
Message-ID: <ae3f7acc-033e-186c-7c15-d89b84602b6f@mentor.com> (raw)
In-Reply-To: <b574d8e8-586c-43fb-1e6a-5ece2af20237@mentor.com>

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

[ 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

[-- Attachment #2: 0001-lto-Fixup-loops-before-lto-write-out.patch --]
[-- Type: text/x-patch, Size: 1572 bytes --]

[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;
+}

  reply	other threads:[~2018-04-23 12:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-06 13:49 [PATCH] Handle empty infinite loops in OpenACC for PR84955 Cesar Philippidis
2018-04-06 15:35 ` Jakub Jelinek
2018-04-09 11:32   ` Richard Biener
2018-04-11 19:31     ` Cesar Philippidis
2018-04-12  8:02       ` Richard Biener
2018-04-12 18:27       ` H.J. Lu
2018-04-12 18:39         ` Cesar Philippidis
2018-04-12 20:35           ` Jakub Jelinek
2018-04-16 18:13             ` Tom de Vries
2018-04-23 12:07               ` Tom de Vries [this message]
2018-04-23 12:11                 ` [PATCH, lto, PR85422] Fixup loops before lto write-out Richard Biener
2018-05-01 13:31               ` [PATCH] Handle empty infinite loops in OpenACC for PR84955 Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae3f7acc-033e-186c-7c15-d89b84602b6f@mentor.com \
    --to=tom_devries@mentor.com \
    --cc=cesar@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=jakub@redhat.com \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).