public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31366]  New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record
@ 2007-03-26 16:27 michael dot a dot richmond at nasa dot gov
  2007-03-26 21:18 ` [Bug fortran/31366] " jvdelisle at gcc dot gnu dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2007-03-26 16:27 UTC (permalink / raw)
  To: gcc-bugs

When the last record written to a direct access file is shorter than the record
length of the file, gfortran truncates the record. The following test program
produces a file whose length is 1 when it should be 10.

PROGRAM test
OPEN (76, FILE="test.txt", ACCESS="DIRECT", STATUS="NEW", RECL=10)
WRITE(76, REC=1) "1"
END PROGRAM test


-- 
           Summary: When the last record written to a direct access file is
                    shorter than the record length of the file, gfortran
                    truncates the record
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: michael dot a dot richmond at nasa dot gov


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


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

* [Bug fortran/31366] When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
@ 2007-03-26 21:18 ` jvdelisle at gcc dot gnu dot org
  2007-03-27 19:05 ` tkoenig at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-03-26 21:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2007-03-26 22:18 -------
Adding Thomas to cc.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-03-26 22:18:42
               date|                            |


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


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

* [Bug fortran/31366] When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
  2007-03-26 21:18 ` [Bug fortran/31366] " jvdelisle at gcc dot gnu dot org
@ 2007-03-27 19:05 ` tkoenig at gcc dot gnu dot org
  2007-03-28  0:53 ` jvdelisle at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-03-27 19:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tkoenig at gcc dot gnu dot org  2007-03-27 20:04 -------
This is the same behavor that g77 had.  Also, reading
back what we have written works for both gfortran and g77:

$ cat tst.f
      PROGRAM MAIN
      character*1 c
      OPEN (76, FILE="test.txt",ACCESS="DIRECT",STATUS="NEW",RECL=10)
      WRITE(76, REC=1) "1"
      read (76, REC=1) c
      print *,c
      END
$ g77 tst.f
$ ./a.out
 1
$ rm -f test.txt
$ gfortran tst.f
$ ./a.out
 1

Offhand, I don't think this is wrong.  The Fortran standard talks
about records, not about bytes in a file.


-- 


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


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

* [Bug fortran/31366] When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
  2007-03-26 21:18 ` [Bug fortran/31366] " jvdelisle at gcc dot gnu dot org
  2007-03-27 19:05 ` tkoenig at gcc dot gnu dot org
@ 2007-03-28  0:53 ` jvdelisle at gcc dot gnu dot org
  2007-03-31  0:45 ` [Bug fortran/31366] Last record truncated for read after short write, direct access file jvdelisle at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-03-28  0:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2007-03-28 01:53 -------
Closing as not a bug.  If anyone sees something in the standard otherwise,
please let me know.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


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


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

* [Bug fortran/31366] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (2 preceding siblings ...)
  2007-03-28  0:53 ` jvdelisle at gcc dot gnu dot org
@ 2007-03-31  0:45 ` jvdelisle at gcc dot gnu dot org
  2007-03-31  0:46 ` jvdelisle at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-03-31  0:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2007-03-31 01:45 -------
Michael sent me this excellent test case illustrating the problem.

      PROGRAM test
      CHARACTER(LEN=8) :: as_written, as_read
      as_written = "12345678"
      OPEN (76, FILE="test.txt", ACCESS="DIRECT", STATUS="NEW", RECL=12)
      WRITE(76, REC=1) as_written
      READ(76, REC=1) as_read, i
      PRINT *, "as_written = ", as_written, " as_read = ", as_read
      CLOSE(76)
      END PROGRAM test


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED
            Summary|When the last record written|Last record truncated for
                   |to a direct access file is  |read after short write,
                   |shorter than the record     |direct access file
                   |length of the file, gfortran|
                   |truncates the record        |


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


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

* [Bug fortran/31366] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (3 preceding siblings ...)
  2007-03-31  0:45 ` [Bug fortran/31366] Last record truncated for read after short write, direct access file jvdelisle at gcc dot gnu dot org
@ 2007-03-31  0:46 ` jvdelisle at gcc dot gnu dot org
  2007-03-31  5:06 ` jvdelisle at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-03-31  0:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2007-03-31 01:46 -------
I just need to hit the right button in bugzilla.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|VERIFIED                    |REOPENED
         Resolution|INVALID                     |


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


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

