public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/67664] New: [6 Regression] Duplicate AT_const_value attributes in some c++ cases.
@ 2015-09-21  9:07 iains at gcc dot gnu.org
  2015-09-21  9:24 ` [Bug debug/67664] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2015-09-21  9:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67664
           Summary: [6 Regression] Duplicate AT_const_value attributes in
                    some c++ cases.
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iains at gcc dot gnu.org
  Target Milestone: ---

[AFAICT] between 227779 and 227800 a change was introduced that causes multiple
instances of AT_const_value to be inserted in some DIEs.

This is picked up by Darwin's dsymutil and results in wide-spread fails in the
libstdc++ test suite for both m32 and m64.

The duplicate is not detected by binutils ld, but appears to be present on a
current build of x86_64-linux-gnu.

testcase libstdc++/17_intro/freestanding.cc:

linux (r227958):
 <2><398>: Abbrev Number: 25 (DW_TAG_structure_type)
    <399>   DW_AT_name        : (indirect string, offset: 0x7be):
numeric_limits<long int>
    <39d>   DW_AT_byte_size   : 1
    <39e>   DW_AT_decl_file   : 8
    <39f>   DW_AT_decl_line   : 1132
    <3a1>   DW_AT_sibling     : <0x578>
 <3><3a5>: Abbrev Number: 26 (DW_TAG_member)
    <3a6>   DW_AT_name        : (indirect string, offset: 0x75f):
is_specialized
    <3aa>   DW_AT_decl_file   : 8
    <3ab>   DW_AT_decl_line   : 1134
    <3ad>   DW_AT_type        : <0xc81>
    <3b1>   DW_AT_external    : 1
    <3b1>   DW_AT_declaration : 1
    <3b1>   DW_AT_const_value : 1
    <3b2>   DW_AT_const_value : 1
 <3><3b3>: Abbrev Number: 26 (DW_TAG_member)
    <3b4>   DW_AT_name        : (indirect string, offset: 0x503): digits
    <3b8>   DW_AT_decl_file   : 8
    <3b9>   DW_AT_decl_line   : 1147
    <3bb>   DW_AT_type        : <0x8dd>
    <3bf>   DW_AT_external    : 1
    <3bf>   DW_AT_declaration : 1
    <3bf>   DW_AT_const_value : 63
    <3c0>   DW_AT_const_value : 63
 <3><3c1>: Abbrev Number: 26 (DW_TAG_member)

======

Darwin (r227952):
0x000003ff:     TAG_structure_type [14] *
                 AT_name( "numeric_limits<long int>" )
                 AT_byte_size( 0x01 )
                 AT_decl_file(
"/Volumes/Data0/gcc-trunk/libstdc++-v3/include/std/limits" )
                 AT_decl_line( 1132 )
                 AT_sibling( {0x00000835} )

0x00000421:         TAG_member [15]  
                     AT_name( "is_specialized" )
                     AT_decl_file(
"/Volumes/Data0/gcc-trunk/libstdc++-v3/include/std/limits" )
                     AT_decl_line( 1134 )
                     AT_type( {0x000003c8} ( const bool ) )
                     AT_external( 0x01 )
                     AT_declaration( 0x01 )
                     AT_const_value( 0x01 )
                     AT_const_value( 0x01 )

0x0000043c:         TAG_member [15]  
                     AT_name( "digits" )
                     AT_decl_file(
"/Volumes/Data0/gcc-trunk/libstdc++-v3/include/std/limits" )
                     AT_decl_line( 1147 )
                     AT_type( {0x000003cd} ( const int ) )
                     AT_external( 0x01 )
                     AT_declaration( 0x01 )
                     AT_const_value( 0x1f )
                     AT_const_value( 0x1f )


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

* [Bug debug/67664] [6 Regression] Duplicate AT_const_value attributes in some c++ cases.
  2015-09-21  9:07 [Bug debug/67664] New: [6 Regression] Duplicate AT_const_value attributes in some c++ cases iains at gcc dot gnu.org
@ 2015-09-21  9:24 ` rguenth at gcc dot gnu.org
  2015-09-21  9:33 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-09-21  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-09-21
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
   Target Milestone|---                         |6.0
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'll have a look.


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

