aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-out.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-10-15 18:30:15 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-10-15 18:30:15 +0000
commit7e601a1d3ef4bf1467bc85d01f641bdbbf3e7fd8 (patch)
tree19abd6e2980f99fdcc78a7477781141a9662017a /gcc/lto-streamer-out.c
parent2a0cb1644c8431660f24f25aa82118f86d7f9627 (diff)
downloadgcc-7e601a1d3ef4bf1467bc85d01f641bdbbf3e7fd8.zip
gcc-7e601a1d3ef4bf1467bc85d01f641bdbbf3e7fd8.tar.gz
gcc-7e601a1d3ef4bf1467bc85d01f641bdbbf3e7fd8.tar.bz2
lto-streamer-out.c (lto_variably_modified_type_p): New.
2019-10-15 Richard Biener <rguenther@suse.de> * lto-streamer-out.c (lto_variably_modified_type_p): New. (tree_is_indexable): Use it. * tree-streamer-out.c (pack_ts_type_common_value_fields): Stream variably_modified_type_p as TYPE_LANG_FLAG_0. * tree-streamer-in.c (unpack_ts_type_common_value_fields): Likewise. From-SVN: r277005
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r--gcc/lto-streamer-out.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 285c010a..87c9e92 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -120,6 +120,17 @@ output_type_ref (struct output_block *ob, tree node)
lto_output_type_ref_index (ob->decl_state, ob->main_stream, node);
}
+/* Wrapper around variably_modified_type_p avoiding type modification
+ during WPA streaming. */
+
+static bool
+lto_variably_modified_type_p (tree type)
+{
+ return (in_lto_p
+ ? TYPE_LANG_FLAG_0 (TYPE_MAIN_VARIANT (type))
+ : variably_modified_type_p (type, NULL_TREE));
+}
+
/* Return true if tree node T is written to various tables. For these
nodes, we sometimes want to write their phyiscal representation
@@ -134,7 +145,7 @@ tree_is_indexable (tree t)
definition. */
if ((TREE_CODE (t) == PARM_DECL || TREE_CODE (t) == RESULT_DECL)
&& DECL_CONTEXT (t))
- return variably_modified_type_p (TREE_TYPE (DECL_CONTEXT (t)), NULL_TREE);
+ return lto_variably_modified_type_p (TREE_TYPE (DECL_CONTEXT (t)));
/* IMPORTED_DECL is put into BLOCK and thus it never can be shared.
We should no longer need to stream it. */
else if (TREE_CODE (t) == IMPORTED_DECL)
@@ -154,10 +165,10 @@ tree_is_indexable (tree t)
them we have to localize their members as well.
??? In theory that includes non-FIELD_DECLs as well. */
else if (TYPE_P (t)
- && variably_modified_type_p (t, NULL_TREE))
+ && lto_variably_modified_type_p (t))
return false;
else if (TREE_CODE (t) == FIELD_DECL
- && variably_modified_type_p (DECL_CONTEXT (t), NULL_TREE))
+ && lto_variably_modified_type_p (DECL_CONTEXT (t)))
return false;
else
return (TYPE_P (t) || DECL_P (t) || TREE_CODE (t) == SSA_NAME);