[Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
--- Comment #9 from dodji at gcc dot gnu dot org 2010-06-06 18:33 --- Hopefully properly fixed in trunk (4.6) now. -- dodji at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
[Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
--- Comment #8 from dodji at gcc dot gnu dot org 2010-06-06 18:24 --- Subject: Bug 44188 Author: dodji Date: Sun Jun 6 18:24:27 2010 New Revision: 160347 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160347 Log: Fix PR c++/44188 gcc/ChangeLog: PR c++/44188 * c-common.c (is_typedef_decl): Move this definition ... * tree.c (is_typedef_decl): ... here. (typdef_variant_p): Move definition here from gcc/cp/tree.c. * c-common.h (is_typedef_decl): Move this declaration ... * tree.h (is_typedef_decl): ... here. (typedef_variant_p): Move declaration here from gcc/cp/cp-tree.h * dwarf2out.c (is_naming_typedef_decl): New function. (gen_tagged_type_die): Split out of ... (gen_type_die_with_usage): ... this function. When an anonymous tagged type is named by a typedef, make sure a DW_TAG_typedef DIE is emitted for the typedef. (gen_typedef_die): Emit DW_TAG_typedef also for typedefs naming anonymous tagged types. gcc/cp/ChangeLog: PR c++/44188 * cp-tree.h (typedef_variant_p): Move this declaration to gcc/tree.h. * tree.c (typedef_variant_p): Move this definition to gcc/tree.c. * decl.c (grokdeclarator): Do not rename debug info of an anonymous tagged type named by a typedef. gcc/testsuite/ChangeLog: PR c++/44188 * g++.dg/debug/dwarf2/typedef3.C: New test. Added: trunk/gcc/testsuite/g++.dg/debug/dwarf2/typedef3.C Modified: trunk/gcc/ChangeLog trunk/gcc/c-family/c-common.c trunk/gcc/c-family/c-common.h trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/decl.c trunk/gcc/cp/tree.c trunk/gcc/dwarf2out.c trunk/gcc/testsuite/ChangeLog trunk/gcc/tree.c trunk/gcc/tree.h -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
[Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
-- dodji at gcc dot gnu dot org changed: What|Removed |Added Status|REOPENED|ASSIGNED Last reconfirmed|2010-05-18 21:50:32 |2010-06-05 20:03:35 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
[Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
--- Comment #7 from dodji at gcc dot gnu dot org 2010-06-05 20:03 --- So I posted an updated patch for this to http://gcc.gnu.org/ml/gcc-patches/2010-06/msg00437.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
[Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
--- Comment #6 from dodji at gcc dot gnu dot org 2010-05-28 00:08 --- Re-opening as my patch broke Ada and Obj-c(++). It looks like Ada emits TYPE_DECLs that smell like c/c++ naming typedefs but with different semantics ... -- dodji at gcc dot gnu dot org changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
[Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
--- Comment #5 from dodji at gcc dot gnu dot org 2010-05-28 00:03 --- Subject: Bug 44188 Author: dodji Date: Fri May 28 00:03:19 2010 New Revision: 159955 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159955 Log: Revert "Fix PR c++/44188" gcc/ChangeLog: revert fix for PR c++/44188 * c-common.c (is_typedef_decl): Revert the moving of this definition ... * tree.c (is_typedef_decl): ... here. (typdef_variant_p): Revert the moving of this definition here from gcc/cp/tree.c. * c-common.h (is_typedef_decl): Revert the moving of this declaration ... * tree.h (is_typedef_decl): ... here. (typedef_variant_p): Revert the moving of this declaration here from gcc/cp/cp-tree.h * dwarf2out.c (is_naming_typedef_decl): Revert this new function. (gen_tagged_type_die): Revert the splitting out of ... (gen_type_die_with_usage): ... this function. Revert the anonymous tagged type handling. (gen_typedef_die): Revert emitting DW_TAG_typedef for typedefs naming anonymous tagged types. gcc/cp/ChangeLog: Revert fix of PR c++/44188 * cp-tree.h (typedef_variant_p): Revert moving this declaration to gcc/tree.h. * tree.c (typedef_variant_p): Revert moving this definition to gcc/tree.c. * decl.c (grokdeclarator): Revert naming typedef handling. gcc/testsuite/ChangeLog: Revert fix for PR c++/44188 * g++.dg/debug/dwarf2/typedef3.C: Revert new test. Removed: trunk/gcc/testsuite/g++.dg/debug/dwarf2/typedef3.C Modified: trunk/gcc/ChangeLog trunk/gcc/c-common.c trunk/gcc/c-common.h trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/decl.c trunk/gcc/cp/tree.c trunk/gcc/dwarf2out.c trunk/gcc/testsuite/ChangeLog trunk/gcc/tree.c trunk/gcc/tree.h -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
[Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
--- Comment #4 from jakub at gcc dot gnu dot org 2010-05-27 20:50 --- Not 100% sure yet, but I believe this commit broke bootstrap on both x86_64-linux and i686-linux, e.g. in libobjc or in ada bits. One of the ICEs I'm seeing is: #0 fancy_abort (file=0x8d1d1e3 "../../gcc/dwarf2out.c", line=16990, function=0x8d21b15 "add_byte_size_attribute") at ../../gcc/diagnostic.c:782 #1 0x0823486f in add_byte_size_attribute (die=0xf7d76a20, tree_node=) at ../../gcc/dwarf2out.c:16990 #2 0x082568d3 in gen_struct_or_union_type_die (type=0xf7d52cc0, context_die=0xf7d633f0, usage=) at ../../gcc/dwarf2out.c:19329 #3 gen_tagged_type_die (type=0xf7d52cc0, context_die=0xf7d633f0, usage=) at ../../gcc/dwarf2out.c:19502 #4 0x08257e9a in gen_typedef_die (decl=0xf7d600d8, context_die=0xf7d633f0) at ../../gcc/dwarf2out.c:19430 #5 0x08255a59 in gen_decl_die (decl=0xf7d600d8, origin=, context_die=0xf7d633f0) at ../../gcc/dwarf2out.c:20186 gen_typedef_die is called on: unit size align 32 symtab -136878016 alias set -1 canonical type 0xf7d52c00 fields pointer_to_this chain > asm_written unsigned SI size unit size align 32 symtab -136877536 alias set -1 canonical type 0xf7d52cc0> asm_written VOID file /usr/src/gcc/libobjc/objc/objc.h line 72 col 4 align 1> Given the comments, I wonder if: --- dwarf2out.c.jj3 2010-05-27 21:48:57.0 +0200 +++ dwarf2out.c 2010-05-27 22:50:22.0 +0200 @@ -19427,7 +19427,9 @@ gen_typedef_die (tree decl, dw_die_ref c generate that DIE right away. add_type_attribute called below will then pick (via lookup_type_die) that anonymous struct DIE. */ - gen_tagged_type_die (type, context_die, DINFO_USAGE_DIR_USE); + if (RECORD_OR_UNION_TYPE_P (type) + || TREE_CODE (type) == ENUMERAL_TYPE) + gen_tagged_type_die (type, context_die, DINFO_USAGE_DIR_USE); } add_type_attribute (type_die, type, TREE_READONLY (decl), isn't intended, calling gen_tagged_type_die on a POINTER_TYPE is weird. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
[Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
--- Comment #3 from dodji at gcc dot gnu dot org 2010-05-27 19:36 --- Fixed in trunk (4.6). -- dodji at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED Target Milestone|--- |4.6.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
[Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
--- Comment #2 from dodji at gcc dot gnu dot org 2010-05-27 19:30 --- Subject: Bug 44188 Author: dodji Date: Thu May 27 19:29:53 2010 New Revision: 159943 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159943 Log: Fix PR c++/44188 gcc/ChangeLog: PR c++/44188 * c-common.c (is_typedef_decl): Move this definition ... * tree.c (is_typedef_decl): ... here. (typdef_variant_p): Move definition here from gcc/cp/tree.c. * c-common.h (is_typedef_decl): Move this declaration ... * tree.h (is_typedef_decl): ... here. (typedef_variant_p): Move declaration here from gcc/cp/cp-tree.h * dwarf2out.c (is_naming_typedef_decl): New function. (gen_tagged_type_die): Split out of ... (gen_type_die_with_usage): ... this function. When an anonymous tagged type is named by a typedef, make sure a DW_TAG_typedef DIE is emitted for the typedef. (gen_typedef_die): Emit DW_TAG_typedef also for typedefs naming anonymous tagged types. gcc/cp/ChangeLog: PR c++/44188 * cp-tree.h (typedef_variant_p): Move this declaration to gcc/tree.h. * tree.c (typedef_variant_p): Move this definition to gcc/tree.c. * decl.c (grokdeclarator): Do not rename debug info of an anonymous tagged type named by a typedef. gcc/testsuite/ChangeLog: PR c++/44188 * g++.dg/debug/dwarf2/typedef3.C: New test. Added: trunk/gcc/testsuite/g++.dg/debug/dwarf2/typedef3.C Modified: trunk/gcc/ChangeLog trunk/gcc/c-common.c trunk/gcc/c-common.h trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/decl.c trunk/gcc/cp/tree.c trunk/gcc/dwarf2out.c trunk/gcc/testsuite/ChangeLog trunk/gcc/tree.c trunk/gcc/tree.h -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
[Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
--- Comment #1 from dodji at gcc dot gnu dot org 2010-05-20 11:06 --- A patch has been proposed to http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01476.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
[Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
-- dodji at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |dodji at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2010-05-18 21:50:32 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188