From 13f92e8df561c41de9f7f3ed9aa25bf963ab8f20 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 26 Jan 2016 16:51:51 +0100 Subject: 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 --- gcc/c/c-parser.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index efac47b..eede3a7 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -1431,15 +1431,14 @@ c_parser_translation_unit (c_parser *parser) while (c_parser_next_token_is_not (parser, CPP_EOF)); } - for (unsigned i = 0; i < incomplete_record_decls.length (); ++i) - { - tree decl = incomplete_record_decls[i]; - if (DECL_SIZE (decl) == NULL_TREE && TREE_TYPE (decl) != error_mark_node) - { - error ("storage size of %q+D isn%'t known", decl); - TREE_TYPE (decl) = error_mark_node; - } - } + unsigned int i; + tree decl; + FOR_EACH_VEC_ELT (incomplete_record_decls, i, decl) + if (DECL_SIZE (decl) == NULL_TREE && TREE_TYPE (decl) != error_mark_node) + { + error ("storage size of %q+D isn%'t known", decl); + TREE_TYPE (decl) = error_mark_node; + } } /* Parse an external declaration (C90 6.7, C99 6.9). -- cgit v1.1