Commit 69e02b35 by Jan Hubicka Committed by Jan Hubicka

lto-streamer-out.c (DFS::DFS_write_tree_body): Do not stream DECL_ORIGINAL_TYPE.


	* lto-streamer-out.c (DFS::DFS_write_tree_body): Do not
	stream DECL_ORIGINAL_TYPE.
	(DFS::DFS_write_tree_body): Drop hack handling local external decls.
	(hash_tree): Do not walk DECL_ORIGINAL_TYPE.
	* tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers):
	Do not walk original type.
	* tree-streamer-out.c (streamer_write_chain): Drop hack handling
	external decls.
	(write_ts_decl_non_common_tree_pointers): Do not stream
	DECL_ORIGINAL_TYPE
	* tree.c (free_lang_data_in_decl): Clear DECL_ORIGINAL_TYPE.
	(find_decls_types_r): Do not walk DEC_ORIGINAL_TYPE.

From-SVN: r262560
parent f790df6b
2018-07-11 Jan Hubicka <hubicka@ucw.cz>
* lto-streamer-out.c (DFS::DFS_write_tree_body): Do not
stream DECL_ORIGINAL_TYPE.
(DFS::DFS_write_tree_body): Drop hack handling local external decls.
(hash_tree): Do not walk DECL_ORIGINAL_TYPE.
* tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers):
Do not walk original type.
* tree-streamer-out.c (streamer_write_chain): Drop hack handling
external decls.
(write_ts_decl_non_common_tree_pointers): Do not stream
DECL_ORIGINAL_TYPE
* tree.c (free_lang_data_in_decl): Clear DECL_ORIGINAL_TYPE.
(find_decls_types_r): Do not walk DEC_ORIGINAL_TYPE.
2018-07-11 Aldy Hernandez <aldyh@redhat.com> 2018-07-11 Aldy Hernandez <aldyh@redhat.com>
* tree-ssa-threadupdate.c (thread_through_all_blocks): Do not jump * tree-ssa-threadupdate.c (thread_through_all_blocks): Do not jump
......
...@@ -819,12 +819,6 @@ DFS::DFS_write_tree_body (struct output_block *ob, ...@@ -819,12 +819,6 @@ DFS::DFS_write_tree_body (struct output_block *ob,
DFS_follow_tree_edge (DECL_DEBUG_EXPR (expr)); DFS_follow_tree_edge (DECL_DEBUG_EXPR (expr));
} }
if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON))
{
if (TREE_CODE (expr) == TYPE_DECL)
DFS_follow_tree_edge (DECL_ORIGINAL_TYPE (expr));
}
if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS)) if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
{ {
/* Make sure we don't inadvertently set the assembler name. */ /* Make sure we don't inadvertently set the assembler name. */
...@@ -907,14 +901,13 @@ DFS::DFS_write_tree_body (struct output_block *ob, ...@@ -907,14 +901,13 @@ DFS::DFS_write_tree_body (struct output_block *ob,
if (CODE_CONTAINS_STRUCT (code, TS_BLOCK)) if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
{ {
for (tree t = BLOCK_VARS (expr); t; t = TREE_CHAIN (t)) for (tree t = BLOCK_VARS (expr); t; t = TREE_CHAIN (t))
if (VAR_OR_FUNCTION_DECL_P (t) {
&& DECL_EXTERNAL (t)) /* We would have to stream externals in the block chain as
/* We have to stream externals in the block chain as non-references but we should have dropped them in
non-references. See also free-lang-data. */
tree-streamer-out.c:streamer_write_chain. */ gcc_assert (!VAR_OR_FUNCTION_DECL_P (t) || !DECL_EXTERNAL (t));
DFS_write_tree (ob, expr_state, t, ref_p, false);
else
DFS_follow_tree_edge (t); DFS_follow_tree_edge (t);
}
DFS_follow_tree_edge (BLOCK_SUPERCONTEXT (expr)); DFS_follow_tree_edge (BLOCK_SUPERCONTEXT (expr));
DFS_follow_tree_edge (BLOCK_ABSTRACT_ORIGIN (expr)); DFS_follow_tree_edge (BLOCK_ABSTRACT_ORIGIN (expr));
...@@ -1244,12 +1237,6 @@ hash_tree (struct streamer_tree_cache_d *cache, hash_map<tree, hashval_t> *map, ...@@ -1244,12 +1237,6 @@ hash_tree (struct streamer_tree_cache_d *cache, hash_map<tree, hashval_t> *map,
be able to call get_symbol_initial_value. */ be able to call get_symbol_initial_value. */
} }
if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON))
{
if (code == TYPE_DECL)
visit (DECL_ORIGINAL_TYPE (t));
}
if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS)) if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
{ {
if (DECL_ASSEMBLER_NAME_SET_P (t)) if (DECL_ASSEMBLER_NAME_SET_P (t))
......
...@@ -721,11 +721,9 @@ lto_input_ts_decl_common_tree_pointers (struct lto_input_block *ib, ...@@ -721,11 +721,9 @@ lto_input_ts_decl_common_tree_pointers (struct lto_input_block *ib,
file being read. */ file being read. */
static void static void
lto_input_ts_decl_non_common_tree_pointers (struct lto_input_block *ib, lto_input_ts_decl_non_common_tree_pointers (struct lto_input_block *,
struct data_in *data_in, tree expr) struct data_in *, tree)
{ {
if (TREE_CODE (expr) == TYPE_DECL)
DECL_ORIGINAL_TYPE (expr) = stream_read_tree (ib, data_in);
} }
......
...@@ -494,14 +494,10 @@ streamer_write_chain (struct output_block *ob, tree t, bool ref_p) ...@@ -494,14 +494,10 @@ streamer_write_chain (struct output_block *ob, tree t, bool ref_p)
{ {
/* We avoid outputting external vars or functions by reference /* We avoid outputting external vars or functions by reference
to the global decls section as we do not want to have them to the global decls section as we do not want to have them
enter decl merging. This is, of course, only for the call enter decl merging. We should not need to do this anymore because
for streaming BLOCK_VARS, but other callers are safe. free_lang_data removes them from block scopes. */
See also lto-streamer-out.c:DFS_write_tree_body. */ gcc_assert (!VAR_OR_FUNCTION_DECL_P (t) || !DECL_EXTERNAL (t));
if (VAR_OR_FUNCTION_DECL_P (t) stream_write_tree (ob, t, ref_p);
&& DECL_EXTERNAL (t))
stream_write_tree_shallow_non_ref (ob, t, ref_p);
else
stream_write_tree (ob, t, ref_p);
t = TREE_CHAIN (t); t = TREE_CHAIN (t);
} }
...@@ -617,11 +613,8 @@ write_ts_decl_common_tree_pointers (struct output_block *ob, tree expr, ...@@ -617,11 +613,8 @@ write_ts_decl_common_tree_pointers (struct output_block *ob, tree expr,
pointer fields. */ pointer fields. */
static void static void
write_ts_decl_non_common_tree_pointers (struct output_block *ob, tree expr, write_ts_decl_non_common_tree_pointers (struct output_block *, tree, bool)
bool ref_p)
{ {
if (TREE_CODE (expr) == TYPE_DECL)
stream_write_tree (ob, DECL_ORIGINAL_TYPE (expr), ref_p);
} }
......
...@@ -5357,6 +5357,7 @@ free_lang_data_in_decl (tree decl) ...@@ -5357,6 +5357,7 @@ free_lang_data_in_decl (tree decl)
DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
DECL_VISIBILITY_SPECIFIED (decl) = 0; DECL_VISIBILITY_SPECIFIED (decl) = 0;
DECL_INITIAL (decl) = NULL_TREE; DECL_INITIAL (decl) = NULL_TREE;
DECL_ORIGINAL_TYPE (decl) = NULL_TREE;
} }
else if (TREE_CODE (decl) == FIELD_DECL) else if (TREE_CODE (decl) == FIELD_DECL)
DECL_INITIAL (decl) = NULL_TREE; DECL_INITIAL (decl) = NULL_TREE;
...@@ -5469,10 +5470,6 @@ find_decls_types_r (tree *tp, int *ws, void *data) ...@@ -5469,10 +5470,6 @@ find_decls_types_r (tree *tp, int *ws, void *data)
fld_worklist_push (DECL_ARGUMENTS (t), fld); fld_worklist_push (DECL_ARGUMENTS (t), fld);
fld_worklist_push (DECL_RESULT (t), fld); fld_worklist_push (DECL_RESULT (t), fld);
} }
else if (TREE_CODE (t) == TYPE_DECL)
{
fld_worklist_push (DECL_ORIGINAL_TYPE (t), fld);
}
else if (TREE_CODE (t) == FIELD_DECL) else if (TREE_CODE (t) == FIELD_DECL)
{ {
fld_worklist_push (DECL_FIELD_OFFSET (t), fld); fld_worklist_push (DECL_FIELD_OFFSET (t), fld);
......
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