This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, Cilk+] Fix for PR61963
- From: "Zamyatin, Igor" <igor dot zamyatin at intel dot com>
- To: "GCC Patches (gcc-patches at gcc dot gnu dot org)" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 31 Jul 2014 19:51:43 +0000
- Subject: [PATCH, Cilk+] Fix for PR61963
- Authentication-results: sourceware.org; auth=none
Hi!
This patch fixes the ICE on invalid code by adding missed check for error_mark_node.
Regtested on x86_64. Ok for trunk/4.9?
Thanks,
Igor
Changelog:
gcc/cp:
2014-07-31 Igor Zamyatin <igor.zamyatin@intel.com>
PR other/61963
* parser.c (cp_parser_array_notation): Added check for array_type.
gcc/testsuite:
2014-07-31 Igor Zamyatin <igor.zamyatin@intel.com>
PR other/61963
* c-c++-common/cilk-plus/AN/pr61963.c: New test.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 32c7a3f..be071a8 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -6376,7 +6376,7 @@ cp_parser_array_notation (location_t loc, cp_parser *parser, tree *init_index,
parser->colon_corrects_to_scope_p = saved_colon_corrects;
if (*init_index == error_mark_node || length_index == error_mark_node
- || stride == error_mark_node)
+ || stride == error_mark_node || array_type == error_mark_node)
{
if (cp_lexer_peek_token (parser->lexer)->type == CPP_CLOSE_SQUARE)
cp_lexer_consume_token (parser->lexer);
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.
new file mode 100644
index 0000000..dfa713c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c
@@ -0,0 +1,9 @@
+/* PR other/61963 */
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+void f (int * int *a) /* { dg-error "expected" } */
+{
+ a[0:64] = 0; /* { dg-error "was not declared" "" { target c++ } 7 } */
+ a[0:64] = 0;
+}