From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16100 invoked by alias); 17 Jun 2007 20:29:39 -0000 Received: (qmail 16079 invoked by uid 48); 17 Jun 2007 20:29:31 -0000 Date: Sun, 17 Jun 2007 20:29:00 -0000 Subject: [Bug fortran/32382] New: missed optimization in internal read X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "manfred99 at gmx dot ch" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-06/txt/msg01373.txt.bz2 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