OpenMP: Add 'omp requires' to Fortran (mostly parsing)
authorTobias Burnus <tobias@codesourcery.com>
Wed, 29 Jul 2020 08:37:44 +0000 (10:37 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Wed, 29 Jul 2020 08:37:44 +0000 (10:37 +0200)
commit269322ece17202632bc354e9c510e4a5bd6ad84b
tree0f455436d3c7c8d20fa70bb68296c9e9445fb3b1
parent5c180464b7b0827b3cc07a78e96dfe55352db33f
OpenMP: Add 'omp requires' to Fortran (mostly parsing)

gcc/fortran/ChangeLog:

* gfortran.h (enum gfc_statement): Add ST_OMP_REQUIRES.
(enum gfc_omp_requires_kind): New.
(enum gfc_omp_atomic_op): Add GFC_OMP_ATOMIC_ACQ_REL.
(struct gfc_namespace): Add omp_requires and omp_target_seen.
(gfc_omp_requires_add_clause,
(gfc_check_omp_requires): New.
* match.h (gfc_match_omp_requires): New.
* module.c (enum ab_attribute, attr_bits): Add omp requires clauses.
(mio_symbol_attribute): Read/write them.
* openmp.c (gfc_check_omp_requires, (gfc_omp_requires_add_clause,
gfc_match_omp_requires): New.
(gfc_match_omp_oacc_atomic): Use requires's default mem-order.
* parse.c (decode_omp_directive): Match requires, set omp_target_seen.
(gfc_ascii_statement): Handle ST_OMP_REQUIRES.
* trans-openmp.c (gfc_trans_omp_atomic): Handle GFC_OMP_ATOMIC_ACQ_REL.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/requires-1.f90: New test.
* gfortran.dg/gomp/requires-2.f90: New test.
* gfortran.dg/gomp/requires-3.f90: New test.
* gfortran.dg/gomp/requires-4.f90: New test.
* gfortran.dg/gomp/requires-5.f90: New test.
* gfortran.dg/gomp/requires-6.f90: New test.
* gfortran.dg/gomp/requires-7.f90: New test.
* gfortran.dg/gomp/requires-8.f90: New test.
* gfortran.dg/gomp/requires-9.f90: New test.
15 files changed:
gcc/fortran/gfortran.h
gcc/fortran/match.h
gcc/fortran/module.c
gcc/fortran/openmp.c
gcc/fortran/parse.c
gcc/fortran/trans-openmp.c
gcc/testsuite/gfortran.dg/gomp/requires-1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/requires-2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/requires-3.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/requires-4.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/requires-5.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/requires-6.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/requires-7.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/requires-8.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/requires-9.f90 [new file with mode: 0644]