aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2022-11-02 09:06:28 +0100
committerSandra Loosemore <sloosemore@baylibre.com>2025-05-15 20:25:47 +0000
commitcc069acadd2723a6a5884251ebc946bd61a4dc44 (patch)
tree3d609d2e57afe09d2d6b2f5d008d331866891352 /gcc
parent103758a6d5a021b8d703887bbdc990e2b6986c73 (diff)
downloadgcc-cc069acadd2723a6a5884251ebc946bd61a4dc44.zip
gcc-cc069acadd2723a6a5884251ebc946bd61a4dc44.tar.gz
gcc-cc069acadd2723a6a5884251ebc946bd61a4dc44.tar.bz2
OpenMP/Fortran: 'target update' with strides + DT components
OpenMP 5.0 permits to use arrays with strides and derived type components for the list items to the 'from'/'to' clauses of the 'target update' directive. Partially committed to mainline as: 6629444170f85 OpenMP/Fortran: 'target update' with DT components This patch contains the differences to the mainline version. gcc/fortran/ChangeLog: * openmp.cc (resolve_omp_clauses): Apply to OpenMP target update. libgomp/ChangeLog: * testsuite/libgomp.fortran/target-13.f90: Update test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/openmp.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc
index 1cf1a81..9f2bb79 100644
--- a/gcc/fortran/openmp.cc
+++ b/gcc/fortran/openmp.cc
@@ -9573,8 +9573,11 @@ 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. */
+ like it may not be.
+ And OpenMP's 'target update' permits strides for
+ the to/from clause. */
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)
@@ -9634,7 +9637,9 @@ 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)
+ if (ar->stride[i]
+ && code->op != EXEC_OACC_UPDATE
+ && code->op != EXEC_OMP_TARGET_UPDATE)
{
gfc_error ("Stride should not be specified for "
"array section in %s clause at %L",