]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PATCH] OpenMP: Improve Fortran metadirective diagnostics [PR107067]
authorSandra Loosemore <sloosemore@baylibre.com>
Sat, 8 Feb 2025 17:44:55 +0000 (17:44 +0000)
committerSandra Loosemore <sloosemore@baylibre.com>
Sat, 8 Feb 2025 17:44:55 +0000 (17:44 +0000)
commit5753f459444fa61a93d23325cd59467dc1838eef
tree8c8533364be6c15a9ac909f0c49310b9a71a59fd
parent06e5b0b4a244090abfea333d91fc5963292cb41d
[PATCH] OpenMP: Improve Fortran metadirective diagnostics [PR107067]

The Fortran front end was giving an ICE instead of a user-friendly
diagnostic when variants of a metadirective variant had different
statement associations.  The particular test case reported in the issue
also involved invalid placement of the "omp end metadirective" which
was not being diagnosed either.

gcc/fortran/ChangeLog
PR middle-end/107067
* parse.cc (parse_omp_do): Diagnose missing "OMP END METADIRECTIVE"
after loop.
(parse_omp_structured_block): Likewise for strictly structured block.
(parse_omp_metadirective_body): Use better test for variants ending
at different places.  Issue a user diagnostic at the end if any
were inconsistent, instead of calling gcc_assert.

gcc/testsuite/ChangeLog
PR middle-end/107067
* gfortran.dg/gomp/metadirective-11.f90: Remove the dg-ice, update
for current behavior, and add more tests to exercise the new error
code.
gcc/fortran/parse.cc
gcc/testsuite/gfortran.dg/gomp/metadirective-11.f90