------- Comment #42 from jv244 at cam dot ac dot uk 2009-07-28 07:37 ------- another issue I found is this:
> gfortran -fwhole-file test.f90 /tmp/cciOiaMB.o: In function `__m_MOD_b': test.f90:(.text+0xa): undefined reference to `c_' collect2: ld returned 1 exit status > cat test.f90 SUBROUTINE c() CALL a() END SUBROUTINE c SUBROUTINE a() END SUBROUTINE a MODULE M CONTAINS SUBROUTINE b() CALL c() END SUBROUTINE END MODULE USE M CALL b() END things link fine if I swap the order of definition of the subroutines 'a' and 'c' it is similar to PR40873, but happens with just -fwhole-file. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40011