public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bdavis9659 at comcast dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/14872] New: [gfortran]  Variables used for REC= in READ / WRITE always case run-time error
Date: Wed, 07 Apr 2004 05:38:00 -0000	[thread overview]
Message-ID: <20040407053821.14872.bdavis9659@comcast.net> (raw)

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


             reply	other threads:[~2004-04-07  5:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-07  5:38 bdavis9659 at comcast dot net [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040407053821.14872.bdavis9659@comcast.net \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).