public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/47154] [4.6 Regression] END= does not work in namelist read
  2011-01-02 21:49 [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read tkoenig at gcc dot gnu.org
@ 2011-01-02 21:49 ` tkoenig at gcc dot gnu.org
  2011-01-03  7:35 ` tkoenig at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-01-02 21:49 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47154

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0


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

* [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read
@ 2011-01-02 21:49 tkoenig at gcc dot gnu.org
  2011-01-02 21:49 ` [Bug libfortran/47154] " tkoenig at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-01-02 21:49 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47154

           Summary: [4.6 Regression] END= does not work in namelist read
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tkoenig@gcc.gnu.org


Original test case by Lawrence Doctors, from


http://gcc.gnu.org/ml/fortran/2011-01/msg00000.html

Reduced test case:

ig25@linux-fd1f:~/Krempel/Lawr/TST> cat tst.f
      program foo
      real :: a
      namelist /b/a
      open(10,status="scratch")
      read (10,nml=b,end=100)
 100  continue
      end
ig25@linux-fd1f:~/Krempel/Lawr/TST> gfortran tst.f
ig25@linux-fd1f:~/Krempel/Lawr/TST> ./a.out
At line 5 of file tst.f (unit = 10, file = '/tmp/gfortrantmpeSWNTR')
Fortran runtime error: `8,�

Works with 4.4.


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

* [Bug libfortran/47154] [4.6 Regression] END= does not work in namelist read
  2011-01-02 21:49 [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read tkoenig at gcc dot gnu.org
  2011-01-02 21:49 ` [Bug libfortran/47154] " tkoenig at gcc dot gnu.org
@ 2011-01-03  7:35 ` tkoenig at gcc dot gnu.org
  2011-01-03 10:35 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-01-03  7:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47154

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.5.3
      Known to fail|                            |4.6.0

--- Comment #1 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-01-03 07:34:54 UTC ---
Also works with 4.5.3.


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

* [Bug libfortran/47154] [4.6 Regression] END= does not work in namelist read
  2011-01-02 21:49 [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read tkoenig at gcc dot gnu.org
  2011-01-02 21:49 ` [Bug libfortran/47154] " tkoenig at gcc dot gnu.org
  2011-01-03  7:35 ` tkoenig at gcc dot gnu.org
@ 2011-01-03 10:35 ` jakub at gcc dot gnu.org
  2011-01-03 14:40 ` jvdelisle at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-03 10:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47154

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
                 CC|                            |jakub at gcc dot gnu.org


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

* [Bug libfortran/47154] [4.6 Regression] END= does not work in namelist read
  2011-01-02 21:49 [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read tkoenig at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-01-03 10:35 ` jakub at gcc dot gnu.org
@ 2011-01-03 14:40 ` jvdelisle at gcc dot gnu.org
  2011-01-04  5:17 ` jvdelisle at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-01-03 14:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47154

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jvdelisle at gcc dot
                   |                            |gnu.org
         AssignedTo|unassigned at gcc dot       |jvdelisle at gcc dot
                   |gnu.org                     |gnu.org

--- Comment #2 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-01-03 14:40:26 UTC ---
I will work on this one.


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

* [Bug libfortran/47154] [4.6 Regression] END= does not work in namelist read
  2011-01-02 21:49 [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read tkoenig at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-01-03 14:40 ` jvdelisle at gcc dot gnu.org
@ 2011-01-04  5:17 ` jvdelisle at gcc dot gnu.org
  2011-01-04 14:25 ` jvdelisle at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-01-04  5:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47154

--- Comment #3 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-01-04 05:17:18 UTC ---
Created attachment 22893
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22893
A proposed patch

The regression was caused by:

http://gcc.gnu.org/viewcvs?view=revision&revision=166180

I have attached a patch that passes our current namelist tests.  The problem is
that we were getting more than one call to generate_error, interfering with the
END handler in error.c and even trashing some error messages.


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

* [Bug libfortran/47154] [4.6 Regression] END= does not work in namelist read
  2011-01-02 21:49 [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read tkoenig at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-01-04  5:17 ` jvdelisle at gcc dot gnu.org
@ 2011-01-04 14:25 ` jvdelisle at gcc dot gnu.org
  2011-01-04 14:53 ` jb at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-01-04 14:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47154

--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-01-04 14:24:56 UTC ---
The patch passes regression testing.  I will commit tonight with ChangeLog and
test case if someone can approve.


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

* [Bug libfortran/47154] [4.6 Regression] END= does not work in namelist read
  2011-01-02 21:49 [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read tkoenig at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-01-04 14:25 ` jvdelisle at gcc dot gnu.org
@ 2011-01-04 14:53 ` jb at gcc dot gnu.org
  2011-01-04 18:24 ` jvdelisle at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jb at gcc dot gnu.org @ 2011-01-04 14:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47154

Janne Blomqvist <jb at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jb at gcc dot gnu.org

--- Comment #5 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-04 14:53:40 UTC ---
Ok for trunk.

Thanks for the patch.

Per se, I suspect the problem was not multiple calls to generate_error(), as
generate_error has some logic to return early in case an error has already been
recorded. Rather I think the culprit is multiple calls to hit_eof(), I've been
bitten by this myself. The first call tells us that we've hit EOF, and we're at
the endfile record. The second one moves the position to after the endfile
record, which is another type of error. Unfortunately I don't have any good
idea how to solve this.


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

* [Bug libfortran/47154] [4.6 Regression] END= does not work in namelist read
  2011-01-02 21:49 [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read tkoenig at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-01-04 14:53 ` jb at gcc dot gnu.org
@ 2011-01-04 18:24 ` jvdelisle at gcc dot gnu.org
  2011-01-05  3:53 ` jvdelisle at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-01-04 18:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47154

--- Comment #6 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-01-04 18:24:19 UTC ---
Thanks Janne,

You are absolutely right, the multiple hit_eof's which call the generate_error.

So far I do not think we need to fix anything in hit_eof.  Thanks for review.


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

* [Bug libfortran/47154] [4.6 Regression] END= does not work in namelist read
  2011-01-02 21:49 [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read tkoenig at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2011-01-04 18:24 ` jvdelisle at gcc dot gnu.org
@ 2011-01-05  3:53 ` jvdelisle at gcc dot gnu.org
  2011-01-05  4:19 ` jvdelisle at gcc dot gnu.org
  2011-01-05  4:24 ` jvdelisle at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-01-05  3:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47154

--- Comment #7 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-01-05 03:53:23 UTC ---
Author: jvdelisle
Date: Wed Jan  5 03:53:15 2011
New Revision: 168502

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168502
Log:
2011-01-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

    PR libgfortran/47154
    * io/list_read.c (namelist_read): Remove calls to hit_eof to avoid the
    duplicate calls via next_record.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/list_read.c


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

* [Bug libfortran/47154] [4.6 Regression] END= does not work in namelist read
  2011-01-02 21:49 [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read tkoenig at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2011-01-05  3:53 ` jvdelisle at gcc dot gnu.org
@ 2011-01-05  4:19 ` jvdelisle at gcc dot gnu.org
  2011-01-05  4:24 ` jvdelisle at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-01-05  4:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47154

--- Comment #8 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-01-05 04:18:43 UTC ---
Author: jvdelisle
Date: Wed Jan  5 04:18:39 2011
New Revision: 168503

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168503
Log:
2011-01-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

    PR libgfortran/47154
    * gfortran.dg/namelist_68.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/namelist_68.f90
Modified:
    trunk/gcc/testsuite/ChangeLog


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

* [Bug libfortran/47154] [4.6 Regression] END= does not work in namelist read
  2011-01-02 21:49 [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read tkoenig at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2011-01-05  4:19 ` jvdelisle at gcc dot gnu.org
@ 2011-01-05  4:24 ` jvdelisle at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-01-05  4:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47154

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED

--- Comment #9 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-01-05 04:24:48 UTC ---
Fixed


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

end of thread, other threads:[~2011-01-05  4:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-02 21:49 [Bug libfortran/47154] New: [4.6 Regression] END= does not work in namelist read tkoenig at gcc dot gnu.org
2011-01-02 21:49 ` [Bug libfortran/47154] " tkoenig at gcc dot gnu.org
2011-01-03  7:35 ` tkoenig at gcc dot gnu.org
2011-01-03 10:35 ` jakub at gcc dot gnu.org
2011-01-03 14:40 ` jvdelisle at gcc dot gnu.org
2011-01-04  5:17 ` jvdelisle at gcc dot gnu.org
2011-01-04 14:25 ` jvdelisle at gcc dot gnu.org
2011-01-04 14:53 ` jb at gcc dot gnu.org
2011-01-04 18:24 ` jvdelisle at gcc dot gnu.org
2011-01-05  3:53 ` jvdelisle at gcc dot gnu.org
2011-01-05  4:19 ` jvdelisle at gcc dot gnu.org
2011-01-05  4:24 ` jvdelisle at gcc dot gnu.org

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).