public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/54734] New: Debug info for C++ and LTO misses types
@ 2012-09-28 10:37 rguenth at gcc dot gnu.org
  2020-07-16 19:07 ` [Bug debug/54734] " mark at gcc dot gnu.org
  2020-07-17  6:29 ` rguenth at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-28 10:37 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54734

             Bug #: 54734
           Summary: Debug info for C++ and LTO misses types
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: lto
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


Consider the following reduced testcase (from standard library use):

template <class T> class basic_string;
typedef basic_string<char> sstring;

template <class T>
class basic_string
{
public:
  typedef T type;
};

extern template class basic_string<char>;

int main()
{
  sstring s;
  return sstring::type (0);
}

without LTO we have

 <1><130>: Abbrev Number: 2 (DW_TAG_typedef)
    <131>   DW_AT_name        : (indirect string, offset: 0x98): sstring        
    <135>   DW_AT_decl_file   : 1       
    <136>   DW_AT_decl_line   : 2       
    <137>   DW_AT_type        : <0x13b> 
 <1><13b>: Abbrev Number: 3 (DW_TAG_class_type)
    <13c>   DW_AT_name        : (indirect string, offset: 0xa0):
basic_string<char>     
    <140>   DW_AT_byte_size   : 1       
    <141>   DW_AT_decl_file   : 1       
    <142>   DW_AT_decl_line   : 5       
    <143>   DW_AT_sibling     : <0x15a> 
 <2><147>: Abbrev Number: 2 (DW_TAG_typedef)
    <148>   DW_AT_name        : (indirect string, offset: 0x8e): type   
    <14c>   DW_AT_decl_file   : 1       
    <14d>   DW_AT_decl_line   : 8       
    <14e>   DW_AT_type        : <0x15a> 

while with LTO we get only

 <1><137>: Abbrev Number: 3 (DW_TAG_typedef)
    <138>   DW_AT_name        : (indirect string, offset: 0xf8): sstring        
    <13c>   DW_AT_decl_file   : 1       
    <13d>   DW_AT_decl_line   : 11      
    <13e>   DW_AT_type        : <0x142> 
 <1><142>: Abbrev Number: 4 (DW_TAG_structure_type)
    <143>   DW_AT_name        : (indirect string, offset: 0xeb): basic_string   
    <147>   DW_AT_declaration : 1       

which results from gen_struct_or_union_type_die on the type seeing
a TYPE_STUB_DECL with TYPE_DECL_SUPPRESS_DEBUG set.

Somehow the C++ frontend "manually" outputs the desired info and then for
later processing directs dwarf2out.c to not output anything?

This probably all boils down to LTO "ignoring" debug-hook calls from the
frontend, but is there a way to recover from that?  For example by
clearing TYPE_DECL_SUPPRESS_DEBUG for LTO?  Or is that used in "meaningful"
ways as well?


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

* [Bug debug/54734] Debug info for C++ and LTO misses types
  2012-09-28 10:37 [Bug debug/54734] New: Debug info for C++ and LTO misses types rguenth at gcc dot gnu.org
@ 2020-07-16 19:07 ` mark at gcc dot gnu.org
  2020-07-17  6:29 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: mark at gcc dot gnu.org @ 2020-07-16 19:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at gcc dot gnu.org

--- Comment #1 from Mark Wielaard <mark at gcc dot gnu.org> ---
This seems fixed with recent GCC. At least with GNU C++14 10.1.1 20200507 (Red
Hat 10.1.1-1) I now get:

 [    6b]    typedef              abbrev: 2
             name                 (strp) "sstring"
             decl_file            (data1) t.cc (1)
             decl_line            (data1) 2
             decl_column          (data1) 28
             type                 (ref4) [    77]
 [    77]    class_type           abbrev: 3
             name                 (strp) "basic_string<char>"
             byte_size            (data1) 1
             decl_file            (data1) t.cc (1)
             decl_line            (data1) 5
             decl_column          (data1) 7
             sibling              (ref4) [    99]
 [    84]      typedef              abbrev: 4
               name                 (strp) "type"
               decl_file            (data1) t.cc (1)
               decl_line            (data1) 8
               decl_column          (data1) 13
               type                 (ref4) [    99]
               accessibility        (data1) public (1)
 [    91]      template_type_parameter abbrev: 5
               name                 (string) "T"
               type                 (ref4) [    99]
 [    99]    base_type            abbrev: 6
             byte_size            (data1) 1
             encoding             (data1) signed_char (6)
             name                 (strp) "char"

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

* [Bug debug/54734] Debug info for C++ and LTO misses types
  2012-09-28 10:37 [Bug debug/54734] New: Debug info for C++ and LTO misses types rguenth at gcc dot gnu.org
  2020-07-16 19:07 ` [Bug debug/54734] " mark at gcc dot gnu.org
@ 2020-07-17  6:29 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-07-17  6:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
      Known to work|                            |8.1.0

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
This was fixed with LTO early debug in GCC 8.

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

end of thread, other threads:[~2020-07-17  6:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-28 10:37 [Bug debug/54734] New: Debug info for C++ and LTO misses types rguenth at gcc dot gnu.org
2020-07-16 19:07 ` [Bug debug/54734] " mark at gcc dot gnu.org
2020-07-17  6:29 ` 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).