re PR lto/65316 (LTO: Uninitialized memory / ICE with -g -fno-lto-odr-type-merging...
authorJan Hubicka <hubicka@ucw.cz>
Sat, 7 Mar 2015 20:33:58 +0000 (21:33 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 7 Mar 2015 20:33:58 +0000 (20:33 +0000)
PR ipa/65316
* tree.c (free_lang_data_in_type): Be sure to keep BINFO_VTABLE
when outputting debug.

From-SVN: r221258

gcc/ChangeLog
gcc/tree.c

index f71958d88664cc945d61971b9ed482f73aa42da8..ce183a0d08a9b582632a4db3dbb1cda5ebafd1f6 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-05  Jan Hubicka  <hubicka@ucw.cz>
+
+       PR ipa/65316
+       * tree.c (free_lang_data_in_type): Be sure to keep BINFO_VTABLE
+       when outputting debug.
+
 2015-03-07  Marek Polacek  <polacek@redhat.com>
            Martin Uecker  <uecker@eecs.berkeley.edu>
 
index 29f70f8ec11045b6cb82aa1a9dfed2315ef3c750..0b8e8961b0800a9543443954b52d003bca7f58d1 100644 (file)
@@ -5081,9 +5081,15 @@ free_lang_data_in_type (tree type)
       if (TYPE_BINFO (type))
        {
          free_lang_data_in_binfo (TYPE_BINFO (type));
+         /* We need to preserve link to bases and virtual table for all
+            polymorphic types to make devirtualization machinery working.
+            Debug output cares only about bases, but output also
+            virtual table pointers so merging of -fdevirtualize and
+            -fno-devirtualize units is easier.  */
          if ((!BINFO_VTABLE (TYPE_BINFO (type))
               || !flag_devirtualize)
-             && (!BINFO_N_BASE_BINFOS (TYPE_BINFO (type))
+             && ((!BINFO_N_BASE_BINFOS (TYPE_BINFO (type))
+                  && !BINFO_VTABLE (TYPE_BINFO (type)))
                  || debug_info_level != DINFO_LEVEL_NONE))
            TYPE_BINFO (type) = NULL;
        }