From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98031 invoked by alias); 23 Apr 2018 12:06:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 97554 invoked by uid 89); 23 Apr 2018 12:06:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=discovery, HCC:D*gmail.com, infinite X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Apr 2018 12:06:35 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1fAaEq-0002D8-M9 from Tom_deVries@mentor.com ; Mon, 23 Apr 2018 05:06:32 -0700 Received: from [172.30.72.29] (137.202.0.87) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Mon, 23 Apr 2018 13:06:12 +0100 Subject: [PATCH, lto, PR85422] Fixup loops before lto write-out From: Tom de Vries To: Richard Biener CC: Jakub Jelinek , Cesar Philippidis , "H.J. Lu" , "gcc-patches@gcc.gnu.org" References: <20180406141029.GF8577@tucnak> <20180412185840.GR8577@tucnak> Message-ID: Date: Mon, 23 Apr 2018 12:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------25D972215169ADFA97291610" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2018-04/txt/msg01042.txt.bz2 --------------25D972215169ADFA97291610 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1324 [ 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 --------------25D972215169ADFA97291610 Content-Type: text/x-patch; name="0001-lto-Fixup-loops-before-lto-write-out.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0001-lto-Fixup-loops-before-lto-write-out.patch" Content-length: 1572 [lto] Fixup loops before lto write-out 2018-04-23 Richard Biener Tom de Vries 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; +} --------------25D972215169ADFA97291610--