aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2012-10-07 17:16:02 +0000
committerJan Hubicka <jh@suse.cz>2012-10-07 17:16:02 +0000
commitbda21c272e9690f9e9ff100710496d198fddd2d8 (patch)
tree087897b09e6c3cf173e2c0cc37e7b9dc85b7043a /gcc/lto
parentf8adc2c1218499d52740e69da985ffd35c5e6fe5 (diff)
* lto-cgraph.c (lto_symtab_encoder_new): New parameter FOR_INPUT.
(lto_symtab_encoder_delete): Update. (lto_symtab_encoder_encode): Update. (compute_ltrans_boundary): Update. (input_symtab): Update. * lto-streamer.h (lto_symtab_encoder_new): Update. * lto.c (read_cgraph_and_symbols): Release type merging hash early; release input encoders. * lto-partition.c (new_partition): Update for new lto_symtab_encoder_new. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@192184 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog6
-rw-r--r--gcc/lto/lto-partition.c2
-rw-r--r--gcc/lto/lto.c28
3 files changed, 26 insertions, 10 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 86acc2417d2..7218f4873cd 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,9 @@
+2012-10-07 Jan Hubicka <jh@suse.cz>
+
+ * lto.c (read_cgraph_and_symbols): Release type merging hash early;
+ release input encoders.
+ * lto-partition.c (new_partition): Update for new lto_symtab_encoder_new.
+
2012-10-06 Jan Hubicka <jh@suse.cz>
PR lto/54790
diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c
index b1310335a4a..32243fb83d3 100644
--- a/gcc/lto/lto-partition.c
+++ b/gcc/lto/lto-partition.c
@@ -99,7 +99,7 @@ static ltrans_partition
new_partition (const char *name)
{
ltrans_partition part = XCNEW (struct ltrans_partition_def);
- part->encoder = lto_symtab_encoder_new ();
+ part->encoder = lto_symtab_encoder_new (false);
part->name = name;
part->insns = 0;
VEC_safe_push (ltrans_partition, heap, ltrans_partitions, part);
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index c6b882d6941..d880c8a2062 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -2946,6 +2946,17 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
if (resolution_file_name)
fclose (resolution);
+ /* Free gimple type merging datastructures. */
+ htab_delete (gimple_types);
+ gimple_types = NULL;
+ htab_delete (type_hash_cache);
+ type_hash_cache = NULL;
+ free (type_pair_cache);
+ type_pair_cache = NULL;
+ gimple_type_leader = NULL;
+ free_gimple_type_tables ();
+ ggc_collect ();
+
/* Set the hooks so that all of the ipa passes can read in their data. */
lto_set_in_hooks (all_file_decl_data, get_section_data, free_section_data);
@@ -2989,18 +3000,10 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
if (seen_error ())
fatal_error ("errors during merging of translation units");
- /* Fixup all decls and types and free the type hash tables. */
+ /* Fixup all decls. */
lto_fixup_decls (all_file_decl_data);
htab_delete (tree_with_vars);
tree_with_vars = NULL;
- htab_delete (gimple_types);
- gimple_types = NULL;
- htab_delete (type_hash_cache);
- type_hash_cache = NULL;
- free (type_pair_cache);
- type_pair_cache = NULL;
- gimple_type_leader = NULL;
- free_gimple_type_tables ();
ggc_collect ();
timevar_pop (TV_IPA_LTO_DECL_MERGE);
@@ -3015,6 +3018,13 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
else
ipa_read_summaries ();
+ for (i = 0; all_file_decl_data[i]; i++)
+ {
+ gcc_assert (all_file_decl_data[i]->symtab_node_encoder);
+ lto_symtab_encoder_delete (all_file_decl_data[i]->symtab_node_encoder);
+ all_file_decl_data[i]->symtab_node_encoder = NULL;
+ }
+
/* Finally merge the cgraph according to the decl merging decisions. */
timevar_push (TV_IPA_LTO_CGRAPH_MERGE);
if (cgraph_dump_file)