[margot@naic.edu: Re: complement to namelist bug report (fwd)]

craig@jcb-sc.com craig@jcb-sc.com
Fri Jun 25 11:13:00 GMT 1999


This patch appears to fix this particular problem.  I can't claim to
understand the code *thoroughly*, but the code in the area looks
familiar enough, and, to that extent, this patch seems correct to me.

Since this does not seem to be a regression, and gcc 2.95 is now
in code-freeze, I'm leaning away from trying to get it into 2.95.

So, I'll wait until libf2c changes to bring the changes over into gcc
(i.e. g77's version of libf2c).  That is, I don't plan to put this patch
into g77 myself, so if it turns out to be wrong, i.e. you (Dave) decide
on a better fix, (the development version of) g77 won't get any worse in
the meantime.

        tq vm, (burley)


*** g77-e/libf2c/libI77/rsne.c.~1~	Sat Jan 31 20:37:07 1998
--- g77-e/libf2c/libI77/rsne.c	Fri Jun 25 10:56:22 1999
*************** x_rsne(cilist *a)
*** 531,535 ****
  					if (no1 > f__lcount)
  						no1 = f__lcount;
- 					iva += no1 * dn0->delta;
  					if (k = l_read(&no1, vaddr + iva,
  							size, type))
--- 531,534 ----


------- Start of forwarded message -------
Mailing-List: contact egcs-bugs-help@egcs.cygnus.com; run by ezmlm
Precedence: bulk
Sender: owner-egcs-bugs@egcs.cygnus.com
Date: Fri, 25 Jun 1999 08:44:16 -0400 (AST)
From: Jean-Luc Margot <margot@naic.edu>
X-Sender: margot@mosquito
To: egcs-bugs@egcs.cygnus.com
Subject: Re: complement to namelist bug report (fwd)
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-UIDL: 629e6c727f0d2f647b505a7a9b074145

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
------- End of forwarded message -------


More information about the Gcc-bugs mailing list