Using a fresh build of gfortran from the cvs archive (old versions of gfortran hit the now fixed - Internal Error: Recursive library error) I get an error trying to open a direct access file (g77 and Absoft f77 are happy with it and gfortran works ok if status='SCRATCH' is used instead of the variable) - [dranta:~/tests/gfortran] dir% g77 -o direct direct.f [dranta:~/tests/gfortran] dir% direct [dranta:~/tests/gfortran] dir% gfortran -o direct direct.f [dranta:~/tests/gfortran] dir% direct ERROR SCRATCH SCRATCH STOP 0 [dranta:~/tests/gfortran] dir% cat direct.f program main CALL OPENF(11,642,'SCRATCH') stop end SUBROUTINE OPENF (NT,NRECL,STAT) CHARACTER*8 STAT*(*),STATUS STATUS=STAT OPEN(UNIT=NT,STATUS=STATUS,ACCESS='DIRECT', $ FORM='UNFORMATTED',RECL=NRECL,ERR=999) RETURN 999 Write(*,*)'ERROR ',STAT,' ',STATUS RETURN END
Confirmed.
This is the same bug as the first half of 20163, which is fixed with http://gcc.gnu.org/ml/gcc-patches/2005-02/msg01694.html Thomas
Indeed. This is now fixed on mainline. Resolving it as duplicate of PR20163. $ gfortran -v Using built-in specs. Target: i386-linux Configured with: ../gcc/configure --prefix=/tmp/gfortran-20050412/irun --enable-languages=c,f95 --host=i386-linux Thread model: posix gcc version 4.1.0 20050412 (experimental) $ gfortran direct.f && ./a.out STOP 0 *** This bug has been marked as a duplicate of 20163 ***