Sandra Loosemore wrote:
omp-low.cc was failing to handle iterators when processing attach
clauses, resulting in wrong code that caused a runtime error.
Moreover the code in gimplify.cc that creates implicit attach clauses
for base pointers was failing to remove unused iterators. This patch
addresses both problems. Also, several new test cases are added.
LGTM – however …
gcc/ChangeLog
* gimplify.cc (omp_accumulate_sibling_list): Remove unused
iterators from the generated base pointer attach clause.
* omp-low.cc (lower_omp_target): Handle iterators when
processing GOMP_MAP_ATTACH and GOMP_MAP_DETACH.
libgomp/ChangeLog
* testsuite/libgomp.c-c++-common/target-map-iterators-7.c: New.
* testsuite/libgomp.fortran/target-map-iterators-7a.f90: New.
* testsuite/libgomp.fortran/target-map-iterators-7b.f90: New.
* testsuite/libgomp.fortran/target-map-iterators-7c.f90: New.
* testsuite/libgomp.fortran/target-map-iterators-8.f90: New.
* testsuite/libgomp.fortran/target-map-iterators-9.f90: New.
+++ b/libgomp/testsuite/libgomp.c-c++-common/target-map-iterators-7.c
@@ -0,0 +1,92 @@
+/* f - iterator dynamic bounds
+ h - iterator static bounds
+ g - explicit mapping */
...
+f (struct array_ptr *x, int low, int high, int stride)
...
+h (struct array_ptr *x)
...
+g (struct array_ptr *x)
...
+// FIXME: This should be split out into a separate test since it's unrelated
+// to the other failures that have been seen here.
+#if 0
+void
+this_ices (struct array_ptr *x)
What shall we do with this one? Assuming it still ICEs, it seems to make
sense to either fix it later – or at least track it in some PR en order
that we eventually fix this one.
...
+int
+main ()
...
+ g(var);
+// h(var);
+ f(var, 0, 3, 2);
Likeweise for 'h' – it seems to compile but it fails at runtime? Or was
this a leftover from testing and it actually works?
Tobias