aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-08-19 15:25:22 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-08-19 15:25:22 +0200
commitc26dffff5c573aa7f3935dddc8300a2c8fd660a1 (patch)
tree963ec6d00bf1bf89a14122150aae777bf1f6a55a /libgomp
parentdf698a8707413cc5ebaa2f5ad0007e011eae8418 (diff)
re PR fortran/49792 (OpenMP workshare: Wrong result with array assignment)
PR fortran/49792 * trans-expr.c (gfc_trans_assignment_1): Set OMPWS_SCALARIZER_WS bit in ompws_flags only if loop.temp_ss is NULL, and clear it if lhs needs reallocation. * trans-openmp.c (gfc_trans_omp_workshare): Don't return early if code is NULL, emit a barrier if workshare emitted no code at all and NOWAIT clause isn't present. * testsuite/libgomp.fortran/pr49792-1.f90: New test. * testsuite/libgomp.fortran/pr49792-2.f90: New test. From-SVN: r177898
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog6
-rw-r--r--libgomp/testsuite/libgomp.fortran/pr49792-1.f9018
-rw-r--r--libgomp/testsuite/libgomp.fortran/pr49792-2.f9022
3 files changed, 46 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 63a8fe1d0ea..c5ebeb0b555 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/49792
+ * testsuite/libgomp.fortran/pr49792-1.f90: New test.
+ * testsuite/libgomp.fortran/pr49792-2.f90: New test.
+
2011-08-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config/posix95/lock.c, posix95/omp-lock.h: Remove.
diff --git a/libgomp/testsuite/libgomp.fortran/pr49792-1.f90 b/libgomp/testsuite/libgomp.fortran/pr49792-1.f90
new file mode 100644
index 00000000000..cf2bb66fc89
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/pr49792-1.f90
@@ -0,0 +1,18 @@
+! PR fortran/49792
+! { dg-do run }
+
+subroutine reverse(n, a)
+ integer :: n
+ real(kind=8) :: a(n)
+!$omp parallel workshare
+ a(:) = a(n:1:-1)
+!$omp end parallel workshare
+end subroutine reverse
+
+program pr49792
+ real(kind=8) :: a(16) = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
+ real(kind=8) :: b(16)
+ b(:) = a(16:1:-1)
+ call reverse (16,a)
+ if (any (a.ne.b)) call abort
+end program pr49792
diff --git a/libgomp/testsuite/libgomp.fortran/pr49792-2.f90 b/libgomp/testsuite/libgomp.fortran/pr49792-2.f90
new file mode 100644
index 00000000000..2101028a9c2
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/pr49792-2.f90
@@ -0,0 +1,22 @@
+! PR fortran/49792
+! { dg-do run }
+! { dg-options "-std=f2003 -fall-intrinsics" }
+
+subroutine reverse(n, a)
+ integer :: n
+ real(kind=8) :: a(n)
+!$omp parallel workshare
+ a(:) = a(n:1:-1)
+!$omp end parallel workshare
+end subroutine reverse
+
+program pr49792
+ integer :: b(16)
+ integer, allocatable :: a(:)
+ b = 1
+!$omp parallel workshare
+ a = b
+!$omp end parallel workshare
+ if (size(a).ne.size(b)) call abort()
+ if (any (a.ne.b)) call abort()
+end program pr49792