------- Comment #66 from rguenther at suse dot de 2010-07-24 13:46 ------- Subject: Re: Problems with -fwhole-file
On Sat, 24 Jul 2010, burnus at gcc dot gnu dot org wrote: > > > ------- Comment #64 from burnus at gcc dot gnu dot org 2010-07-24 11:31 > ------- > Reduced a tiny bit more. If one swaps "one" and "two" (functions or use) it > works - if one swaps both, it fails again. Wild guess: gfortran does not > properly walk the tree. > > Failure with -fwhole-file: > /tmp/ccN7F1tB.o: In function `__mod_MOD_four': > test.f90:(.text+0x3): undefined reference to `one_' > > > SUBROUTINE one ( ) > END SUBROUTINE one > > SUBROUTINE two ( ) > END SUBROUTINE two > > MODULE mod > CONTAINS > SUBROUTINE three ( ) > CALL two ( ) > END SUBROUTINE three > SUBROUTINE four ( ) > CALL one ( ) > END SUBROUTINE four > END MODULE mod > END To diagnose these kind of problems look at -fdump-tree-original-uid and/or -fdump-ipa-cgraph. You'll see if the middle-end thinks you have two different entities for one function or variable. Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40011