public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef
@ 2011-01-28 11:42 dodji at gcc dot gnu.org
  2011-01-28 12:01 ` [Bug debug/47510] " dodji at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-01-28 11:42 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: DW_TAG_typedef can have children when designating a
                    naming typedef
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: dodji@gcc.gnu.org
        ReportedBy: dodji@gcc.gnu.org


Consider this test case:

    class C {
    public:
      C() {}
      ~C() {}
    };
    typedef struct {
      C m;
    } t;
    typedef t s;
    s v;

The DW_TAG_typedef DIE describing the typedef t has children DIEs. The
children DIEs are actually the DIEs representing the members of the
anonymous structure named by T.

What is happening is, since gen_typedef_die equates the anonymous
struct named by the typedef t with the DIE of the naming typedef,
get_context_die called with the type tree of the anonymous typedef
yields the DIE of the typedef.


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
@ 2011-01-28 12:01 ` dodji at gcc dot gnu.org
  2011-01-28 17:02 ` dodji at gcc dot gnu.org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-01-28 12:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-01-28 11:13:51 UTC ---
Created attachment 23149
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23149
Candidate patch

I am bootstrapping this patch at the moment.


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
  2011-01-28 12:01 ` [Bug debug/47510] " dodji at gcc dot gnu.org
@ 2011-01-28 17:02 ` dodji at gcc dot gnu.org
  2011-02-03 15:21 ` jan.kratochvil at redhat dot com
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-01-28 17:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-01-28 16:13:07 UTC ---
Patch posted to http://gcc.gnu.org/ml/gcc-patches/2011-01/msg02118.html


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
  2011-01-28 12:01 ` [Bug debug/47510] " dodji at gcc dot gnu.org
  2011-01-28 17:02 ` dodji at gcc dot gnu.org
@ 2011-02-03 15:21 ` jan.kratochvil at redhat dot com
  2011-03-14 21:03 ` dodji at gcc dot gnu.org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-02-03 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-02-03 15:21:02 UTC ---
g++ (GCC) 4.6.0 20110203 (experimental) with the Comment 2 patch

template <typename T>
class F {
  typedef struct { int i; } C;
  C a;
};
F<int> f;

->

 <1><2d>: Abbrev Number: 2 (DW_TAG_class_type)
    <2e>   DW_AT_name        : (indirect string, offset: 0x37): F<int>  
 <2><39>: Abbrev Number: 3 (DW_TAG_structure_type)
    <3a>   DW_AT_name        : C        

and DW_TAG_typedef gets completely lost in such case.


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-02-03 15:21 ` jan.kratochvil at redhat dot com
@ 2011-03-14 21:03 ` dodji at gcc dot gnu.org
  2011-03-15 16:29 ` rguenth at gcc dot gnu.org
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-03-14 21:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-03-14 21:03:35 UTC ---
This is because G++ generates struct F<int>::C.  The instantiated
F<int>::C a typedef.  No anonymous struct is generated inside F<int>.
What is generated is really the same as for:

template<typename T>
class F
{
  struct C {int i};
  C a;
};
F<int> f;

I guess we could try hard to trick the dwarf emitter into describing
debug information for a typedef and an anonymous code that is actually
not generated (instantiated), but would that be really worth it?


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-03-14 21:03 ` dodji at gcc dot gnu.org
@ 2011-03-15 16:29 ` rguenth at gcc dot gnu.org
  2011-03-16 10:25 ` dodji at gcc dot gnu.org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-15 16:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-15 16:24:27 UTC ---
