aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2020-05-22 16:37:06 +0200
committerJan Hubicka <jh@suse.cz>2020-05-22 16:37:06 +0200
commitbcb63eb2cbd3caf212b9cf42d8c218c09dc6ff8b (patch)
treea533824ecaf664934915b8534378801b2da04ba2 /gcc
parent098ba49c7cd4d3f6202b6472aec8c33b68bbada7 (diff)
downloadgcc-bcb63eb2cbd3caf212b9cf42d8c218c09dc6ff8b.zip
gcc-bcb63eb2cbd3caf212b9cf42d8c218c09dc6ff8b.tar.gz
gcc-bcb63eb2cbd3caf212b9cf42d8c218c09dc6ff8b.tar.bz2
Avoid streaming stray references.
this patch avoids stremaing completely useless stray references to gobal decl stream. I am re-testing the patch (rebased to current tree) on x86_64-linux and intend to commit once testing finishes. gcc/ChangeLog: 2020-05-22 Jan Hubicka <hubicka@ucw.cz> * lto-streamer-out.c (lto_output_tree): Do not stream final ref if it is not needed. gcc/lto/ChangeLog: 2020-05-22 Jan Hubicka <hubicka@ucw.cz> * lto-common.c (lto_read_decls): Do not skip stray refs.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/lto-streamer-out.c2
-rw-r--r--gcc/lto/ChangeLog4
-rw-r--r--gcc/lto/lto-common.c28
4 files changed, 21 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b019951..cef15b0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2020-05-22 Jan Hubicka <hubicka@ucw.cz>
+ * lto-streamer-out.c (lto_output_tree): Do not stream final ref if
+ it is not needed.
+
+2020-05-22 Jan Hubicka <hubicka@ucw.cz>
+
* lto-section-out.c (lto_output_decl_index): Adjust dump indentation.
* lto-streamer-out.c (create_output_block): Fix whitespace
(lto_write_tree_1): Add (debug) dump.
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index f5daadc..5ff7f33 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1780,7 +1780,7 @@ lto_output_tree (struct output_block *ob, tree expr,
it. */
if (!existed_p)
lto_output_tree_1 (ob, expr, 0, ref_p, this_ref_p);
- else
+ else if (this_ref_p)
{
if (streamer_dump_file)
{
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index aedcba9..047afba 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,7 @@
+2020-05-22 Jan Hubicka <hubicka@ucw.cz>
+
+ * lto-common.c (lto_read_decls): Do not skip stray refs.
+
2020-05-20 Jan Hubicka <hubicka@ucw.cz>
* lto-common.c (compare_tree_sccs_1): Sanity check that we never
diff --git a/gcc/lto/lto-common.c b/gcc/lto/lto-common.c
index d04b1c9..3ea1894 100644
--- a/gcc/lto/lto-common.c
+++ b/gcc/lto/lto-common.c
@@ -1955,25 +1955,19 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data,
else
{
t = lto_input_tree_1 (&ib_main, data_in, tag, 0);
- /* We streamed in new tree. Add it to cache and process dref. */
- if (data_in->reader_cache->nodes.length () == from + 1)
+ gcc_assert (data_in->reader_cache->nodes.length () == from + 1);
+ num_unshared_trees_read++;
+ data_in->location_cache.accept_location_cache ();
+ process_dref (data_in, t, from);
+ if (TREE_CODE (t) == IDENTIFIER_NODE
+ || (TREE_CODE (t) == INTEGER_CST
+ && !TREE_OVERFLOW (t)))
+ ;
+ else
{
- num_unshared_trees_read++;
- data_in->location_cache.accept_location_cache ();
- process_dref (data_in, t, from);
- if (TREE_CODE (t) == IDENTIFIER_NODE
- || (TREE_CODE (t) == INTEGER_CST
- && !TREE_OVERFLOW (t)))
- ;
- else
- {
- lto_maybe_register_decl (data_in, t, from);
- process_new_tree (t, &hm, from, &total, data_in);
- }
+ lto_maybe_register_decl (data_in, t, from);
+ process_new_tree (t, &hm, from, &total, data_in);
}
- else
- /* FIXME: It seems useless to pickle stray references. */
- gcc_assert (data_in->reader_cache->nodes.length () == from);
}
}