Hi!

The following program 

program test
   character(len=10) :: str
   str = '123'
   read( str, *, end=10 ) i,x
10 continue
   print*,i
end program test

aborts at runtime with somewhat unexpected  message 

gfortran -v -o file file.f90; ./file
Driving: gfortran -v -o file file.f90 -lgfortranbegin -lgfortran -lm
-shared-libgcc
Using built-in specs.
Target: i386-linux
Configured with: ../gcc/configure --prefix=/tmp/gfortran-20051205/irun
--enable-languages=c,fortran --host=i386-linux
Thread model: posix
gcc version 4.2.0 20051205 (experimental)
 /home/wrk/jpr/irun/bin/../libexec/gcc/i386-linux/4.2.0/f951 file.f90 -quiet
-dumpbase file.f90 -auxbase file -version -o /tmp/ccuEHGgN.s
GNU F95 version 4.2.0 20051205 (experimental) (i386-linux)
        compiled by GNU C version 4.0.2 (Debian 4.0.2-2).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
 as -V -Qy -o /tmp/ccqaQsjs.o /tmp/ccuEHGgN.s
GNU assembler version 2.13.90.0.18 (i386-redhat-linux) using BFD version
2.13.90.0.18 20030206
 /home/wrk/jpr/irun/bin/../libexec/gcc/i386-linux/4.2.0/collect2 --eh-frame-hdr
-m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o file /usr/lib/crt1.o
/usr/lib/crti.o /home/wrk/jpr/irun/bin/../lib/gcc/i386-linux/4.2.0/crtbegin.o
-L/home/wrk/jpr/irun/bin/../lib/gcc/i386-linux/4.2.0
-L/home/wrk/jpr/irun/bin/../lib/gcc
-L/home/wrk/jpr/irun/bin/../lib/gcc/i386-linux/4.2.0/../../.. /tmp/ccqaQsjs.o
-lgfortranbegin -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/home/wrk/jpr/irun/bin/../lib/gcc/i386-linux/4.2.0/crtend.o /usr/lib/crtn.o
At line 4 of file file.f90
Fortran runtime error: Success

ifort, g95, sun f90, pgf90, pathf90, xlf90 all treat the end specfier
as i would expect...

Juha


-- 
           Summary: internal read with end=label aborts
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jpr at csc dot fi


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

Reply via email to