]> git.ipfire.org Git - thirdparty/gcc.git/commit
OpenACC: Stand-alone attach/detach clause fixes for Fortran [PR109622]
authorJulian Brown <julian@codesourcery.com>
Wed, 26 Apr 2023 14:31:53 +0000 (14:31 +0000)
committerJulian Brown <julian@codesourcery.com>
Fri, 28 Apr 2023 11:33:12 +0000 (11:33 +0000)
commitcacf65d74463600815773255e8b82b4043432bd7
tree1ef13704b0500f7584e44ca8d03d3ad0b25e0783
parent6e6f86f22873aab7059e083fd0c9905bd58e5efa
OpenACC: Stand-alone attach/detach clause fixes for Fortran [PR109622]

This patch fixes several cases where multiple attach or detach mapping
nodes were being created for stand-alone attach or detach clauses
in Fortran.  After the introduction of stricter checking later during
compilation, these extra nodes could cause ICEs, as seen in the PR.

The patch also fixes cases that "happened to work" previously where
the user attaches/detaches a pointer to array using a descriptor, and
(I think!) the "_data" field has offset zero, hence the same address as
the descriptor as a whole.

2023-04-27  Julian Brown  <julian@codesourcery.com>

PR fortran/109622

gcc/fortran/
* trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.

gcc/testsuite/
* gfortran.dg/goacc/attach-descriptor.f90: Adjust expected output.

libgomp/
* testsuite/libgomp.fortran/pr109622.f90: New test.
* testsuite/libgomp.fortran/pr109622-2.f90: New test.
* testsuite/libgomp.fortran/pr109622-3.f90: New test.
gcc/fortran/trans-openmp.cc
gcc/testsuite/gfortran.dg/goacc/attach-descriptor.f90
libgomp/testsuite/libgomp.fortran/pr109622-2.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/pr109622-3.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/pr109622.f90 [new file with mode: 0644]