* tree.c (free_lang_data_in_type): Only check main variants.
authorJan Hubicka <jh@suse.cz>
Fri, 26 Oct 2018 07:21:04 +0000 (09:21 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 26 Oct 2018 07:21:04 +0000 (07:21 +0000)
From-SVN: r265520

gcc/ChangeLog
gcc/tree.c

index 87e79471af8e6c33b02d3fb62d749c53a6f72cf0..6a2ba3aa7a5a523eac04ab5059c660667eb7530b 100644 (file)
@@ -1,5 +1,6 @@
 2018-10-26  Jan Hubicka  <jh@suse.cz>
 
+       * tree.c (free_lang_data_in_type): Only check main variants.
        * ipa-devirt.c (warn_odr): Make static.
        (types_same_for_odr): Drop strict variant.
        (types_odr_comparable): Likewise.
index f87bc373f566224e8ff7a7619c8b9922a21588d2..593ef1ae293f0c73567a518ea5c5c76785cbd600 100644 (file)
@@ -5174,7 +5174,7 @@ free_lang_data_in_type (tree type)
 
   /* Drop TYPE_DECLs in TYPE_NAME in favor of the identifier in the
      TYPE_DECL if the type doesn't have linkage.  */
-  if (! type_with_linkage_p (type))
+  if (type != TYPE_MAIN_VARIANT (type) || ! type_with_linkage_p (type))
     {
       TYPE_NAME (type) = TYPE_IDENTIFIER (type);
       TYPE_STUB_DECL (type) = NULL;