From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 03FCE385803F; Sat, 22 May 2021 14:21:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03FCE385803F From: "fx at gnu dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/100724] New: -fwhole-program breaks module use Date: Sat, 22 May 2021 14:21:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fx at gnu dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2021 14:21:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100724 Bug ID: 100724 Summary: -fwhole-program breaks module use Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: fx at gnu dot org Target Milestone: --- I found that trying gfortran -fwhole-program failed to link a case I tried, with undefined references to routines with interface blocks. It's OK with gfortran 10. Here's a trivial example (on Debian 10, but I don't suppose that matters): $ gfortran-11 --version GNU Fortran (GCC) 11.1.0 $ cat test.f90 module tw interface real function twice (x) end function twice end interface end module tw real function twice (x) twice =3D 2*x end function twice use tw read *, x print *, twice (x) end $ gfortran-11 -O -fwhole-program test.f90=20 /usr/bin/ld: /tmp/ccBKHiLp.o: in function `MAIN__': test.f90:(.text+0x7d): undefined reference to `twice_' collect2: error: ld returned 1 exit status=