The following is an outline for a book that I hoped someone would write about GCC. I wrote the outline several years ago while I was trying to understand the source code for GCC and how to use the flexible retargeting features of GCC. Eventually I gave up and forgot about it until I saw it quoted in the web page http://www.mathematik.uni-marburg.de/~hampel/system/net/Software/GCC/PROJECTS So maybe someone will write this book. If so, I'd like to read it. Allan Adler ara@zurich.csail.mit.edu I. Overview of this document II. The machines on which GCC is implemented A. Prose description of those characteristics of target machines and their operating systems which are pertinent to the implementation of GCC. i. target machine characteristics ii. comparison of this system of machine characteristics with other systems of machine specification currently in use B. Tables of the characteristics of the target machines on which GCC is implemented. C. A priori restrictions on the values of characteristics of target machines, with special reference to those parts of the source code which entail those restrictions i. restrictions on individual characteristics ii. restrictions involving relations between various characteristics D. The use of GCC as a cross-compiler i. cross-compilation to existing machines ii. cross-compilation to non-existent machines E. Assumptions which are made regarding the target machine i. assumptions regarding the architecture of the target machine ii. assumptions regarding the operating system of the target machine iii. assumptions regarding software resident on the target machine iv. where in the source code these assumptions are in effect made III. A systematic approach to writing the files tm.h and xm.h A. Macros which require special care or skill B. Examples, with special reference to the underlying reasoning IV. A systematic approach to writing the machine description file md A. Minimal viable sets of insn descriptions B. Examples, with special reference to the underlying reasoning V. Uses of the file aux-output.c VI. Specification of what constitutes correct performance of an implementation of GCC A. The components of GCC B. The itinerary of a C program through GCC C. A system of benchmark programs D. What your RTL and assembler should look like with these benchmarks E. Fine tuning for speed and size of compiled code VII. A systematic procedure for debugging an implementation of GCC A. Use of GDB i. the macros in the file .gdbinit for GCC ii. obstacles to the use of GDB a. functions implemented as macros can't be called in GDB B. Debugging without GDB i. How to turn off the normal operation of GCC and access specific parts of GCC C. Debugging tools D. Debugging the parser i. how machine macros and insn definitions affect the parser E. Debugging the recognizer i. how machine macros and insn definitions affect the recognizer ditto for other components VIII. Data types used by GCC, with special reference to restrictions not specified in the formal definition of the data type IX. References to the literature for the algorithms used in GCC