/sodsim/local/gcc-4.0-20050220#>gcc -v Using built-in specs. Target: sparc-sun-solaris2.8 Configured with: ../configure --enable-languages=c,f95 Thread model: posix gcc version 4.0.0 20050220 (experimental) Build with no problems. This little test program was created as a result of a runtime error on a large program used to test gfortran. G77 does not have this problem. ************************************************************************ program ntst character*16 bufld character*142 line open (10,file='bumsls',status='old') 32 read (10,'(a)',end=33) line if (line(1:1) .eq. '.') goto 32 write(*,*) 'write values on the line ',line write(*,*) read (line,79) bufld,budelt 79 format (t43,a16,t61,f8.0) write(*,*) 'write 2 values from the line ',bufld,budelt write(*,*) 33 continue end ************************************************************************ At line 14 of file ntst.f Fortran runtime error: Bad value during floating point read bumsls file contents 3 lines ***************************************************************************** . . ---- ------ --- --------- --------- ---------------- -------- ---- ----- 1 axxxx 1 54.3000 35.3000 rrrabcrbbbbxxxxb 1200. 13p3 33333
*** Bug 20235 has been marked as a duplicate of this bug. ***
Fixed form testcase which doesn't need the data file: program ntst character*16 bufld character*142 line line = ' 1 axxxx 1 54.3000 35.3000 rrrabcrbbbbxxxx' 1 //'b 1200. 13p3 33333' write(*,*) 'write values on the line ',line write(*,*) read (line,79) bufld,budelt 79 format (t43,a16,t61,f8.0) write(*,*) 'write 2 values from the line ',bufld,budelt write(*,*) 33 continue end Works with g77, output: write values on the line 1 axxxx 1 54.3000 35.3000 rrrabcrbbbbxxxxb 1200. 13p3 33333 write 2 values from the line rrrabcrbbbbxxxxb 1200. Runtime error with gfortran.
Using testcase from comment #2, I don't get a runtime error but the program hangs out forever: Program received signal SIGINT, Interrupt. 0x0806b971 in memset () Current language: auto; currently asm (gdb) where #0 0x0806b971 in memset () #1 0x08048ba1 in *_gfortrani_read_block (length=0xbffff7a4) at ../../../gcc/libgfortran/io/transfer.c:153 #2 0x080529b8 in *_gfortrani_read_x (f=0x0) at ../../../gcc/libgfortran/io/read.c:726 #3 0x08049b72 in formatted_transfer (type=BT_CHARACTER, p=0xbffff8e4, len=16) at ../../../gcc/libgfortran/io/transfer.c:684 #4 0x08048f77 in *_gfortran_transfer_character (p=0xbffff8d4, len=16) at ../../../gcc/libgfortran/io/transfer.c:820 #5 0x080482e9 in MAIN__ () #6 0x080483b8 in main (argc=1, argv=0xbffffb54) at ../../../gcc/libgfortran/fmain.c:18 This behavior is, I think, due to the T edit descriptor. From what I have seen, T and TL descriptors are incorrectly handled in library (see PR16436).
As I suggested in comment #3, this is a duplicate of PR16436. Patch from http://gcc.gnu.org/ml/fortran/2005-05/msg00439.html fixes both. *** This bug has been marked as a duplicate of 16436 ***