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

--- Comment #4 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:9f485bb6ac443e89e25e67069ace874a1c99d9c0

commit r17-6330-g9f485bb6ac443e89e25e67069ace874a1c99d9c0
Author: Jerry DeLisle <[email protected]>
Date:   Sat Nov 14 17:58:13 2026 -0800

    fortran: [PR107144] ICE for dummy function returning CHARACTER(n)

    gfc_trans_deferred_vars set up the result length of a CHARACTER dummy
    function as it does the length of a CHARACTER dummy variable.  When that
    length is an argument of the dummy function itself, the argument is
    never declared in the caller, so gfc_get_symbol_decl failed an
    assertion.  The result length is evaluated at each call, so skip the
    setup for a dummy function.

    Assisted-by: Claude Opus 5.5

            PR fortran/107144

    gcc/fortran/ChangeLog:

            * trans-decl.cc (gfc_trans_deferred_vars): Do not set up the result
            length of a CHARACTER dummy function.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/pr107144.f90: New test.
  • [Bug fortran/107144] ICE in gfc... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to