In my quest for old software, I’ve seen this file in multiple searches, gcc-0.9.tar.bz2, which is the first version of GCC!
GCC 0.9 on SIMH VAX / 4.2BSD
Â Date: Sun, 22 Mar 87 10:56:56 EST
From: rms (Richard M. Stallman)
Â Â The GNU C compiler is now available for ftp from the file
/u2/emacs/gcc.tar on prep.ai.mit.edu. Â This includes machine
descriptions for vax and sun, 60 pages of documentation on writing
machine descriptions (internals.texinfo, internals.dvi and Info
Â Â This also contains the ANSI standard (Nov 86) C preprocessor and 30
pages of reference manual for it.
Â Â This compiler compiles itself correctly on the 68020 and did so
recently on the vax. Â It recently compiled Emacs correctly on the
68020, and has also compiled tex-in-C and Kyoto Common Lisp.
However, it probably still has numerous bugs that I hope you will
find for me.
Â Â I will be away for a month, so bugs reported now will not be
handled until then.
Â Â If you can’t ftp, you can order a compiler beta-test tape from the
Free Software Foundation for $150 (plus 5% sales tax in
Massachusetts, or plus $15 overseas if you want air mail).
Â Â Free Software Foundation
1000 Mass Ave
Cambridge, MA Â 02138
[tapes are generally in Unix tar format. Â If you have other needs,
write to the above address, and ask if they can be met. -len]
And indeed, the files are datedÂ 22/03/1987 making this the first public release of GCC.
GNU CC is a fairly portable optimizing C compiler intended for
machines with 32-bit words that have several registers and address
memory in terms of 8-bit bytes. Â It supports full ANSI standard C, not
including libraries (which we do not consider to be part of a
Currently we have working machine descriptions for the Vax and for
the 68000/68020 (including 68881 support).
Optimizations performed by GNU CC include:
- Invariant code motion out of loops.
- Common subexpression elimination.
- Automatic register packing (register declarations are unnecessary
- Constant propagation and elimination of consequent dead code.
- Copy propagation.
- Elimination of dead stores.
- Jump optimization including cross-jumping.
- Delaying of stack adjustments after function calls.
- Arithmetic performed in subword types when appropriate.
- Many local optimizations.
GNU CC runs about as fast as PCC.
Most of the optimizations are machine-independent or controlled by a
machine description. Â GNU CC takes advantage of all the 68020
addressing modes that we can see how to make the Sun assembler
assemble. Â Debugging output for DBX is available whether you request
optimization or not.
Seeing as 4.3BSD didn’t ship until 1988, I went ahead and set out to build this on 4.2BSD. The first stumbling block I hit is that GCC needs bison. Â The oldest version of bison I have is 1.25 which honestly is just too new! Â However in the same location as GCC is this file gnu1988.tar.bz2 which contains all of the current GNU software of 1988! Â And what is on that tape?
So this is probably as old as it is going to get, so I downloaded and went to compile bison, however getopt is a missing call! Â A creative search found getopt.c (local mirror) and even better PCC liked it enough to get a running bison so I could then configure GCC.
Configuring GCC is a manual process, but not too involved:
- Make a symbolic link from file `config.h’ to the top-level
config file for the machine you are using. Its name should be
`config-MACHINE.h’. This file is responsible for
defining information about the host machine. It includes
- Make a symbolic link from `tm.h’ to the machine-description
macro file for your machine (its name should be
- Make a symbolic link from `md’ to the
machine description pattern file (its name should be
- Make a symbolic link from
`aux-output.c’ to the output-subroutine file for your machine
(its name should be `MACHINE-output.c’).Make sure the Bison parser generator is installed.Build the compiler. Just type `make’ in the compiler directory.
And in a minute I had GCC compiled. Â I ran it with -v and got this output:
# gcc -v
ld /lib/crt0.o -lc
It really is nowhere near as featured as 1.21 that is for sure! Â So time to do a simple hello world program:
# cat hello.c
printf(“GCC 0.9 in action!\n”);
# gcc -v hello.c -o hello
cpp -Dvax hello.c /tmp/cc002050.cpp
cc1 /tmp/cc002050.cpp -quiet -dumpbase hello.c -noreg -o /tmp/cc002050.s
as -o hello.o /tmp/cc002050.s
ld -o hello /lib/crt0.o hello.o -lc
GCC 0.9 in action!
And there we go!
I don’t know why, but I haven’t seen anything about anyone actually running GCC 0.9. Â Or even where or how they found this ‘lost’ file. Â Let alone anyone even building or running it in 2016.
For anyone who wants to try, SIMH tape files of the binaries are here:
And of course source tapes are here.