diff options
author | Cesar Philippidis <cesar@codesourcery.com> | 2016-01-15 06:49:55 -0800 |
---|---|---|
committer | Cesar Philippidis <cesar@gcc.gnu.org> | 2016-01-15 06:49:55 -0800 |
commit | 33a126a6f2669a29a6657bffa96214ea33de211b (patch) | |
tree | 60de8fc3a07ebcd9cfacd0fd6e4b83d1bd7079c9 /gcc | |
parent | a00fe3b787de1916bed415c57024d49bbe81cb1c (diff) | |
download | gcc-33a126a6f2669a29a6657bffa96214ea33de211b.zip gcc-33a126a6f2669a29a6657bffa96214ea33de211b.tar.gz gcc-33a126a6f2669a29a6657bffa96214ea33de211b.tar.bz2 |
gimplify.c (oacc_default_clause): Decode reference and pointer types for both kernels and parallel regions.
gcc/
* gimplify.c (oacc_default_clause): Decode reference and pointer
types for both kernels and parallel regions.
libgomp/
* testsuite/libgomp.oacc-fortran/kernels-data.f90: New test.
From-SVN: r232431
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/gimplify.c | 12 |
2 files changed, 10 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 59dc4ab..5680be8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-01-15 Cesar Philippidis <cesar@codesourcery.com> + + * gimplify.c (oacc_default_clause): Decode reference and pointer + types for both kernels and parallel regions. + 2016-01-15 Richard Sandiford <richard.sandiford@arm.com> PR middle-end/69246 diff --git a/gcc/gimplify.c b/gcc/gimplify.c index ca66402..c8de1e6 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -5986,6 +5986,10 @@ oacc_default_clause (struct gimplify_omp_ctx *ctx, tree decl, unsigned flags) { const char *rkind; bool on_device = false; + tree type = TREE_TYPE (decl); + + if (lang_hooks.decls.omp_privatize_by_reference (decl)) + type = TREE_TYPE (type); if ((ctx->region_type & (ORT_ACC_PARALLEL | ORT_ACC_KERNELS)) != 0 && is_global_var (decl) @@ -6004,7 +6008,7 @@ oacc_default_clause (struct gimplify_omp_ctx *ctx, tree decl, unsigned flags) /* Scalars are default 'copy' under kernels, non-scalars are default 'present_or_copy'. */ flags |= GOVD_MAP; - if (!AGGREGATE_TYPE_P (TREE_TYPE (decl))) + if (!AGGREGATE_TYPE_P (type)) flags |= GOVD_MAP_FORCE; rkind = "kernels"; @@ -6012,12 +6016,6 @@ oacc_default_clause (struct gimplify_omp_ctx *ctx, tree decl, unsigned flags) case ORT_ACC_PARALLEL: { - tree type = TREE_TYPE (decl); - - if (TREE_CODE (type) == REFERENCE_TYPE - || POINTER_TYPE_P (type)) - type = TREE_TYPE (type); - if (on_device || AGGREGATE_TYPE_P (type)) /* Aggregates default to 'present_or_copy'. */ flags |= GOVD_MAP; |