Fortran: Emit correct prototypes for procedures defined via INTERFACE.
Fixes prototype generation for Fortran procedures defined via an interface block.
This patch corrects prototype generation for Fortran procedures declared using the INTERFACE keyword. It ensures that the formal argument list is taken from the interface, which is crucial for proper type checking and correct code generation, especially when dealing with external routines or library functions.
In Details
In GCC's Fortran front end (gcc/fortran), the presence of INTERFACE blocks affect symbol's formal arglist. This patch modifies dump-parse-tree.cc to handle such definitions correctly. This matters to toolchain devs because incorrect prototype generation can lead to miscompilations and runtime errors.
For Context
In Fortran, an INTERFACE block declares the argument types of an external procedure, allowing the compiler to check calls to it. The compiler needs to emit a prototype from that INTERFACE declaration. This patch fixes a bug where those prototypes were being generated incorrectly, potentially leading to type mismatches and runtime errors.