complement to namelist bug report (fwd)

Jean-Luc Margot margot@naic.edu
Fri Jun 25 05:44:00 GMT 1999


Hi,

John Chandler reported a bug in the implementation of namelist in g77.
The sample program (reproduced below for completeness) was compiled with:

g77 sample.f

The following version of g77 was being used:

g77 version egcs-2.91.60 Debian 2.1 (egcs-1.1.1 release) (from FSF-g77
version 0.5.24-19980804)
Driving: g77 -v -c -xf77-version /dev/null -xnone
Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.60/specs
gcc version egcs-2.91.60 Debian 2.1 (egcs-1.1.1 release)
 /usr/lib/gcc-lib/i486-linux/egcs-2.91.60/cpp -lang-c -v -undef
-D__GNUC__=2 -D__GNUC_MINOR__=91 -D__ELF__ -D__unix__ -D__i386__
-D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(posix)
-D_LANGUAGE_FORTRAN -traditional -Asystem(unix) -Acpu(i386)
-Amachine(i386) -Di386 -D__i386 -D__i386__ -Di486 -D__i486 -D__i486__
/dev/null /dev/null
GNU CPP version egcs-2.91.60 Debian 2.1 (egcs-1.1.1 release) (i386
Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /home/margot/include
 /home/margot/include
 /usr/local/include
 /usr/lib/gcc-lib/i486-linux/egcs-2.91.60/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i486-linux/egcs-2.91.60/f771 -fnull-version -quiet
-dumpbase g77-version.f -version -fversion -o /tmp/ccQAbdnY.s /dev/null
GNU F77 version egcs-2.91.60 Debian 2.1 (egcs-1.1.1 release) (i486-linux)
compiled by GNU C version egcs-2.91.60 Debian 2.1 (egcs-1.1.1 release).
GNU Fortran Front End version 0.5.24-19980804
 as -V -Qy -o /tmp/ccKqoRK0.o /tmp/ccQAbdnY.s
GNU assembler version 2.9.1 (i486-linux), using BFD version 2.9.1
 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o /tmp/ccGP6sV4
/tmp/ccKqoRK0.o /usr/lib/crt1.o /usr/lib/crti.o
/usr/lib/gcc-lib/i486-linux/egcs-2.91.60/crtbegin.o
-L/usr/lib/gcc-lib/i486-linux/egcs-2.91.60 -lg2c -lm -lgcc -lc -lgcc
/usr/lib/gcc-lib/i486-linux/egcs-2.91.60/crtend.o /usr/lib/crtn.o
 /tmp/ccGP6sV4
__G77_LIBF77_VERSION__: 0.5.24
@(#)LIBF77 VERSION 19970919
__G77_LIBI77_VERSION__: 0.5.24-19980920
@(#) LIBI77 VERSION pjw,dmg-mods 19980617
__G77_LIBU77_VERSION__: 0.5.24
@(#) LIBU77 VERSION 19980709

The sample code is:

      integer*4 k(40)/40*-1/
      namelist /input/ k
      read(5,input,end=20)
 20   write(6,input)
      stop
      end

The sample input is:

&input k(5)=10*1 &end

And the sample output is:

&INPUT 
 K = -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 1 1 1 1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1/

Clearly, the first token is placed correctly but all other tokens are
misplaced.  

Jean-Luc Margot




More information about the Gcc-bugs mailing list