This is a followup for the C++ changes (your pt.c suggested changes, etc).
Only a few minor changes are needed, since c_finish_cilk_simd_loop() is shared between C/C++ and it creates the appropriate CILK_SIMD tree node.
Is this what you had in mind?
commit db2127098137dea6c246041e0d763a57a174fa3c Author: Aldy Hernandez <al...@redhat.com> Date: Wed Jun 26 09:29:27 2013 -0500 Handle CILK_SIMD tree code in C++. diff --git a/gcc/cp/ChangeLog.cilkplus b/gcc/cp/ChangeLog.cilkplus index e7f7596..f0ee3ee 100644 --- a/gcc/cp/ChangeLog.cilkplus +++ b/gcc/cp/ChangeLog.cilkplus @@ -1,3 +1,10 @@ +2013-06-26 Aldy Hernandez <al...@redhat.com> + + * cp-gimplify.c (cp_gimplify_expr): Add case for CILK_SIMD. + (cp_genericize_r): Same. + * pt.c (tsubst_expr): Same. + * semantics.c (finish_omp_for): Same. + 2013-05-21 Balaji V. Iyer <balaji.v.i...@intel.com> Aldy Hernandez <al...@redhat.com> diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index 0dfa4a2..52ce57b 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -670,6 +670,7 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) case OMP_FOR: case OMP_SIMD: + case CILK_SIMD: case OMP_DISTRIBUTE: ret = cp_gimplify_omp_for (expr_p, pre_p); break; @@ -1120,6 +1121,7 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data) genericize_break_stmt (stmt_p); else if (TREE_CODE (stmt) == OMP_FOR || TREE_CODE (stmt) == OMP_SIMD + || TREE_CODE (stmt) == CILK_SIMD || TREE_CODE (stmt) == OMP_DISTRIBUTE) genericize_omp_for_stmt (stmt_p, walk_subtrees, data); else if (TREE_CODE (stmt) == SIZEOF_EXPR) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 63d960d..d0fa491 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -13293,6 +13293,7 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl, case OMP_FOR: case OMP_SIMD: + case CILK_SIMD: case OMP_DISTRIBUTE: { tree clauses, body, pre_body; diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index ee83462..722a996 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -5782,7 +5782,7 @@ finish_omp_for (location_t locus, enum tree_code code, tree declv, tree initv, if (CLASS_TYPE_P (TREE_TYPE (decl))) { - if (code == OMP_SIMD) + if (code == OMP_SIMD || code == CILK_SIMD) { error_at (elocus, "%<#pragma omp simd%> used with class " "iteration variable %qE", decl);