]> gcc.gnu.org Git - gcc.git/commit
OpenMP/Fortran: Reject not strictly nested target -> teams [PR110725, PR71065]
authorTobias Burnus <tobias@codesourcery.com>
Mon, 24 Jul 2023 20:57:07 +0000 (22:57 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 24 Jul 2023 20:57:07 +0000 (22:57 +0200)
commit2e31fe431b08b0302e1fa8a1c18ee51adafd41df
tree3d4f7fdbd47af7aa8ae4cc3c0f5b1912030c64de
parent31c3b67dfc6e67773d13260bc38b833663698b74
OpenMP/Fortran: Reject not strictly nested target -> teams [PR110725, PR71065]

OpenMP requires: "If a teams region is nested inside a target region, the
corresponding target construct must not contain any statements, declarations
or directives outside of the corresponding teams construct."

This commit checks now for this restriction.

PR fortran/110725
PR middle-end/71065

gcc/fortran/ChangeLog:

* gfortran.h (gfc_omp_clauses): Add contains_teams_construct.
* openmp.cc (resolve_omp_target): New; check for teams nesting.
(gfc_resolve_omp_directive): Call it.
* parse.cc (decode_omp_directive): Set contains_teams_construct
on enclosing ST_OMP_TARGET.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/pr99226.f90: Update dg-error.
* gfortran.dg/gomp/teams-5.f90: New test.
gcc/fortran/gfortran.h
gcc/fortran/openmp.cc
gcc/fortran/parse.cc
gcc/testsuite/gfortran.dg/gomp/pr99226.f90
gcc/testsuite/gfortran.dg/gomp/teams-5.f90 [new file with mode: 0644]
This page took 0.06626 seconds and 5 git commands to generate.