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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-24 
14:21:57 UTC ---
In the cc1plus case the type for s is already output and we return in

static void
gen_type_die_with_usage (tree type, dw_die_ref context_die,
                         enum debug_info_usage usage)
{
...
  if (TREE_ASM_WRITTEN (type))
    return;

that isn't the case for lto1.

Called from cc1plus via

#4  0x00000000009e9d25 in dwarf2out_type_decl (decl=0x7ffff5b86450, local=0)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21985
21985       dwarf2out_decl (decl);
(gdb) 
#5  0x0000000000cd1e8c in rest_of_type_compilation (type=0x7ffff5b7f7e0, 
    toplev=1) at /space/rguenther/src/svn/trunk/gcc/passes.c:230
230       debug_hooks->type_decl (TYPE_STUB_DECL (type), !toplev);
(gdb) 
#6  0x000000000062c460 in finish_struct_1 (t=0x7ffff5b7f7e0)
    at /space/rguenther/src/svn/trunk/gcc/cp/class.c:5760
5760      rest_of_type_compilation (t, ! LOCAL_CLASS_P (t));

not doing that does not make us ICE the same way from cc1plus but we
are outputting the type then via the Dummy typedef instead.

The scope blocks look the same for cc1plus and lto1:

{ Scope block 0x7ffff5b42058#2 
  typedef struct Dummy Dummy; (unused)
  struct S s; (unused)

}

One difference is that cc1plus sees DECL_ORIGINAL_TYPE for the TYPE_DECL
while lto1 does not (it's not streamed), and thus is_typedef_decl will
always return false as well.

I have a patch.

Reply via email to