From c1b8f25d8090e778b330555005c81bc0c582a6b8 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 10 Apr 2018 08:33:38 +0200 Subject: re PR lto/85078 (LTO ICE: tree check: expected tree that contains 'decl minimal' structure, have 'identifier_node' in decl_mangling_context, at cp/mangle.c:878) PR lto/85078 * ipa-devirt.c (rebuild_type_inheritance-hash): New. * ipa-utils.h (rebuild_type_inheritance-hash): Declare. * tree.c (free_lang_data_in_type): Fix handling of binfos; walk basetypes. (free_lang_data): Rebuild type inheritance graph. * g++.dg/torture/pr85078.C: New. From-SVN: r259264 --- gcc/ipa-devirt.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gcc/ipa-devirt.c') diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index 30d3757..fa9380c 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -2702,6 +2702,24 @@ free_polymorphic_call_targets_hash () } } +/* Force rebuilding type inheritance graph from scratch. + This is use to make sure that we do not keep references to types + which was not visible to free_lang_data. */ + +void +rebuild_type_inheritance_graph () +{ + if (!odr_hash) + return; + delete odr_hash; + if (in_lto_p) + delete odr_vtable_hash; + odr_hash = NULL; + odr_vtable_hash = NULL; + odr_types_ptr = NULL; + free_polymorphic_call_targets_hash (); +} + /* When virtual function is removed, we may need to flush the cache. */ static void -- cgit v1.1