From patchwork Wed Apr 12 13:03:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 750013 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w33yX6FFyz9sDG for ; Wed, 12 Apr 2017 23:03:48 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="dIcCTSfz"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:in-reply-to:references:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=y6N m5sgYRrrSY7VvyjjRv+qornzKh6kxUF/AaNrHYNJ3Z7cE5Cbv9lm5u+XqPEWi2dK 3S7Yr7/2KHi30t+j9BYfLGUtia6Xqc4XPYfVgFubHKHo+pFmWtc4f2ZKo+yG5OVS df7KQbL9IcPFJoosjPmrtzvJMM10bMsWYwdR3zN0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:in-reply-to:references:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=3/BZpuXBj HB8V6LUACw557F5Oy0=; b=dIcCTSfzkWGzyrAmwOmVXlylo5jt/XyFs/N7yQhoG qUMoN4Ro8nfcK10xLt/o65f2/Rv/A1RaMwyRbo1Mnc17heqLFuz2/okwwNBBscgV 0rcqVunkJuFrMIVPJT4S/cSJ6/n1vFxoN/NmjFkAyW+copoy9JAUM9St81rv0xlO LM= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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 15:03:24 +0200 Message-ID: <87d1ch4w2r.fsf@hertz.schwinge.homeip.net> MIME-Version: 1.0 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) 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 = 0; j < N; ++j) > + a[j] = j - 1; > + } > + > +#pragma acc update host (a) > + > + for (i = 0; i < N; ++i) > + { > + if (a[i] != i - 1) > + abort (); > + } > + > +#pragma acc kernels default (present) > + { > + for (int j = 0; j < N; ++j) > + a[j] = j - 2; > + } > + > +#pragma acc exit data copyout (a) > + > + for (i = 0; i < N; ++i) > + { > + if (a[i] != 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 != (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 char" libgomp/ * testsuite/libgomp.oacc-c-c++-common/nested-2.c: Respect that "char" might mean "unsigned char". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@246871 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(-) Grüße Thomas 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 * testsuite/libgomp.oacc-c++/template-reduction.C: Update. diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/nested-2.c libgomp/testsuite/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 = 0; j < N; ++j) - a[j] = j - 1; + a[j] = j + 1; } #pragma acc update host (a) for (i = 0; i < N; ++i) { - if (a[i] != i - 1) + if (a[i] != i + 1) abort (); } #pragma acc kernels default (present) { for (int j = 0; j < N; ++j) - a[j] = j - 2; + a[j] = j + 2; } #pragma acc exit data copyout (a) for (i = 0; i < N; ++i) { - if (a[i] != i - 2) + if (a[i] != i + 2) abort (); }