diff options
author | kyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-23 12:58:12 +0000 |
---|---|---|
committer | kyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-23 12:58:12 +0000 |
commit | 8d63c601b260fc0ca8aaa5c469b40c8239f4c3a9 (patch) | |
tree | 30e258cf929d46b9df9c2b27f3695b35c4253e1c /gcc/c-family/cilk.c | |
parent | 39a9f2bea17b2d74c71ecac457c6771d7116390f (diff) | |
download | gcc-8d63c601b260fc0ca8aaa5c469b40c8239f4c3a9.tar.gz |
PR c++/68001
gcc/c-family
PR c++/68001
* c-gimplify.c (c_gimplify_expr): Stop the process if see an error.
* cilk.c (recognize_spawn): Determine location in a more precise
way.
gcc/cp
* cp-gimplify.c (cp_gimplify_expr): Stop the process if see an error.
gcc/testsuite
* g++.dg/cilk-plus/CK/pr68001.cc: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230755 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/cilk.c')
-rw-r--r-- | gcc/c-family/cilk.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/c-family/cilk.c b/gcc/c-family/cilk.c index e75e20c2383..15cce34b33d 100644 --- a/gcc/c-family/cilk.c +++ b/gcc/c-family/cilk.c @@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "gimplify.h" #include "tree-iterator.h" #include "tree-inline.h" -#include "toplev.h" +#include "toplev.h" #include "calls.h" #include "cilk.h" @@ -76,6 +76,7 @@ struct wrapper_data tree block; }; +static tree contains_cilk_spawn_stmt_walker (tree *tp, int *, void *); static void extract_free_variables (tree, struct wrapper_data *, enum add_variable_type); static HOST_WIDE_INT cilk_wrapper_count; @@ -235,7 +236,19 @@ recognize_spawn (tree exp, tree *exp0) } /* _Cilk_spawn can't be wrapped in expression such as PLUS_EXPR. */ else if (contains_cilk_spawn_stmt (exp)) - error_at (EXPR_LOCATION (exp), "invalid use of %<_Cilk_spawn%>"); + { + location_t loc = EXPR_LOCATION (exp); + if (loc == UNKNOWN_LOCATION) + { + tree stmt = walk_tree (&exp, + contains_cilk_spawn_stmt_walker, + NULL, + NULL); + gcc_assert (stmt != NULL_TREE); + loc = EXPR_LOCATION (stmt); + } + error_at (loc, "invalid use of %<_Cilk_spawn%>"); + } return spawn_found; } |