https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121452
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Paul-Antoine Arras <[email protected]>: https://gcc.gnu.org/g:6b90d56d0c352a151efabe06f81d26faeeb9496f commit r16-4593-g6b90d56d0c352a151efabe06f81d26faeeb9496f Author: Paul-Antoine Arras <[email protected]> Date: Tue Oct 21 09:48:23 2025 +0200 OpenMP: Fix bogus diagnostics with intervening code [PR121452] The introduction in r14-3488-ga62c8324e7e31a of OMP_STRUCTURED_BLOCK (to diagnose invalid intervening code) caused a regression rejecting the valid use of the Fortran CONTINUE statement to end a collapsed loop. This patch fixes the incorrect error checking in the OMP lowering pass. It also fixes a check in the Fortran front end that erroneously rejects a similar statement in an ordered loop. Co-authored by: Tobias Burnus <[email protected]> PR fortran/121452 gcc/fortran/ChangeLog: * openmp.cc (resolve_omp_do): Allow CONTINUE as end statement of a perfectly nested loop. gcc/ChangeLog: * omp-low.cc (check_omp_nesting_restrictions): Accept an OMP_STRUCTURED_BLOCK in a collapsed simd region and in an ordered loop. gcc/testsuite/ChangeLog: * c-c++-common/gomp/pr121452-1.c: New test. * c-c++-common/gomp/pr121452-2.c: New test. * gfortran.dg/gomp/pr121452-1.f90: New test. * gfortran.dg/gomp/pr121452-2.f90: New test. * gfortran.dg/gomp/pr121452-3.f90: New test.
