diff mbox

Fix ICE in lto-symtab

Message ID 20160119112202.GC5273@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka Jan. 19, 2016, 11:22 a.m. UTC
Hi,
this patch fixes ICE with abstract decls.  Those need not to be linked.

Bootstrapped/regtested x86_64-linux, will commit it shortly.

Honza

	* lto-symtab.c (lto_symtab_prevailing_virtual_decl): Abstract
	decls have no assemblernames.
	* g++.dg/torture/pr69136.C: New testcase.
diff mbox

Patch

Index: lto/lto-symtab.c
===================================================================
--- lto/lto-symtab.c	(revision 232466)
+++ lto/lto-symtab.c	(working copy)
@@ -987,6 +1013,8 @@  lto_symtab_merge_symbols (void)
 tree
 lto_symtab_prevailing_virtual_decl (tree decl)
 {
+  if (DECL_ABSTRACT_P (decl))
+    return decl;
   gcc_checking_assert (!type_in_anonymous_namespace_p (DECL_CONTEXT (decl))
 		       && DECL_ASSEMBLER_NAME_SET_P (decl));
 
Index: testsuite/g++.dg/torture/pr69136.C
===================================================================
--- testsuite/g++.dg/torture/pr69136.C	(revision 0)
+++ testsuite/g++.dg/torture/pr69136.C	(revision 0)
@@ -0,0 +1,6 @@ 
+// { dg-do compile }
+class GrBufferAllocPool {
+  virtual ~GrBufferAllocPool();
+};
+GrBufferAllocPool::~GrBufferAllocPool() { static long a; }
+