@@ -1,3 +1,8 @@
+2017-05-05 Thomas Schwinge <thomas@codesourcery.com>
+
+ * tree-nested.c (convert_nonlocal_omp_clauses)
+ (convert_local_omp_clauses): Handle OMP_CLAUSE_IF_PRESENT.
+
2017-05-04 Cesar Philippidis <cesar@codesourcery.com>
* gimplify.c (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_IF_PRESENT.
@@ -1,3 +1,9 @@
+2017-05-05 Thomas Schwinge <thomas@codesourcery.com>
+
+ * g++.dg/goacc/update-1.C: Update.
+ * gcc.dg/goacc/nested-function-1.c: Likewise.
+ * gfortran.dg/goacc/nested-function-1.f90: Likewise.
+
2017-05-04 Cesar Philippidis <cesar@codesourcery.com>
* c-c++-common/goacc/update-if_present-1.c: New test.
@@ -15,4 +15,24 @@ t ()
#pragma acc update self(c) device(b) host (a) async(10) if (a == 5) if_present
}
+class
+C
+{
+private:
+ bool a;
+ float b;
+
+public:
+ bool operator== (int x)
+ {
+ return a == x;
+ }
+};
+
+void
+f ()
+{
+ t<C> ();
+}
+
/* { dg-final { scan-tree-dump-times "pragma omp target oacc_update if_present" 4 "omplower" } } */
@@ -25,6 +25,8 @@ int main ()
local_a[i] = 5;
local_arg = 5;
+#pragma acc update device(local_a) if_present
+
#pragma acc kernels loop \
gang(num:local_arg) worker(local_arg) vector(local_arg) \
wait async(local_arg)
@@ -62,6 +64,8 @@ int main ()
nonlocal_a[i] = 5;
nonlocal_arg = 5;
+#pragma acc update device(nonlocal_a) if_present
+
#pragma acc kernels loop \
gang(num:nonlocal_arg) worker(nonlocal_arg) vector(nonlocal_arg) \
wait async(nonlocal_arg)
@@ -25,6 +25,8 @@ contains
local_a (:) = 5
local_arg = 5
+ !$acc update device(local_a) if_present
+
!$acc kernels loop &
!$acc gang(num:local_arg) worker(local_arg) vector(local_arg) &
!$acc wait async(local_arg)
@@ -60,6 +62,8 @@ contains
nonlocal_a (:) = 5
nonlocal_arg = 5
+ !$acc update device(nonlocal_a) if_present
+
!$acc kernels loop &
!$acc gang(num:nonlocal_arg) worker(nonlocal_arg) vector(nonlocal_arg) &
!$acc wait async(nonlocal_arg)
@@ -1202,6 +1202,7 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
case OMP_CLAUSE_SEQ:
case OMP_CLAUSE_INDEPENDENT:
case OMP_CLAUSE_AUTO:
+ case OMP_CLAUSE_IF_PRESENT:
break;
case OMP_CLAUSE_DEVICE_TYPE:
@@ -1900,6 +1901,7 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
case OMP_CLAUSE_SEQ:
case OMP_CLAUSE_INDEPENDENT:
case OMP_CLAUSE_AUTO:
+ case OMP_CLAUSE_IF_PRESENT:
break;
case OMP_CLAUSE_DEVICE_TYPE: