https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99065
--- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> --- This mega-patch, on the scale of the importance of the problem, was required because of gfortran's one pass parsing. It might be a temporary fix because I am contemplating how an initial pass of contained procedures might be introduced. Fixed on mainline. Paul