From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 893 invoked by alias); 28 Jul 2009 07:37:52 -0000 Received: (qmail 811 invoked by uid 48); 28 Jul 2009 07:37:37 -0000 Date: Tue, 28 Jul 2009 07:37:00 -0000 Message-ID: <20090728073737.810.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: "jv244 at cam dot ac dot uk" 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: 2009-07/txt/msg02228.txt.bz2 ------- 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