diff options
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/cilk.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cilk-plus/CK/pr69048.cc | 14 |
4 files changed, 30 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index e3b9654..af21551 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/gcc/c-family/cilk.c b/gcc/c-family/cilk.c index 57dfa41..4d6be33 100644 --- a/gcc/c-family/cilk.c +++ b/gcc/c-family/cilk.c @@ -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)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d2ad41c..05ae50bb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/pr69048.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/pr69048.cc new file mode 100644 index 0000000..b6c57fc --- /dev/null +++ b/gcc/testsuite/g++.dg/cilk-plus/CK/pr69048.cc @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ + +struct A { + ~A () {} +}; + +A f () { + return A (); +} + +void t1 () { + _Cilk_spawn f (); +} |