public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/100725] New: dwarf error with --whole-program
@ 2021-05-22 14:37 fx at gnu dot org
  2021-05-23 11:12 ` [Bug debug/100725] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: fx at gnu dot org @ 2021-05-22 14:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100725

            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 assume 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 = 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. 
It also works with gcc-10 and -gdwarf-5.  The system is Debian 10 amd64
(binutils 2.31.1, if that matters).

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-25  7:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-22 14:37 [Bug debug/100725] New: dwarf error with --whole-program fx at gnu dot org
2021-05-23 11:12 ` [Bug debug/100725] " jakub at gcc dot gnu.org
2021-05-24 10:36 ` fx at gnu dot org
2021-05-25  7:19 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).