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

--- Comment #35 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:6181d4761b99a1734bb88b6cf96e6f11d7991982

commit r15-11359-g6181d4761b99a1734bb88b6cf96e6f11d7991982
Author: Christopher Albert <[email protected]>
Date:   Sun Mar 29 22:18:43 2026 +0200

    fortran: Fix ICE in gfc_conv_array_initializer with invalid index
[PR103367]

    An undefined variable used as an array index in a parameter initializer
    expression reaches gfc_conv_array_initializer after parameter substitution
    with an unexpected expression type, hitting gcc_unreachable().

    Guard against unexpected expression types by returning a zero-filled
    constructor, since the frontend has already diagnosed the error.

            PR fortran/103367

    gcc/fortran/ChangeLog:

            * trans-array.cc (gfc_conv_array_initializer): Return empty
            constructor for unexpected expression types after parameter
            substitution.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/pr103367.f90: New test.

    Signed-off-by: Christopher Albert <[email protected]>

Reply via email to