Ante-scriptum: This PR might be related to PR30284 (or not).

$ cat a.f90                
  character(len=12) :: date(1) = (/ '200612231200' /)
  integer :: foo

  read (date(:)(1:4),'(i4)') foo
  print *, foo
  end
$ ifort a.f90 && ./a.out
        2006
$ gfortran a.f90 && ./a.out
           2

gfortran has an incorrect behaviour here, while ifort is doing the right thing
(like all other compilers I could test).


-- 
           Summary: Wrong-code for internal read
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org
 BugsThisDependsOn: 30284


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30626

Reply via email to