From: Jan Hubicka Date: Thu, 12 Mar 2015 00:14:19 +0000 (+0100) Subject: cgraph.c (cgraph_node::release_body): Free function_in_decl_state. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1c4db829238c99209ba210d36a4290cf0eb809ff;p=gcc.git cgraph.c (cgraph_node::release_body): Free function_in_decl_state. * cgraph.c (cgraph_node::release_body): Free function_in_decl_state. (cgraph_node::remove): Likewise. (cgraph_node::get_untransformed_body): Likewise. * varpool.c (varpool_node::remove): Likewise. (varpool_node::get_constructor): Add sanity check. * lto.c (read_cgraph_and_symbols): Do not do merging at ltrans stage. From-SVN: r221366 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e451495c724..53f582b5e96 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-03-10 Jan Hubicka + + * cgraph.c (cgraph_node::release_body): Free function_in_decl_state. + (cgraph_node::remove): Likewise. + (cgraph_node::get_untransformed_body): Likewise. + * varpool.c (varpool_node::remove): Likewise. + (varpool_node::get_constructor): Add sanity check. + 2015-03-11 Sandra Loosemore * doc/invoke.texi (-fgnu89-inline): Remove discussion about diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 5ca19015a3d..ede58bf5aaf 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); diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 994189f75b0..ae379ebb4f9 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2015-03-10 Jan Hubicka + + * lto.c (read_cgraph_and_symbols): Do not do merging + at ltrans stage. + 2015-02-26 Jakub Jelinek * lto.c (lto_mode_identity_table): New variable. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index ce7e6b1974a..760975fdf25 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -3118,13 +3118,20 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) fprintf (symtab->dump_file, "Before merging:\n"); symtab_node::dump_table (symtab->dump_file); } - lto_symtab_merge_symbols (); - /* Removal of unreachable symbols is needed to make verify_symtab to pass; - we are still having duplicated comdat groups containing local statics. - We could also just remove them while merging. */ - symtab->remove_unreachable_nodes (dump_file); + if (!flag_ltrans) + { + lto_symtab_merge_symbols (); + /* Removal of unreachable symbols is needed to make verify_symtab to pass; + we are still having duplicated comdat groups containing local statics. + We could also just remove them while merging. */ + symtab->remove_unreachable_nodes (dump_file); + } ggc_collect (); symtab->state = IPA_SSA; + /* FIXME: Technically all node removals happening here are useless, because + WPA should not stream them. */ + if (flag_ltrans) + symtab->remove_unreachable_nodes (dump_file); timevar_pop (TV_IPA_LTO_CGRAPH_MERGE); diff --git a/gcc/varpool.c b/gcc/varpool.c index 707f62f0d84..b5836934d72 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -195,6 +195,11 @@ void varpool_node::remove (void) { symtab->call_varpool_removal_hooks (this); + if (lto_file_data) + { + lto_free_function_in_decl_state_for_node (this); + lto_file_data = NULL; + } /* When streaming we can have multiple nodes associated with decl. */ if (symtab->state == LTO_STREAMING) @@ -323,6 +328,7 @@ varpool_node::get_constructor (void) name); lto_input_variable_constructor (file_data, this, data); + gcc_assert (DECL_INITIAL (decl) != error_mark_node); lto_stats.num_function_bodies++; lto_free_section_data (file_data, LTO_section_function_body, name, data, len);