public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/59700] [4.8/4.9 Regression] Misleading/buggy runtime error message: Bad integer for item 0 in list input
Date: Thu, 09 Jan 2014 15:44:00 -0000 [thread overview]
Message-ID: <bug-59700-4-HZ3feGyasR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59700-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59700
--- Comment #6 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Jan 09, 2014 at 09:27:18AM +0000, dominiq at lps dot ens.fr wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59700
>
> --- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> > Created attachment 31760 [details]
> > list_io.diff
> >
> > The attached patch fixes the code in comment #1. I'm currently
> > doing the regtest.
>
> The patch fixes the problem (at least integer and real) without regression.
> I don't know how to test that it does not reintroduce memory leak (though I
> doubt it will).
>
> Would it help if I write a test case and do the packaging?
>
I've started to write a testcase, but the counting of items is
still wrong. Look for the XXX comment in the following code.
I can't find where the item count is incremented in this particular
situation. Probably need Jan or Jerry to look at this code.
! { dg-do run }
program foo
implicit none
character(len=80) msg
integer, parameter :: fd = 10
integer i1, i2, i3, i4
real x1, x2, x3, x4
complex c1, c2
logical a
open(unit=fd, status='scratch')
write(fd, '(A)') '1 2 3.4 q'
rewind(fd)
msg = 'ok'
read(fd, *, err=10, iomsg=msg) i1, i2, i3, i4
10 if (msg /= 'Bad integer for item 3 in list input') call abort
rewind(fd)
msg = 'ok'
read(fd, *, err=20, iomsg=msg) x1, x2, x3, x4
20 if (msg /= 'Bad real number in item 4 of list input') call abort
rewind(fd)
msg = 'ok'
! XXX The following line gives 'Bad logical value while reading item 5',
! XXX so the item count is off by one.
read(fd, *, err=30, iomsg=msg) i1, x2, x1, a
30 if (msg /= 'Bad logical value while reading item 4') call abort
read(fd, *, err=31, iomsg=msg) i1, x2, a, x1
31 if (msg /= 'Bad repeat count in item 3 of list input') call abort
close(fd)
open(unit=fd, status='scratch')
write(fd, '(A)') '(1, 2) (3.4, q)'
rewind(fd)
msg = 'ok'
read(fd, *, err=40, iomsg=msg) c1, c2
40 if (msg /= 'Bad floating point number for item 2') call abort
close(fd)
end program foo
next prev parent reply other threads:[~2014-01-09 15:44 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-06 14:45 [Bug fortran/59700] New: " mvondomaros at gmail dot com
2014-01-06 23:24 ` [Bug fortran/59700] [4.8/4.9 Regression] " kargl at gcc dot gnu.org
2014-01-07 11:54 ` rguenth at gcc dot gnu.org
2014-01-09 9:27 ` dominiq at lps dot ens.fr
2014-01-09 15:39 ` sgk at troutmask dot apl.washington.edu
2014-01-09 15:44 ` sgk at troutmask dot apl.washington.edu [this message]
2014-01-09 20:41 ` dominiq at lps dot ens.fr
2014-01-09 20:58 ` dominiq at lps dot ens.fr
2014-01-09 21:09 ` sgk at troutmask dot apl.washington.edu
2014-01-09 21:27 ` dominiq at lps dot ens.fr
2014-01-09 21:39 ` sgk at troutmask dot apl.washington.edu
2014-01-09 22:48 ` dominiq at lps dot ens.fr
2014-01-10 4:18 ` jvdelisle at gcc dot gnu.org
2014-01-10 17:09 ` jvdelisle at gcc dot gnu.org
2014-01-10 22:29 ` dominiq at lps dot ens.fr
2014-01-10 22:39 ` jvdelisle at gcc dot gnu.org
2014-01-10 23:11 ` sgk at troutmask dot apl.washington.edu
2014-01-11 0:55 ` dominiq at lps dot ens.fr
2014-01-11 18:57 ` jvdelisle at gcc dot gnu.org
2014-01-11 21:39 ` jvdelisle at gcc dot gnu.org
2014-02-22 0:02 ` jvdelisle at gcc dot gnu.org
2014-02-22 0:34 ` sgk at troutmask dot apl.washington.edu
2014-02-22 2:12 ` jvdelisle at gcc dot gnu.org
2014-02-22 2:51 ` jvdelisle at gcc dot gnu.org
2014-02-22 2:53 ` jvdelisle at gcc dot gnu.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-59700-4-HZ3feGyasR@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).