public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libf2c/6367: multiple repeat counts confuse namelist read into array
@ 2002-04-19 15:00 toon
  0 siblings, 0 replies; 3+ messages in thread
From: toon @ 2002-04-19 15:00 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mcdonald, nobody, toon

Synopsis: multiple repeat counts confuse namelist read into array

Responsible-Changed-From-To: unassigned->toon
Responsible-Changed-By: toon
Responsible-Changed-When: Fri Apr 19 15:00:01 2002
Responsible-Changed-Why:
    Fortran maintainer
State-Changed-From-To: open->analyzed
State-Changed-By: toon
State-Changed-When: Fri Apr 19 15:00:01 2002
State-Changed-Why:
    Fails at least from GCC-2.95.2 onwards.
    Added test suite entry 6367.f for it.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6367


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libf2c/6367: multiple repeat counts confuse namelist read into array
@ 2002-08-31  9:06 toon
  0 siblings, 0 replies; 3+ messages in thread
From: toon @ 2002-08-31  9:06 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mcdonald, toon

Synopsis: multiple repeat counts confuse namelist read into array

State-Changed-From-To: analyzed->closed
State-Changed-By: toon
State-Changed-When: Sat Aug 31 07:51:15 2002
State-Changed-Why:
    Fixed for GCC/g77 - 3.3

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6367


^ permalink raw reply	[flat|nested] 3+ messages in thread

* libf2c/6367: multiple repeat counts confuse namelist read into array
@ 2002-04-18 13:26 mcdonald
  0 siblings, 0 replies; 3+ messages in thread
From: mcdonald @ 2002-04-18 13:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6367
>Category:       libf2c
>Synopsis:       multiple repeat counts confuse namelist read into array
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 18 13:26:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jim McDonald
>Release:        gcc 2.96
>Organization:
>Environment:
RedHat Linux 7.2
>Description:
A one-dimensional array assigned values by a namelist read
statement receives those values in the wrong array elements
when the namelist input contains an array assignment with
(1) an array subscript and
(2) more than one repeat count specifier with dissimilar
    counts.

I have produced the same incorrect result using g77 3.1,
f2c, and g77 under cygwin/Win2000.  Other Fortran
compilers not using f2c's library (such as Lahey Fortran
95 ver.6.1 under RH Linux 7.2) yield the correct result.

Note - this bug is similar to but not the same as the
namelist repeat count bug fixed 1999-jun-27; from
www.netlib.org f2c "changes" list:
  Sun Jun 27 22:05:47 EDT 1999
   libf2c.zip, libi77: rsne.c: fix bug in namelist input:
  a misplaced increment could cause wrong array elements
  to be assigned; e.g.,
  "&input k(5)=10*1 &end" assigned k(5) and k(15 .. 23).
>How-To-Repeat:
Compile this 10-line Fortran77 program:

      program testnl
c
      dimension a(10)
      namelist /nl/ a
      data a / 10 * 0.0 /
c
      read(5,nl)
      write(6,*) a
c
      end

Now run the program with this input data,

&nl a(2) = 3*1.0, 2*2.0, 3*3.0 /

and you will probably see this incorrect result:

  0.  1.  1.  1.  2.  3.  3.  0.  0.  0.

The correct result should be

  0.  1.  1.  1.  2.  2.  3.  3.  3.  0.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-08-31 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-19 15:00 libf2c/6367: multiple repeat counts confuse namelist read into array toon
  -- strict thread matches above, loose matches on Subject: below --
2002-08-31  9:06 toon
2002-04-18 13:26 mcdonald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).