]> git.ipfire.org Git - thirdparty/gcc.git/commit
OpenMP: Create additional interop objects with append_args.
authorSandra Loosemore <sloosemore@baylibre.com>
Tue, 25 Mar 2025 15:55:45 +0000 (15:55 +0000)
committerSandra Loosemore <sloosemore@baylibre.com>
Tue, 25 Mar 2025 16:22:59 +0000 (16:22 +0000)
commitf016ee89955ab4da5fe7ef89368e9437bb5ffb13
tree6e2450aea2a849f87f782bf1167dfe5d88a5cd15
parent91051d60d95156e830423fd258dedfb574b42195
OpenMP: Create additional interop objects with append_args.

This patch adds support for the case where #pragma omp declare variant
with append_args is used inside a #pragma omp dispatch interop that
specifies fewer interop args than required by the variant; new interop
objects are implicitly created and then destroyed around the call to the
variant, using the GOMP_interop builtin.

gcc/fortran/ChangeLog
* trans-openmp.cc (gfc_trans_omp_declare_variant): Remove accidental
redeclaration of pref.

gcc/ChangeLog
* gimplify.cc (modify_call_for_omp_dispatch): Adjust arguments.
Remove the "sorry" for the case where new interop objects must be
constructed, and add code to make it work instead.
(expand_variant_call_expr): Adjust arguments and call to
modify_call_for_omp_dispatch.
(gimplify_variant_call_expr): Simplify logic for calling
expand_variant_call_expr.

gcc/testsuite/ChangeLog
* c-c++-common/gomp/append-args-1.c: Adjust expected behavior.
* c-c++-common/gomp/append-args-interop.c: New.
* c-c++-common/gomp/dispatch-11.c: Adjust expected behavior.
* g++.dg/gomp/append-args-1.C: Likewise.
* gfortran.dg/gomp/append-args-interop.f90: New.
* gfortran.dg/gomp/declare-variant-mod-2.f90: Adjust expected behavior.

libgomp/ChangeLog
* libgomp.texi (OpenMP 5.1): Mark append_args as fully supported.

Co-Authored-By: Tobias Burnus <tburnus@baylibre.com>
gcc/fortran/trans-openmp.cc
gcc/gimplify.cc
gcc/testsuite/c-c++-common/gomp/append-args-1.c
gcc/testsuite/c-c++-common/gomp/append-args-interop.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/dispatch-11.c
gcc/testsuite/g++.dg/gomp/append-args-1.C
gcc/testsuite/gfortran.dg/gomp/append-args-interop.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-2.f90
libgomp/libgomp.texi