The following program prints READ FAILED.  A similar program
with an unformatted, rather than direct access, file also fails.

Dick Hendrickson

      Program qi0011
      CHARACTER(9) BDA(10)
      CHARACTER(9) BDA1(10)
      INTEGER  J_LEN
      ISTAT = -314

      INQUIRE(IOLENGTH = J_LEN) BDA1

      ISTAT = -314
      OPEN (UNIT=48,
     $      STATUS='SCRATCH',
     $      ACCESS='DIRECT',
     $      RECL = j_len,
     $      IOSTAT = ISTAT,
     $      FORM='UNFORMATTED',
     $      ACTION='READWRITE')


      IF (ISTAT /= 0) stop

      BDA = 'xxxxxxxxx'
      WRITE (48,IOSTAT = ISTAT, REC = 10) BDA1(4:3)
      IF ( ISTAT .NE. 0) THEN
        stop ' WRITE FAILED '
      ENDIF

      ISTAT = -314
      READ (48,IOSTAT = ISTAT, REC=10) BDA(4:3)
      IF ( ISTAT .NE. 0) THEN
        stop ' READ FAILED '
      ENDIF
      end


-- 
           Summary: can't read zero length array sections
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dick dot hendrickson at gmail dot com


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

Reply via email to