[Bug libfortran/61173] New: [4.9/4.10 Regression] Erroneous "end of file" with internal read

dominiq at lps dot ens.fr gcc-bugzilla@gcc.gnu.org
Tue May 13 12:59:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61173

            Bug ID: 61173
           Summary: [4.9/4.10 Regression] Erroneous "end of file" with
                    internal read
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dominiq at lps dot ens.fr
                CC: jvdelisle at gcc dot gnu.org

Compiling the following test from
https://gcc.gnu.org/ml/fortran/2014-05/msg00046.html

module bd
  character(len=256), dimension(:), allocatable, save :: source
  contains
    subroutine init_data

      allocate(source(3))
      deallocate(source)

      allocate(source(2))

      source=["   1   1   1","   4   4   4"]

    end subroutine init_data
end module bd
program read_internal

  use bd

  integer :: x(6),i,iostat
  character(len=512) :: iomsg

  call init_data

  read(source,*,iostat=iostat,iomsg=iomsg) (x(i), i=1,6)
  if( iostat /= 0 ) then
     write(*,*) "Error: ",trim(iomsg)
  else
     write(*,*) (x(i), i=1,6)
  end if
end program read_internal

with 4.9.0 or trunk gives at runtime the following error

 Error: End of file

r208320 (2014-03-04) gives

           1           1           1           4           4           4

and r208478 (2014-03-11) gives the error. This likely due to r208438 (pr38199).



More information about the Gcc-bugs mailing list