]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Fixes to OpenMP 'interop' directive parsing support
authorTobias Burnus <tburnus@baylibre.com>
Fri, 13 Sep 2024 14:48:57 +0000 (16:48 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Fri, 13 Sep 2024 14:48:57 +0000 (16:48 +0200)
commit99988464fc86354f0359c0fd91eee444fb5bd8a2
tree7077436e7a92d198838ca9006a40032a6b8229c3
parent508ef585243d4674d06b0737bfe8769fc18f824f
Fortran: Fixes to OpenMP 'interop' directive parsing support

Handle lists as argument to 'fr' and 'attr'; fix parsing corner cases.
Additionally, 'fr' values are now internally stored as integer, permitting
the diagnoses (warning) for values not defined in the OpenMP additional
definitions document.

PR fortran/116661

gcc/fortran/ChangeLog:

* gfortran.h (gfc_omp_namelist): Rename 'init' members for clarity.
* match.cc (gfc_free_omp_namelist): Handle renaming.
* dump-parse-tree.cc (show_omp_namelist): Update for new format
and features.
* openmp.cc (gfc_match_omp_prefer_type): Parse list to 'fr' and 'attr';
store 'fr' values as integer.
(gfc_match_omp_init): Rename variable names.

gcc/ChangeLog:

* omp-api.h (omp_get_fr_id_from_name, omp_get_name_from_fr_id): New
prototypes.
* omp-general.cc (omp_get_fr_id_from_name, omp_get_name_from_fr_id):
New.

include/ChangeLog:

* gomp-constants.h (GOMP_INTEROP_IFR_LAST,
GOMP_INTEROP_IFR_SEPARATOR, GOMP_INTEROP_IFR_NONE): New.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/interop-1.f90: Extend, update dg-*.
* gfortran.dg/gomp/interop-2.f90: Update dg-error.
* gfortran.dg/gomp/interop-3.f90: Add dg-warning.
gcc/fortran/dump-parse-tree.cc
gcc/fortran/gfortran.h
gcc/fortran/match.cc
gcc/fortran/openmp.cc
gcc/omp-api.h
gcc/omp-general.cc
gcc/testsuite/gfortran.dg/gomp/interop-1.f90
gcc/testsuite/gfortran.dg/gomp/interop-2.f90
gcc/testsuite/gfortran.dg/gomp/interop-3.f90
include/gomp-constants.h