[Bug fortran/31144] New: Gfortran module names are not Standards compliant
jkrahn at nc dot rr dot com
gcc-bugzilla@gcc.gnu.org
Mon Mar 12 05:05:00 GMT 2007
Fortran Standards require that module symbol names are unique for a given
module and procedure name pair. Gfortran uses an underscore prefix to prevent
collisions with non-module procedures, but the double-underscore used to join
the module and procedure name in not sufficient to ensure a unique symbol name.
The following code snippet illustrates the problem:
module m1
contains
subroutine m2__m3()
end subroutine m2__m3
end module m1
module m1__m2
contains
subroutine m3()
end subroutine m3
end module m1__m2
Compiling this code under gfortran produces a duplicate symbol error in the
assembly code. The name pair should be joined with character(s) that cannot
occur as part of a normal fortran name, either by using upper case (i.e. G95's
_MP_) or some other character (I think one compiler uses a period).
To be fair, a conflict is unlikely, and Intel Fortran has an equally broken
system of module symbol names. But, the current Gfortran mechanism is clearly
wrong, and should be changed the next time a binary incompatibility occurs that
requires code to be recompiled anyhow.
--
Summary: Gfortran module names are not Standards compliant
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jkrahn at nc dot rr dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31144
More information about the Gcc-bugs
mailing list