Commit b6e3db06 by Ryan Burn Committed by Jeff Law

[cilkplus] Fix cilk_spawn gimplification bug (PR cilkplus/69048)

	PR c++/69048
	* cilk.c (create_cilk_wrapper_body): Call fold_build_cleanup_point_expr
	 to add missing cleanup point.

	PR c++/69048
	* g++.dg/cilk-plus/CK/pr69048.cc: New test.

From-SVN: r232393
parent 006df05d
2015-01-14 Ryan Burn <contact@rnburn.com>
PR c++/69048
* cilk.c (create_cilk_wrapper_body): Call fold_build_cleanup_point_expr
to add missing cleanup point.
2016-01-14 David Malcolm <dmalcolm@redhat.com>
PR c++/68819
......
......@@ -592,6 +592,11 @@ create_cilk_wrapper_body (tree stmt, struct wrapper_data *wd)
for (p = wd->parms; p; p = TREE_CHAIN (p))
DECL_CONTEXT (p) = fndecl;
/* The statement containing the spawn expression might create temporaries with
destructors defined; if so we need to add a CLEANUP_POINT_EXPR to ensure
the expression is properly gimplified. */
stmt = fold_build_cleanup_point_expr (void_type_node, stmt);
gcc_assert (!DECL_SAVED_TREE (fndecl));
cilk_install_body_with_frame_cleanup (fndecl, stmt, (void *) wd);
gcc_assert (DECL_SAVED_TREE (fndecl));
......
2015-01-14 Ryan Burn <contact@rnburn.com>
PR c++/69048
* g++.dg/cilk-plus/CK/pr69048.cc: New test.
2016-01-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR testsuite/67509
......
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
struct A {
~A () {}
};
A f () {
return A ();
}
void t1 () {
_Cilk_spawn f ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment