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

--- Comment #17 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Harald Anlauf
<[email protected]>:

https://gcc.gnu.org/g:35b2c6ec954c903ab0e7b5ca6095e84ed2c1488d

commit r14-12121-g35b2c6ec954c903ab0e7b5ca6095e84ed2c1488d
Author: Harald Anlauf <[email protected]>
Date:   Thu Oct 9 18:43:22 2025 +0200

    Fortran: fix "unstable" interfaces of external procedures [PR122206]

    In the testcase repeated invocations of a function showed an apparently
    unstable interface.  This was caused by trying to guess an (inappropriate)
    interface of the external procedure after processing of the procedure
    arguments in gfc_conv_procedure_call.  The mis-guessed interface showed up
    in subsequent uses of the procedure symbol in gfc_conv_procedure_call.  The
    solution is to check for an existing interface of an external procedure
    before trying to wildly guess based on just the actual arguments.

            PR fortran/122206

    gcc/fortran/ChangeLog:

            * trans-types.cc (gfc_get_function_type): Do not clobber an
            existing procedure interface.

    gcc/testsuite/ChangeLog:

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

    (cherry picked from commit c474a50b42ac3f7561f628916cf58810044986b3)

Reply via email to