diff options
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 5ca1901..ede58bf 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1721,7 +1721,10 @@ cgraph_node::release_body (bool keep_arguments) DECL_INITIAL (decl) = error_mark_node; release_function_body (decl); if (lto_file_data) - lto_free_function_in_decl_state_for_node (this); + { + lto_free_function_in_decl_state_for_node (this); + lto_file_data = NULL; + } } /* Remove function from symbol table. */ @@ -1799,13 +1802,18 @@ cgraph_node::remove (void) n = cgraph_node::get (decl); if (!n || (!n->clones && !n->clone_of && !n->global.inlined_to - && (symtab->global_info_ready + && ((symtab->global_info_ready || in_lto_p) && (TREE_ASM_WRITTEN (n->decl) || DECL_EXTERNAL (n->decl) || !n->analyzed || (!flag_wpa && n->in_other_partition))))) release_body (); } + else + { + lto_free_function_in_decl_state_for_node (this); + lto_file_data = NULL; + } decl = NULL; if (call_site_hash) @@ -3218,6 +3226,8 @@ cgraph_node::get_untransformed_body (void) lto_free_section_data (file_data, LTO_section_function_body, name, data, len); lto_free_function_in_decl_state_for_node (this); + /* Keep lto file data so ipa-inline-analysis knows about cross module + inlining. */ timevar_pop (TV_IPA_LTO_GIMPLE_IN); |