[OpenACC] C++ reference mapping
authorCesar Philippidis <cesar@codesourcery.com>
Wed, 12 Sep 2018 15:21:19 +0000 (08:21 -0700)
committerJulian Brown <jules@gcc.gnu.org>
Wed, 12 Sep 2018 15:21:19 +0000 (15:21 +0000)
2018-09-09  Cesar Philippidis  <cesar@codesourcery.com>
    Julian Brown  <julian@codesourcery.com>

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 <julian@codesourcery.com>
From-SVN: r264244

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/gimplify.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.oacc-c++/non-scalar-data.C

index 122e0d2948e93adc7d224724bbe69cece1182c4d..06911461a1253a7b0520d97ef2bfbc68dd69f492 100644 (file)
@@ -1,3 +1,12 @@
+2018-09-09  Cesar Philippidis  <cesar@codesourcery.com>
+            Julian Brown  <julian@codesourcery.com>
+
+       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  <ubizjak@gmail.com>
 
        * config/i386/i386.md (sqrt_extend<mode>xf3_i387): Remove.
index 258a6ffd65db08a126c5e14f1564e5a660586693..e4d635dc47d8f3c8cfa5ac929eaf9bbcf7272a13 100644 (file)
@@ -1,3 +1,10 @@
+2018-09-09  Cesar Philippidis  <cesar@codesourcery.com>
+            Julian Brown  <julian@codesourcery.com>
+
+       PR middle-end/86336
+       * semantics.c (finish_omp_clauses): Treat C++ references the same in
+       OpenACC as OpenMP.
+
 2018-08-28  Martin Liska  <mliska@suse.cz>
 
        * constexpr.c (cxx_eval_call_expression): Add quotes
index f3e5d83b1ef5d2f35b34b2bc1807a11439d37be9..bf3c63a09a1fbe98723d567174519ea53d9bd074 100644 (file)
@@ -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);
index dbd0f0ebd0cd40ddfc59f833b74022f9b0d332c6..f0eb04a751ccc64ebeb5ba695ebf31f7b5758cec 100644 (file)
@@ -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);
index b3fad644863433b9d963e7ee40e3fb1853cc8b9a..219a75217ed8c67a02d2154194b403a8da9d1c5d 100644 (file)
@@ -1,3 +1,9 @@
+2018-09-09  Cesar Philippidis  <cesar@codesourcery.com>
+            Julian Brown  <julian@codesourcery.com>
+
+       PR middle-end/86336
+       * testsuite/libgomp.oacc-c++/non-scalar-data.C: Remove XFAIL.
+
 2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
        Thomas Koenig <tkoenig@gcc.gnu.org>
 
index 8e4b296382ba04a2dbfc264ab856e06ea1a0b7ca..e5f8707c24911fa9b48a6ba1dfd86bc50f81b561 100644 (file)
@@ -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 <cassert>