public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/34370]  New: file positioning after nonadvancing i/o
@ 2007-12-06 22:33 tkoenig at gcc dot gnu dot org
  2007-12-07  4:33 ` [Bug libfortran/34370] " jvdelisle at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-06 22:33 UTC (permalink / raw)
  To: gcc-bugs

... should add a record marker.

F 2003, 9.2.3.1:

If a nonadvancing output statement leaves a file positioned 1 within a current
record and no further output
statement is executed for the file before it is closed or a BACKSPACE, ENDFILE,
or REWIND statement
is executed for it, the effect is as if the output statement were the
corresponding advancing output
statement.

$ cat advance.f90
program main
  open(95, form="formatted")
  write (95, '(A)', advance="no") 'a'
  backspace 95
end program main

$ gfortran advance.f90
$ ./a.out
$ cat fort.95
a$


-- 
           Summary: file positioning after nonadvancing i/o
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


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


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

* [Bug libfortran/34370] file positioning after nonadvancing i/o
  2007-12-06 22:33 [Bug libfortran/34370] New: file positioning after nonadvancing i/o tkoenig at gcc dot gnu dot org
@ 2007-12-07  4:33 ` jvdelisle at gcc dot gnu dot org
  2007-12-07 19:18 ` tkoenig at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-07  4:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2007-12-07 04:32 -------
Thomas, this should be straightforward.  Do you want to work this along with PR
34323 ?


-- 


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


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

* [Bug libfortran/34370] file positioning after nonadvancing i/o
  2007-12-06 22:33 [Bug libfortran/34370] New: file positioning after nonadvancing i/o tkoenig at gcc dot gnu dot org
  2007-12-07  4:33 ` [Bug libfortran/34370] " jvdelisle at gcc dot gnu dot org
@ 2007-12-07 19:18 ` tkoenig at gcc dot gnu dot org
  2007-12-09 23:05 ` tkoenig at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-07 19:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tkoenig at gcc dot gnu dot org  2007-12-07 19:18 -------
(In reply to comment #1)
> Thomas, this should be straightforward.  Do you want to work this along with PR
> 34323 ?

Yes, I'll take it.


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tkoenig at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-12-07 19:18:12
               date|                            |


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


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

* [Bug libfortran/34370] file positioning after nonadvancing i/o
  2007-12-06 22:33 [Bug libfortran/34370] New: file positioning after nonadvancing i/o tkoenig at gcc dot gnu dot org
  2007-12-07  4:33 ` [Bug libfortran/34370] " jvdelisle at gcc dot gnu dot org
  2007-12-07 19:18 ` tkoenig at gcc dot gnu dot org
@ 2007-12-09 23:05 ` tkoenig at gcc dot gnu dot org
  2007-12-12 20:08 ` tkoenig at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-09 23:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tkoenig at gcc dot gnu dot org  2007-12-09 23:05 -------
Created an attachment (id=14715)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14715&action=view)
proposed patch

This is a first go at PR 34323, 34370 and 34405, so
far untested and missing some test cases.


-- 


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


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

* [Bug libfortran/34370] file positioning after nonadvancing i/o
  2007-12-06 22:33 [Bug libfortran/34370] New: file positioning after nonadvancing i/o tkoenig at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-12-09 23:05 ` tkoenig at gcc dot gnu dot org
@ 2007-12-12 20:08 ` tkoenig at gcc dot gnu dot org
  2007-12-13 19:36 ` tkoenig at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-12 20:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tkoenig at gcc dot gnu dot org  2007-12-12 20:08 -------
Created an attachment (id=14740)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14740&action=view)
an improved version

Sanity checking found bugs :-)


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #14715|0                           |1
        is obsolete|                            |


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


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

* [Bug libfortran/34370] file positioning after nonadvancing i/o
  2007-12-06 22:33 [Bug libfortran/34370] New: file positioning after nonadvancing i/o tkoenig at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-12-12 20:08 ` tkoenig at gcc dot gnu dot org
@ 2007-12-13 19:36 ` tkoenig at gcc dot gnu dot org
  2007-12-13 19:38 ` tkoenig at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-13 19:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tkoenig at gcc dot gnu dot org  2007-12-13 19:35 -------
Subject: Bug 34370

