]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[og12] OpenACC: Don't gang-privatize artificial variables: restrict to blocks
authorThomas Schwinge <thomas@codesourcery.com>
Tue, 18 Oct 2022 14:59:54 +0000 (16:59 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 28 Oct 2022 07:59:50 +0000 (09:59 +0200)
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) <DECL_ARTIFICIAL>:
Restrict to 'block's.
libgomp/
* testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Adjust.

gcc/omp-low.cc
libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90

index 002f91d930a9768218b34f0a7c00d7a59754e5ae..66aa11cd32d773b8599e256f09ea24b815f3f03d 100644 (file)
@@ -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;
 
index 936285e9f696f43c6d44f826e716c2842adaa437..498ef70b63a4ae977d11c4341f16d2443334c714 100644 (file)
@@ -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