From patchwork Tue Jun 18 22:28:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1118370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-503221-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Ar/mnv4J"; dkim-atps=neutral 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 45T2nM0JCQz9s4V for ; Wed, 19 Jun 2019 08:29:25 +1000 (AEST) 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:date:message-id:mime-version:content-type; q=dns; s= default; b=fXAwYQTw7jHms0Np532KrCFFCrfKl7D5dd2GjhrActR7ClylZ1+C9 DuSWijFz9eMG45BgU1uhjzshtVWHEK7VOH9+SnfwrGI356VXIEyZjddRsg6InZVS zNVPMadrtcuO1UYVAAKtekhlXXSNLaQplK+tS37xsSSI0ol5EUJJX4= 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:date:message-id:mime-version:content-type; s= default; bh=Cgukxr9JWiFXpbT1vDZ3QV8Q0Y8=; b=Ar/mnv4JlaHRHmuK6x0Z +Il/AoPgKaKgB7imOE/hzwpeq6zbdnLbIZo2uS8POvaxJY/uYGCdT7flZSas0eFQ 5cL2lP4Pv3DuOh05zKU6GAPE5PZiDaCK5oxxBgfMkqeECTNlvxF+rPFeMJp5ZCo8 AzWTDW2Fcp3eazOQP6hRolw= Received: (qmail 118869 invoked by alias); 18 Jun 2019 22:29:18 -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 118860 invoked by uid 89); 18 Jun 2019 22:29:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.2 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 autolearn=ham version=3.3.1 spammy=cleans, r272446 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; Tue, 18 Jun 2019 22:29:16 +0000 Received: from svr-orw-mbx-05.mgc.mentorg.com ([147.34.90.205]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1hdMbK-0002nR-T9 from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Tue, 18 Jun 2019 15:29:14 -0700 Received: from svr-orw-mbx-08.mgc.mentorg.com (147.34.90.208) by SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Tue, 18 Jun 2019 15:29:12 -0700 Received: from tftp-cs (147.34.91.1) by svr-orw-mbx-08.mgc.mentorg.com (147.34.90.208) with Microsoft SMTP Server id 15.0.1320.4 via Frontend Transport; Tue, 18 Jun 2019 15:29:12 -0700 Received: by tftp-cs (Postfix, from userid 49978) id EB711C2212; Tue, 18 Jun 2019 15:29:11 -0700 (PDT) From: Thomas Schwinge To: Subject: [committed] [PR90861] Document status quo for OpenACC 'declare' not cleaning up for VLAs User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/26.1 (x86_64-pc-linux-gnu) Date: Wed, 19 Jun 2019 00:28:58 +0200 Message-ID: <871rzqh6j9.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Hi! This doesn't resolve PR90861, but at least in trunk r272446 we now "Document status quo for OpenACC 'declare' not cleaning up for VLAs", see attached. Grüße Thomas From 3f8b36838cd2aa34d59d867ed22fad054f489884 Mon Sep 17 00:00:00 2001 From: tschwinge Date: Tue, 18 Jun 2019 22:14:14 +0000 Subject: [PATCH] [PR90861] Document status quo for OpenACC 'declare' not cleaning up for VLAs gcc/testsuite/ PR testsuite/90861 * c-c++-common/goacc/declare-pr90861.c: New file. libgomp/ PR testsuite/90861 * testsuite/libgomp.oacc-c-c++-common/declare-vla.c: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272446 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 3 ++ .../c-c++-common/goacc/declare-pr90861.c | 21 +++++++++ libgomp/ChangeLog | 3 ++ .../libgomp.oacc-c-c++-common/declare-vla.c | 47 +++++++++++++++++-- 4 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/c-c++-common/goacc/declare-pr90861.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 981055838ab6..699a94b3ed40 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2019-06-18 Thomas Schwinge + PR testsuite/90861 + * c-c++-common/goacc/declare-pr90861.c: New file. + PR testsuite/90868 * c-c++-common/goacc/declare-1.c: Update. * c-c++-common/goacc/declare-2.c: Likewise. diff --git a/gcc/testsuite/c-c++-common/goacc/declare-pr90861.c b/gcc/testsuite/c-c++-common/goacc/declare-pr90861.c new file mode 100644 index 000000000000..7c905624f7a1 --- /dev/null +++ b/gcc/testsuite/c-c++-common/goacc/declare-pr90861.c @@ -0,0 +1,21 @@ +/* Verify that OpenACC 'declare' cleans up for VLAs. */ + +/* { dg-additional-options "-fdump-tree-gimple" } */ + +void f1 (void) +{ +#define N_f1 1000 + int A_f1[N_f1]; +#pragma acc declare copy(A_f1) + /* { dg-final { scan-tree-dump-times {#pragma omp target oacc_declare map\(to:A_f1} 1 gimple } } + { dg-final { scan-tree-dump-times {#pragma omp target oacc_declare map\(from:A_f1} 1 gimple } } */ +} + +void f2 (void) +{ + int N_f2 = 1000; + int A_f2[N_f2]; +#pragma acc declare copy(A_f2) + /* { dg-final { scan-tree-dump-times {#pragma omp target oacc_declare map\(to:\(\*A_f2} 1 gimple } } + { dg-final { scan-tree-dump-times {#pragma omp target oacc_declare map\(from:\(\*A_f2} 1 gimple { xfail *-*-* } } } TODO PR90861 */ +} diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 06004aafde98..1a0d363e4ba2 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,5 +1,8 @@ 2019-06-18 Thomas Schwinge + PR testsuite/90861 + * testsuite/libgomp.oacc-c-c++-common/declare-vla.c: Update. + PR middle-end/90862 * testsuite/libgomp.oacc-c-c++-common/declare-1.c: Update. diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c index 3ea148ed40db..0f51badca42e 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c @@ -1,9 +1,10 @@ -/* Verify that acc declare accept VLA variables. */ +/* Verify OpenACC 'declare' with VLAs. */ #include -int -main () + +void +f (void) { int N = 1000; int i, A[N]; @@ -20,6 +21,46 @@ main () for (i = 0; i < N; i++) assert (A[i] == i); +} + + +/* The same as 'f' but everything contained in an OpenACC 'data' construct. */ + +void +f_data (void) +{ +#pragma acc data + { + int N = 1000; + int i, A[N]; +# pragma acc declare copy(A) + + for (i = 0; i < N; i++) + A[i] = -i; + +# pragma acc kernels + for (i = 0; i < N; i++) + A[i] = i; + +# pragma acc update host(A) + + for (i = 0; i < N; i++) + assert (A[i] == i); + } +} + + +int +main () +{ + f (); + + f_data (); return 0; } + + +/* { dg-xfail-run-if "TODO PR90861" { *-*-* } { "-DACC_MEM_SHARED=0" } } + This might XPASS if the compiler happens to put the two 'A' VLAs at the same + address. */ -- 2.20.1