From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 8E3D13857415; Fri, 28 Oct 2022 08:09:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E3D13857415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666944595; bh=UImNylvsNS/ErdcUZGPSpcIi2p9QxMf93nlhiVW+bm8=; h=From:To:Subject:Date:From; b=cqBGxuY0NDyAlKLCB+q3ciM31DaHG9Tx++XO49Ggd0rbYCqyp/wnh5f1vUV5jhbys LF5P7B/M0A2m8uKa/SOu0rgpMrG8lTGylJsxyLnG0hyZAckYWFXyc7dk0bO6ZXQDEC D5bO23QY49qn77Wbp77P8g6vTXsK+EI7WhHBRQDk= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/omp/gcc-12] [og12] OpenACC: Don't gang-privatize artificial variables: restrict to blocks X-Act-Checkin: gcc X-Git-Author: Thomas Schwinge X-Git-Refname: refs/heads/devel/omp/gcc-12 X-Git-Oldrev: 1c5087dfff64c40505bcb81b5069781a44bb0b4d X-Git-Newrev: 9a50d282f03f7f1e1ad00de917143a2a8e0c0ee0 Message-Id: <20221028080955.8E3D13857415@sourceware.org> Date: Fri, 28 Oct 2022 08:09:48 +0000 (GMT) List-Id: https://gcc.gnu.org/g:9a50d282f03f7f1e1ad00de917143a2a8e0c0ee0 commit 9a50d282f03f7f1e1ad00de917143a2a8e0c0ee0 Author: Thomas Schwinge Date: Tue Oct 18 16:59:54 2022 +0200 [og12] OpenACC: Don't gang-privatize artificial variables: restrict to blocks Follow-up to og12 commit d4504346d2a1d6ffecb8b2d8e3e04ab8ea259785 "[og12] OpenACC: Don't gang-privatize artificial variables", to restore the previous behavior, until we understand what it means for a 'DECL_ARTIFICIAL' to appear in a 'private' clause. gcc/ * omp-low.cc (oacc_privatization_candidate_p) : Restrict to 'block's. libgomp/ * testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Adjust. Diff: --- gcc/omp-low.cc | 2 +- libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc index 002f91d930a..66aa11cd32d 100644 --- a/gcc/omp-low.cc +++ b/gcc/omp-low.cc @@ -11409,7 +11409,7 @@ oacc_privatization_candidate_p (const location_t loc, const tree c, At present, no compiler-generated artificial variables require such sharing semantics, so this is safe. */ - if (res && DECL_ARTIFICIAL (decl)) + if (res && block && DECL_ARTIFICIAL (decl)) { res = false; diff --git a/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 index 936285e9f69..498ef70b63a 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 @@ -94,7 +94,9 @@ contains !$acc parallel copy(array) !$acc loop gang private(array) ! { dg-line l_loop[incr c_loop] } ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } - ! { dg-note {variable 'array\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: artificial} "" { target *-*-* } l_loop$c_loop } + ! { dg-note {variable 'array\.[0-9]+' in 'private' clause is candidate for adjusting OpenACC privatization level} "" { target *-*-* } l_loop$c_loop } + ! { dg-note {variable 'array\.[0-9]+' ought to be adjusted for OpenACC privatization level: 'gang'} "" { target *-*-* } l_loop$c_loop } + ! { dg-note {variable 'array\.[0-9]+' adjusted for OpenACC privatization level: 'gang'} "" { target { ! { openacc_host_selected || { openacc_nvidia_accel_selected && __OPTIMIZE__ } } } } l_loop$c_loop } ! { dg-message {sorry, unimplemented: target cannot support alloca} PR65181 { target openacc_nvidia_accel_selected } l_loop$c_loop } do i = 1, 10 array(i) = 9*i