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

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

https://gcc.gnu.org/g:c474a50b42ac3f7561f628916cf58810044986b3

commit r16-4332-gc474a50b42ac3f7561f628916cf58810044986b3
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.

Reply via email to