From 007b38808c7c937f240123c9508c243df262b2f3 Mon Sep 17 00:00:00 2001 From: hubicka Date: Sat, 7 Mar 2015 20:33:58 +0000 Subject: [PATCH] PR ipa/65316 * tree.c (free_lang_data_in_type): Be sure to keep BINFO_VTABLE when outputting debug. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221258 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/tree.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f71958d8866..ce183a0d08a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-05 Jan Hubicka + + PR ipa/65316 + * tree.c (free_lang_data_in_type): Be sure to keep BINFO_VTABLE + when outputting debug. + 2015-03-07 Marek Polacek Martin Uecker 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; } -- 2.11.4.GIT