public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32382]  New: missed optimization in internal read
@ 2007-06-17 20:29 manfred99 at gmx dot ch
  2007-06-17 20:48 ` [Bug fortran/32382] " jvdelisle at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: manfred99 at gmx dot ch @ 2007-06-17 20:29 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-02-14 15:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-17 20:29 [Bug fortran/32382] New: missed optimization in internal read manfred99 at gmx dot ch
2007-06-17 20:48 ` [Bug fortran/32382] " jvdelisle at gcc dot gnu dot org
2007-06-23  3:13 ` jvdelisle at gcc dot gnu dot org
2007-09-02 11:53 ` manfred99 at gmx dot ch
2007-09-02 16:08 ` jvdelisle at gcc dot gnu dot org
2007-10-05  9:37 ` manfred99 at gmx dot ch
2007-10-05  9:38 ` manfred99 at gmx dot ch
2009-09-13 14:30 ` jvdelisle at gcc dot gnu dot org
2010-02-13  6:17 ` jvdelisle at gcc dot gnu dot org
2010-02-14  8:29 ` jvdelisle at gcc dot gnu dot org
2010-02-14  8:33 ` jvdelisle at gcc dot gnu dot org
2010-02-14 15:02 ` hjl dot tools at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).