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.
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; }
+

Reply via email to