diff options
author | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-12-12 00:58:04 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-12-12 00:58:04 +0100 |
commit | f8ac7d8f35e7c4a5444d4e554cb822f6346c1f2b (patch) | |
tree | 7d20a573af1e06236f0853fb15c674f275417f72 /libgomp | |
parent | f5c03155aa77bdb065fed3c5a0031db45a850493 (diff) | |
download | gcc-f8ac7d8f35e7c4a5444d4e554cb822f6346c1f2b.zip gcc-f8ac7d8f35e7c4a5444d4e554cb822f6346c1f2b.tar.gz gcc-f8ac7d8f35e7c4a5444d4e554cb822f6346c1f2b.tar.bz2 |
re PR fortran/92899 ([OpenMP] ICE in gfc_trans_omp_atomic, at fortran/trans-openmp.c:3769)
PR fortran/92899
* trans-openmp.c (gfc_trans_omp_atomic): For GFC_OMP_ATOMIC_SWAP,
do look through conversion on expr2 if any.
* testsuite/libgomp.fortran/atomic1.f90: New test.
From-SVN: r279266
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.fortran/atomic1.f90 | 46 |
2 files changed, 51 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index e5fb05a..dda2d9a 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2019-12-11 Jakub Jelinek <jakub@redhat.com> + + PR fortran/92899 + * testsuite/libgomp.fortran/atomic1.f90: New test. + 2019-12-11 Thomas Schwinge <thomas@codesourcery.com> PR libgomp/92843 diff --git a/libgomp/testsuite/libgomp.fortran/atomic1.f90 b/libgomp/testsuite/libgomp.fortran/atomic1.f90 new file mode 100644 index 0000000..e0c1353 --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/atomic1.f90 @@ -0,0 +1,46 @@ +! PR fortran/92899 + +program pr92899 + real :: x = 1.0 + double precision :: y + integer(kind=4) :: z = 4 + integer(kind=8) :: w + !$omp atomic capture + y = x + x = 2.0 + !$omp end atomic + if (y /= 1.0 .or. x /= 2.0) stop 1 + !$omp atomic capture + x = y + y = 3.0 + !$omp end atomic + if (x /= 1.0 .or. y /= 3.0) stop 2 + !$omp atomic capture + w = z + z = 5 + !$omp end atomic + if (w /= 4 .or. z /= 5) stop 3 + !$omp atomic capture + z = w + w = 6 + !$omp end atomic + if (z /= 4 .or. w /= 6) stop 4 + !$omp atomic write + x = y + !$omp end atomic + if (x /= 3.0 .or. y /= 3.0) stop 5 + x = 7.0 + !$omp atomic write + y = x + !$omp end atomic + if (x /= 7.0 .or. y /= 7.0) stop 6 + !$omp atomic write + z = w + !$omp end atomic + if (z /= 6 .or. w /= 6) stop 7 + z = 8 + !$omp atomic write + w = z + !$omp end atomic + if (z /= 8 .or. w /= 8) stop 8 +end |