This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

OpenMP private variable initialization


Hi all,

I have a problem with the initialization of a private variable in an
OpenMP loop. I do not know whether this is really a bug, but I would
have expected a different behaviour.

$ cat a.F90
MODULE A

TYPE TA
  INTEGER :: ILMESS = 1024
END TYPE

END MODULE
$ cat main.F90
PROGRAM MAIN

USE A

TYPE (TA) :: YA

PRINT *, YA%ILMESS

!$OMP PARALLEL PRIVATE (YA)

PRINT *, YA%ILMESS

!$OMP END PARALLEL


END PROGRAM

$ gfortran -fopenmp a.F90 main.F90 -o main-GNU472.x
$ ./main-GNU472.x
        1024
           0
           0
           0
           0
           0
           0
           0
           0
           0
           0
           0
           0
           0
           0
...

What do you think ? Is this a bug or does it conform to the standard ?

Best regards,

Philippe


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]