From: Tobias Burnus Date: Fri, 4 Nov 2022 10:20:24 +0000 (+0100) Subject: Align with: "OpenMP/Fortran: 'target update' with DT components" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9d5362918ef7aa6f840ac48ccb8897a09fe99f1;p=thirdparty%2Fgcc.git 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 gcc/fortran/ChangeLog.omp Partial Revert: 2022-11-02 Tobias Burnus * 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 --git a/gcc/fortran/ChangeLog.omp b/gcc/fortran/ChangeLog.omp index a7ce52cf9baf..a7c7a252b477 100644 --- a/gcc/fortran/ChangeLog.omp +++ b/gcc/fortran/ChangeLog.omp @@ -1,3 +1,10 @@ +2022-11-04 Tobias Burnus + + Partial Revert: + 2022-11-02 Tobias Burnus + + * openmp.cc (resolve_omp_clauses):Accept noncontiguous arrays. + 2022-11-02 Tobias Burnus * 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 52ffb2c1bc1e..7cf0d2e53e75 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 72b74493685d..95d5186606c9 100644 --- a/libgomp/ChangeLog.omp +++ b/libgomp/ChangeLog.omp @@ -1,3 +1,8 @@ +2022-11-04 Tobias Burnus + + * testsuite/libgomp.fortran/target-13.f90: Remove strides to match + mainline (GCC 13) version. + 2022-11-02 Thomas Schwinge * 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 e6334a5275f9..6aacc7784494 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