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

--- Comment #6 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:51ade34151dff8e444bfe3623373f42c1a29b5fa

commit r17-5174-g51ade34151dff8e444bfe3623373f42c1a29b5fa
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.

Reply via email to