* [Bug fortran/31366] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (4 preceding siblings ...)
  2007-03-31  0:46 ` jvdelisle at gcc dot gnu dot org
@ 2007-03-31  5:06 ` jvdelisle at gcc dot gnu dot org
  2007-03-31  7:11 ` tkoenig at alice-dsl dot net
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-03-31  5:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2007-03-31 06:06 -------
Here is a preliminary patch for this. 

Index: io/transfer.c
===================================================================
*** io/transfer.c       (revision 123355)
--- io/transfer.c       (working copy)
*************** read_block_direct (st_parameter_dt *dtp,
*** 411,417 ****
          /* Short read, e.g. if we hit EOF.  Apparently, we read
           more than was written to the last record.  */
          *nbytes = to_read_record;
-         generate_error (&dtp->common, ERROR_SHORT_RECORD, NULL);
          return;
        }

--- 411,416 ----


-- 


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


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

* [Bug fortran/31366] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (5 preceding siblings ...)
  2007-03-31  5:06 ` jvdelisle at gcc dot gnu dot org
@ 2007-03-31  7:11 ` tkoenig at alice-dsl dot net
  2007-03-31 16:28 ` jvdelisle at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tkoenig at alice-dsl dot net @ 2007-03-31  7:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from tkoenig at alice-dsl dot net  2007-03-31 08:11 -------
Subject: Re:  Last record truncated for read after short
        write, direct access file

On Sat, 2007-03-31 at 00:45 +0000, jvdelisle at gcc dot gnu dot org
wrote:
> Michael sent me this excellent test case illustrating the problem.
> 
>       PROGRAM test
>       CHARACTER(LEN=8) :: as_written, as_read
>       as_written = "12345678"
>       OPEN (76, FILE="test.txt", ACCESS="DIRECT", STATUS="NEW",
> RECL=12)
>       WRITE(76, REC=1) as_written
>       READ(76, REC=1) as_read, i
>       PRINT *, "as_written = ", as_written, " as_read = ", as_read
>       CLOSE(76)
>       END PROGRAM test

Hi Jerry,

this reads a variable that we haven't written.  I am
not convinced that this is standard-conforming.

I'll ask on c.l.f.

        Thomas


-- 


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


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

* [Bug fortran/31366] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (6 preceding siblings ...)
  2007-03-31  7:11 ` tkoenig at alice-dsl dot net
@ 2007-03-31 16:28 ` jvdelisle at gcc dot gnu dot org
  2007-04-01  7:11 ` patchapp at dberlin dot org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-03-31 16:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jvdelisle at gcc dot gnu dot org  2007-03-31 17:28 -------
Thomas, thanks for c.l.f query.  From the response so far:

>>
> 
> 9.5.3.4.1  "On output to a file connected for unformatted direct access,
>            the output list shall not specify more values than can fit
>            into the record. If the file is connected for direct access
>            and the values specified by the output list do not fill the
>            record, the remainder of the record is undefined."
> 
> The value of I is at least undefined.
> 
It would seem then that variable i in the test case is undefined and should not
be used for anything.  That makes this problem moot.  Ifort accepts the code
and does nothing.

Lets adjust the test case a bit:

      PROGRAM test
      CHARACTER(LEN=8) :: as_written, as_read
      character(1) :: byte
      as_written = "12345678"
      OPEN (76, ACCESS="DIRECT", RECL=12)
      WRITE(76, REC=1) as_written
      WRITE(76, REC=2) as_written
      READ(76, REC=1) as_read, byte, byte, byte, byte
      READ(76, REC=2) as_read, byte, byte, byte, byte
      PRINT *, "as_written = ", as_written, " as_read = ", as_read
      print *, byte
      CLOSE(76)
      END PROGRAM test

In this case, the reading of record 2 should be at least consistent with
reading of record 1.  In the case of 1, byte is set to whatever default value
the OS gives in the last four bytes in the record, in my case zero.  In case 2,
I get an error.

I think we should not give an error and consider possibly not assigning byte a
value for the last record (it remains undefined so it doe not matter) or pad
the last record with '\0' on the write similar to what is done for record 1,
and just reading that padding in.  

The padding would yield more consistent results, though strictly not required
since that portion of the record is undefined.  However, there is a performance
penalty doing that padding.  So I am leaning to just not giving the error and
let the variable remain untouched.


-- 


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


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

* [Bug fortran/31366] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (7 preceding siblings ...)
  2007-03-31 16:28 ` jvdelisle at gcc dot gnu dot org
