]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Store OpenMP's 'declare variant' in module file [PR115271]
authorTobias Burnus <tburnus@baylibre.com>
Sat, 15 Mar 2025 07:28:11 +0000 (08:28 +0100)
committerTobias Burnus <tburnus@baylibre.com>
Sat, 15 Mar 2025 07:30:35 +0000 (08:30 +0100)
commit6f3bca0db8645c2556e5a01669af4384bb230d87
tree9d4ecf0dbb94ddb4588ef641a0cd584f46a382f6
parentf70f4b60debce4a223725781d1973c05d8d1dfa9
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.
gcc/fortran/module.cc
gcc/fortran/openmp.cc
gcc/fortran/trans-decl.cc
gcc/fortran/trans-openmp.cc
gcc/fortran/trans-stmt.h
gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-1-use.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-2-use.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-2.f90 [new file with mode: 0644]