public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/78100] DWARF symbols for an array sometimes missing the array length
       [not found] <bug-78100-4@http.gcc.gnu.org/bugzilla/>
@ 2024-01-05 17:56 ` gccbugs at dima dot secretsauce.net
  2024-03-14 16:38 ` cJ-gcc at zougloub dot eu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: gccbugs at dima dot secretsauce.net @ 2024-01-05 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Dima Kogan <gccbugs at dima dot secretsauce.net> ---
I just tried again, and I see that this bug has been fixed. I'm using

  gcc (Debian 13.2.0-2) 13.2.0

Should we close this report?

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

* [Bug debug/78100] DWARF symbols for an array sometimes missing the array length
       [not found] <bug-78100-4@http.gcc.gnu.org/bugzilla/>
  2024-01-05 17:56 ` [Bug debug/78100] DWARF symbols for an array sometimes missing the array length gccbugs at dima dot secretsauce.net
@ 2024-03-14 16:38 ` cJ-gcc at zougloub dot eu
  2024-06-01  3:38 ` puetzk at puetzk dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: cJ-gcc at zougloub dot eu @ 2024-03-14 16:38 UTC (permalink / raw)
  To: gcc-bugs

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

Jérôme Carretero <cJ-gcc at zougloub dot eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cJ-gcc at zougloub dot eu

--- Comment #5 from Jérôme Carretero <cJ-gcc at zougloub dot eu> ---
Yeah, this looks fixed since gcc 10.

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

* [Bug debug/78100] DWARF symbols for an array sometimes missing the array length
       [not found] <bug-78100-4@http.gcc.gnu.org/bugzilla/>
  2024-01-05 17:56 ` [Bug debug/78100] DWARF symbols for an array sometimes missing the array length gccbugs at dima dot secretsauce.net
  2024-03-14 16:38 ` cJ-gcc at zougloub dot eu
@ 2024-06-01  3:38 ` puetzk at puetzk dot org
  2024-06-01  3:56 ` puetzk at puetzk dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: puetzk at puetzk dot org @ 2024-06-01  3:38 UTC (permalink / raw)
  To: gcc-bugs

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

Kevin Puetz <puetzk at puetzk dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |puetzk at puetzk dot org

--- Comment #6 from Kevin Puetz <puetzk at puetzk dot org> ---
Possibly r263660/ea379c9ec3776b9d4f72d5d8c8987e2e43c7baae? 
add_bound_info (subrange_die, DW_AT_upper_bound) eventually calls the
add_scalar_info() that was changed in that patch. And it at least seems
plausible that the changes around decl_die = lookup_decl_die(decl)` could be
relevant.

https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/dwarf2out.c;h=b80c909e1fc6b05c35faa30a72e262a08cc7d65e;hp=236f199afcf050957639f1cce839f870a0d472c6;hb=ea379c9ec3776b9d4f72d5d8c8987e2e43c7baae;hpb=3fb558b154f795983ae6a9dd6478e18a2c846584

The new code requires that decl_die have  DW_AT_location or DW_AT_const_value
in order to take the early return, and the first decl (the `extern` with
DW_AT_external = yes) has neither. So that would help the function *not* just
reference the extern and return early, thus eventually writing the complete
DW_TAG_array_type too.

I don't know this code well, haven't actually bisected, and this isn't actually
an LTO case that patch's comment describes... but it seems to be in the right
timeframe and changing relevant parts of dwarf2out.c

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

