]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Align with: "OpenMP/Fortran: 'target update' with DT components"
authorTobias Burnus <tobias@codesourcery.com>
Fri, 4 Nov 2022 10:20:24 +0000 (11:20 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Fri, 4 Nov 2022 10:20:24 +0000 (11:20 +0100)
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)

gcc/fortran/ChangeLog.omp
gcc/fortran/openmp.cc
libgomp/ChangeLog.omp
libgomp/testsuite/libgomp.fortran/target-13.f90

index a7ce52cf9baff84410097c0f2fa0c673321009df..a7c7a252b47792758147c95e309fbb1f12b3e4b0 100644 (file)
@@ -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
index 52ffb2c1bc1ea677b3e83a90d25561a70fd584f6..7cf0d2e53e750e2a351a49fa6270e8e8c0a0f076 100644 (file)
@@ -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",
index 72b74493685d91e709251b420970c41f46bff2a8..95d5186606c9d3afb7266efd9d1353d1530bf7d3 100644 (file)
@@ -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:
index e6334a5275f9089d364aa9dc03161c76fe1286f1..6aacc7784494746ab27705c8d8b75d2315c726f6 100644 (file)
@@ -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