diff options
author | Sandra Loosemore <sloosemore@baylibre.com> | 2025-03-25 15:55:45 +0000 |
---|---|---|
committer | Sandra Loosemore <sloosemore@baylibre.com> | 2025-03-25 16:22:59 +0000 |
commit | f016ee89955ab4da5fe7ef89368e9437bb5ffb13 (patch) | |
tree | 6e2450aea2a849f87f782bf1167dfe5d88a5cd15 /gcc/fortran | |
parent | 91051d60d95156e830423fd258dedfb574b42195 (diff) | |
download | gcc-f016ee89955ab4da5fe7ef89368e9437bb5ffb13.zip gcc-f016ee89955ab4da5fe7ef89368e9437bb5ffb13.tar.gz gcc-f016ee89955ab4da5fe7ef89368e9437bb5ffb13.tar.bz2 |
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>
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/trans-openmp.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc index bf8c341..03d9432 100644 --- a/gcc/fortran/trans-openmp.cc +++ b/gcc/fortran/trans-openmp.cc @@ -8980,8 +8980,8 @@ gfc_trans_omp_declare_variant (gfc_namespace *ns, gfc_namespace *parent_ns) tree pref = NULL_TREE; if (n->u.init.len) { - tree pref = build_string (n->u.init.len, - n->u2.init_interop); + pref = build_string (n->u.init.len, + n->u2.init_interop); TREE_TYPE (pref) = build_array_type_nelts ( unsigned_char_type_node, n->u.init.len); |