This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 May 2010 20:50:47 -0000
- Subject: [Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
- References: <bug-44188-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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=<value
optimized out>) at ../../gcc/dwarf2out.c:16990
#2 0x082568d3 in gen_struct_or_union_type_die (type=0xf7d52cc0,
context_die=0xf7d633f0, usage=<value optimized out>)
at ../../gcc/dwarf2out.c:19329
#3 gen_tagged_type_die (type=0xf7d52cc0, context_die=0xf7d633f0, usage=<value
optimized out>) 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=<value optimized out>,
context_die=0xf7d633f0) at ../../gcc/dwarf2out.c:20186
gen_typedef_die is called on:
<type_decl 0xf7d600d8 id
type <pointer_type 0xf7d52cc0 id
type <record_type 0xf7d52c00 objc_object asm_written type_0 SI
size <integer_cst 0xf7ce8258 constant 32>
unit size <integer_cst 0xf7ce8090 constant 4>
align 32 symtab -136878016 alias set -1 canonical type 0xf7d52c00
fields <field_decl 0xf7d62a6c class_pointer>
pointer_to_this <pointer_type 0xf7d52cc0 id> chain <type_decl
0xf7d60000 D.1196>>
asm_written unsigned SI size <integer_cst 0xf7ce8258 32> unit size
<integer_cst 0xf7ce8090 4>
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.000000000 +0200
+++ dwarf2out.c 2010-05-27 22:50:22.000000000 +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