[Bug lto/51635] [4.7 regression] ICE in in dwarf2out_finish, at dwarf2out.c:22494 when building Firefox's libxul

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 20 14:42:00 GMT 2011


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

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-20 14:16:35 UTC ---
It's actually easy to do.  We just have to make sure that the TYPE_DECLs we
refer to are those of their type.  Thus,

Index: gcc/lto/lto.c
===================================================================
--- gcc/lto/lto.c       (revision 182525)
+++ gcc/lto/lto.c       (working copy)
@@ -867,7 +867,11 @@ uniquify_nodes (struct data_in *data_in,
       if (t == NULL_TREE)
        continue;

-      if (TREE_CODE (t) == VAR_DECL)
+      if (TYPE_P (t)
+         && TYPE_NAME (t)
+         && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL)
+       TYPE_NAME (t) = TYPE_NAME (TREE_TYPE (TYPE_NAME (t)));
+      else if (TREE_CODE (t) == VAR_DECL)
        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);



More information about the Gcc-bugs mailing list