https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100273
--- Comment #14 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:cb25c5dd6b315dc216c7a5640dc89c5d74ffea34 commit r12-10720-gcb25c5dd6b315dc216c7a5640dc89c5d74ffea34 Author: Harald Anlauf <anl...@gmx.de> Date: Thu Sep 5 21:30:25 2024 +0200 Fortran: fix ICE in gfc_create_module_variable [PR100273] gcc/fortran/ChangeLog: PR fortran/100273 * trans-decl.cc (gfc_create_module_variable): Handle module variable also when it is needed for the result specification of a contained function. gcc/testsuite/ChangeLog: PR fortran/100273 * gfortran.dg/pr100273.f90: New test. (cherry picked from commit 1f462b5072a5e82c35921f7e3bdf3959c4a49dc9)