ghoti@BOURBAKI.MIT.EDU (01/24/89)
Enclosed is my recent correspondence with Richard Stallman regarding my suggestions for making GCC source code more accessible to amateurs, such as myself, who are interested in studying and experimenting with GCC source code. It includes an outline for the book I wish someone would write. Sincerely, Allan Adler ghoti@hypatia.mit.edu =========================================================================== Adler to Stallman I'm glad that you like the idea of a book. I am also grateful that you are willing to answer questions. I think that copyleft for the book is a great idea. That does pose some problems regarding publication and distribution but I think they can be easily handled. However, I should explain the constraints I am working under since they are severe: (1) I have been unemployed for 3 years and am destitute. I live entirely on charity, which is by no means a mode of survival. Furthermore, because of my strong ideals regarding education and employment practices, and because of my commitment to my own scholarly interests, it is quite unlikely that things can ever get better for me (although they can easily get worse). (2) I don't have enough room on the machine I'm using to store a reasonably current version of GCC. Furthermore, I have no guarantee of being to keep my account for long enough to finish the project. (3) I am not competent to write a book on implementing GCC. I have only attempted one implementation (namely to a nonexistent Z80 based system for which I have a half-finished simulator) and it was unsuccessful because I couldn't figure out how to debug it. (4) Although I am quite enthusiastic about the educational potential of GCC and FSF software in general, my strongest interests lie in other areas such as pure mathematics, musical composition, history, etc. In view of (1), this means that if I have to go down fighting (as seems likely), it will be for such studies, not for FSF. Furthermore, even if (1) were not a consideration, I would still give considerable priority to my own scholarship. (5) Even with your generous offer to answer questions, I think I will need more help than you can afford to provide. I will therefore have to get other people involved in the effort, and so far I haven't been able to find other people interested in helping me. One way to solve some of these problems would be for me to be part of a grant proposal. I probably couldn't be PI for one since my Ph.D. is in mathematics, not computer science. But I could probably be listed as a consultant, where my mathematical background and my experience as an educator would be relevant. But someone else would have to ask for the grant. But who ? As for the contents of the book itself, here is a naive and tentative outline. In view of (3) above, I am reminded of when, as an experiment, I gave my class the homework problem of writing a midterm which they thought would be reasonable. I discovered that the most difficult exams were written by the students least likely to be able to pass them. And so it is with the outline which I submit to you below for your comments, composed by the person least likely to be able to fill in the details. Sincerely, Allan Adler ghoti@hypatia.mit.edu =============================================================================== Outline, submitted by Allan Adler 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 look should 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 =============================================================================== Stallman to Adler Received: from sugar-bombs.ai.mit.edu by math.mit.edu; Tue, 24 Jan 89 02:33:38 EST Received: by sugar-bombs.ai.mit.edu; Tue, 24 Jan 89 02:33:22 EST Date: Tue, 24 Jan 89 02:33:22 EST From: rms@wheaties.ai.mit.edu (Richard Stallman) Message-Id: <8901240733.AA00701@sugar-bombs.ai.mit.edu> To: ghoti@bourbaki.mit.edu In-Reply-To: <8901240655.AA28576@hermite.mit.edu> (ghoti@bourbaki.mit.edu) Based on what you say, I don't think you are the person to write a book on GCC. But your outline looks reasonable, so I will put it in PROJECTS in case someone shows up wanting to write the stuff.