public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/51567] New: [4.7 Regression] ICE in splice_child_die, at dwarf2out.c:5009 with -flto -g
@ 2011-12-15 14:16 rguenth at gcc dot gnu.org
  2011-12-15 14:42 ` [Bug debug/51567] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-15 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51567
           Summary: [4.7 Regression] ICE in splice_child_die, at
                    dwarf2out.c:5009 with -flto -g
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: lto
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


struct _Deque_iterator {
    int* _M_cur;
    void foo() {}
};
class _Deque_base {
public:
    typedef _Deque_iterator iterator;
    iterator _M_impl;
};
class deque : public _Deque_base {
public:
    typedef _Deque_base::iterator iterator;
};
class OutputContextStack {
public:
    deque m_stack;
    deque::iterator m_stackPosition;
};
int main()
{
  OutputContextStack s;
  s.m_stackPosition.foo();
}


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

* [Bug debug/51567] [4.7 Regression] ICE in splice_child_die, at dwarf2out.c:5009 with -flto -g
  2011-12-15 14:16 [Bug debug/51567] New: [4.7 Regression] ICE in splice_child_die, at dwarf2out.c:5009 with -flto -g rguenth at gcc dot gnu.org
@ 2011-12-15 14:42 ` rguenth at gcc dot gnu.org
  2011-12-15 14:46 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-15 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011-12-15
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.7.0
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-15 14:16:10 UTC ---
Mine.


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

* [Bug debug/51567] [4.7 Regression] ICE in splice_child_die, at dwarf2out.c:5009 with -flto -g
  2011-12-15 14:16 [Bug debug/51567] New: [4.7 Regression] ICE in splice_child_die, at dwarf2out.c:5009 with -flto -g rguenth at gcc dot gnu.org
  2011-12-15 14:42 ` [Bug debug/51567] " rguenth at gcc dot gnu.org
@ 2011-12-15 14:46 ` rguenth at gcc dot gnu.org
  2011-12-15 16:39 ` rguenth at gcc dot gnu.org
  2011-12-15 16:39 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-15 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-15 14:42:19 UTC ---
5007      gcc_assert (child->die_parent == parent
5008                  || (child->die_parent
5009                      == get_AT_ref (parent, DW_AT_specification)));

we have

(gdb) call debug_dwarf_die (child)
DIE    0: DW_TAG_member (0x7ffff5b6c2d0)
  abbrev id: 0 offset: 0 mark: 0
  DW_AT_name: "_M_cur"
  DW_AT_decl_file: "t.ii" (1)
  DW_AT_decl_line: 2
  DW_AT_type: die -> 0 (0x7ffff5b6c320)
  DW_AT_data_member_location: location descriptor

(gdb) call debug_dwarf_die (parent)
DIE    0: DW_TAG_structure_type (0x7ffff5b6c8c0)
  abbrev id: 0 offset: 0 mark: 0
  DW_AT_name: "iterator"
  DW_AT_byte_size: 8
  DW_AT_decl_file: "t.ii" (1)
  DW_AT_decl_line: 1

so somehow it messes up parent, which should be a typedef DIE(?).  We generate
it through

#0  0x000000000062a089 in gen_struct_or_union_type_die (type=0x7ffff5b5fc78, 
    context_die=0x7ffff5b6c820, usage=DINFO_USAGE_DIR_USE)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18582
#1  0x000000000062b139 in gen_tagged_type_die (type=0x7ffff5b5fc78, 
    context_die=0x7ffff5b6c820, usage=DINFO_USAGE_DIR_USE)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18810
#2  0x000000000062ab4f in gen_typedef_die (decl=0x7ffff5b682e0, 
    context_die=0x7ffff5b6c820)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18719
#3  0x000000000062ecbd in gen_decl_die (decl=0x7ffff5b682e0, origin=0x0, 
    context_die=0x7ffff5b6c820)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:19523
#4  0x000000000062ba99 in gen_type_die_with_usage (type=0x7ffff5b5fc78, 
    context_die=0x7ffff5b6c820, usage=DINFO_USAGE_DIR_USE)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18873
#5  0x000000000062bfc8 in gen_type_die (type=0x7ffff5b5fc78, 
    context_die=0x7ffff5b6c820)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18999
#6  0x000000000062f032 in gen_decl_die (decl=0x7ffff5a45428, origin=0x0, 
    context_die=0x7ffff5b6c820)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:19574
#7  0x00000000006297dd in gen_member_die (type=0x7ffff5b5fb28, 
    context_die=0x7ffff5b6c820)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18532
#8  0x000000000062a484 in gen_struct_or_union_type_die (type=0x7ffff5b5fb28, 
    context_die=0x7ffff5b6c780, usage=DINFO_USAGE_DIR_USE)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18624
#9  0x000000000062b139 in gen_tagged_type_die (type=0x7ffff5b5fb28, 
    context_die=0x7ffff5b6c780, usage=DINFO_USAGE_DIR_USE)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18810
#10 0x000000000062be2d in gen_type_die_with_usage (type=0x7ffff5b5fb28, 
    context_die=0x7ffff5b6c780, usage=DINFO_USAGE_DIR_USE)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18960
#11 0x000000000062bfc8 in gen_type_die (type=0x7ffff5b5fb28, 
    context_die=0x7ffff5b6c780)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18999
#12 0x000000000060960d in modified_type_die (type=0x7ffff5b5fb28, 
    is_const_type=0, is_volatile_type=0, context_die=0x7ffff5b6c780)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:9835
#13 0x000000000061f7de in add_type_attribute (object_die=0x7ffff5b6c7d0, 
    type=0x7ffff5b5fb28, decl_const=0, decl_volatile=0, 
    context_die=0x7ffff5b6c780)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16136
#14 0x000000000062946d in gen_inheritance_die (binfo=0x7ffff5b650c0, 
    access=0x7ffff5a2b528, context_die=0x7ffff5b6c780)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18464
...

I think it happens because we very likely merge the two types
named 'iterator' (_Deque_base::iterator and deque::iterator).
Which is because gimple.c:compare_type_names_p simply looks
through the TYPE_DECLs to the IDENTIFIER_NODEs.  It probably
should compare the DECL_CONTEXT of the TYPE_DECLs as well
(but if they are a TREE_TYPE that creates new members of the
SCC we have to visit ...)

Fixing that fixes this bug.


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

* [Bug debug/51567] [4.7 Regression] ICE in splice_child_die, at dwarf2out.c:5009 with -flto -g
  2011-12-15 14:16 [Bug debug/51567] New: [4.7 Regression] ICE in splice_child_die, at dwarf2out.c:5009 with -flto -g rguenth at gcc dot gnu.org
  2011-12-15 14:42 ` [Bug debug/51567] " rguenth at gcc dot gnu.org
  2011-12-15 14:46 ` rguenth at gcc dot gnu.org
@ 2011-12-15 16:39 ` rguenth at gcc dot gnu.org
  2011-12-15 16:39 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-15 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-15 16:38:16 UTC ---