@ 2007-04-01  7:11 ` patchapp at dberlin dot org
  2007-04-01 15:24 ` jvdelisle at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: patchapp at dberlin dot org @ 2007-04-01  7:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from patchapp at dberlin dot org  2007-04-01 08:10 -------
Subject: Bug number PR31366

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00005.html


-- 


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


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

* [Bug fortran/31366] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (8 preceding siblings ...)
  2007-04-01  7:11 ` patchapp at dberlin dot org
@ 2007-04-01 15:24 ` jvdelisle at gcc dot gnu dot org
  2007-04-01 15:29 ` jvdelisle at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-04-01 15:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jvdelisle at gcc dot gnu dot org  2007-04-01 16:24 -------
Subject: Bug 31366

Author: jvdelisle
Date: Sun Apr  1 16:23:48 2007
New Revision: 123401

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

        PR libgfortran/31366
        * io/transfer.c (read_block_direct): Do not generate error when reading
        past EOF on a short record that is less than the RECL= specified.

2007-04-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libgfortran/31207
        * io/unit.c (close_unit_1): If there are bytes previously written from
        ADVANCE="no", move to the end before closing.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/transfer.c
    trunk/libgfortran/io/unit.c


-- 


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


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

* [Bug fortran/31366] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (9 preceding siblings ...)
  2007-04-01 15:24 ` jvdelisle at gcc dot gnu dot org
@ 2007-04-01 15:29 ` jvdelisle at gcc dot gnu dot org
  2007-04-01 17:56 ` [Bug fortran/31366] [4.2 only] " jvdelisle at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-04-01 15:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jvdelisle at gcc dot gnu dot org  2007-04-01 16:29 -------
Subject: Bug 31366

Author: jvdelisle
Date: Sun Apr  1 16:29:05 2007
New Revision: 123402

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

        PR libgfortran/31366
        * gfortran.dg/direct_io_6.f90: New test.

2007-04-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libgfortran/31207
        * gfortran.dg/advance_5.f90: New test.
        * gfortran.dg/advance_6.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/advance_4.f90
    trunk/gcc/testsuite/gfortran.dg/advance_5.f90
    trunk/gcc/testsuite/gfortran.dg/direct_io_6.f90
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/31366] [4.2 only] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (10 preceding siblings ...)
  2007-04-01 15:29 ` jvdelisle at gcc dot gnu dot org
@ 2007-04-01 17:56 ` jvdelisle at gcc dot gnu dot org
  2007-04-17 18:10 ` fxcoudert at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-04-01 17:56 UTC (permalink / raw)
  To: gcc-bugs



-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|REOPENED                    |ASSIGNED
           Keywords|                            |wrong-code
   Last reconfirmed|2007-03-26 22:18:42         |2007-04-01 18:56:41
               date|                            |
            Summary|Last record truncated for   |[4.2 only] Last record
                   |read after short write,     |truncated for read after
                   |direct access file          |short write, direct access
                   |                            |file


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


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

* [Bug fortran/31366] [4.2 only] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (11 preceding siblings ...)
  2007-04-01 17:56 ` [Bug fortran/31366] [4.2 only] " jvdelisle at gcc dot gnu dot org
@ 2007-04-17 18:10 ` fxcoudert at gcc dot gnu dot org
  2007-04-18  3:00 ` jvdelisle at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-17 18:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from fxcoudert at gcc dot gnu dot org  2007-04-17 19:10 -------
This one does not look like a regression. Thomas or Jerry, can you confirm this
and close it?


-- 


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


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

* [Bug fortran/31366] [4.2 only] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (12 preceding siblings ...)
  2007-04-17 18:10 ` fxcoudert at gcc dot gnu dot org
@ 2007-04-18  3:00 ` jvdelisle at gcc dot gnu dot org
  2007-04-18  4:01 ` jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-04-18  3:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jvdelisle at gcc dot gnu dot org  2007-04-18 04:00 -------
I believe this was a regression against 4.1.  It was introduced by the record
marker patch.  I need to build latest 4.1 and test.  I will report here teh
results.


-- 


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


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

* [Bug fortran/31366] [4.2 only] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (13 preceding siblings ...)
  2007-04-18  3:00 ` jvdelisle at gcc dot gnu dot org
