summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-03-07 21:33:58 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-03-07 20:33:58 +0000
commita7384b1b02a158cf644f36cc26dc1f4064394435 (patch)
tree91f63bc1abbe313000a21842ded438002ddcf52e /gcc/tree.c
parente291927919ac6a7bd0d6fa8848b2acf5f27c959f (diff)
downloadgcc-a7384b1b02a158cf644f36cc26dc1f4064394435.tar.gz
re PR lto/65316 (LTO: Uninitialized memory / ICE with -g -fno-lto-odr-type-merging: in types_same_for_odr, at ipa-devirt.c:465)
PR ipa/65316 * tree.c (free_lang_data_in_type): Be sure to keep BINFO_VTABLE when outputting debug. From-SVN: r221258
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 29f70f8ec11..0b8e8961b08 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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;
}