@@ -559,6 +559,7 @@ int
cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
{
int saved_stmts_are_full_exprs_p = 0;
+ bool is_spawn_detected = true;
enum tree_code code = TREE_CODE (*expr_p);
enum gimplify_status ret;
@@ -614,12 +615,12 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
25979. */
case INIT_EXPR:
if (fn_contains_cilk_spawn_p (cfun)
- && cilk_detect_spawn_and_unwrap (expr_p))
+ && (is_spawn_detected = cilk_detect_spawn_and_unwrap (expr_p)))
{
cilk_cp_gimplify_call_params_in_spawned_fn (expr_p, pre_p, post_p);
return (enum gimplify_status) gimplify_cilk_spawn (expr_p);
}
- if (seen_error ())
+ if (!is_spawn_detected && seen_error ())
return GS_ERROR;
cp_gimplify_init_expr (expr_p);