diff mbox

[GOMP4,COMMITTED] OpenACC deviceptr clause.

Message ID 87bnodph0y.fsf@schwinge.name
State New
Headers show

Commit Message

Thomas Schwinge Nov. 11, 2014, 9:24 p.m. UTC
Hi!

On Thu, 5 Jun 2014 16:00:16 +0200, I wrote:
> --- gcc/omp-low.c
> +++ gcc/omp-low.c
> @@ -1738,6 +1754,10 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
>  	    {
>  	      tree base = get_base_address (decl);
>  	      tree nc = OMP_CLAUSE_CHAIN (c);
> +	      gcc_assert (nc == NULL_TREE
> +			  || OMP_CLAUSE_CODE (nc) != OMP_CLAUSE_MAP
> +			  || (OMP_CLAUSE_MAP_KIND (nc)
> +			      != OMP_CLAUSE_MAP_FORCE_DEVICEPTR));
>  	      if (DECL_P (base)
>  		  && nc != NULL_TREE
>  		  && OMP_CLAUSE_CODE (nc) == OMP_CLAUSE_MAP

That's a bogus assertion; removed in r217372 on gomp-4_0-branch:

commit 7ae51786d4a2aad4c82045dda780ae3e7904afa8
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Tue Nov 11 21:22:26 2014 +0000

    OpenACC deviceptr clause: Remove bogus assertion.
    
    	gcc/
    	* omp-low.c (scan_sharing_clauses): Remove bogus assertion.
    	gcc/testsuite/
    	* c-c++-common/goacc/deviceptr-3.c: New file.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@217372 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.gomp                             |  2 ++
 gcc/omp-low.c                                  |  4 ----
 gcc/testsuite/ChangeLog.gomp                   |  5 +++++
 gcc/testsuite/c-c++-common/goacc/deviceptr-3.c | 11 +++++++++++
 4 files changed, 18 insertions(+), 4 deletions(-)



Grüße,
 Thomas
diff mbox

Patch

diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp
index 94a7f8c..4ea28e2 100644
--- gcc/ChangeLog.gomp
+++ gcc/ChangeLog.gomp
@@ -1,5 +1,7 @@ 
 2014-11-11  Thomas Schwinge  <thomas@codesourcery.com>
 
+	* omp-low.c (scan_sharing_clauses): Remove bogus assertion.
+
 	* omp-low.c (delete_omp_context): Dispose of reduction_map.
 
 	* omp-low.c (maybe_lookup_reduction): Don't require an OpenACC
diff --git gcc/omp-low.c gcc/omp-low.c
index 5695ec3..1263409 100644
--- gcc/omp-low.c
+++ gcc/omp-low.c
@@ -1920,10 +1920,6 @@  scan_sharing_clauses (tree clauses, omp_context *ctx)
 	    {
 	      tree base = get_base_address (decl);
 	      tree nc = OMP_CLAUSE_CHAIN (c);
-	      gcc_assert (nc == NULL_TREE
-			  || OMP_CLAUSE_CODE (nc) != OMP_CLAUSE_MAP
-			  || (OMP_CLAUSE_MAP_KIND (nc)
-			      != OMP_CLAUSE_MAP_FORCE_DEVICEPTR));
 	      if (DECL_P (base)
 		  && nc != NULL_TREE
 		  && OMP_CLAUSE_CODE (nc) == OMP_CLAUSE_MAP
diff --git gcc/testsuite/ChangeLog.gomp gcc/testsuite/ChangeLog.gomp
index a02f58a..f8bacc3 100644
--- gcc/testsuite/ChangeLog.gomp
+++ gcc/testsuite/ChangeLog.gomp
@@ -1,3 +1,8 @@ 
+2014-11-07  Thomas Schwinge  <thomas@codesourcery.com>
+	    James Norris  <jnorris@codesourcery.com>
+
+	* c-c++-common/goacc/deviceptr-3.c: New file.
+
 2014-11-05  Thomas Schwinge  <thomas@codesourcery.com>
 
 	* c-c++-common/goacc/update-1.c: Extend.
diff --git gcc/testsuite/c-c++-common/goacc/deviceptr-3.c gcc/testsuite/c-c++-common/goacc/deviceptr-3.c
new file mode 100644
index 0000000..bab56c3
--- /dev/null
+++ gcc/testsuite/c-c++-common/goacc/deviceptr-3.c
@@ -0,0 +1,11 @@ 
+float *d_a;
+
+void
+f (float *a)
+{
+#pragma acc parallel copyout (a[3:10]) deviceptr (d_a)
+  d_a[2] += 1.0;
+
+#pragma acc parallel deviceptr (d_a) copyout (a[3:10])
+  d_a[2] += 1.0;
+}