On 01/20/2016 10:57 AM, Ryan Burn wrote:
This patch follows on from
https://gcc.gnu.org/ml/gcc-patches/2015-12/msg02142.html
As discussed, it creates a separate function
cilk_cp_detect_spawn_and_unwrap in gcc/cp to handle processing
cilk_spawn expressions for c++ and adds support for implicit
constructor and type conversions.
Bootstrapped and regression tested on x86_64-linux.
gcc/c-family/ChangeLog:
2015-01-20 Ryan Burn <cont...@rnburn.com>
PR c++/69024
PR c++/68997
* cilk.c (cilk_ignorable_spawn_rhs_op): Change to have external linkage.
* cilk.c (recognize_spawn): Rename to cilk_recognize_spawn. Change to have
external linkage.
* cilk.c (cilk_detect_and_unwrap): Rename to recognize_spawn to
cilk_recognize_spawn.
* cilk.c (extract_free_variables): Don't extract free variables from
AGGR_INIT_EXPR slot.
gcc/cp/ChangeLog
2015-01-20 Ryan Burn <cont...@rnburn.com>
PR c++/69024
PR c++/68997
* cp-gimplify.c (cp_gimplify_expr): Call cilk_cp_detect_spawn_and_unwrap
instead of cilk_detect_spawn_and_unwrap.
* cp-cilkplus.c (is_conversion_operator_function_decl_p): New.
* cp-cilkplus.c (find_spawn): New.
* cp-cilkplus.c (cilk_cp_detect_spawn_and_unwrap): New.
gcc/testsuite/ChangeLog
2015-01-20 Ryan Burn <cont...@rnburn.com>
PR c++/69024
PR c++/68997
* g++.dg/cilk-plus/CK/pr68001.cc: Fix to not depend on broken diagnostic.
* g++.dg/cilk-plus/CK/pr69024.cc: New test.
* g++.dg/cilk-plus/CK/pr68997.cc: New test.
cilk3.diff
Index: gcc/cp/cp-gimplify.c
===================================================================
--- gcc/cp/cp-gimplify.c (revision 232444)
+++ gcc/cp/cp-gimplify.c (working copy)
@@ -39,6 +39,7 @@
static tree cp_fold_r (tree *, int *, void *);
static void cp_genericize_tree (tree*);
static tree cp_fold (tree);
+bool cilk_cp_detect_spawn_and_unwrap (tree *);
The right thing to do here is create cp-cilkplus.h and put the prototype
in here. Along with cpp_validate_cilk_plus_loop.
Index: gcc/cp/cp-cilkplus.c
===================================================================
--- gcc/cp/cp-cilkplus.c (revision 232444)
+++ gcc/cp/cp-cilkplus.c (working copy)
@@ -27,6 +27,108 @@
#include "tree-iterator.h"
#include "cilk.h"
+bool cilk_ignorable_spawn_rhs_op (tree);
+bool cilk_recognize_spawn (tree, tree *);
These should be prototyped in an appropriate .h file. c-common.h, while
not ideal, would be OK. c-common seems to be a fairly bad dumping
ground and we'll want to untangle separately.
+
+/* Return TRUE if T is a FUNCTION_DECL for a type-conversion operator. */
+
+static bool
+is_conversion_operator_function_decl_p (tree t) {
+ if (TREE_CODE (t) != FUNCTION_DECL)
+ return false;
+
+ return DECL_NAME (t) && IDENTIFIER_TYPENAME_P (DECL_NAME (t));
+}
Formatting. The open-curly goes on a line by itself
I'm spinning up those changes for testing. Assuming they pass, I'll
update the ChangeLog appropriately as well.
Jeff