public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-12] Align with: "OpenMP/Fortran: 'target update' with DT components"
@ 2022-11-04 12:50 Tobias Burnus
  0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2022-11-04 12:50 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f9d5362918ef7aa6f840ac48ccb8897a09fe99f1

commit f9d5362918ef7aa6f840ac48ccb8897a09fe99f1
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Fri Nov 4 11:20:24 2022 +0100

    Align with: "OpenMP/Fortran: 'target update' with DT components"
    
    This commit partially undos the OG12 commit
       cb934e37962eeccc8641982b9a9855408979c767
       OpenMP/Fortran: 'target update' with strides + DT components
    to match the mainline (GCC 13) version:
       r13-3625-g6629444170f85e9b1e243aa07e3e07a8b9f8fce5
       OpenMP/Fortran: 'target update' with DT components
    
    The difference is that strides are not permitted in the mainline
    version; for the reason and to-do, see: https://gcc.gnu.org/PR107517
    
    Interdiff changelog:
    
    2022-11-04  Tobias Burnus  <tobias@codesourcery.com>
    
    gcc/fortran/ChangeLog.omp
            Partial Revert:
            2022-11-02  Tobias Burnus  <tobias@codesourcery.com>
    
            * openmp.cc (resolve_omp_clauses):Accept noncontiguous arrays.
    
    libgomp/ChangeLog.omp
    
            * testsuite/libgomp.fortran/target-13.f90: Remove strides to match
            mainline (GCC 13) version.
    
    (cherry picked from commit 6629444170f85e9b1e243aa07e3e07a8b9f8fce5)

Diff:
---
 gcc/fortran/ChangeLog.omp                       |  7 +++++++
 gcc/fortran/openmp.cc                           |  9 ++-------
 libgomp/ChangeLog.omp                           |  5 +++++
 libgomp/testsuite/libgomp.fortran/target-13.f90 | 13 +++++--------
 4 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/gcc/fortran/ChangeLog.omp b/gcc/fortran/ChangeLog.omp
index a7ce52cf9ba..a7c7a252b47 100644
--- a/gcc/fortran/ChangeLog.omp
+++ b/gcc/fortran/ChangeLog.omp
@@ -1,3 +1,10 @@
+2022-11-04  Tobias Burnus  <tobias@codesourcery.com>
+
+	Partial Revert:
+	2022-11-02  Tobias Burnus  <tobias@codesourcery.com>
+
+	* openmp.cc (resolve_omp_clauses):Accept noncontiguous arrays.
+
 2022-11-02  Tobias Burnus  <tobias@codesourcery.com>
 
 	* trans-openmp.cc (gfc_trans_omp_clauses): Ensure DT struct-comp with
diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc
index 52ffb2c1bc1..7cf0d2e53e7 100644
--- a/gcc/fortran/openmp.cc
+++ b/gcc/fortran/openmp.cc
@@ -8378,11 +8378,8 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
 			   Only raise an error here if we're really sure the
 			   array isn't contiguous.  An expression such as
 			   arr(-n:n,-n:n) could be contiguous even if it looks
-			   like it may not be.
-			   And OpenMP's 'target update' permits strides for
-			   the to/from clause. */
+			   like it may not be.  */
 			if (code->op != EXEC_OACC_UPDATE
-			    && code->op != EXEC_OMP_TARGET_UPDATE
 			    && list != OMP_LIST_CACHE
 			    && list != OMP_LIST_DEPEND
 			    && !gfc_is_simply_contiguous (n->expr, false, true)
@@ -8426,9 +8423,7 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
 			int i;
 			gfc_array_ref *ar = &lastslice->u.ar;
 			for (i = 0; i < ar->dimen; i++)
-			  if (ar->stride[i]
-			      && code->op != EXEC_OACC_UPDATE
-			      && code->op != EXEC_OMP_TARGET_UPDATE)
+			  if (ar->stride[i] && code->op != EXEC_OACC_UPDATE)
 			    {
 			      gfc_error ("Stride should not be specified for "
 					 "array section in %s clause at %L",
diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index 72b74493685..95d5186606c 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,3 +1,8 @@
+2022-11-04  Tobias Burnus  <tobias@codesourcery.com>
+
+	* testsuite/libgomp.fortran/target-13.f90: Remove strides to match
+	mainline (GCC 13) version.
+
 2022-11-02  Thomas Schwinge  <thomas@codesourcery.com>
 
 	* testsuite/libgomp.oacc-fortran/declare-allocatable-array_descriptor-1-directive.f90:
diff --git a/libgomp/testsuite/libgomp.fortran/target-13.f90 b/libgomp/testsuite/libgomp.fortran/target-13.f90
index e6334a5275f..6aacc778449 100644
--- a/libgomp/testsuite/libgomp.fortran/target-13.f90
+++ b/libgomp/testsuite/libgomp.fortran/target-13.f90
@@ -76,7 +76,7 @@ var3a = var3
 
 ! ---------------
 
-!$omp target update from(var1%at(::2))
+!$omp target update from(var1%at(2:3))
 
 if (var1a /= var1) error stop
 if (any (var2a /= var2)) error stop
@@ -134,20 +134,17 @@ var1a%at(2)%a = var1a%at(2)%a * 7
 var1a%at(3)%s = var1a%at(3)%s * (-3)
 
 block
-  integer, volatile :: i1,i2,i3,i4,i5,i6
+  integer, volatile :: i1,i2,i3,i4
   i1 = 1
   i2 = 2
   i3 = 1
-  i4 = 1
-  i5 = 2
-  i6 = 1
-  !$omp target update from(var3(i1:i2:i3)) from(var1%at(i4:i5:i6))
+  i4 = 2
+  !$omp target update from(var3(i1:i2)) from(var1%at(i3:i4))
   i1 = 3
   i2 = 3
   i3 = 1
   i4 = 5
-  i5 = 1
-  !$omp target update from(var1%at(i1)%s) from(var1%at(i1)%a(i3:i4:i5))
+  !$omp target update from(var1%at(i1)%s) from(var1%at(i2)%a(i3:i4))
 end block
 
 if (var1 /= var1) error stop

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-04 12:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-04 12:50 [gcc/devel/omp/gcc-12] Align with: "OpenMP/Fortran: 'target update' with DT components" Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).