re PR c++/61811 (Firefox LTO build error due to undefined symbols)
authorJason Merrill <jason@redhat.com>
Tue, 15 Jul 2014 21:38:48 +0000 (17:38 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 15 Jul 2014 21:38:48 +0000 (17:38 -0400)
PR c++/61811
* decl2.c (maybe_emit_vtables): Return true for -fuse-all-virtuals.

From-SVN: r212576

gcc/cp/ChangeLog
gcc/cp/decl2.c

index 1d5b7d6423c40dc86aa8d22481de746fb79b5b7e..231b315321cb431808f0af079d57851199bb154c 100644 (file)
@@ -1,5 +1,8 @@
 2014-07-15  Jason Merrill  <jason@redhat.com>
 
+       PR c++/61811
+       * decl2.c (maybe_emit_vtables): Return true for -fuse-all-virtuals.
+
        PR c++/60848
        PR c++/61723
        * call.c (is_std_init_list): Don't check CLASSTYPE_TEMPLATE_INFO.
index 0926dbc60fcdb4854edafeabf83ad4d556117a77..83a07e64d72dd79be97b847f0351dbb7ab658ec4 100644 (file)
@@ -2014,11 +2014,15 @@ maybe_emit_vtables (tree ctype)
       if (DECL_COMDAT (primary_vtbl)
          && CLASSTYPE_DEBUG_REQUESTED (ctype))
        note_debug_info_needed (ctype);
-      if (mark_all_virtuals)
-       /* Make sure virtual functions get instantiated/synthesized so that
-          they can be inlined after devirtualization even if the vtable is
-          never emitted.  */
-       mark_vtable_entries (primary_vtbl);
+      if (mark_all_virtuals && !DECL_ODR_USED (primary_vtbl))
+       {
+         /* Make sure virtual functions get instantiated/synthesized so that
+            they can be inlined after devirtualization even if the vtable is
+            never emitted.  */
+         mark_used (primary_vtbl);
+         mark_vtable_entries (primary_vtbl);
+         return true;
+       }
       return false;
     }