[Bug debug/94450] lto abstract variable emitted as concrete decl

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Apr 2 08:07:17 GMT 2020


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-04-02
           Keywords|                            |lto
                 CC|                            |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I guess the more correct DWARF would be to have the 13d DIE include
DW_AT_declaration?  Then we could also stop the "abuse" of
DW_AT_abstract_origin
and instead have to use DW_AT_specification.  But I'm not sure whether
DW_AT_specification allows cross CU references (technically yes but
practically) especially since there's explicit wording that DW_AT_specification
cannot refer to type unit entities.

Note I originally saw all early debug as abstract (but we're not consistently
emitting DW_AT_inline to all early function DIEs either) but that concept
doesn't apply to globals.

As you said the DW_TAG_imported_unit serve no useful purpose (I originally
thought that it would provide proper name-lookup scopes but that works
correct in other ways).  And I'm fine to simply drop those (also given
consumers seem to handle references to CUs not explicitely imported just
fine).  That could be done for GCC 10 already, I fear the rest needs more
testing?

Btw, thanks for sanity checking the LTO DWARF.


More information about the Gcc-bugs mailing list