aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-03-12 01:14:19 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-03-12 00:14:19 +0000
commit1c4db829238c99209ba210d36a4290cf0eb809ff (patch)
tree9f5abb5d1ef41104ac985a833791fcc67420ed66 /gcc/cgraph.c
parent8648c55f3b703a0a824ae0815485dbebe4e01478 (diff)
downloadgcc-1c4db829238c99209ba210d36a4290cf0eb809ff.zip
gcc-1c4db829238c99209ba210d36a4290cf0eb809ff.tar.gz
gcc-1c4db829238c99209ba210d36a4290cf0eb809ff.tar.bz2
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
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c14
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);