* [Bug debug/78100] DWARF symbols for an array sometimes missing the array length
       [not found] <bug-78100-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2024-06-01  3:38 ` puetzk at puetzk dot org
@ 2024-06-01  3:56 ` puetzk at puetzk dot org
  2024-06-01  4:01 ` puetzk at puetzk dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: puetzk at puetzk dot org @ 2024-06-01  3:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Kevin Puetz <puetzk at puetzk dot org> ---
Nope, falsified that guess - I just realized compiler explorer can do
dwarfdump, which makes it easy to bisect among the releases they have (if not
actually commit-by-commit). This shows that 9.5.0 (which has r263660) still
produces bad DWARF, and 10.1 is fixed. So it can't be that commit...

https://godbolt.org/z/jj4safe6e

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

* [Bug debug/78100] DWARF symbols for an array sometimes missing the array length
       [not found] <bug-78100-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2024-06-01  3:56 ` puetzk at puetzk dot org
@ 2024-06-01  4:01 ` puetzk at puetzk dot org
  2024-06-01 11:52 ` mark at gcc dot gnu.org
  2024-06-01 13:33 ` puetzk at puetzk dot org
  6 siblings, 0 replies; 7+ messages in thread
From: puetzk at puetzk dot org @ 2024-06-01  4:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Kevin Puetz <puetzk at puetzk dot org> ---
Found it: this is a duplicate of bug 91507, thus fixed by
r276403/31632e2c4327146ea8d21cff33adaa505b17d2bd

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

* [Bug debug/78100] DWARF symbols for an array sometimes missing the array length
       [not found] <bug-78100-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2024-06-01  4:01 ` puetzk at puetzk dot org
@ 2024-06-01 11:52 ` mark at gcc dot gnu.org
  2024-06-01 13:33 ` puetzk at puetzk dot org
  6 siblings, 0 replies; 7+ messages in thread
From: mark at gcc dot gnu.org @ 2024-06-01 11:52 UTC (permalink / raw)
  To: gcc-bugs

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

Mark Wielaard <mark at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #9 from Mark Wielaard <mark at gcc dot gnu.org> ---
(In reply to Kevin Puetz from comment #8)
> Found it: this is a duplicate of bug 91507, thus fixed by
> r276403/31632e2c4327146ea8d21cff33adaa505b17d2bd

Thanks for the research.

*** This bug has been marked as a duplicate of bug 91507 ***

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

* [Bug debug/78100] DWARF symbols for an array sometimes missing the array length
       [not found] <bug-78100-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2024-06-01 11:52 ` mark at gcc dot gnu.org
@ 2024-06-01 13:33 ` puetzk at puetzk dot org
  6 siblings, 0 replies; 7+ messages in thread
From: puetzk at puetzk dot org @ 2024-06-01 13:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Kevin Puetz <puetzk at puetzk dot org> ---
The godbolt recipe also nails down the other end of the version range - 5.4
produced something weirder still (a single DW_TAG_variable with
DW_AT_external=true, but also with DW_AT_location and DW_AT_upper_bound present
- so it kind of mushed the two decls together with all the attributes of both).

6.1 starts emitting two separate DW_TAG_variable DIEs, one with
DW_AT_external=true and the other with DW_AT_location, using
DW_AT_specification to link them; but it lost the DW_AT_upper_bound. Then
10.1...trunk all seem fixed, emitting an incomplete `extern` and a complete
definition, as it should.

So "Known to fail" should be 6.1-9.5, "Known to Work" should be 10.0+ (and bug
91507 can also be marked "RESOLVED FIXED" since 10.1 is long since released).
I'd update the metadata myself but don't the permission bits...

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

end of thread, other threads:[~2024-06-01 13:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-78100-4@http.gcc.gnu.org/bugzilla/>
2024-01-05 17:56 ` [Bug debug/78100] DWARF symbols for an array sometimes missing the array length gccbugs at dima dot secretsauce.net
2024-03-14 16:38 ` cJ-gcc at zougloub dot eu
2024-06-01  3:38 ` puetzk at puetzk dot org
2024-06-01  3:56 ` puetzk at puetzk dot org
2024-06-01  4:01 ` puetzk at puetzk dot org
2024-06-01 11:52 ` mark at gcc dot gnu.org
2024-06-01 13:33 ` puetzk at puetzk dot 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).