This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Do not try to set assembler name on unused FUNCTION_DECLs
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 29 Dec 2008 17:44:26 -0500
- Subject: [lto] Do not try to set assembler name on unused FUNCTION_DECLs
This was causing ICEs in ~20 libstdc++ tests.
Tested on x86_64.
Diego.
2008-12-29 Diego Novillo <dnovillo@google.com>
* tree.c (set_asm_name): Do not try to set the assembler
name for unused FUNCTION_DECLs.
Index: tree.c
===================================================================
--- tree.c (revision 142949)
+++ tree.c (working copy)
@@ -4008,7 +4008,9 @@ set_asm_name (void **slot, void *unused
&& (TREE_CODE (decl) != VAR_DECL
|| TREE_STATIC (decl)
|| TREE_PUBLIC (decl)
- || DECL_EXTERNAL (decl)))
+ || DECL_EXTERNAL (decl))
+ && (TREE_CODE (decl) != FUNCTION_DECL
+ || TREE_USED (decl)))
lang_hooks.set_decl_assembler_name (decl);
return 1;
}