diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-11-25 00:08:26 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-11-25 00:08:26 +0100 |
commit | 3f9e8f13a316a0044bd303983746cafba804d646 (patch) | |
tree | d83db1c113f6d65bcbb7993517f743311e6b26e2 /libgomp | |
parent | 05e729ec76723889b44f8bd3176666800c514a0d (diff) | |
download | gcc-3f9e8f13a316a0044bd303983746cafba804d646.zip gcc-3f9e8f13a316a0044bd303983746cafba804d646.tar.gz gcc-3f9e8f13a316a0044bd303983746cafba804d646.tar.bz2 |
re PR fortran/63938 (OpenMP atomic update does not protect access to automatic array)
PR fortran/63938
* trans-openmp.c (gfc_trans_omp_atomic): Make sure lhsaddr is
simple enough for goa_lhs_expr_p.
* libgomp.fortran/pr63938-1.f90: New test.
* libgomp.fortran/pr63938-2.f90: New test.
From-SVN: r218031
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 6 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.fortran/pr63938-1.f90 | 14 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.fortran/pr63938-2.f90 | 18 |
3 files changed, 38 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 08425e9..097b36f 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,9 @@ +2014-11-24 Jakub Jelinek <jakub@redhat.com> + + PR fortran/63938 + * libgomp.fortran/pr63938-1.f90: New test. + * libgomp.fortran/pr63938-2.f90: New test. + 2014-11-21 Steve Ellcey <sellcey@imgtec.com> * config/linux/mips/futex.h (SYS_futex): Define if not already done. diff --git a/libgomp/testsuite/libgomp.fortran/pr63938-1.f90 b/libgomp/testsuite/libgomp.fortran/pr63938-1.f90 new file mode 100644 index 0000000..27501b2 --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/pr63938-1.f90 @@ -0,0 +1,14 @@ +! PR fortran/63938 +! { dg-do run } + +program pr63938_1 + integer :: i, x(1) + x(1) = 0 +!$omp parallel do + do i = 1, 1000 + !$omp atomic + x(1) = x(1) + 1 + end do +!$omp end parallel do + if (x(1) .ne. 1000) call abort +end program pr63938_1 diff --git a/libgomp/testsuite/libgomp.fortran/pr63938-2.f90 b/libgomp/testsuite/libgomp.fortran/pr63938-2.f90 new file mode 100644 index 0000000..e5f37ba --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/pr63938-2.f90 @@ -0,0 +1,18 @@ +! PR fortran/63938 +! { dg-do run } + +program pr63938_2 + type t + integer :: x + end type + integer :: i + type(t) :: x + x%x = 0 +!$omp parallel do + do i = 1, 1000 + !$omp atomic + x%x = x%x + 1 + end do +!$omp end parallel do + if (x%x .ne. 1000) call abort +end program pr63938_2 |