This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35131] New: OpenMP: Private variable passed to subroutine
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Feb 2008 22:23:46 -0000
- Subject: [Bug fortran/35131] New: OpenMP: Private variable passed to subroutine
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
As reported by Ignacio Fernández Galván, the following program prints with
"gfortran -fopenmp" 0.0 instead of 42.0. Without -fopenmp or using, e.g., ifort
or sunf95 42.0 is printed.
See also http://gcc.gnu.org/ml/fortran/2008-02/msg00058.html
I believe the program is valid, compare also
http://www.openmp.org/pipermail/omp/2006/000532.html
PROGRAM Outer
IMPLICIT NONE
REAL, DIMENSION(20) :: A
INTEGER :: k
A = 0.0
!$OMP PARALLEL DO PRIVATE(k)
DO k=1,SIZE(A)
CALL Inner(k)
END DO
!$OMP END PARALLEL DO
print *, A
CONTAINS
SUBROUTINE Inner(i)
IMPLICIT NONE
INTEGER :: i
A(i) = 42
END SUBROUTINE Inner
END PROGRAM Outer
--
Summary: OpenMP: Private variable passed to subroutine
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: wrong-code, openmp
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35131