aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 4e6f448..bb50e25 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4189,6 +4189,7 @@ is_gimple_stmt (tree t)
case OMP_PARALLEL:
case OMP_FOR:
case OMP_SIMD:
+ case CILK_SIMD:
case OMP_DISTRIBUTE:
case OMP_SECTIONS:
case OMP_SECTION:
@@ -6406,7 +6407,8 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
orig_for_stmt = for_stmt = *expr_p;
- simd = TREE_CODE (for_stmt) == OMP_SIMD;
+ simd = TREE_CODE (for_stmt) == OMP_SIMD
+ || TREE_CODE (for_stmt) == CILK_SIMD;
gimplify_scan_omp_clauses (&OMP_FOR_CLAUSES (for_stmt), pre_p,
simd ? ORT_SIMD : ORT_WORKSHARE);
@@ -6543,15 +6545,22 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
{
case PREINCREMENT_EXPR:
case POSTINCREMENT_EXPR:
- if (orig_for_stmt != for_stmt)
+ {
+ tree decl = TREE_OPERAND (t, 0);
+ // c_omp_for_incr_canonicalize_ptr() should have been
+ // called to massage things appropriately.
+ gcc_assert (!POINTER_TYPE_P (TREE_TYPE (decl)));
+
+ if (orig_for_stmt != for_stmt)
+ break;
+ t = build_int_cst (TREE_TYPE (decl), 1);
+ if (c)
+ OMP_CLAUSE_LINEAR_STEP (c) = t;
+ t = build2 (PLUS_EXPR, TREE_TYPE (decl), var, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (var), var, t);
+ TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i) = t;
break;
- t = build_int_cst (TREE_TYPE (decl), 1);
- if (c)
- OMP_CLAUSE_LINEAR_STEP (c) = t;
- t = build2 (PLUS_EXPR, TREE_TYPE (decl), var, t);
- t = build2 (MODIFY_EXPR, TREE_TYPE (var), var, t);
- TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i) = t;
- break;
+ }
case PREDECREMENT_EXPR:
case POSTDECREMENT_EXPR:
@@ -6661,6 +6670,7 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
{
case OMP_FOR: kind = GF_OMP_FOR_KIND_FOR; break;
case OMP_SIMD: kind = GF_OMP_FOR_KIND_SIMD; break;
+ case CILK_SIMD: kind = GF_OMP_FOR_KIND_CILKSIMD; break;
case OMP_DISTRIBUTE: kind = GF_OMP_FOR_KIND_DISTRIBUTE; break;
default:
gcc_unreachable ();
@@ -7730,6 +7740,7 @@ 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 = gimplify_omp_for (expr_p, pre_p);
break;