From 8e36332cf65b4ec5a1ea6b4b3a6ae8cb6ed9f455 Mon Sep 17 00:00:00 2001 From: Cesar Philippidis Date: Wed, 12 Sep 2018 08:21:19 -0700 Subject: [PATCH] [OpenACC] C++ reference mapping 2018-09-09 Cesar Philippidis Julian Brown PR middle-end/86336 gcc/cp/ * semantics.c (finish_omp_clauses): Treat C++ references the same in OpenACC as OpenMP. gcc/ * gimplify.c (gimplify_scan_omp_clauses): Set target_firstprivatize_array_bases in OpenACC parallel and kernels region contexts. Remove GOMP_MAP_FIRSTPRIVATE_REFERENCE clauses from OpenACC data regions. libgomp/ * testsuite/libgomp.oacc-c++/non-scalar-data.C: Remove XFAIL. Co-Authored-By: Julian Brown From-SVN: r264244 --- gcc/ChangeLog | 9 +++++++++ gcc/cp/ChangeLog | 7 +++++++ gcc/cp/semantics.c | 2 +- gcc/gimplify.c | 5 ++++- libgomp/ChangeLog | 6 ++++++ libgomp/testsuite/libgomp.oacc-c++/non-scalar-data.C | 3 +-- 6 files changed, 28 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 122e0d2948e..06911461a12 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2018-09-09 Cesar Philippidis + Julian Brown + + PR middle-end/86336 + * gimplify.c (gimplify_scan_omp_clauses): Set + target_firstprivatize_array_bases in OpenACC parallel and kernels + region contexts. Remove GOMP_MAP_FIRSTPRIVATE_REFERENCE clauses from + OpenACC data regions. + 2018-09-12 Uros Bizjak * config/i386/i386.md (sqrt_extendxf3_i387): Remove. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 258a6ffd65d..e4d635dc47d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2018-09-09 Cesar Philippidis + Julian Brown + + PR middle-end/86336 + * semantics.c (finish_omp_clauses): Treat C++ references the same in + OpenACC as OpenMP. + 2018-08-28 Martin Liska * constexpr.c (cxx_eval_call_expression): Add quotes diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index f3e5d83b1ef..bf3c63a09a1 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -6878,7 +6878,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) handle_map_references: if (!remove && !processing_template_decl - && (ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP + && ort != C_ORT_DECLARE_SIMD && TYPE_REF_P (TREE_TYPE (OMP_CLAUSE_DECL (c)))) { t = OMP_CLAUSE_DECL (c); diff --git a/gcc/gimplify.c b/gcc/gimplify.c index dbd0f0ebd0c..f0eb04a751c 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -7513,6 +7513,8 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, case OMP_TARGET_EXIT_DATA: case OACC_DECLARE: case OACC_HOST_DATA: + case OACC_PARALLEL: + case OACC_KERNELS: ctx->target_firstprivatize_array_bases = true; default: break; @@ -8556,7 +8558,8 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, if (code == OACC_DATA && OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP - && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_POINTER) + && (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_POINTER + || OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_REFERENCE)) remove = true; if (remove) *list_p = OMP_CLAUSE_CHAIN (c); diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index b3fad644863..219a75217ed 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,9 @@ +2018-09-09 Cesar Philippidis + Julian Brown + + PR middle-end/86336 + * testsuite/libgomp.oacc-c++/non-scalar-data.C: Remove XFAIL. + 2018-08-21 Nicolas Koenig Thomas Koenig diff --git a/libgomp/testsuite/libgomp.oacc-c++/non-scalar-data.C b/libgomp/testsuite/libgomp.oacc-c++/non-scalar-data.C index 8e4b296382b..e5f8707c249 100644 --- a/libgomp/testsuite/libgomp.oacc-c++/non-scalar-data.C +++ b/libgomp/testsuite/libgomp.oacc-c++/non-scalar-data.C @@ -1,8 +1,7 @@ // Ensure that a non-scalar dummy arguments which are implicitly used inside // offloaded regions are properly mapped using present_or_copy semantics. -// { dg-xfail-if "TODO" { *-*-* } } -// { dg-excess-errors "ICE" } +// { dg-do run } #include -- 2.30.2