This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/32103] New: Module with equivalence draws "unsatisfied reference"


Given this eq-mod.f90

module aap
   real a(5)
   real b(3)
   equivalence (a(3),b(1))
end module aap

and the following main program eq-main.f90

use aap, only : b
print*,b
end

draws, when compiling with GNU Fortran (GCC) 4.2.1 20070523 (prerelease),
as follows:

toon@laptop:~/g95-bugs$ /usr/rel/bin/gfortran -c eq-mod.f90
toon@laptop:~/g95-bugs$ /usr/rel/bin/gfortran -c eq-main.f90
toon@laptop:~/g95-bugs$ /usr/rel/bin/gfortran -static eq-main.o eq-mod.o
eq-main.o: In function `MAIN__':
eq-main.f90:(.text+0x78): undefined reference to `__aap(bool)'
collect2: ld returned 1 exit status

The "(bool)" is a red herring, caused by collect2's "helpful" reinterpretation
of the following external reference:

toon@laptop:~/g95-bugs$ nm eq-main.o
                 U __aap__b
...


-- 
           Summary: Module with equivalence draws "unsatisfied reference"
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: toon at moene dot indiv dot nluug dot nl


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32103


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