Fortran/openmp: Partial OpenMP 5.2 doacross and omp_cur_iteration support
authorTobias Burnus <tobias@codesourcery.com>
Mon, 5 Sep 2022 16:05:24 +0000 (18:05 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 5 Sep 2022 16:06:06 +0000 (18:06 +0200)
commit938cda536019cd6a1bc0dd2346381185b420bbf8
tree78f0c5604425d3e2db0576f1a35066187750ea2f
parentb4d8a56a4c62ba8bca55469ae2b841fb4e1334a4
Fortran/openmp: Partial OpenMP 5.2 doacross and omp_cur_iteration support

Add the Fortran support to the ME/C/C++ commit
r13-2388-ga651e6d59188da8992f8bfae2df1cb4e6316f9e6

gcc/fortran/ChangeLog:

* dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Handle
omp_cur_iteration and distinguish doacross/depend.
* gfortran.h (enum gfc_omp_depend_doacross_op): Renamed from
gfc_omp_depend_op.
(enum gfc_omp_depend_doacross_op): Add OMP_DOACROSS_SINK_FIRST,
Rename OMP_DEPEND_SINK to OMP_DOACROSS_SINK.
(gfc_omp_namelist) Handle renaming, rename depend_op to
depend_doacross_op.
(struct gfc_omp_clauses): Add doacross_source.
* openmp.cc (gfc_match_omp_depend_sink): Renamed to ...
(gfc_match_omp_doacross_sink): ... this; handle omp_all_memory.
(enum omp_mask2): Add OMP_CLAUSE_DOACROSS.
(gfc_match_omp_clauses): Handle 'doacross' and syntax changes to
depend.
(gfc_match_omp_depobj): Simplify as sink/source are now impossible.
(gfc_match_omp_ordered_depend): Request OMP_CLAUSE_DOACROSS.
(resolve_omp_clauses): Update sink/source checks.
(gfc_resolve_omp_directive): Resolve EXEC_OMP_ORDERED clauses.
* parse.cc (decode_omp_directive): Handle 'ordered doacross'.
* trans-openmp.cc (gfc_trans_omp_clauses): Handle doacross.
(gfc_trans_omp_do): Fix OMP_FOR_ORIG_DECLS handling if 'ordered'
clause is present.
(gfc_trans_omp_depobj): Update for member name change.

libgomp/ChangeLog:

* libgomp.texi (OpenMP 5.2): Update doacross/omp_cur_iteration status.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/all-memory-1.f90: Update dg-error.
* gfortran.dg/gomp/depend-iterator-2.f90: Likewise.
* gfortran.dg/gomp/depobj-2.f90: Likewise.
* gfortran.dg/gomp/doacross-5.f90: New test.
* gfortran.dg/gomp/doacross-6.f90: New test.
gcc/fortran/dump-parse-tree.cc
gcc/fortran/gfortran.h
gcc/fortran/openmp.cc
gcc/fortran/parse.cc
gcc/fortran/trans-openmp.cc
gcc/testsuite/gfortran.dg/gomp/all-memory-1.f90
gcc/testsuite/gfortran.dg/gomp/depend-iterator-2.f90
gcc/testsuite/gfortran.dg/gomp/depobj-2.f90
gcc/testsuite/gfortran.dg/gomp/doacross-5.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/doacross-6.f90 [new file with mode: 0644]
libgomp/libgomp.texi