------- Comment #12 from dominiq at lps dot ens dot fr 2009-05-05 15:57 ------- Reduced test for gfortran.dg/contained_3.f90:
[ibook-dhum] f90/bug% cat contained_3_red.f90 MODULE ksbin1_aux_mod CONTAINS FUNCTION binden() INTEGER :: binden INTEGER :: setbd binden = 0 ENTRY setbd() setbd = 99 END FUNCTION binden END MODULE ksbin1_aux_mod PROGRAM test integer setbd ! setbd is external, since not use assoc. print *, setbd () if (setbd () .ne. 42 ) call abort () call foo contains subroutine foo USE ksbin1_aux_mod ! module setbd is available print *, setbd () if (setbd () .ne. 99 ) call abort () end subroutine END PROGRAM test INTEGER FUNCTION setbd() setbd=42 END FUNCTION setbd [ibook-dhum] f90/bug% gfc contained_3_red.f90 [ibook-dhum] f90/bug% a.out 42 99 [ibook-dhum] f90/bug% gfc -fwhole-file contained_3_red.f90 [ibook-dhum] f90/bug% a.out 42 42 Abort -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40011