Author: tkoenig
Date: Thu Dec 13 19:35:09 2007
New Revision: 130912

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130912
Log:
2007-12-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR libfortran/34370
        PR libfortran/34323
        PR libfortran/34405
        * io/io.h:  Add previous_nonadvancing_write to gfc_unit.
        Add prototype for finish_last_advance_record.
        * io/file_pos.c (st_backspace):  Generate error if backspace is
        attempted for direct access or unformatted stream.
        If there are bytes left from a previous ADVANCE="no", write
        them out before performing the backspace.
        (st_endfile):  Generate error if endfile is attempted for
        direct access.
        If there are bytes left from a previous ADVANCE="no", write
        them out before performing the endfile.
        (st_rewind):  Generate error if rewind is attempted for
        direct access.
        * unit.c (close_unit_1):  Move functionality to write
        previously written bytes to...
        (finish_last_advance_record):  ... here.
        * transfer.c (data_transfer_init):  If reading, reset
        previous_nonadvancing_write.
        (finalize_transfer):  Set the previous_noadvancing_write
        flag if we are writing and ADVANCE="no" was specified.
        Only call next_record() if advance="no" wasn't specified.

2007-12-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR libfortran/34370
        PR libfortran/34323
        PR libfortran/34405
        * gfortran.dg/advance_6.f90:  New test case.
        * gfortran.dg/direct_io_7.f90:  New test case.
        * gfortran.dg/streamio_13.f90:  New test case.


Added:
    trunk/gcc/testsuite/gfortran.dg/advance_6.f90
    trunk/gcc/testsuite/gfortran.dg/direct_io_7.f90
    trunk/gcc/testsuite/gfortran.dg/streamio_13.f90
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/file_pos.c
    trunk/libgfortran/io/io.h
    trunk/libgfortran/io/transfer.c
    trunk/libgfortran/io/unit.c


-- 


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


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

* [Bug libfortran/34370] file positioning after nonadvancing i/o
  2007-12-06 22:33 [Bug libfortran/34370] New: file positioning after nonadvancing i/o tkoenig at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-12-13 19:36 ` tkoenig at gcc dot gnu dot org
@ 2007-12-13 19:38 ` tkoenig at gcc dot gnu dot org
  2007-12-13 19:38 ` tkoenig at gcc dot gnu dot org
  2007-12-13 19:39 ` tkoenig at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-13 19:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from tkoenig at gcc dot gnu dot org  2007-12-13 19:38 -------
Fixed on trunk.

Closing.


-- 


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


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

* [Bug libfortran/34370] file positioning after nonadvancing i/o
  2007-12-06 22:33 [Bug libfortran/34370] New: file positioning after nonadvancing i/o tkoenig at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-12-13 19:38 ` tkoenig at gcc dot gnu dot org
@ 2007-12-13 19:38 ` tkoenig at gcc dot gnu dot org
  2007-12-13 19:39 ` tkoenig at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-13 19:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from tkoenig at gcc dot gnu dot org  2007-12-13 19:37 -------
Fixed on trunk.

Closing.


-- 


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


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

* [Bug libfortran/34370] file positioning after nonadvancing i/o
  2007-12-06 22:33 [Bug libfortran/34370] New: file positioning after nonadvancing i/o tkoenig at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-12-13 19:38 ` tkoenig at gcc dot gnu dot org
@ 2007-12-13 19:39 ` tkoenig at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-13 19:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from tkoenig at gcc dot gnu dot org  2007-12-13 19:39 -------
Actually closing *sigh*


-- 

tkoenig at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-12-13 19:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-06 22:33 [Bug libfortran/34370] New: file positioning after nonadvancing i/o tkoenig at gcc dot gnu dot org
2007-12-07  4:33 ` [Bug libfortran/34370] " jvdelisle at gcc dot gnu dot org
2007-12-07 19:18 ` tkoenig at gcc dot gnu dot org
2007-12-09 23:05 ` tkoenig at gcc dot gnu dot org
2007-12-12 20:08 ` tkoenig at gcc dot gnu dot org
2007-12-13 19:36 ` tkoenig at gcc dot gnu dot org
2007-12-13 19:38 ` tkoenig at gcc dot gnu dot org
2007-12-13 19:38 ` tkoenig at gcc dot gnu dot org
2007-12-13 19:39 ` tkoenig at gcc dot gnu dot 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).