* [Bug debug/67664] [6 Regression] Duplicate AT_const_value attributes in some c++ cases.
  2015-09-21  9:07 [Bug debug/67664] New: [6 Regression] Duplicate AT_const_value attributes in some c++ cases iains at gcc dot gnu.org
  2015-09-21  9:24 ` [Bug debug/67664] " rguenth at gcc dot gnu.org
@ 2015-09-21  9:33 ` rguenth at gcc dot gnu.org
  2015-09-21  9:46 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-09-21  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Reduced testcase:

struct T
{
  static const int a = 0;
};

int main()
{
  T t;
  return t.a;
}


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

* [Bug debug/67664] [6 Regression] Duplicate AT_const_value attributes in some c++ cases.
  2015-09-21  9:07 [Bug debug/67664] New: [6 Regression] Duplicate AT_const_value attributes in some c++ cases iains at gcc dot gnu.org
  2015-09-21  9:24 ` [Bug debug/67664] " rguenth at gcc dot gnu.org
  2015-09-21  9:33 ` rguenth at gcc dot gnu.org
@ 2015-09-21  9:46 ` rguenth at gcc dot gnu.org
  2015-09-21 14:03 ` rguenth at gcc dot gnu.org
  2015-09-21 14:05 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-09-21  9:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
First time via

#0  add_AT_unsigned (
    die=<dw_die_ref 0x7ffff68f60a0 DW_TAG_member <parent=0x7ffff68f6050
DW_TAG_structure_type>>, attr_kind=DW_AT_const_value, unsigned_val=0)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:3879
#1  0x0000000000bc777f in add_const_value_attribute (
    die=<dw_die_ref 0x7ffff68f60a0 DW_TAG_member <parent=0x7ffff68f6050
DW_TAG_structure_type>>, rtl=0x7ffff68d3480)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:15578
#2  0x0000000000bca519 in tree_add_const_value_attribute (
    die=<dw_die_ref 0x7ffff68f60a0 DW_TAG_member <parent=0x7ffff68f6050
DW_TAG_structure_type>>, t=<integer_cst 0x7ffff68ee1f8>)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16386
#3  0x0000000000bca710 in tree_add_const_value_attribute_for_decl (
    var_die=<dw_die_ref 0x7ffff68f60a0 DW_TAG_member <parent=0x7ffff68f6050
DW_TAG_structure_type>>, decl=<var_decl 0x7ffff68d8bd0 a>)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16434
#4  0x0000000000bd24f4 in gen_variable_die (decl=<var_decl 0x7ffff68d8bd0 a>, 
    origin=<tree 0x0>, 
    context_die=<dw_die_ref 0x7ffff68f6050 DW_TAG_structure_type
<parent=0x7ffff68f6000 DW_TAG_compile_unit>>)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:19666
#5  0x0000000000bd8183 in gen_decl_die (decl=<var_decl 0x7ffff68d8bd0 a>, 
    origin=<tree 0x0>, 
    context_die=<dw_die_ref 0x7ffff68f6050 DW_TAG_structure_type
<parent=0x7ffff68f6000 DW_TAG_compile_unit>>)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21531
#6  0x0000000000bd44f2 in gen_member_die (type=<record_type 0x7ffff6a32348 T>, 
    context_die=<dw_die_ref 0x7ffff68f6050 DW_TAG_structure_type
<parent=0x7ffff68f6000 DW_TAG_compile_unit>>)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20378
#7  0x0000000000bd4d57 in gen_struct_or_union_type_die (
    type=<record_type 0x7ffff6a32348 T>, 
    context_die=<dw_die_ref 0x7ffff68f6000 DW_TAG_compile_unit>, 
    usage=DINFO_USAGE_DIR_USE)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20483
#8  0x0000000000bd5742 in gen_tagged_type_die (
    type=<record_type 0x7ffff6a32348 T>, 
    context_die=<dw_die_ref 0x7ffff68f6000 DW_TAG_compile_unit>, 
    usage=DINFO_USAGE_DIR_USE)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20684
#9  0x0000000000bd5ec1 in gen_type_die_with_usage (
    type=<record_type 0x7ffff6a32348 T>, 
    context_die=<dw_die_ref 0x7ffff68f6000 DW_TAG_compile_unit>, 
    usage=DINFO_USAGE_DIR_USE)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20846
#10 0x0000000000bd622d in gen_type_die (type=<record_type 0x7ffff6a32348 T>, 
    context_die=<dw_die_ref 0x7ffff68f6000 DW_TAG_compile_unit>)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20901
