]> git.ipfire.org Git - thirdparty/gcc.git/commit
OpenACC: Don't gang-privatize artificial variables [PR90115]
authorJulian Brown <julian@codesourcery.com>
Wed, 12 Oct 2022 20:44:57 +0000 (20:44 +0000)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 28 Oct 2022 08:28:51 +0000 (10:28 +0200)
commit9b116c51a451995f1bae8fdac0748fcf3f06aafe
tree73f91a19fb076abae8d04de987cd81e5fa32d27c
parent578e0131c220f4a568b1732397be7e85f13b9071
OpenACC: Don't gang-privatize artificial variables [PR90115]

This patch prevents compiler-generated artificial variables from being
treated as privatization candidates for OpenACC.

The rationale is that e.g. "gang-private" variables actually must be
shared by each worker and vector spawned within a particular gang, but
that sharing is not necessary for any compiler-generated variable (at
least at present, but no such need is anticipated either).  Variables on
the stack (and machine registers) are already private per-"thread"
(gang, worker and/or vector), and that's fine for artificial variables.

We're restricting this to blocks, as we still need to understand what it
means for a 'DECL_ARTIFICIAL' to appear in a 'private' clause.

Several tests need their scan output patterns adjusted to compensate.

2022-10-14  Julian Brown  <julian@codesourcery.com>

PR middle-end/90115
gcc/
* omp-low.cc (oacc_privatization_candidate_p): Artificial vars are not
privatization candidates.

libgomp/
* testsuite/libgomp.oacc-fortran/declare-1.f90: Adjust scan output.
* testsuite/libgomp.oacc-fortran/host_data-5.F90: Likewise.
* testsuite/libgomp.oacc-fortran/if-1.f90: Likewise.
* testsuite/libgomp.oacc-fortran/print-1.f90: Likewise.
* testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Likewise.

Co-authored-by: Thomas Schwinge <thomas@codesourcery.com>
(cherry picked from commit 11e811d8e2f63667f60f73731bb934273f5882b8)
gcc/omp-low.cc
libgomp/testsuite/libgomp.oacc-fortran/declare-1.f90
libgomp/testsuite/libgomp.oacc-fortran/host_data-5.F90
libgomp/testsuite/libgomp.oacc-fortran/if-1.f90
libgomp/testsuite/libgomp.oacc-fortran/print-1.f90
libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90