diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2023-07-25 15:43:58 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2023-07-25 15:43:58 +0200 |
commit | 09dda270380fe13e7b4722305cb1122df1f779a0 (patch) | |
tree | 8f7054e1df3db3d39d1ce497b4595ab9ba417c07 /gcc/cp | |
parent | d8dc61bb5ab99c3239ea93a37097f9419bee0211 (diff) | |
download | gcc-09dda270380fe13e7b4722305cb1122df1f779a0.zip gcc-09dda270380fe13e7b4722305cb1122df1f779a0.tar.gz gcc-09dda270380fe13e7b4722305cb1122df1f779a0.tar.bz2 |
OpenMP/Fortran: Reject declarations between target + teams
While commit r14-2754-g2e31fe431b08b0302e1fa8a1c18ee51adafd41df
detected executable statements, declarations do not show up as
executable statements. Hence, we now check whether the first
statement after TARGET is TEAMS - such that we can detect data
statements like type or variable declarations. Fortran semantics
ensures that only executable directives/statemens can come after
'!$omp end teams' such that those can be detected with the
previous check.
Note that statements returning ST_NONE such as 'omp nothing' or
'omp error at(compilation)' will still slip through.
PR fortran/110725
PR middle-end/71065
gcc/fortran/ChangeLog:
* gfortran.h (gfc_omp_clauses): Add target_first_st_is_teams.
* parse.cc (parse_omp_structured_block): Set it if the first
statement in the structured block of a TARGET is TEAMS or
a combined/composite starting with TEAMS.
* openmp.cc (resolve_omp_target): Also show an error for
contains_teams_construct without target_first_st_is_teams.
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/teams-6.f90: New test.
Diffstat (limited to 'gcc/cp')
0 files changed, 0 insertions, 0 deletions