From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3962B3858024; Sat, 22 May 2021 14:37:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3962B3858024 From: "fx at gnu dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/100725] New: dwarf error with --whole-program Date: Sat, 22 May 2021 14:37:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug 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:37:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100725 Bug ID: 100725 Summary: dwarf error with --whole-program Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: fx at gnu dot org Target Milestone: --- Extending my example in #100724 with -g, I see a dwarf error, which I assum= e is a separate issue: $ 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 -O2 -g -fwhole-program test.f90 /usr/bin/ld: /usr/bin/ld: DWARF error: can't find .debug_ranges section. /tmp/cc8sFtAX.o: in function `MAIN__': test.f90:(.text+0x7f): undefined reference to `twice_' collect2: error: ld returned 1 exit status Changing -g to -gdwarf-4 avoids the error, as does removing -fwhole-program= .=20 It also works with gcc-10 and -gdwarf-5. The system is Debian 10 amd64 (binutils 2.31.1, if that matters).=