public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/14872] New: [gfortran]  Variables used for REC= in READ / WRITE always case run-time error
@ 2004-04-07  5:38 bdavis9659 at comcast dot net
  2004-04-07  5:40 ` [Bug fortran/14872] " bdavis9659 at comcast dot net
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bdavis9659 at comcast dot net @ 2004-04-07  5:38 UTC (permalink / raw)
  To: gcc-bugs

This problem is from FM410.FOR and FM413.FOR of the NIST tests.


! demonstrates using a variable for REC in READ/WRITE
       implicit none
       integer i,j,irec
       OPEN(UNIT=10,ACCESS='DIRECT',RECL=80)
       DO I=1,10
          WRITE(UNIT=10,REC=i)i
       END DO
       STOP
       END

$ gfortran y.f
$ ./a.out
At line 6 of file y.f
Fortran runtime error: Record number must be positive


from g77:

$ g77 y.f
$ ./a.out


GNU Fortran 95 (GCC 3.5-tree-ssa 20040405 (merged 20040331))

from y.f.t03.original:

        _gfortran_filename = "y.f";
        _gfortran_line = 6;
        _gfortran_ioparm.unit = 10;
        _gfortran_ioparm.rec = &i;
                            ^^^^^^^^^
                      wrong, run time lib expects a value

        _gfortran_st_write ();
        _gfortran_transfer_integer (&i, 4);
        _gfortran_st_write_done ();
        i = i + 1;

so this looks like a front end issue.  note that direct access reads/writes work
fine with a constant REC, like: 

WRITE(10,REC=100)

-- 
           Summary: [gfortran]  Variables used for REC= in READ / WRITE
                    always case run-time error
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bdavis9659 at comcast dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2004-04-11 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-07  5:38 [Bug libfortran/14872] New: [gfortran] Variables used for REC= in READ / WRITE always case run-time error bdavis9659 at comcast dot net
2004-04-07  5:40 ` [Bug fortran/14872] " bdavis9659 at comcast dot net
2004-04-08 18:03 ` pinskia at gcc dot gnu dot org
2004-04-11 16:07 ` cvs-commit at gcc dot gnu dot org
2004-04-11 17:19 ` pinskia 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).