https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110421
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Jerry DeLisle <[email protected]>: https://gcc.gnu.org/g:8d06be85e7b25e32eb98613f3dc52ce8cd6efd72 commit r16-9799-g8d06be85e7b25e32eb98613f3dc52ce8cd6efd72 Author: Jerry DeLisle <[email protected]> Date: Sun Jul 12 15:51:13 2026 -0700 fortran: [PR110421] Fix ICE sizing CLASS component from derived value Allocating a CLASS component of a structure constructor from a non-polymorphic derived-type value ICEd, because alloc_scalar_allocatable_subcomponent passed the type's own symbol to gfc_get_symbol_decl to get the size. The patch uses gfc_typenode_for_spec for derived types too, as it already does for every other type. PR fortran/110421 gcc/fortran/ChangeLog: * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Use gfc_typenode_for_spec for BT_DERIVED values too. gcc/testsuite/ChangeLog: * gfortran.dg/pr110421.f90: New test. (cherry picked from commit 51ade34151dff8e444bfe3623373f42c1a29b5fa)
