From 97563bc895f753bab46f97c1843167faae1a6c06 Mon Sep 17 00:00:00 2001 From: Igor Zamyatin Date: Mon, 26 May 2014 10:04:01 +0000 Subject: [PATCH] re PR c/61191 (cilkplus ICE on syntax error) gcc/c/ PR c/61191 * c-array-notation.c (fix_builtin_array_notation_fn): Check invalid function parameters. gcc/testsuite/ PR c/61191 * c-c++-common/cilk-plus/AN/pr61191.c: Check for correct handling of the case with syntax error. From-SVN: r210930 --- gcc/c/ChangeLog | 6 ++++++ gcc/c/c-array-notation.c | 2 ++ gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c | 10 ++++++++++ 4 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index dc4a653d5087..9c35867de5f5 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2014-05-26 Igor Zamyatin + + PR c/61191 + * c-array-notation.c (fix_builtin_array_notation_fn): Check invalid + function parameters. + 2014-05-23 Jan Hubicka * c-decl.c (merge_decls): Preserve symtab node pointers. diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c index a01269742ce1..a0fe2fbbee8d 100644 --- a/gcc/c/c-array-notation.c +++ b/gcc/c/c-array-notation.c @@ -229,6 +229,8 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) /* Fully fold any EXCESSIVE_PRECISION EXPR that can occur in the function parameter. */ func_parm = c_fully_fold (func_parm, false, NULL); + if (func_parm == error_mark_node) + return error_mark_node; location = EXPR_LOCATION (an_builtin_fn); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 810cc44a87cc..c2c2f6a363f7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-05-26 Igor Zamyatin + + PR c/61191 + * c-c++-common/cilk-plus/AN/pr61191.c: Check for correct handling of + the case with syntax error. + 2014-05-26 Zhenqiang Chen * gcc.dg/lto/pr61278_0.c: New test. diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c new file mode 100644 index 000000000000..e27819b4fc3b --- /dev/null +++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c @@ -0,0 +1,10 @@ +/* PR c/61191 */ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ + +double f(double * A, double * B) +{ + return __sec_reduce_add((B[0:500])(; +/* { dg-error "expected expression before ';' token" "" {target *-*-*} 7 } */ +/* { dg-error "called object" "" {target *-*-*} 7 } */ +} /* { dg-error "expected" } */ -- 2.43.5