On Aug 17, 2017, arnold(a)skeeve.com wrote:
I remember reading an article somewhere on the history
of the first
FORTRAN compiler. The guys doing it wanted it to succeed, and they
were fighting the mentality that high level languages could not possibly
be as efficient as hand-coded assembly, so they put a lot of work into
the optimization of the generated code.
It worked so well that the results that came out of the compiler
sometimes suprised the compiler writers! They then would have to
dive into the compiler sources to figure out how it was done.
I don't remember where I read this article. If the story rings a
bell with anyone, let me know.
In his paper "The history of FORTRAN I, II and III” presented at the First ACM
SIGPLAN conference on History of Programming Languages (1978), John Backus said:
It was an exciting period; when later on we began to
get fragments of compiled programs out of the system, we were often astonished at the
surprising transformations in the indexing operations and in the arrangement of the
computation which the compiler made, changes which made the object program efficient but
which we would not have thought to make as programmers ourselves (even though, of course,
Nelson or Ziller could figure out how the indexing worked, Sheridan could explain how an
expresssion had been optimized beyond recognition, and Goldberg or Sayre could tell us how
section 5 had generated additional indexing operations). Transfers of control appeared
which corresponded to no source statement, expressions were radically rearranged, and the
same DO statement might produce no instructions in the object program in one context, and
in another it would produce many instructions in different places in the program.
The paper is available here, courtesy of ACM:
http://www.softwarepreservation.org/projects/FORTRAN/index.html .