#11 0x0000000000bd7ff7 in gen_decl_die (decl=<type_decl 0x7ffff6a2f390 T>, 
    origin=<tree 0x0>, 
    context_die=<dw_die_ref 0x7ffff68f6000 DW_TAG_compile_unit>)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21487
#12 0x0000000000bd90ed in dwarf2out_decl (decl=<type_decl 0x7ffff6a2f390 T>)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21943
#13 0x0000000000bd85af in dwarf2out_type_decl (
    decl=<type_decl 0x7ffff6a2f390 T>, local=0)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21653
#14 0x0000000000ebc3bc in rest_of_type_compilation (
    type=<record_type 0x7ffff6a32348 T>, toplev=1)
    at /space/rguenther/src/svn/trunk/gcc/passes.c:349
#15 0x0000000000857e3c in finish_struct_1 (t=<record_type 0x7ffff6a32348 T>)
    at /space/rguenther/src/svn/trunk/gcc/cp/class.c:6744

2nd time via

#0  add_AT_unsigned (
    die=<dw_die_ref 0x7ffff68f60a0 DW_TAG_member <parent=0x7ffff68f6050
DW_TAG_structure_type>>, attr_kind=DW_AT_const_value, unsigned_val=0)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:3879
#1  0x0000000000bc777f in add_const_value_attribute (
    die=<dw_die_ref 0x7ffff68f60a0 DW_TAG_member <parent=0x7ffff68f6050
DW_TAG_structure_type>>, rtl=0x7ffff68d3480)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:15578
#2  0x0000000000bc95a0 in add_location_or_const_value_attribute (
    die=<dw_die_ref 0x7ffff68f60a0 DW_TAG_member <parent=0x7ffff68f6050
DW_TAG_structure_type>>, decl=<var_decl 0x7ffff68d8bd0 a>, cache_p=false, 
    attr=DW_AT_location)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16162
#3  0x0000000000bd8580 in dwarf2out_late_global_decl (
    decl=<var_decl 0x7ffff68d8bd0 a>)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21641
#4  0x0000000000b44f10 in analyze_functions (first_time=true)
    at /space/rguenther/src/svn/trunk/gcc/cgraphunit.c:1202
#5  0x0000000000b48e55 in symbol_table::finalize_compilation_unit (
    this=0x7ffff68d00a8)
    at /space/rguenther/src/svn/trunk/gcc/cgraphunit.c:2540


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

* [Bug debug/67664] [6 Regression] Duplicate AT_const_value attributes in some c++ cases.
  2015-09-21  9:07 [Bug debug/67664] New: [6 Regression] Duplicate AT_const_value attributes in some c++ cases iains at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-09-21  9:46 ` rguenth at gcc dot gnu.org
@ 2015-09-21 14:03 ` rguenth at gcc dot gnu.org
  2015-09-21 14:05 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-09-21 14:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Mon Sep 21 14:02:27 2015
New Revision: 227972

URL: https://gcc.gnu.org/viewcvs?rev=227972&root=gcc&view=rev
Log:
2015-09-21  Richard Biener  <rguenther@suse.de>

        PR debug/67664
        * dwarf2out.c (add_location_or_const_value_attribute): Remove
        attribute parameter.  Early exit if either DW_AT_const_value
        or DW_AT_location are present already.
        (gen_variable_die): Adjust caller.
        (dwarf2out_late_global_decl): Likewise.

        * g++.dg/debug/dwarf2/pr67764.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/pr67764.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug debug/67664] [6 Regression] Duplicate AT_const_value attributes in some c++ cases.
  2015-09-21  9:07 [Bug debug/67664] New: [6 Regression] Duplicate AT_const_value attributes in some c++ cases iains at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-09-21 14:03 ` rguenth at gcc dot gnu.org
@ 2015-09-21 14:05 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-09-21 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2015-09-21 14:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-21  9:07 [Bug debug/67664] New: [6 Regression] Duplicate AT_const_value attributes in some c++ cases iains at gcc dot gnu.org
2015-09-21  9:24 ` [Bug debug/67664] " rguenth at gcc dot gnu.org
2015-09-21  9:33 ` rguenth at gcc dot gnu.org
2015-09-21  9:46 ` rguenth at gcc dot gnu.org
2015-09-21 14:03 ` rguenth at gcc dot gnu.org
2015-09-21 14:05 ` 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).