From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29607 invoked by alias); 12 Apr 2017 13:03:36 -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 29574 invoked by uid 89); 12 Apr 2017 13:03:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=our 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; Wed, 12 Apr 2017 13:03:32 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1cyHvn-0004eR-3w from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Wed, 12 Apr 2017 06:03:31 -0700 Received: from hertz.schwinge.homeip.net (137.202.0.87) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 12 Apr 2017 14:03:28 +0100 From: Thomas Schwinge To: Subject: Re: OpenACC 2.5 default (present) clause In-Reply-To: <87a87s5k6w.fsf@hertz.schwinge.homeip.net> References: <87a87s5k6w.fsf@hertz.schwinge.homeip.net> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Wed, 12 Apr 2017 13:03:00 -0000 Message-ID: <87d1ch4w2r.fsf@hertz.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: 2017-04/txt/msg00577.txt.bz2 Hi! On Fri, 07 Apr 2017 17:08:55 +0200, I wrote: > OpenACC 2.5 added a default (present) clause, which "causes all arrays or > variables of aggregate data type used in the compute construct that have > implicitly determined data attributes to be treated as if they appeared > in a present clause". Preceded by the following cleanup patch (see > for its > origin), OK for trunk in next stage 1? (Jakub asked me to ping this in next stage 1.) > For now committed to gomp-4_0-branch in r246763: > --- libgomp/testsuite/libgomp.oacc-c-c++-common/nested-2.c > +++ libgomp/testsuite/libgomp.oacc-c-c++-common/nested-2.c > +#pragma acc enter data create (a) > + > +#pragma acc parallel default (present) > + { > + for (int j =3D 0; j < N; ++j) > + a[j] =3D j - 1; > + } > + > +#pragma acc update host (a) > + > + for (i =3D 0; i < N; ++i) > + { > + if (a[i] !=3D i - 1) > + abort (); > + } > + > +#pragma acc kernels default (present) > + { > + for (int j =3D 0; j < N; ++j) > + a[j] =3D j - 2; > + } > + > +#pragma acc exit data copyout (a) > + > + for (i =3D 0; i < N; ++i) > + { > + if (a[i] !=3D i - 2) > + abort (); > + } In our PowerPC testing, this change triggered linking failures (for host comilation) and ICEs (for offloading compilation). "DCE vs. offloading" filed (here, we got: "char a[N]", causing GCC to figure out that "(char) -1 !=3D (int) -1", thus unconditionally "abort", thus the following OpenACC kernels getting DCEd, thus PR80411), and committed to gomp-4_0-branch in r246871: commit 6cf38f5ba09e4152336cf94d0eb9c80db9ffc024 Author: tschwinge Date: Wed Apr 12 12:54:10 2017 +0000 Fix libgomp.oacc-c-c++-common/nested-2.c: "char" might mean "unsigned c= har" =20=20=20=20 libgomp/ * testsuite/libgomp.oacc-c-c++-common/nested-2.c: Respect that "char" might mean "unsigned char". =20=20=20=20 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@2468= 71 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog.gomp | 5 +++++ libgomp/testsuite/libgomp.oacc-c-c++-common/nested-2.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp index 873668e..32cb7e8 100644 --- libgomp/ChangeLog.gomp +++ libgomp/ChangeLog.gomp @@ -1,3 +1,8 @@ +2017-04-12 Thomas Schwinge + + * testsuite/libgomp.oacc-c-c++-common/nested-2.c: Respect that + "char" might mean "unsigned char". + 2017-04-07 Thomas Schwinge =20 * testsuite/libgomp.oacc-c++/template-reduction.C: Update. diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/nested-2.c libgomp/t= estsuite/libgomp.oacc-c-c++-common/nested-2.c index e8ead3d..51b3b18 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/nested-2.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/nested-2.c @@ -143,28 +143,28 @@ main (int argc, char *argv[]) #pragma acc parallel default (present) { for (int j =3D 0; j < N; ++j) - a[j] =3D j - 1; + a[j] =3D j + 1; } =20 #pragma acc update host (a) =20 for (i =3D 0; i < N; ++i) { - if (a[i] !=3D i - 1) + if (a[i] !=3D i + 1) abort (); } =20 #pragma acc kernels default (present) { for (int j =3D 0; j < N; ++j) - a[j] =3D j - 2; + a[j] =3D j + 2; } =20 #pragma acc exit data copyout (a) =20 for (i =3D 0; i < N; ++i) { - if (a[i] !=3D i - 2) + if (a[i] !=3D i + 2) abort (); } =20 Gr=C3=BC=C3=9Fe Thomas