This is a followup to BUG 32257. Above Bug has been resolved as invalid, but how comes that the loop variable i has the value 101 at the end of the read?
consider C234567 program internalread implicit none integer m CC parameter(m=100) parameter(m=1000000) character value*10 integer i,j,intvalues(m) DO j=1,100 write(value,'(i3,a5)') j," 5 69" write(*,*) value read(value,*,end=20,err=20) (intvalues(i),i=1,m) 20 write(*,*) j ENDDO end program internalread (There is no access to i after the loop, so this program should be valid) m=100: gfortran needs 0.003s g77 needs 0.002s m=1000000: gfortran needs 0.8s g77 needs 0.002s So gfortran loops to its bitter end, although it could shortcut the loop. g77 seems to exit the loop at i=3, as BUG 32257 shows as well. -- Summary: missed optimization in internal read Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: manfred99 at gmx dot ch http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32382