[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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).
[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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.0 +0200 +++ gcc/dwarf2out.c 2011-10-10 13:56:09.0 +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)))
[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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 |---
[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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.
[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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.
[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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.
[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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
[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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.
[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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 Fint::C. The instantiated Fint::C a typedef. No anonymous struct is generated inside Fint. What is generated is really the same as for: templatetypename T class F { struct C {int i}; C a; }; Fint 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.
[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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 Fint::C. The instantiated Fint::C a typedef. No anonymous struct is generated inside Fint. What is generated is really the same as for: templatetypename T class F { struct C {int i}; C a; }; Fint 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?
[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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; }; Fint f; - 12d: Abbrev Number: 2 (DW_TAG_class_type) 2e DW_AT_name: (indirect string, offset: 0x37): Fint 239: Abbrev Number: 3 (DW_TAG_structure_type) 3a DW_AT_name: C and DW_TAG_typedef gets completely lost in such case.
[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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.
[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef
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