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

* [Bug fortran/14872] [gfortran]  Variables used for REC= in READ / WRITE always case run-time error
  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 ` bdavis9659 at comcast dot net
  2004-04-08 18:03 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bdavis9659 at comcast dot net @ 2004-04-07  5:40 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libfortran                  |fortran


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


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

* [Bug fortran/14872] [gfortran]  Variables used for REC= in READ / WRITE always case run-time error
  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
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-08 18:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-08 18:03 -------
Patch here: <http://gcc.gnu.org/ml/fortran/2004-04/msg00067.html>. Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |patch
   Last reconfirmed|0000-00-00 00:00:00         |2004-04-08 18:03:18
               date|                            |
   Target Milestone|---                         |tree-ssa


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


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

* [Bug fortran/14872] [gfortran]  Variables used for REC= in READ / WRITE always case run-time error
  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
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-04-11 16:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-04-11 14:51 -------
Subject: Bug 14872

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	tree-ssa-20020619-branch
Changes by:	bdavis@gcc.gnu.org	2004-04-11 14:51:41

Modified files:
	gcc/fortran    : ChangeLog trans-io.c 
	gcc/testsuite  : ChangeLog.tree-ssa 
Added files:
	gcc/testsuite/gfortran.fortran-torture/execute: direct_io.f90 

Log message:
	PR gfortran/14872
	* testsuite/gfortran.fortran-torture/execute/direct_io.f90: Add new test.
	
	PR fortran/14872
	* gcc/gcc/fortran/trans-io.c (build_dt): Change REC to value.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.137&r2=1.1.2.138
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-io.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.9&r2=1.1.2.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.tree-ssa.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.219&r2=1.1.2.220
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/execute/direct_io.f90.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug fortran/14872] [gfortran]  Variables used for REC= in READ / WRITE always case run-time error
  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
                   ` (2 preceding siblings ...)
  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
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-11 17:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-11 16:06 -------
Fixed.

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


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