Author: rguenth
Date: Thu Dec 15 16:38:08 2011
New Revision: 182377

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182377
Log:
2011-12-15  Richard Guenther  <rguenther@suse.de>

    PR lto/51567
    * gimple.c (compare_type_names_p): Also compare the TREE_CODE.
    (iterative_hash_name): Also hash the TREE_CODE.
    (gimple_types_compatible_p_1): For types with a TYPE_DECL
    name and a type DECL_CONTEXT recurse to that type.
    (iterative_hash_gimple_type): Likewise.

    * g++.dg/lto/pr51567-1_0.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/lto/pr51567-1_0.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimple.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug debug/51567] [4.7 Regression] ICE in splice_child_die, at dwarf2out.c:5009 with -flto -g
  2011-12-15 14:16 [Bug debug/51567] New: [4.7 Regression] ICE in splice_child_die, at dwarf2out.c:5009 with -flto -g rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-12-15 16:39 ` rguenth at gcc dot gnu.org
@ 2011-12-15 16:39 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-15 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-15 16:38:30 UTC ---
Fixed.


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

end of thread, other threads:[~2011-12-15 16:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-15 14:16 [Bug debug/51567] New: [4.7 Regression] ICE in splice_child_die, at dwarf2out.c:5009 with -flto -g rguenth at gcc dot gnu.org
2011-12-15 14:42 ` [Bug debug/51567] " rguenth at gcc dot gnu.org
2011-12-15 14:46 ` rguenth at gcc dot gnu.org
2011-12-15 16:39 ` rguenth at gcc dot gnu.org
2011-12-15 16:39 ` 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).