https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107067
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Sandra Loosemore <san...@gcc.gnu.org>: https://gcc.gnu.org/g:5753f459444fa61a93d23325cd59467dc1838eef commit r15-7445-g5753f459444fa61a93d23325cd59467dc1838eef Author: Sandra Loosemore <sloosem...@baylibre.com> Date: Sat Feb 8 17:44:55 2025 +0000 [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.