aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2017-05-19 15:32:30 +0200
committerThomas Schwinge <tschwinge@gcc.gnu.org>2017-05-19 15:32:30 +0200
commit0d0afa9fafec1711b52259b9b8caebf51380216d (patch)
treea75a6480974531c739fdc88ea1bf94df0ea2af73
parent9740ed54a6daf89d224a169d93412e6d821fad3c (diff)
downloadgcc-0d0afa9fafec1711b52259b9b8caebf51380216d.zip
gcc-0d0afa9fafec1711b52259b9b8caebf51380216d.tar.gz
gcc-0d0afa9fafec1711b52259b9b8caebf51380216d.tar.bz2
Clarify gcc/gimplify.c:oacc_default_clause
gcc/ * gimplify.c (oacc_default_clause): Clarify. From-SVN: r248279
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/gimplify.c40
2 files changed, 26 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 44ff617..8f63902 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
+
+ * gimplify.c (oacc_default_clause): Clarify.
+
2017-05-19 Nathan Sidwell <nathan@acm.org>
LANG_HOOK_REGISTER_DUMPS
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index acaab8b..0c02ee4 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6952,30 +6952,34 @@ oacc_default_clause (struct gimplify_omp_ctx *ctx, tree decl, unsigned flags)
switch (ctx->region_type)
{
- default:
- gcc_unreachable ();
-
case ORT_ACC_KERNELS:
- /* Scalars are default 'copy' under kernels, non-scalars are default
- 'present_or_copy'. */
- flags |= GOVD_MAP;
- if (!AGGREGATE_TYPE_P (type))
- flags |= GOVD_MAP_FORCE;
-
rkind = "kernels";
+
+ if (AGGREGATE_TYPE_P (type))
+ /* Aggregates default to 'present_or_copy'. */
+ flags |= GOVD_MAP;
+ else
+ /* Scalars default to 'copy'. */
+ flags |= GOVD_MAP | GOVD_MAP_FORCE;
+
break;
case ORT_ACC_PARALLEL:
- {
- if (on_device || AGGREGATE_TYPE_P (type) || declared)
- /* Aggregates default to 'present_or_copy'. */
- flags |= GOVD_MAP;
- else
- /* Scalars default to 'firstprivate'. */
- flags |= GOVD_FIRSTPRIVATE;
- rkind = "parallel";
- }
+ rkind = "parallel";
+
+ if (on_device || declared)
+ flags |= GOVD_MAP;
+ else if (AGGREGATE_TYPE_P (type))
+ /* Aggregates default to 'present_or_copy'. */
+ flags |= GOVD_MAP;
+ else
+ /* Scalars default to 'firstprivate'. */
+ flags |= GOVD_FIRSTPRIVATE;
+
break;
+
+ default:
+ gcc_unreachable ();
}
if (DECL_ARTIFICIAL (decl))