@ 2007-04-18  4:01 ` jvdelisle at gcc dot gnu dot org
  2007-04-18  4:36 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-04-18  4:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from jvdelisle at gcc dot gnu dot org  2007-04-18 05:01 -------
This one is a regression against g77.  4.1 fails as well.  It passes the .f
version of the test case with g77.

I will backport to 4.2 and 4.1


-- 


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


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

* [Bug fortran/31366] [4.2 only] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (14 preceding siblings ...)
  2007-04-18  4:01 ` jvdelisle at gcc dot gnu dot org
@ 2007-04-18  4:36 ` jvdelisle at gcc dot gnu dot org
  2007-04-18  4:37 ` jvdelisle at gcc dot gnu dot org
  2007-04-18  4:42 ` jvdelisle at gcc dot gnu dot org
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-04-18  4:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from jvdelisle at gcc dot gnu dot org  2007-04-18 05:35 -------
Subject: Bug 31366

Author: jvdelisle
Date: Wed Apr 18 05:35:41 2007
New Revision: 123940

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

        PR libgfortran/31366
        * io/transfer.c (read_block_direct): Do not generate error when reading
        past EOF on a short record that is less than the RECL= specified.

Modified:
    branches/gcc-4_2-branch/libgfortran/ChangeLog
    branches/gcc-4_2-branch/libgfortran/io/transfer.c


-- 


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


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

* [Bug fortran/31366] [4.2 only] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (15 preceding siblings ...)
  2007-04-18  4:36 ` jvdelisle at gcc dot gnu dot org
@ 2007-04-18  4:37 ` jvdelisle at gcc dot gnu dot org
  2007-04-18  4:42 ` jvdelisle at gcc dot gnu dot org
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-04-18  4:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from jvdelisle at gcc dot gnu dot org  2007-04-18 05:37 -------
Subject: Bug 31366

Author: jvdelisle
Date: Wed Apr 18 05:37:12 2007
New Revision: 123941

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

        PR libgfortran/31366
        * gfortran.dg/direct_io_6.f90: New test.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/direct_io_6.f90
Modified:
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/31366] [4.2 only] Last record truncated for read after short write, direct access file
  2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
                   ` (16 preceding siblings ...)
  2007-04-18  4:37 ` jvdelisle at gcc dot gnu dot org
@ 2007-04-18  4:42 ` jvdelisle at gcc dot gnu dot org
  17 siblings, 0 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-04-18  4:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from jvdelisle at gcc dot gnu dot org  2007-04-18 05:42 -------
Will not fix on 4.1.  Fixed on 4.2 and 4.3


-- 

jvdelisle at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-04-18  4:42 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-26 16:27 [Bug fortran/31366] New: When the last record written to a direct access file is shorter than the record length of the file, gfortran truncates the record michael dot a dot richmond at nasa dot gov
2007-03-26 21:18 ` [Bug fortran/31366] " jvdelisle at gcc dot gnu dot org
2007-03-27 19:05 ` tkoenig at gcc dot gnu dot org
2007-03-28  0:53 ` jvdelisle at gcc dot gnu dot org
2007-03-31  0:45 ` [Bug fortran/31366] Last record truncated for read after short write, direct access file jvdelisle at gcc dot gnu dot org
2007-03-31  0:46 ` jvdelisle at gcc dot gnu dot org
2007-03-31  5:06 ` jvdelisle at gcc dot gnu dot org
2007-03-31  7:11 ` tkoenig at alice-dsl dot net
2007-03-31 16:28 ` jvdelisle at gcc dot gnu dot org
2007-04-01  7:11 ` patchapp at dberlin dot org
2007-04-01 15:24 ` jvdelisle at gcc dot gnu dot org
2007-04-01 15:29 ` jvdelisle at gcc dot gnu dot org
2007-04-01 17:56 ` [Bug fortran/31366] [4.2 only] " jvdelisle at gcc dot gnu dot org
2007-04-17 18:10 ` fxcoudert at gcc dot gnu dot org
2007-04-18  3:00 ` jvdelisle at gcc dot gnu dot org
2007-04-18  4:01 ` jvdelisle at gcc dot gnu dot org
2007-04-18  4:36 ` jvdelisle at gcc dot gnu dot org
2007-04-18  4:37 ` jvdelisle at gcc dot gnu dot org
2007-04-18  4:42 ` jvdelisle 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).