From 815d9cc6641a3eeb6734a98f64ea8b183a495ee5 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 1 May 2017 22:26:02 +0000 Subject: re PR c++/80038 (Random segfault using local vectors in Cilk function) 2017-05-01 Xi Ruoyao PR c++/80038 * cilk_common.c (expand_builtin_cilk_detach): Move pedigree operations here. * gimplify.c (gimplify_cilk_detach): New function. (gimplify_call_expr, gimplify_modify_expr): Call it as needed. * tree-core.h: Document EXPR_CILK_SPAWN. * tree.h (EXPR_CILK_SPAWN): Define. PR c++/80038 * c-common.h (cilk_gimplify_call_params_in_spawned_fn): Remove prototype. (cilk_install_body_pedigree_operations): Likewise. * cilk.c (cilk_set_spawn_marker): Mark functions that should be detatched. (cilk_gimplify_call_params_in_spawned_fn): Remove. (cilk_install_body_pedigree_operations): Likewise. (gimplify_cilk_spawn): Add EXPR_STMT and CLEANUP_POINT_EXPR unwrapping. PR c++/80038 * c-gimplify.c (c_gimplify_expr): Remove calls to cilk_gimplifY_call_params_in_spawned_fn. PR c++/80038 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't add pedigree operation and detach call here. * cp-gimplify.c (cp_gimplify_expr): Remove the calls to cilk_cp_gimplify_call_params_in_spawned_fn. (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function. * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN. PR c++/80038 * lto-lang.c (lto_init): Set in_lto_p earlier. PR c++/80038 * g++.dg/cilk-plus/CK/pr80038.cc: New test. From-SVN: r247446 --- gcc/c-family/c-gimplify.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'gcc/c-family/c-gimplify.c') diff --git a/gcc/c-family/c-gimplify.c b/gcc/c-family/c-gimplify.c index 57edb41af0f..1ae75d294ff 100644 --- a/gcc/c-family/c-gimplify.c +++ b/gcc/c-family/c-gimplify.c @@ -280,10 +280,7 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED, && cilk_detect_spawn_and_unwrap (expr_p)); if (!seen_error ()) - { - cilk_gimplify_call_params_in_spawned_fn (expr_p, pre_p); - return (enum gimplify_status) gimplify_cilk_spawn (expr_p); - } + return (enum gimplify_status) gimplify_cilk_spawn (expr_p); return GS_ERROR; case MODIFY_EXPR: @@ -295,10 +292,7 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED, original expression (MODIFY/INIT/CALL_EXPR) is processes as it is supposed to be. */ && !seen_error ()) - { - cilk_gimplify_call_params_in_spawned_fn (expr_p, pre_p); - return (enum gimplify_status) gimplify_cilk_spawn (expr_p); - } + return (enum gimplify_status) gimplify_cilk_spawn (expr_p); default:; } -- cgit v1.2.1