Hi,
I am attaching correct patch.
The option is new only in a relative sense - it was added 5 years ago
with the orinal ODR warning infrastructure.  
We have -Wodr-type-merging that controls streming data needed for -Wodr
to work and -fno-devirtualize that controls streaming of BINFOs.

I was concerned at that time about extra overhead this streaming causes,
but with all the optimizations this overhead is quite small now (i.e.
the mangled type names and there are "only" about 4k types in Firefox)

What is anoying about -Wno-odr-type-merging is that we lose mangled
names that are also used by devirtualization. ipa-devirt still has two
implementations of the main hash - one based on mangled names and the
original one based on virtual table names, but combining both hashes
results in incomplete type inheritance graphs.

Honza


        PR lto/89272
        * tree.c (fld_simplified_type_name): Also keep TYPE_DECL for
        polymorphic types.


--- trunk/gcc/tree.c    2019/02/10 09:45:55     268741
+++ trunk/gcc/tree.c    2019/02/10 10:46:43     268742
@@ -5153,7 +5153,10 @@
      TYPE_DECL if the type doesn't have linkage.
      this must match fld_  */
   if (type != TYPE_MAIN_VARIANT (type)
-      || !DECL_ASSEMBLER_NAME_SET_P (TYPE_NAME (type)))
+      || (!DECL_ASSEMBLER_NAME_SET_P (TYPE_NAME (type))
+         && (TREE_CODE (type) != RECORD_TYPE
+             || !TYPE_BINFO (type)
+             || !BINFO_VTABLE (TYPE_BINFO (type)))))
     return DECL_NAME (TYPE_NAME (type));
   return TYPE_NAME (type);
 }

Reply via email to