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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <[email protected]>:

https://gcc.gnu.org/g:8aa0c63fad5dc4e432d002d8753e6e80484f3d36

commit r17-1342-g8aa0c63fad5dc4e432d002d8753e6e80484f3d36
Author: Paul Thomas <[email protected]>
Date:   Thu Jun 4 13:24:05 2026 +0100

    Fortran: ICE with pointer result from submodule function [PR93424]

    The declaration at line 41 of the testcase produced:
       42 |     class(c), pointer :: bp
          |     1
    Error: Unclassifiable statement at (1)
    Followed by either an ICE (gcc-13 and gcc-17) or
    "(null):0: confused by earlier errors, bailing out"
    for the other active branches.

    It is the error that is key, the aftermath is a distraction especially
    in examining the entrails for clues.

    The fix recognises 'bp', in the offending line, to be the implicit
    result of the module procedure, redeclared in the submodule contained
    function. MATCH_YES is emitted and the potential new symbol is not
    commited by jumping straight to cleanup.

    2026-06-04  Paul Thomas  <[email protected]>

    gcc/fortran
            PR fortran/93424
            * decl.cc (variable_decl): Do not commit the symbol if it is
            the implicit result of a module procedure being declared in a
            function, used in a submodule.

    gcc/testsuite/
            PR fortran/93424
            * gfortran.dg/submodule_37.f90: New test.
  • [Bug fortran/93424] ICE on vali... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to