]> git.ipfire.org Git - thirdparty/gcc.git/commit
OpenMP: Add 'omp requires' to Fortran (mostly parsing)
authorTobias Burnus <tobias@codesourcery.com>
Wed, 29 Jul 2020 08:37:44 +0000 (10:37 +0200)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:20:01 +0000 (13:20 -0300)
commitee3b1655acbb03eba22e0adfa4ae493a2b495b7d
treeee5aa98cff6a540591dc317c85976add3c774d22
parented0322a4ee3054ff3d5480019227140f46a24189
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]