$> cat mangle.f90 MODULE m CONTAINS SUBROUTINE g() END SUBROUTINE SUBROUTINE f() CALL g() CONTAINS SUBROUTINE g() END SUBROUTINE END SUBROUTINE END MODULE
USE m CALL g() END $> gfortran-svn mangle.f90 /tmp/ccqzRB3z.o: In function `MAIN__': mangle.f90:(.text+0x2f): undefined reference to `__m_MOD_g' collect2: ld returned 1 exit status $> gfortran-svn --version GNU Fortran (GCC) 4.4.0 20081221 (experimental) The problem disappears if F and G are reordered in the module or the contained G is removed. -- Summary: module function name mangled improperly if contained function of same name exists Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dfranke at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38594