public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35130]  New: OpenMP: Private variable passed to subroutine
@ 2008-02-07 22:25 burnus at gcc dot gnu dot org
  2008-02-07 22:44 ` [Bug fortran/35130] " jakub at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-02-07 22:25 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

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=35130


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-05-28  7:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-07 22:25 [Bug fortran/35130] New: OpenMP: Private variable passed to subroutine burnus at gcc dot gnu dot org
2008-02-07 22:44 ` [Bug fortran/35130] " jakub at gcc dot gnu dot org
2008-02-07 22:45 ` jakub at gcc dot gnu dot org
2008-02-10 15:38 ` fxcoudert at gcc dot gnu dot org
2008-02-11 16:12 ` [Bug middle-end/35130] " jakub at gcc dot gnu dot org
2008-02-15 17:38 ` jakub at gcc dot gnu dot org
2008-02-15 17:51 ` jakub at gcc dot gnu dot org
2008-02-15 18:10 ` ubizjak at gmail dot com
2008-05-28  7:18 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).