diff options
author | Tobias Burnus <tburnus@baylibre.com> | 2025-03-15 08:28:11 +0100 |
---|---|---|
committer | Tobias Burnus <tburnus@baylibre.com> | 2025-03-15 08:30:35 +0100 |
commit | 6f3bca0db8645c2556e5a01669af4384bb230d87 (patch) | |
tree | 9d4ecf0dbb94ddb4588ef641a0cd584f46a382f6 /gcc/fortran/trans-decl.cc | |
parent | f70f4b60debce4a223725781d1973c05d8d1dfa9 (diff) | |
download | gcc-6f3bca0db8645c2556e5a01669af4384bb230d87.zip gcc-6f3bca0db8645c2556e5a01669af4384bb230d87.tar.gz gcc-6f3bca0db8645c2556e5a01669af4384bb230d87.tar.bz2 |
Fortran: Store OpenMP's 'declare variant' in module file [PR115271]
Write the 'omp declare variant' data into the .mod file: Base function,
variant function(s), supporting the clauses match, append_args, and
adjust_args.
PR fortran/115271
gcc/fortran/ChangeLog:
* module.cc (mio_omp_declare_simd_clauses): New, moved from ...
(mio_omp_declare_simd): ... here. Update call, write empty '( )'
if there is no declare simd but a declare variant.
(mio_omp_declare_variant): New.
(mio_symbol): Call it.
* openmp.cc (gfc_match_omp_context_selector): Add comment about
module.cc to TODO note.
* trans-stmt.h (gfc_trans_omp_declare_variant): Take additional
parent_ns argument.
* trans-decl.cc (create_function_arglist,
gfc_create_function_decl): Update call.
* trans-openmp.cc (gfc_trans_omp_declare_variant): Take new
argument, add some special case handling for attr.use_assoc.
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/declare-variant-mod-1-use.f90: New test.
* gfortran.dg/gomp/declare-variant-mod-1.f90: New test.
* gfortran.dg/gomp/declare-variant-mod-2-use.f90: New test.
* gfortran.dg/gomp/declare-variant-mod-2.f90: New test.
Diffstat (limited to 'gcc/fortran/trans-decl.cc')
-rw-r--r-- | gcc/fortran/trans-decl.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc index 893eac0..8dd1c93 100644 --- a/gcc/fortran/trans-decl.cc +++ b/gcc/fortran/trans-decl.cc @@ -2481,7 +2481,7 @@ module_sym: // We need DECL_ARGUMENTS to put attributes on, in case some arguments // need adjustment create_function_arglist (sym->formal_ns->proc_name); - gfc_trans_omp_declare_variant (sym->formal_ns); + gfc_trans_omp_declare_variant (sym->formal_ns, sym->ns); } } @@ -3269,7 +3269,7 @@ gfc_create_function_decl (gfc_namespace * ns, bool global) be declared in a parent namespace, so this needs to be called even if there are no local directives. */ if (flag_openmp) - gfc_trans_omp_declare_variant (ns); + gfc_trans_omp_declare_variant (ns, NULL); } /* Return the decl used to hold the function return value. If |