(In reply to comment #4)
> This is because G++ generates struct F<int>::C.  The instantiated
> F<int>::C a typedef.  No anonymous struct is generated inside F<int>.
> What is generated is really the same as for:
> 
> template<typename T>
> class F
> {
>   struct C {int i};
>   C a;
> };
> F<int> f;
> 
> I guess we could try hard to trick the dwarf emitter into describing
> debug information for a typedef and an anonymous code that is actually
> not generated (instantiated), but would that be really worth it?

See also PR47939.  Yes, debug info consumers expect typedefs to be available
if they are used in source.


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-03-15 16:29 ` rguenth at gcc dot gnu.org
@ 2011-03-16 10:25 ` dodji at gcc dot gnu.org
  2011-03-16 20:19 ` [Bug debug/47510] [4.6/4.7 Regression] " dodji at gcc dot gnu.org
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-03-16 10:25 UTC (permalink / raw)
  To: gcc-bugs

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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

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

--- Comment #6 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-03-16 10:14:42 UTC ---
> See also PR47939.  Yes, debug info consumers expect typedefs to be available
> if they are used in source.

I'll try again a little bit :-)

I think for templates the situation is a little bit different from
non-templates cases like PR47939.  Generally speaking we emit close to
no debug info for template *definitions*.  We emit debug info for
template instantiations.

As the instantiation doesn't contain the typedef (because
[dcl.typedef/8] says that the typedef actually names the anonymous
struct, so it is valid that the lookup of C yields a struct named C) I
find it acceptable to emit the debug info that is emitted now.

Now a possible way to go would be to change the output of the
instantiation; i.e make G++ generate the typedef and the anonymous type.
Just like what is done in the non-template case.  If this is agreed upon
by the C++ maintainers then I guess it could be a separate patch that
would go in after the one I am proposing at
http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00781.html


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

* [Bug debug/47510] [4.6/4.7 Regression] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-03-16 10:25 ` dodji at gcc dot gnu.org
@ 2011-03-16 20:19 ` dodji at gcc dot gnu.org
  2011-03-16 21:11 ` dodji at gcc dot gnu.org
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-03-16 20:19 UTC (permalink / raw)
  To: gcc-bugs

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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0
            Summary|DW_TAG_typedef can have     |[4.6/4.7 Regression]
                   |children when designating a |DW_TAG_typedef can have
                   |naming typedef              |children when designating a
                   |                            |naming typedef


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

* [Bug debug/47510] [4.6/4.7 Regression] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-03-16 20:19 ` [Bug debug/47510] [4.6/4.7 Regression] " dodji at gcc dot gnu.org
@ 2011-03-16 21:11 ` dodji at gcc dot gnu.org
  2011-03-16 21:19 ` dodji at gcc dot gnu.org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-03-16 21:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-03-16 21:05:03 UTC ---
Author: dodji
Date: Wed Mar 16 21:04:58 2011
New Revision: 171073

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171073
Log:
PR debug/47510

gcc/

    PR debug/47510
    * dwarf2out.c (strip_naming_typedef): Factorize out of ...
    (lookup_type_die_strip_naming_typedef): ... here.
    (get_context_die): Use it.
    (gen_typedef_die): Add a DW_AT_{,MIPS_}linkage_name attribute to
    the anonymous struct named by the naming typedef.

gcc/testsuite/

        PR debug/47510
    * g++.dg/debug/dwarf2/typedef6.C: New test.

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


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

* [Bug debug/47510] [4.6/4.7 Regression] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2011-03-16 21:11 ` dodji at gcc dot gnu.org
@ 2011-03-16 21:19 ` dodji at gcc dot gnu.org
  2011-03-16 21:33 ` [Bug debug/47510] " dodji at gcc dot gnu.org
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-03-16 21:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-03-16 21:11:19 UTC ---
Author: dodji
Date: Wed Mar 16 21:11:17 2011
New Revision: 171074

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171074
Log:
PR debug/47510

gcc/

    PR debug/47510
    * dwarf2out.c (strip_naming_typedef): Factorize out of ...
    (lookup_type_die_strip_naming_typedef): ... here.
    (get_context_die): Use it.
    (gen_typedef_die): Add a DW_AT_{,MIPS_}linkage_name attribute to
    the anonymous struct named by the naming typedef.

gcc/testsuite/

    PR debug/47510
    * g++.dg/debug/dwarf2/typedef6.C: New test.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/debug/dwarf2/typedef6.C
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/dwarf2out.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2011-03-16 21:19 ` dodji at gcc dot gnu.org
@ 2011-03-16 21:33 ` dodji at gcc dot gnu.org
  2011-03-17 11:34 ` [Bug debug/47510] [4.6 Regression] " dodji at gcc dot gnu.org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-03-16 21:33 UTC (permalink / raw)
  To: gcc-bugs

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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.03.16 21:30:27
            Summary|[4.6/4.7 Regression]        |DW_TAG_typedef can have
                   |DW_TAG_typedef can have     |children when designating a
                   |children when designating a |naming typedef
                   |naming typedef              |
     Ever Confirmed|0                           |1

--- Comment #9 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-03-16 21:30:27 UTC ---
The initial issue has been fixed in trunk (4.7) and 4.6 so far.  There
are two tangent issues that remain, though.  One is the template
related case raised by Jan in comment #3, and the other one is that
constructors of the anonymous struct are named t.  They should also be
anonymous and have DW_AT_linkage_name set to t.  This is from a
comment Jason made at
http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00926.html.  So I am
keeping this bug open to track these.  I will maybe open separate bugs
for these issues at some point.


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

* [Bug debug/47510] [4.6 Regression] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2011-03-16 21:33 ` [Bug debug/47510] " dodji at gcc dot gnu.org
@ 2011-03-17 11:34 ` dodji at gcc dot gnu.org
  2011-03-17 16:53 ` dodji at gcc dot gnu.org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-03-17 11:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-03-17 10:36:01 UTC ---
I have reverted the patch from 4.6 for now because I have apparently committed
a bit too quickly.


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

* [Bug debug/47510] [4.6 Regression] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2011-03-17 11:34 ` [Bug debug/47510] [4.6 Regression] " dodji at gcc dot gnu.org
@ 2011-03-17 16:53 ` dodji at gcc dot gnu.org
  2011-03-25 19:57 ` [Bug debug/47510] " jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-03-17 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-03-17 16:41:24 UTC ---
Author: dodji
Date: Thu Mar 17 16:41:05 2011
New Revision: 171105

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171105
Log:
PR debug/47510

gcc/

    PR debug/47510
    * dwarf2out.c (strip_naming_typedef): Factorize out of ...
    (lookup_type_die_strip_naming_typedef): ... here.
    (get_context_die): Use it.
    (gen_typedef_die): Add a DW_AT_{,MIPS_}linkage_name attribute to
    the anonymous struct named by the naming typedef.

gcc/testsuite/

    PR debug/47510
    * g++.dg/debug/dwarf2/typedef6.C: New test.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/debug/dwarf2/typedef6.C
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/dwarf2out.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2011-03-17 16:53 ` dodji at gcc dot gnu.org
@ 2011-03-25 19:57 ` jakub at gcc dot gnu.org
  2011-04-14  8:14 ` dodji at gcc dot gnu.org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-25 19:57 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.0                       |4.6.1

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-25 19:52:28 UTC ---
GCC 4.6.0 is being released, adjusting target milestone.


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2011-03-25 19:57 ` [Bug debug/47510] " jakub at gcc dot gnu.org
@ 2011-04-14  8:14 ` dodji at gcc dot gnu.org
  2011-04-14  8:28 ` jan.kratochvil at redhat dot com
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-04-14  8:14 UTC (permalink / raw)
  To: gcc-bugs

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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
         AssignedTo|dodji at gcc dot gnu.org    |unassigned at gcc dot
                   |                            |gnu.org

--- Comment #13 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-04-14 08:14:01 UTC ---
Unassigning myself as the initial bug is fixed in 4.6.


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2011-04-14  8:14 ` dodji at gcc dot gnu.org
@ 2011-04-14  8:28 ` jan.kratochvil at redhat dot com
  2011-04-28 16:19 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-04-14  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-04-14 08:27:46 UTC ---
Comment 3 has been filed as new PR debug/48603.


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2011-04-14  8:28 ` jan.kratochvil at redhat dot com
@ 2011-04-28 16:19 ` rguenth at gcc dot gnu.org
  2011-10-10 13:48 ` daniel_beichl at gmx dot net
  2012-03-04 18:31 ` eu at doxos dot eu
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-28 16:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.1                       |---


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2011-04-28 16:19 ` rguenth at gcc dot gnu.org
@ 2011-10-10 13:48 ` daniel_beichl at gmx dot net
  2012-03-04 18:31 ` eu at doxos dot eu
  17 siblings, 0 replies; 19+ messages in thread
From: daniel_beichl at gmx dot net @ 2011-10-10 13:48 UTC (permalink / raw)
  To: gcc-bugs

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

dbeichl <daniel_beichl at gmx dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel_beichl at gmx dot
                   |                            |net

--- Comment #15 from dbeichl <daniel_beichl at gmx dot net> 2011-10-10 13:47:15 UTC ---
The same thing can happen for unions in c++11. Consider the following:

struct some_struct
{
  some_struct() = default;
  some_struct(int v) {}
};

typedef union {
    int x;
    some_struct y;
} a_union_t;

a_union_t z;

This creates a DW_TAG_typedef with children. I propose to extend the
candidate patch to unions:

--- gcc/dwarf2out.c 2011-09-15 12:16:36.000000000 +0200
+++ gcc/dwarf2out.c 2011-10-10 13:56:09.000000000 +0200
@@ -8106,7 +8106,7 @@
 strip_naming_typedef (tree type, dw_die_ref type_die)
 {
   if (type
-      && TREE_CODE (type) == RECORD_TYPE
+      && ( TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE )
       && type_die
       && type_die->die_tag == DW_TAG_typedef
       && is_naming_typedef_decl (TYPE_NAME (type)))


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

* [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
  2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2011-10-10 13:48 ` daniel_beichl at gmx dot net
@ 2012-03-04 18:31 ` eu at doxos dot eu
  17 siblings, 0 replies; 19+ messages in thread
From: eu at doxos dot eu @ 2012-03-04 18:31 UTC (permalink / raw)
  To: gcc-bugs

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

Václav Šmilauer <eu at doxos dot eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eu at doxos dot eu

--- Comment #16 from Václav Šmilauer <eu at doxos dot eu> 2012-03-04 18:30:15 UTC ---
(In reply to comment #15)
> The same thing can happen for unions in c++11.
I am being hit by this bug in c++11, though I am not able to follow the whole
discussion. Can I get a concise summary on what kind of construct triggers the
problem so that I can work it around in my code? Stucts with default ctors
within unions? Thanks!

(Compiling gcc snapshot from 28/2/2012 now to see if it is still an issue).


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

end of thread, other threads:[~2012-03-04 18:31 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-28 11:42 [Bug debug/47510] New: DW_TAG_typedef can have children when designating a naming typedef dodji at gcc dot gnu.org
2011-01-28 12:01 ` [Bug debug/47510] " dodji at gcc dot gnu.org
2011-01-28 17:02 ` dodji at gcc dot gnu.org
2011-02-03 15:21 ` jan.kratochvil at redhat dot com
2011-03-14 21:03 ` dodji at gcc dot gnu.org
2011-03-15 16:29 ` rguenth at gcc dot gnu.org
2011-03-16 10:25 ` dodji at gcc dot gnu.org
2011-03-16 20:19 ` [Bug debug/47510] [4.6/4.7 Regression] " dodji at gcc dot gnu.org
2011-03-16 21:11 ` dodji at gcc dot gnu.org
2011-03-16 21:19 ` dodji at gcc dot gnu.org
2011-03-16 21:33 ` [Bug debug/47510] " dodji at gcc dot gnu.org
2011-03-17 11:34 ` [Bug debug/47510] [4.6 Regression] " dodji at gcc dot gnu.org
2011-03-17 16:53 ` dodji at gcc dot gnu.org
2011-03-25 19:57 ` [Bug debug/47510] " jakub at gcc dot gnu.org
2011-04-14  8:14 ` dodji at gcc dot gnu.org
2011-04-14  8:28 ` jan.kratochvil at redhat dot com
2011-04-28 16:19 ` rguenth at gcc dot gnu.org
2011-10-10 13:48 ` daniel_beichl at gmx dot net
2012-03-04 18:31 ` eu at doxos dot eu

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).