[Bug fortran/43265] New: Read no longer jumps on end

terry at chem dot gu dot se gcc-bugzilla@gcc.gnu.org
Fri Mar 5 06:05:00 GMT 2010


In at least 4.4.2 and 4.4.3, a jump on read trick that worked in 4.2.4 and
4.3.4, and with ifort 10,11 and numerous others, no longer works.


[tjf@rscpc28 ReadTest]$ cat log
line 1
line 2
line 3
[tjf@rscpc28 ReadTest]$ cat fred.f90 
program fred
implicit none
integer::i
open(2,file='log')
do i=1,10
  read(2,'(1x)',end=12)
  write(*,*)i
enddo
12 if (i<11) write(*,*)'ended'
end
[tjf@rscpc28 ReadTest]$ gfortran -v -g -O0 -Wall -Wsurprising fred.f90
Driving: gfortran -v -g -O0 -Wall -Wsurprising fred.f90 -lgfortranbegin
-lgfortran -lm -shared-libgcc
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.4.3/configure --disable-multilib
--enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.4.3 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-g' '-O0' '-Wall' '-Wsurprising' '-shared-libgcc'
'-mtune=generic'
 /usr/local/libexec/gcc/i686-pc-linux-gnu/4.4.3/f951 fred.f90 -quiet -dumpbase
fred.f90 -mtune=generic -auxbase fred -g -O0 -Wall -Wsurprising -version
-fintrinsic-modules-path /usr/local/lib/gcc/i686-pc-linux-gnu/4.4.3/finclude -o
/tmp/ccGHwQ2C.s
GNU Fortran (GCC) version 4.4.3 (i686-pc-linux-gnu)
        compiled by GNU C version 4.4.3, GMP version 4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='-v' '-g' '-O0' '-Wall' '-Wsurprising' '-shared-libgcc'
'-mtune=generic'
 as -V -Qy -o /tmp/ccys0PXc.o /tmp/ccGHwQ2C.s
GNU assembler version 2.18.0 (i486-linux-gnu) using BFD version (GNU Binutils
for Ubuntu) 2.18.0.20080103
COMPILER_PATH=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.4.3/:/usr/local/libexec/gcc/i686-pc-linux-gnu/4.4.3/:/usr/local/libexec/gcc/i686-pc-linux-gnu/:/usr/local/lib/gcc/i686-pc-linux-gnu/4.4.3/:/usr/local/lib/gcc/i686-pc-linux-gnu/
LIBRARY_PATH=/usr/local/lib/gcc/i686-pc-linux-gnu/4.4.3/:/usr/local/lib/gcc/i686-pc-linux-gnu/4.4.3/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-g' '-O0' '-Wall' '-Wsurprising' '-shared-libgcc'
'-mtune=generic'
 /usr/local/libexec/gcc/i686-pc-linux-gnu/4.4.3/collect2 --eh-frame-hdr -m
elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o
/usr/local/lib/gcc/i686-pc-linux-gnu/4.4.3/crtbegin.o
-L/usr/local/lib/gcc/i686-pc-linux-gnu/4.4.3
-L/usr/local/lib/gcc/i686-pc-linux-gnu/4.4.3/../../.. /tmp/ccys0PXc.o
-lgfortranbegin -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/local/lib/gcc/i686-pc-linux-gnu/4.4.3/crtend.o /usr/lib/crtn.o
[tjf@rscpc28 ReadTest]$ ./a.out 
           1
           2
           3
           4
           5
           6
           7
           8
           9
          10
[tjf@rscpc28 ReadTest]$ 


That should have stopped at 3.  When compiled with 4.2.4 I get:
[tjf@rscpc28 ReadTest]$ ./a.out 
           1
           2
           3
 ended
[tjf@rscpc28 ReadTest]$

as expected.

This is killing a large, multi-group quantum dynamics research code.


-- 
           Summary: Read no longer jumps on end
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: terry at chem dot gu dot se
  GCC host triplet: i686-pc-linux-gnu


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



More information about the Gcc-bugs mailing list