]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran/OpenMP: Fix declare_variant's 'adjust_args' mishandling with return by refere...
authorTobias Burnus <tburnus@baylibre.com>
Thu, 16 Jan 2025 21:39:03 +0000 (22:39 +0100)
committerTobias Burnus <tburnus@baylibre.com>
Thu, 16 Jan 2025 21:42:18 +0000 (22:42 +0100)
commitf5409d71e2ec8cdcc674b312dd4c115bb3626eba
treec174d9c77d4b2e5f534bf54b613af467116c20c9
parent62daa81308c6c187059fcad98377146e30725fa5
Fortran/OpenMP: Fix declare_variant's 'adjust_args' mishandling with return by reference [PR118321]

declare_variant's 'adjust_args' clause references the arguments in the
middle end by the argument position; this has to account for hidden
arguments that are inserted before due to return by reference,
as done in this commit.

PR fortran/118321

gcc/fortran/ChangeLog:

* trans-openmp.cc (gfc_trans_omp_declare_variant): Honor hidden
arguments for append_arg's need_device_ptr.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/adjust-args-12.f90: New test.
gcc/fortran/trans-openmp.cc
gcc/testsuite/gfortran.dg/gomp/adjust-args-12.f90 [new file with mode: 0644]