aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorIgor Zamyatin <igor.zamyatin@intel.com>2015-11-23 12:58:12 +0000
committerKirill Yukhin <kyukhin@gcc.gnu.org>2015-11-23 12:58:12 +0000
commitcc5c5226961128c8c1c0eadd3d7997a59bf2a8b0 (patch)
tree30e258cf929d46b9df9c2b27f3695b35c4253e1c /gcc/c-family
parentf7b492ea50624b72ec1d3c109fe0128a69b9e343 (diff)
downloadgcc-cc5c5226961128c8c1c0eadd3d7997a59bf2a8b0.zip
gcc-cc5c5226961128c8c1c0eadd3d7997a59bf2a8b0.tar.gz
gcc-cc5c5226961128c8c1c0eadd3d7997a59bf2a8b0.tar.bz2
re PR c++/68001 ([cilkplus] ICE in cp_gimplify_expr, at cp/cp-gimplify.c:760)
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. From-SVN: r230755
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog7
-rw-r--r--gcc/c-family/c-gimplify.c8
-rw-r--r--gcc/c-family/cilk.c17
3 files changed, 26 insertions, 6 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index c19cafa..6e7b0f7 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,10 @@
+2015-11-23 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ 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.
+
2015-11-19 Jason Merrill <jason@redhat.com>
* c-common.c (shorten_compare): But look through macros from
diff --git a/gcc/c-family/c-gimplify.c b/gcc/c-family/c-gimplify.c
index a3d0025..fc4a44a 100644
--- a/gcc/c-family/c-gimplify.c
+++ b/gcc/c-family/c-gimplify.c
@@ -272,16 +272,16 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
}
case CILK_SPAWN_STMT:
- gcc_assert
- (fn_contains_cilk_spawn_p (cfun)
- && cilk_detect_spawn_and_unwrap (expr_p));
+ gcc_assert(fn_contains_cilk_spawn_p (cfun)
+ && cilk_detect_spawn_and_unwrap (expr_p));
- /* If errors are seen, then just process it as a CALL_EXPR. */
if (!seen_error ())
{
cilk_gimplify_call_params_in_spawned_fn (expr_p, pre_p, post_p);
return (enum gimplify_status) gimplify_cilk_spawn (expr_p);
}
+ return GS_ERROR;
+
case MODIFY_EXPR:
case INIT_EXPR:
case CALL_EXPR:
diff --git a/gcc/c-family/cilk.c b/gcc/c-family/cilk.c
index e75e20c..15cce34 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;
}