[Bug fortran/95119] New: CLOSE hangs when -fopenmp is specified in compilation

longb at cray dot com gcc-bugzilla@gcc.gnu.org
Wed May 13 22:28:49 GMT 2020


            Bug ID: 95119
           Summary: CLOSE hangs when -fopenmp is specified in compilation
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: longb at cray dot com
  Target Milestone: ---

> cat test3.f90
program test
  integer,external :: omp_get_num_threads
              character(len=16) my_status
              open (unit=10, file='test.dat')
              print *, omp_get_num_threads()
              write (10, *) 'weird'
              rewind (10)
              read (10, *) my_status
              close (10)
              open (unit=10, file='test.dat')
              close (unit=10, status=my_status, iostat=ios)
              print *, ios
              close (10, status='delete')
      end program test

Works fine with gfortran 8.3.0:

> gfortran -fopenmp test3.f90
> ./a.out

Hangs with gfortran 9.3.0:

> gfortran -fopenmp test3.f90
> ./a.out
> module avail gcc

More information about the Gcc-bugs mailing list