Commit 1c4db829 by Jan Hubicka Committed by Jan Hubicka

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
parent 8648c55f
2015-03-10 Jan Hubicka <hubicka@ucw.cz>
* 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 <sandra@codesourcery.com> 2015-03-11 Sandra Loosemore <sandra@codesourcery.com>
* doc/invoke.texi (-fgnu89-inline): Remove discussion about * doc/invoke.texi (-fgnu89-inline): Remove discussion about
......
...@@ -1721,7 +1721,10 @@ cgraph_node::release_body (bool keep_arguments) ...@@ -1721,7 +1721,10 @@ cgraph_node::release_body (bool keep_arguments)
DECL_INITIAL (decl) = error_mark_node; DECL_INITIAL (decl) = error_mark_node;
release_function_body (decl); release_function_body (decl);
if (lto_file_data) 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. */ /* Remove function from symbol table. */
...@@ -1799,13 +1802,18 @@ cgraph_node::remove (void) ...@@ -1799,13 +1802,18 @@ cgraph_node::remove (void)
n = cgraph_node::get (decl); n = cgraph_node::get (decl);
if (!n if (!n
|| (!n->clones && !n->clone_of && !n->global.inlined_to || (!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) && (TREE_ASM_WRITTEN (n->decl)
|| DECL_EXTERNAL (n->decl) || DECL_EXTERNAL (n->decl)
|| !n->analyzed || !n->analyzed
|| (!flag_wpa && n->in_other_partition))))) || (!flag_wpa && n->in_other_partition)))))
release_body (); release_body ();
} }
else
{
lto_free_function_in_decl_state_for_node (this);
lto_file_data = NULL;
}
decl = NULL; decl = NULL;
if (call_site_hash) if (call_site_hash)
...@@ -3218,6 +3226,8 @@ cgraph_node::get_untransformed_body (void) ...@@ -3218,6 +3226,8 @@ cgraph_node::get_untransformed_body (void)
lto_free_section_data (file_data, LTO_section_function_body, name, lto_free_section_data (file_data, LTO_section_function_body, name,
data, len); data, len);
lto_free_function_in_decl_state_for_node (this); 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); timevar_pop (TV_IPA_LTO_GIMPLE_IN);
......
2015-03-10 Jan Hubicka <hubicka@ucw.cz>
* lto.c (read_cgraph_and_symbols): Do not do merging
at ltrans stage.
2015-02-26 Jakub Jelinek <jakub@redhat.com> 2015-02-26 Jakub Jelinek <jakub@redhat.com>
* lto.c (lto_mode_identity_table): New variable. * lto.c (lto_mode_identity_table): New variable.
......
...@@ -3118,13 +3118,20 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) ...@@ -3118,13 +3118,20 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
fprintf (symtab->dump_file, "Before merging:\n"); fprintf (symtab->dump_file, "Before merging:\n");
symtab_node::dump_table (symtab->dump_file); symtab_node::dump_table (symtab->dump_file);
} }
lto_symtab_merge_symbols (); if (!flag_ltrans)
/* Removal of unreachable symbols is needed to make verify_symtab to pass; {
we are still having duplicated comdat groups containing local statics. lto_symtab_merge_symbols ();
We could also just remove them while merging. */ /* Removal of unreachable symbols is needed to make verify_symtab to pass;
symtab->remove_unreachable_nodes (dump_file); 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 (); ggc_collect ();
symtab->state = IPA_SSA; 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); timevar_pop (TV_IPA_LTO_CGRAPH_MERGE);
......
...@@ -195,6 +195,11 @@ void ...@@ -195,6 +195,11 @@ void
varpool_node::remove (void) varpool_node::remove (void)
{ {
symtab->call_varpool_removal_hooks (this); 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. */ /* When streaming we can have multiple nodes associated with decl. */
if (symtab->state == LTO_STREAMING) if (symtab->state == LTO_STREAMING)
...@@ -323,6 +328,7 @@ varpool_node::get_constructor (void) ...@@ -323,6 +328,7 @@ varpool_node::get_constructor (void)
name); name);
lto_input_variable_constructor (file_data, this, data); lto_input_variable_constructor (file_data, this, data);
gcc_assert (DECL_INITIAL (decl) != error_mark_node);
lto_stats.num_function_bodies++; lto_stats.num_function_bodies++;
lto_free_section_data (file_data, LTO_section_function_body, name, lto_free_section_data (file_data, LTO_section_function_body, name,
data, len); data, len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment