https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126909
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Paul Thomas <[email protected]>: https://gcc.gnu.org/g:34762afa322a6556adfc7a83381a6f6ba5c3137b commit r17-3562-g34762afa322a6556adfc7a83381a6f6ba5c3137b Author: Paul Thomas <[email protected]> Date: Sun Aug 23 09:37:05 2026 +0100 Fortran: Lost statement label in a program with a CONTAINS section [PR126909] 2026-08-23 Paul Thomas <[email protected]> gcc/fortran PR fortran/126909 * parse.cc (accept_statement): After a contains section, a new namespace is started and, without correction, the new statement the label, if there is one, would be stored there.Go back to the containing namespace and store it there. Likewise add the labelled return statement to the previous entry on the state stack. gcc/testsuite PR fortran/126909 * gfortran.dg/pr126909.f90: New test.
