diff options
author | Julian Brown <julian@codesourcery.com> | 2025-04-23 03:09:01 +0000 |
---|---|---|
committer | Sandra Loosemore <sloosemore@baylibre.com> | 2025-05-15 20:25:48 +0000 |
commit | ed4a45ac95375fac7166cff38dc9a81bd3868abd (patch) | |
tree | b150f7004ed4f48f9155342202423d00f43f31a5 /gcc/c/c-parser.cc | |
parent | f170e172ab2f559aa765a28af796c1a4897adb00 (diff) | |
download | gcc-ed4a45ac95375fac7166cff38dc9a81bd3868abd.zip gcc-ed4a45ac95375fac7166cff38dc9a81bd3868abd.tar.gz gcc-ed4a45ac95375fac7166cff38dc9a81bd3868abd.tar.bz2 |
OpenACC: "declare create" fixes wrt. "allocatable" variables
This patch fixes a case revealed by the previous patch where a synthetic
"acc data" region created for a "declare create" variable could interact
strangely with lexical inheritance behaviour. In fact, it doesn't seem
right to create the "acc data" region for allocatable variables at all
-- doing so means that a data region is likely to be created for an
unallocated variable.
The fix is not to add such variables to the synthetic "acc data" region
at all, and defer to the code that performs "enter data"/"exit data"
for them when allocated/deallocated on the host instead. Then, "declare
create" variables are implicitly turned into "present" clauses on in-scope
offload regions.
gcc/fortran/
* trans-openmp.cc (gfc_omp_finish_clause): Handle "declare create" for
scalar allocatable variables.
(gfc_trans_omp_clauses): Don't include allocatable vars in synthetic
"acc data" region created for "declare create" variables. Mark such
variables with the "oacc declare create" attribute instead. Don't
create ALWAYS_POINTER mapping for target-to-host updates of declare
create variables.
(gfc_trans_oacc_declare): Handle empty clause list.
gcc/
* gimplify.cc (gimplify_adjust_omp_clauses_1): Handle "oacc declare
create" attribute.
gcc/testsuite/
* c-c++-common/goacc/readonly-1.c: Adjust patterns.
libgomp/
* testsuite/libgomp.oacc-fortran/declare-allocatable-1-directive.f90:
Remove xfails.
* testsuite/libgomp.oacc-fortran/declare-allocatable-1-runtime.f90:
Remove xfails.
* testsuite/libgomp.oacc-fortran/declare-allocatable-1.f90:
Remove xfails.
* testsuite/libgomp.oacc-fortran/declare-create-1.f90: New test.
* testsuite/libgomp.oacc-fortran/declare-create-2.f90: New test.
* testsuite/libgomp.oacc-fortran/declare-create-3.f90: New test.
Co-Authored-By: Paul-Antoine Arras <parras@baylibre.com>
Co-Authored-By: Sandra Loosemore <sandra@baylibre.com>
Diffstat (limited to 'gcc/c/c-parser.cc')
0 files changed, 0 insertions, 0 deletions