aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-out.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-01-13 13:57:27 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-01-13 13:57:27 +0000
commite0ffb247d696aa7a98088e0cd9c647947b1d5d39 (patch)
tree854c9d0bb800017b021b7eb0db8a466fb5f1ba8d /gcc/lto-streamer-out.c
parentbf84ac44f9679285d95ac0c96c0e2e83b7ef038f (diff)
downloadgcc-e0ffb247d696aa7a98088e0cd9c647947b1d5d39.zip
gcc-e0ffb247d696aa7a98088e0cd9c647947b1d5d39.tar.gz
gcc-e0ffb247d696aa7a98088e0cd9c647947b1d5d39.tar.bz2
re PR lto/64373 (ICE with lto related to variably modified type)
2015-01-13 Richard Biener <rguenther@suse.de> PR lto/64373 * lto-streamer-out.c (tree_is_indexable): Guard for NULL DECL_CONTEXT. * gcc.dg/lto/pr64373_0.c: New testcase. From-SVN: r219531
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r--gcc/lto-streamer-out.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 21a78bb..3b58191 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -154,7 +154,8 @@ tree_is_indexable (tree t)
/* Parameters and return values of functions of variably modified types
must go to global stream, because they may be used in the type
definition. */
- if (TREE_CODE (t) == PARM_DECL || TREE_CODE (t) == RESULT_DECL)
+ 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);
/* IMPORTED_DECL is put into BLOCK and thus it never can be shared. */
else if (TREE_CODE (t) == IMPORTED_DECL)