From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16678 invoked by alias); 21 Dec 2018 13:23:15 -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 16062 invoked by uid 89); 21 Dec 2018 13:23:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=nathan@acm.org, nathanacmorg, Sidwell, Nathan 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; Fri, 21 Dec 2018 13:23:11 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gaKlg-0000CN-I5 from Julian_Brown@mentor.com ; Fri, 21 Dec 2018 05:23:08 -0800 Received: from squid.athome (137.202.0.90) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 21 Dec 2018 13:23:05 +0000 Date: Fri, 21 Dec 2018 13:29:00 -0000 From: Julian Brown To: Martin Jambor CC: Cesar Philippidis , "gcc-patches@gcc.gnu.org" , Thomas Schwinge Subject: Re: [patch,openacc] Fix PR71959: lto dump of callee counts Message-ID: <20181221132303.1ab86f96@squid.athome> In-Reply-To: <20181221025636.3f9b377c@squid.athome> References: <319b3ebd-c601-449b-718c-963b68414224@codesourcery.com> <20181221025636.3f9b377c@squid.athome> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/5kfaQeaGnjIxZ9lut3riLua" X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg01563.txt.bz2 --MP_/5kfaQeaGnjIxZ9lut3riLua Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 1437 On Fri, 21 Dec 2018 02:56:36 +0000 Julian Brown wrote: > On Tue, 25 Sep 2018 14:59:18 +0200 > Martin Jambor wrote: > > > Hi, > > > > I have noticed a few things... > > > > On Thu, Sep 20 2018, Cesar Philippidis wrote: > > > This is another old gomp4 patch that demotes an ICE in PR71959 to > > > a linker warning. One problem here is that it is not clear if > > > OpenACC allows individual member functions in C++ classes to be > > > marked as acc routines. There's another issue accessing member > > > data inside offloaded regions. We'll add some support for member > > > data OpenACC 2.6, but some of the OpenACC C++ semantics are still > > > unclear. > > > > > > Is this OK for trunk? I bootstrapped and regtested it for x86_64 > > > Linux with nvptx offloading. > > [...] > > The testcase associated with this bug appears to be fixed by the > following patch: > > https://gcc.gnu.org/ml/gcc-patches/2018-12/msg01167.html > > So, it's unclear if there's anything left to do here, and this patch > can probably be withdrawn. ...or actually, maybe we should keep the new testcase in case of future regressions. This patch contains just that. OK to apply? Thanks, Julian ChangeLog 2018-xx-yy Nathan Sidwell PR lto/71959 libgomp/ * testsuite/libgomp.oacc-c++/pr71959-a.C: New. * testsuite/libgomp.oacc-c++/pr71959.C: New. --MP_/5kfaQeaGnjIxZ9lut3riLua Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr71959-test-only.diff" Content-length: 1809 commit c69dce8ba0ecd7ff620f4f1b8dacc94c61984107 Author: Julian Brown Date: Wed Dec 19 05:01:58 2018 -0800 Add testcase from PR71959 libgomp/ * testsuite/libgomp.oacc-c++/pr71959-a.C: New. * testsuite/libgomp.oacc-c++/pr71959.C: New. diff --git a/libgomp/testsuite/libgomp.oacc-c++/pr71959-a.C b/libgomp/testsuite/libgomp.oacc-c++/pr71959-a.C new file mode 100644 index 0000000..ec4b14a --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c++/pr71959-a.C @@ -0,0 +1,31 @@ +// { dg-do compile } + +struct Iter +{ + int *cursor; + + void ctor (int *cursor_) asm("_ZN4IterC1EPi"); + int *point () const asm("_ZNK4Iter5pointEv"); +}; + +#pragma acc routine +void Iter::ctor (int *cursor_) +{ + cursor = cursor_; +} + +#pragma acc routine +int *Iter::point () const +{ + return cursor; +} + +void apply (int (*fn)(), Iter out) asm ("_ZN5Apply5applyEPFivE4Iter"); + +#pragma acc routine +void apply (int (*fn)(), struct Iter out) +{ *out.point() = fn (); } + +extern "C" void __gxx_personality_v0 () +{ +} diff --git a/libgomp/testsuite/libgomp.oacc-c++/pr71959.C b/libgomp/testsuite/libgomp.oacc-c++/pr71959.C new file mode 100644 index 0000000..8508c17 --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c++/pr71959.C @@ -0,0 +1,31 @@ +// { dg-additional-sources "pr71959-a.C" } + +// pr lto/71959 ICEd LTO due to mismatch between writing & reading behaviour + +struct Iter +{ + int *cursor; + + Iter(int *cursor_) : cursor(cursor_) {} + + int *point() const { return cursor; } +}; + +#pragma acc routine seq +int one () { return 1; } + +struct Apply +{ + static void apply (int (*fn)(), Iter out) + { *out.point() = fn (); } +}; + +int main () +{ + int x; + +#pragma acc parallel copyout(x) + Apply::apply (one, Iter (&x)); + + return x != 1; +} --MP_/5kfaQeaGnjIxZ9lut3riLua--