From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29708 invoked by alias); 24 Jul 2010 13:46:39 -0000 Received: (qmail 29651 invoked by alias); 24 Jul 2010 13:46:28 -0000 Date: Sat, 24 Jul 2010 13:46:00 -0000 Message-ID: <20100724134628.29650.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/40011] Problems with -fwhole-file In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenther at suse dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg02640.txt.bz2 ------- 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