@@ -1,3 +1,8 @@
+2014-02-27 Thomas Schwinge <thomas@codesourcery.com>
+
+ * gimplify.c (gimplify_oacc_parallel): Merge into
+ gimplify_omp_workshare. Update all callers.
+
2014-02-27 Ilmir Usmanov <i.usmanov@samsung.com>
Fix OpenACC ASYNC clause: it cannot contain integer-expression-list.
@@ -6572,38 +6572,6 @@ gimplify_adjust_omp_clauses (tree *list_p)
delete_omp_context (ctx);
}
-/* Gimplify the contents of an OACC_PARALLEL statement. This involves
- gimplification of the body, as well as scanning the body for used
- variables. We need to do this scan now, because variable-sized
- decls will be decomposed during gimplification. */
-
-static void
-gimplify_oacc_parallel (tree *expr_p, gimple_seq *pre_p)
-{
- tree expr = *expr_p;
- gimple g;
- gimple_seq body = NULL;
- enum omp_region_type ort = (enum omp_region_type) (ORT_TARGET
- | ORT_TARGET_OFFLOAD
- | ORT_TARGET_MAP_FORCE);
-
- gimplify_scan_omp_clauses (&OACC_PARALLEL_CLAUSES (expr), pre_p, ort);
-
- push_gimplify_context ();
-
- g = gimplify_and_return_first (OACC_PARALLEL_BODY (expr), &body);
- if (gimple_code (g) == GIMPLE_BIND)
- pop_gimplify_context (g);
- else
- pop_gimplify_context (NULL);
-
- gimplify_adjust_omp_clauses (&OACC_PARALLEL_CLAUSES (expr));
-
- g = gimple_build_oacc_parallel (body, OACC_PARALLEL_CLAUSES (expr));
- gimplify_seq_add_stmt (pre_p, g);
- *expr_p = NULL_TREE;
-}
-
/* Gimplify the contents of an OMP_PARALLEL statement. This involves
gimplification of the body, as well as scanning the body for used
variables. We need to do this scan now, because variable-sized
@@ -7039,6 +7007,11 @@ gimplify_omp_workshare (tree *expr_p, gimple_seq *pre_p)
ort = (enum omp_region_type) (ORT_TARGET
| ORT_TARGET_MAP_FORCE);
break;
+ case OACC_PARALLEL:
+ ort = (enum omp_region_type) (ORT_TARGET
+ | ORT_TARGET_OFFLOAD
+ | ORT_TARGET_MAP_FORCE);
+ break;
case OMP_SECTIONS:
case OMP_SINGLE:
ort = ORT_WORKSHARE;
@@ -7097,6 +7070,9 @@ gimplify_omp_workshare (tree *expr_p, gimple_seq *pre_p)
stmt = gimple_build_omp_target (body, GF_OMP_TARGET_KIND_OACC_DATA,
OACC_DATA_CLAUSES (expr));
break;
+ case OACC_PARALLEL:
+ stmt = gimple_build_oacc_parallel (body, OACC_PARALLEL_CLAUSES (expr));
+ break;
case OMP_SECTIONS:
stmt = gimple_build_omp_sections (body, OMP_CLAUSES (expr));
break;
@@ -8060,11 +8036,6 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
ret = GS_ALL_DONE;
break;
- case OACC_PARALLEL:
- gimplify_oacc_parallel (expr_p, pre_p);
- ret = GS_ALL_DONE;
- break;
-
case OACC_KERNELS:
case OACC_HOST_DATA:
case OACC_DECLARE:
@@ -8095,6 +8066,7 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
break;
case OACC_DATA:
+ case OACC_PARALLEL:
case OMP_SECTIONS:
case OMP_SINGLE:
case OMP_TARGET: