aboutsummaryrefslogtreecommitdiff
path: root/gcc/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/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/c')
-rw-r--r--gcc/c/ChangeLog5
-rw-r--r--gcc/c/c-parser.c17
2 files changed, 13 insertions, 9 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 5577518..7d6250e 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/69483
+ * c-parser.c (c_parser_translation_unit): Use FOR_EACH_VEC_ELT.
+
2016-01-20 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR c/24293
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).