https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110421

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Jerry DeLisle
<[email protected]>:

https://gcc.gnu.org/g:0b2cdf07de089e2944a6354fe3ac87a79cacf052

commit r15-11649-g0b2cdf07de089e2944a6354fe3ac87a79cacf052
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)

Reply via email to