]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp, fortran: Add support for iterators in OpenMP 'target update' constructs ...
authorKwok Cheung Yeung <kcyeung@baylibre.com>
Wed, 27 Nov 2024 21:56:08 +0000 (21:56 +0000)
committerKwok Cheung Yeung <kcyeung@baylibre.com>
Thu, 17 Apr 2025 22:30:04 +0000 (23:30 +0100)
commit0861d9c3e63cdc8cb0fd08b06dbfd3ea6b999ddf
tree57175812e733b933c19290b8a2556cbc02a2bb9d
parent28d601fddb3ddcc8ca34b83d8bfd6b8e225ef9df
openmp, fortran: Add support for iterators in OpenMP 'target update' constructs (Fortran)

This adds Fortran support for iterators in 'to' and 'from' clauses in the
'target update' OpenMP directive.

gcc/fortran/

* dump-parse-tree.cc (show_omp_namelist): Add iterator support for
OMP_LIST_TO and OMP_LIST_FROM.
* match.cc (gfc_free_namelist): Free namespace for OMP_LIST_TO and
OMP_LIST_FROM.
* openmp.cc (gfc_free_omp_clauses): Free namespace for OMP_LIST_TO
and OMP_LIST_FROM.
(gfc_match_motion_var_list): Parse 'iterator' modifier.
(resolve_omp_clauses): Resolve iterators for OMP_LIST_TO and
OMP_LIST_FROM.
* trans-openmp.cc (gfc_trans_omp_clauses): Handle iterators in
OMP_LIST_TO and OMP_LIST_FROM clauses.  Add expressions to
iter_block rather than block.

gcc/testsuite/

* gfortran.dg/gomp/target-update-iterators-1.f90: New.
* gfortran.dg/gomp/target-update-iterators-2.f90: New.
* gfortran.dg/gomp/target-update-iterators-3.f90: New.

libgomp/

* testsuite/libgomp.fortran/target-update-iterators-1.f90: New.
* testsuite/libgomp.fortran/target-update-iterators-2.f90: New.
* testsuite/libgomp.fortran/target-update-iterators-3.f90: New.

Co-authored-by: Andrew Stubbs <ams@baylibre.com>
13 files changed:
gcc/fortran/ChangeLog.omp
gcc/fortran/dump-parse-tree.cc
gcc/fortran/match.cc
gcc/fortran/openmp.cc
gcc/fortran/trans-openmp.cc
gcc/testsuite/ChangeLog.omp
gcc/testsuite/gfortran.dg/gomp/target-update-iterators-1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/target-update-iterators-2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/target-update-iterators-3.f90 [new file with mode: 0644]
libgomp/ChangeLog.omp
libgomp/testsuite/libgomp.fortran/target-update-iterators-1.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/target-update-iterators-2.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/target-update-iterators-3.f90 [new file with mode: 0644]