aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2014-03-06 13:41:46 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2014-03-06 13:41:46 +0000
commit3af9c5e9783dd757a944a9022bec182ced5e0596 (patch)
tree2d668c3e9bd8ebb785bab61a9adb5b1d97776036 /gcc/c
parent227a7dc8fb3b72780e5127d85306381b8ff3e81e (diff)
downloadgcc-3af9c5e9783dd757a944a9022bec182ced5e0596.zip
gcc-3af9c5e9783dd757a944a9022bec182ced5e0596.tar.gz
gcc-3af9c5e9783dd757a944a9022bec182ced5e0596.tar.bz2
re PR c/60197 (ICE with _Cilk_spawn in expression)
PR c/60197 c-family/ * cilk.c (contains_cilk_spawn_stmt): New function. (contains_cilk_spawn_stmt_walker): Likewise. (recognize_spawn): Give error on invalid use of _Cilk_spawn. * c-common.h (contains_cilk_spawn_stmt): Add declaration. c/ * c-typeck.c (c_finish_return): Call contains_cilk_spawn_stmt instead of checking tree code. cp/ * typeck.c (check_return_expr): Call contains_cilk_spawn_stmt instead of checking tree code. testsuite/ * c-c++-common/cilk-plus/CK/pr60197.c: New test. * c-c++-common/cilk-plus/CK/pr60197-2.c: New test. From-SVN: r208382
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-typeck.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 5e482a3..e9d25d5 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2014-03-06 Marek Polacek <polacek@redhat.com>
+
+ PR c/60197
+ * c-typeck.c (c_finish_return): Call contains_cilk_spawn_stmt instead
+ of checking tree code.
+
2014-02-19 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
* c-parser.c (c_parser_declspecs): Replace call to error by error_at.
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 2b54290..7c4ba0e 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -9140,7 +9140,7 @@ c_finish_return (location_t loc, tree retval, tree origtype)
return error_mark_node;
}
}
- if (flag_cilkplus && retval && TREE_CODE (retval) == CILK_SPAWN_STMT)
+ if (flag_cilkplus && retval && contains_cilk_spawn_stmt (retval))
{
error_at (loc, "use of %<_Cilk_spawn%> in a return statement is not "
"allowed");