This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/51650] [4.7 regression] LTO ICE in dwarf2out_finish, at dwarf2out.c:22501 while building libxul
- From: "markus at trippelsdorf dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Dec 2011 13:56:55 +0000
- Subject: [Bug debug/51650] [4.7 regression] LTO ICE in dwarf2out_finish, at dwarf2out.c:22501 while building libxul
- Auto-submitted: auto-generated
- References: <bug-51650-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51650
--- Comment #20 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2011-12-23 13:56:55 UTC ---
(In reply to comment #19)
> A workaround for ICEs of this form is
>
> Index: gcc/dwarf2out.c
> ===================================================================
> --- gcc/dwarf2out.c (revision 182652)
> +++ gcc/dwarf2out.c (working copy)
> @@ -22496,15 +22496,23 @@ dwarf2out_finish (const char *filename)
> else if (TYPE_P (node->created_for))
> context = TYPE_CONTEXT (node->created_for);
>
> - gcc_assert (context
> - && (TREE_CODE (context) == FUNCTION_DECL
> - || TREE_CODE (context) == NAMESPACE_DECL));
> + if (!(context
> + && (TREE_CODE (context) == FUNCTION_DECL
> + || TREE_CODE (context) == NAMESPACE_DECL)))
> + {
> + if (!in_lto_p)
> + gcc_unreachable ();
>
> - origin = lookup_decl_die (context);
> - if (origin)
> - add_child_die (origin, die);
> + add_child_die (comp_unit_die (), die);
> + }
> else
> - add_child_die (comp_unit_die (), die);
> + {
> + origin = lookup_decl_die (context);
> + if (origin)
> + add_child_die (origin, die);
> + else
> + add_child_die (comp_unit_die (), die);
> + }
> }
> }
> }
>
> just in case you want to look further ;)
Fortunately it seems that this bug was the last issue that needed to be fixed.
Firefox now builds fine with -lto and -g.