]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran/OpenMP: Fix DT struct-component with 'alloc' and array descr
authorTobias Burnus <tobias@codesourcery.com>
Wed, 2 Nov 2022 16:04:53 +0000 (17:04 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Wed, 2 Nov 2022 16:04:53 +0000 (17:04 +0100)
commit9cb4ef1e56c7187e5a4ab0decf947f3b3df7402f
treed080faaabcb5f3534f0776679d17ceeecda90123
parentca13348769e83462e7b1166159fee01c89b70589
Fortran/OpenMP: Fix DT struct-component with 'alloc' and array descr

When using 'map(alloc: var, dt%comp)' needs to have a 'to' mapping of
the array descriptor as otherwise the bounds are not available in the
target region. - Likewise for character strings.

This patch implements this; however, some additional issues are exposed
by the testcase; those are '#if 0'ed and will be handled later.

Submitted to mainline (but pending review):
https://gcc.gnu.org/pipermail/gcc-patches/2022-November/604887.html

gcc/fortran/ChangeLog:

* trans-openmp.cc (gfc_trans_omp_clauses): Ensure DT struct-comp with
array descriptor and 'alloc:' have the descriptor mapped with 'to:'.

libgomp/ChangeLog:

* testsuite/libgomp.fortran/target-enter-data-3.f90: New test.
gcc/fortran/ChangeLog.omp
gcc/fortran/trans-openmp.cc
libgomp/ChangeLog.omp
libgomp/testsuite/libgomp.fortran/target-enter-data-3.f90 [new file with mode: 0644]