aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-01-26 16:51:51 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-01-26 16:51:51 +0100
commit13f92e8df561c41de9f7f3ed9aa25bf963ab8f20 (patch)
tree9b9363d416df028970358fd729441f699db6d442 /gcc/gimple-fold.c
parent9242223583dde373111fd39fbcff9cc06abefe6f (diff)
downloadgcc-13f92e8df561c41de9f7f3ed9aa25bf963ab8f20.zip
gcc-13f92e8df561c41de9f7f3ed9aa25bf963ab8f20.tar.gz
gcc-13f92e8df561c41de9f7f3ed9aa25bf963ab8f20.tar.bz2
re PR tree-optimization/69483 (gcc ICE on x86_64-linux-gnu with "expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p")
PR tree-optimization/69483 * gimple-fold.c (canonicalize_constructor_val): Return NULL if base has error_mark_node type. * c-parser.c (c_parser_translation_unit): Use FOR_EACH_VEC_ELT. * gcc.dg/pr69483.c: New test. * g++.dg/opt/pr69483.C: New test. From-SVN: r232833
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 70871cf..eb130d0 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -195,6 +195,8 @@ canonicalize_constructor_val (tree cval, tree from_decl)
|| TREE_CODE (base) == FUNCTION_DECL)
&& !can_refer_decl_in_current_unit_p (base, from_decl))
return NULL_TREE;
+ if (TREE_TYPE (base) == error_mark_node)
+ return NULL_TREE;
if (TREE_CODE (base) == VAR_DECL)
TREE_ADDRESSABLE (base) = 1;
else if (TREE_CODE (base) == FUNCTION_DECL)