From 78e4746337d87401a818d0179597e19fab620ee0 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 10 Nov 2007 08:51:55 +0100 Subject: re PR fortran/34020 (Bogus codegen for openmp atomics w/ indirects operands on IPF) PR fortran/34020 * gimplify.c (goa_lhs_expr_p): Inside INDIRECT_REF handle unshared nops. * testsuite/libgomp.fortran/pr34020.f90: New test. From-SVN: r130069 --- libgomp/ChangeLog | 5 +++++ libgomp/testsuite/libgomp.fortran/pr34020.f90 | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 libgomp/testsuite/libgomp.fortran/pr34020.f90 (limited to 'libgomp') diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 3a7d2f5..08b417b 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2007-11-10 Jakub Jelinek + + PR fortran/34020 + * testsuite/libgomp.fortran/pr34020.f90: New test. + 2007-11-06 Jakub Jelinek PR c++/33894 diff --git a/libgomp/testsuite/libgomp.fortran/pr34020.f90 b/libgomp/testsuite/libgomp.fortran/pr34020.f90 new file mode 100644 index 0000000..3bb14f5 --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/pr34020.f90 @@ -0,0 +1,19 @@ +! PR fortran/34020 +! { dg-do run } + + subroutine atomic_add(lhs, rhs) + real lhs, rhs +!$omp atomic + lhs = rhs + lhs + end + + real lhs, rhs + integer i + lhs = 0 + rhs = 1 +!$omp parallel do num_threads(8) shared(lhs, rhs) + do i = 1, 300000 + call atomic_add(lhs, rhs) + enddo + if (lhs .ne. 300000) call abort + end -- cgit v1.1