diff mbox

Do not ICE with -fdump-ipa-cgraph when building firefox

Message ID 20160119111735.GA5273@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka Jan. 19, 2016, 11:17 a.m. UTC
Hi,
cgraph dumpnow segfaults as we have symbols without DECL_NAME set.  This patch makes
us to print node by asm name or as <unamed>  if everything fails.

Honza

	* symtab.c (symtab_node::asm_name): Do not call printable name directly.
	(symtab_node::name): Report name as unnamed if DECL_NAME is not set.
diff mbox

Patch

Index: symtab.c
===================================================================
--- symtab.c	(revision 232466)
+++ symtab.c	(working copy)
@@ -504,7 +513,7 @@  const char *
 symtab_node::asm_name () const
 {
   if (!DECL_ASSEMBLER_NAME_SET_P (decl))
-    return lang_hooks.decl_printable_name (decl, 2);
+    return name ();
   return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
 }
 
@@ -513,6 +522,13 @@  symtab_node::asm_name () const
 const char *
 symtab_node::name () const
 {
+  if (!DECL_NAME (decl))
+    {
+      if (DECL_ASSEMBLER_NAME_SET_P (decl))
+	return asm_name ();
+      else
+        return "<unnamed>";
+    }
   return lang_hooks.decl_printable_name (decl, 2);
 }