public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/45020]  New: Useless DW_TAG_variable generated
@ 2010-07-21 17:13 jakub at gcc dot gnu dot org
  2010-07-21 18:00 ` [Bug c/45020] " jakub at gcc dot gnu dot org
  0 siblings, 1 reply; 3+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-07-21 17:13 UTC (permalink / raw)
  To: gcc-bugs

The C FE (unlike C++) generates extra DW_TAG_variable in the debug info for
e.g.
extern int v;
__typeof (v) v;
or
extern int v;
__typeof (v) w;
int v = 456;
or
extern int v;
int foo (void) { return v; }
int v;

The first one gives with -g -dA:

.uleb128 0x2 # (DIE (0x2d) DW_TAG_variable)
.ascii "v\0" # DW_AT_name
.byte 0x1 # DW_AT_decl_file (u.c)
.byte 0x1 # DW_AT_decl_line
.long 0x38 # DW_AT_type
.byte 0x1 # DW_AT_external
.byte 0x1 # DW_AT_declaration
.uleb128 0x3 # (DIE (0x38) DW_TAG_base_type)
.byte 0x4 # DW_AT_byte_size
.byte 0x5 # DW_AT_encoding
.ascii "int\0" # DW_AT_name
.uleb128 0x4 # (DIE (0x3f) DW_TAG_variable)
.ascii "v\0" # DW_AT_name
.byte 0x1 # DW_AT_decl_file (u.c)
.byte 0x2 # DW_AT_decl_line
.long 0x38 # DW_AT_type
.byte 0x1 # DW_AT_external
.byte 0x9 # DW_AT_location
.byte 0x3 # DW_OP_addr
.quad v

The first decl is olddecl from merge_decls, while the second one is newdecl
from it (from the last one of them).


-- 
           Summary: Useless DW_TAG_variable generated
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 3+ messages in thread
[parent not found: <bug-45020-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2014-03-25  9:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-21 17:13 [Bug c/45020] New: Useless DW_TAG_variable generated jakub at gcc dot gnu dot org
2010-07-21 18:00 ` [Bug c/45020] " jakub at gcc dot gnu dot org
     [not found] <bug-45020-4@http.gcc.gnu.org/bugzilla/>
2014-03-25  9:16 ` mpolacek 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).