$ cat conv-implied-open.f90 program main implicit none integer (kind=8) :: i1, i2, i3 write (10) 1_8 close (10) open (10,status="old", form="unformatted", access="direct", recl=8) read (10,rec=1) i1 read (10,rec=2) i2 read (10,rec=3) i3 print '(3Z16,1X)',i1,i2,i3 end program main $ gfortran conv-implied-open.f90 $ ./a.out 8 1 8 $ gfortran -fconvert=swap conv-implied-open.f90 $ ./a.out 800000000000000 100000000000000 800000000000000
The second call is incorrect. The lack of an open statement means that the information about the byte-swapping isn't picked up. This is not really all that serious, because I suspect most people will give their files descriptive names if they want to move them across architectures. -- Summary: -fconvert=swap and implied open Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: libfortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tkoenig at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26735