This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gfortran] module with interface block


On Thursday 13 November 2003 2:44 pm, Melvin Hadasht wrote:
> Hi,
>
> When I try to link a program (test-ifce-f95) using a module (m_foo_ifce)
> with an interface block (example attached and explained below)

Patch below should fix this. We were incorrectly mangling the function name.

Applied to tree-ssa branch.

Paul

2003-11-13  Paul Brook  <paul@nowt.org>

	* trans-decl.c (gfc_sym_mangled_function_id): Dont mangle externals.

	* gfortran.fortran-torture/execute/module_interface.f90: New test.

--- clean/tree-ssa/gcc/fortran/trans-decl.c
+++ gcc/gcc/fortran/trans-decl.c
@@ -291,7 +291,7 @@ gfc_sym_mangled_function_id (gfc_symbol 
   int has_underscore;
   char name[GFC_MAX_MANGLED_SYMBOL_LEN + 1];
 
-  if (sym->module[0] == 0)
+  if (sym->module[0] == 0 || sym->attr.proc == PROC_EXTERNAL)
     {
       if (strcmp (sym->name, "MAIN__") == 0
 	  || sym->attr.proc == PROC_INTRINSIC)

Attachment: module_interface.f90
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]