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

--- Comment #4 from Markus Trippelsdorf <markus at trippelsdorf dot de> 
2011-12-22 12:51:08 UTC ---
(In reply to comment #3)
> In non-LTO mode we create the DIE for 'C' (which we do not create at all
> with -flto) via
> 
> #3  0x0000000000d54c57 in rest_of_type_compilation (type=0x7ffff5b8f3f0, 
>     toplev=1) at /space/rguenther/src/svn/trunk/gcc/passes.c:238
> 238       debug_hooks->type_decl (TYPE_STUB_DECL (type), !toplev);
> 
> we do not do something equivalent for LTO (but LTO expects to have those
> DIEs created lazily ...).  But dwarf2out isn't prepared to deal with
> this situation it seems :/
> 
> I'm not sure we want to add corresponding debug_hooks calls to the LTO
> machinery, but if, then one place to do that would be here:
> 
> Index: gcc/lto/lto.c
> ===================================================================
> --- gcc/lto/lto.c       (revision 182617)
> +++ gcc/lto/lto.c       (working copy)
> @@ -881,6 +881,8 @@ uniquify_nodes (struct data_in *data_in,
>         lto_register_var_decl_in_symtab (data_in, t);
>        else if (TREE_CODE (t) == FUNCTION_DECL && !DECL_BUILT_IN (t))
>         lto_register_function_decl_in_symtab (data_in, t);
> +      else if (!flag_wpa && TREE_CODE (t) == TYPE_DECL)
> +       debug_hooks->type_decl (t, DECL_FILE_SCOPE_P (t));
>        else if (TYPE_P (t) && !TYPE_CANONICAL (t))
>         TYPE_CANONICAL (t) = gimple_register_canonical_type (t);
>      }
> 
> but I'm not sure we won't confuse dwarf2out.c with the order we are
> calling type_decl () either (might be we start with T, and then the
> one for its context C).  The above patch fixes the reduced testcase at
> least.
> 
> Markus, can you give it a shot?

libxul still fails to build with the same error message (but there is only
one instance of this ICE now instead of three before your patch). 
Reducing...

Reply via email to