http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51635
--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-20
12:13:27 UTC ---
(gdb) call debug_tree (context)
<record_type 0x7ffff58bd7e0 nsSVGEffects asm_written QI
...
(gdb) call debug_tree (context->type_common.name)
<type_decl 0x7ffff58ad958 nsSVGEffects
type <record_type 0x7ffff58bd7e0 nsSVGEffects asm_written QI
...
public VOID file /tmp/test2.ii line 3256 col 17
align 8 context <translation_unit_decl 0x7ffff5a42f18 D.2349>>
(gdb) call lookup_type_die (context)
$1 = (struct die_struct *) 0x7ffff58fdd70
(gdb) call debug_tree (node->created_for)
<type_decl 0x7ffff58dc2e0 FramePropertyDescriptor
type <record_type 0x7ffff58bd9d8 FramePropertyDescriptor BLK
...
asm_written used nonlocal VOID file /tmp/test.ii line 2611 col 51
align 1 context <record_type 0x7ffff58bd7e0 nsSVGEffects>
so it's DECL_CONTEXT is a type from a different TU. And indeed in the
types TYPE_FIELDS we have
<type_decl 0x7ffff58ada10 nsSVGEffects
type <record_type 0x7ffff58bd7e0 nsSVGEffects asm_written QI
which is another instance of the TYPE_DECL. That asks for proper merging
of those TYPE_DECLs :(