https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127671
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jerry DeLisle <[email protected]>: https://gcc.gnu.org/g:f4d32f612a3c43e9d0a861b7dae7bb67139c9ab0 commit r17-4803-gf4d32f612a3c43e9d0a861b7dae7bb67139c9ab0 Author: Jerry DeLisle <[email protected]> Date: Tue Sep 29 15:40:23 2026 -0700 fortran: [PR127671] Create the span of a dummy in its owning function The span variable of a span addressed dummy array was always added to the function being translated. When the dummy was first referenced from a contained procedure it ended up there instead of in the host, which loads it on entry, and tree-nested ICEd. Assisted-by: Claude Opus 5.5 PR fortran/127671 gcc/fortran/ChangeLog: PR fortran/127671 * trans-decl.cc (gfc_build_dummy_array_decl): Create the span variable with create_index_var, in the function that owns the dummy. gcc/testsuite/ChangeLog: PR fortran/127671 * gfortran.dg/target_dummy_span_3.f90: New test.
