The first FORTRAN compiler for the Soviet BESM-6 mainframe was written by means of manually retargeting the assembly code of the CDC 1604 FORTRAN compiler donated by CERN to JINR.
As a result is it likely that any bug in the front-end of the BESM-6 compiler replicates a bug in the original CDC 1604 code. There is a peculiar bug: select "FORTRAN bug" in the left column, then press RUN.
program main i = 5 j = 5 if (i=j) print 10 10 format(13hHello, world!) print 20 20 format(32hWhy isn't "hello, world" printed) end
Unfortunately, SIMH doesn't have the CDC 1604 among the emulated systems, and even if it did, I wouldn't know where to find a FORTRAN compiler for it. I could have tried the CDC 1700, but I don't see a mention of the compiler here, only the runtime.
Update: Another bug observed in the compiler is that the program
dimension ia(9,9) do 1 i=1,9 do 1 j=1,9 1 ia(i,j)=10*i+j e=2.718281828 pi=3.14159265 i=ia(e,pi) j=ia(pi,e) print 2,i,j 2 format(2i6) end
prints 33 92
, instead of erroring out or printing 23 32
.
I'd like to check if these bugs exist in the original code. Does a CDC 1604 emulator exist with a functional FORTRAN compiler?