Your problem is probably due to differences between the compilers and not between the bit-levels of the machines. For example, some FORTRAN 77 compilers implicitly apply save to all procedure (subroutine and function) local variables. This is not required by the standard and this behavior should not be relied upon. It frequently causes problems when a legacy program is compiled with a modern compiler that demands that save be used if local variables should have their values retained across invocations of a procedure. I don't know if g77 has this "feature". You can turn on this behavior in gfortran with the compiler option -fno-automatic.
EDIT: consider:
subroutine MySub
logical FirstCall
save FirstCall
data FirstCall / .TRUE. /
integer I
if ( FirstCall ) then
I = 0
FirstCall = .FALSE.
end if
I = I + 1
write (6, *) "Call", I
end
program main
integer j
do j=1, 4
call MySub ()
end do
end program main
Compiled with g77 (no compiler options), the output is:
Call 1
Call 2
Call 3
Call 4
The local variable I is retaining its value across invocations of MySub. So it appears that g77 is saving local variables even when not requested with save. At least at the default optimization level.
Compiled with gfortran with options fbackslash -ffixed-line-length-0 -std=legacy -g -O0 -fno-inline the output is the same. Now change to -O3 and the output is:
Call 1
Call 2
Call 3
Call 129
Sometimes I retains its value, sometimes not.
Change one line of the program to: save FirstCall, I and the value is always retained:
Call 1
Call 2
Call 3
Call 4
Try -fno-automatic ...