gnu/gcc/2f881d81d613a52b57dab311f0eacc5da11bae7e 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)
2 files changed