Fortran/OpenMP: Support most of 5.1 atomic extensions
authorTobias Burnus <tobias@codesourcery.com>
Sat, 4 Dec 2021 18:39:43 +0000 (19:39 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Sat, 4 Dec 2021 18:43:46 +0000 (19:43 +0100)
commit689407ef916503b2f5a3c8c07fe7d5ab1913f956
tree704f036b6cc7c2435778aa2396470df399b60aa8
parent87710ec7b213245ecb194b778e97ae3a6790394f
Fortran/OpenMP: Support most of 5.1 atomic extensions

Implements moste of OpenMP 5.1 atomic extensions,
except that 'compare' is parsed but rejected during
resolution. (As the trans-openmp.c handling is missing.)

gcc/fortran/ChangeLog:

* dump-parse-tree.c (show_omp_clauses): Handle
weak/compare/fail clause.
* gfortran.h (gfc_omp_clauses): Add weak, compare, fail.
* openmp.c (enum omp_mask1, gfc_match_omp_clauses,
OMP_ATOMIC_CLAUSES): Update for new clauses.
(gfc_match_omp_atomic): Update for 5.1 atomic changes.
(is_conversion): Support widening in one go.
(is_scalar_intrinsic_expr): New.
(resolve_omp_atomic): Update for 5.1 atomic changes.
* parse.c (parse_omp_oacc_atomic): Update for compare.
* resolve.c (gfc_resolve_blocks): Update asserts.
* trans-openmp.c (gfc_trans_omp_atomic): Handle new clauses.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/atomic-2.f90: Move now supported code to ...
* gfortran.dg/gomp/atomic.f90: here.
* gfortran.dg/gomp/atomic-10.f90: New test.
* gfortran.dg/gomp/atomic-12.f90: New test.
* gfortran.dg/gomp/atomic-15.f90: New test.
* gfortran.dg/gomp/atomic-16.f90: New test.
* gfortran.dg/gomp/atomic-17.f90: New test.
* gfortran.dg/gomp/atomic-18.f90: New test.
* gfortran.dg/gomp/atomic-19.f90: New test.
* gfortran.dg/gomp/atomic-20.f90: New test.
* gfortran.dg/gomp/atomic-22.f90: New test.
* gfortran.dg/gomp/atomic-24.f90: New test.
* gfortran.dg/gomp/atomic-25.f90: New test.
* gfortran.dg/gomp/atomic-26.f90: New test.

libgomp/ChangeLog

* libgomp.texi (OpenMP 5.1): Update status.
21 files changed:
gcc/fortran/dump-parse-tree.c
gcc/fortran/gfortran.h
gcc/fortran/openmp.c
gcc/fortran/parse.c
gcc/fortran/resolve.c
gcc/fortran/trans-openmp.c
gcc/testsuite/gfortran.dg/gomp/atomic-10.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/atomic-12.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/atomic-15.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/atomic-16.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/atomic-17.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/atomic-18.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/atomic-19.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/atomic-2.f90
gcc/testsuite/gfortran.dg/gomp/atomic-20.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/atomic-22.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/atomic-24.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/atomic-25.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/atomic-26.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/atomic.f90
libgomp/libgomp.texi