summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-08 11:43:12 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-08 11:43:12 +0000
commitdaa9f80e06402d35cd7e4b16bd72dc828a90369f (patch)
treeb60cdc2551760ddd13bde603e4e1d7d8df918d3e
parente11c67d07882cd920df5357ef8612e9c3cae5fea (diff)
downloadppe42-gcc-daa9f80e06402d35cd7e4b16bd72dc828a90369f.tar.gz
ppe42-gcc-daa9f80e06402d35cd7e4b16bd72dc828a90369f.zip
2011-12-08 Richard Guenther <rguenther@suse.de>
PR lto/49945 * lto-streamer-out.c (tree_is_indexable): Localize variably modified types and their FIELD_DECLs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182107 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/lto-streamer-out.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1f26fa946c4..84083ed3ab2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-12-08 Richard Guenther <rguenther@suse.de>
+
+ PR lto/49945
+ * lto-streamer-out.c (tree_is_indexable): Localize variably
+ modified types and their FIELD_DECLs.
+
2011-12-08 Eric Botcazou <ebotcazou@adacore.com>
PR tree-optimization/51315
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 655cf89bc28..e5c79d11f62 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -139,6 +139,16 @@ tree_is_indexable (tree t)
&& DECL_CONTEXT (t)
&& TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL)
return false;
+ /* Variably modified types need to be streamed alongside function
+ bodies because they can refer to local entities. Together with
+ 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))
+ return false;
+ else if (TREE_CODE (t) == FIELD_DECL
+ && variably_modified_type_p (DECL_CONTEXT (t), NULL_TREE))
+ return false;
else
return (TYPE_P (t) || DECL_P (t) || TREE_CODE (t) == SSA_NAME);
}
OpenPOWER on IntegriCloud