Annotation of gcc/internals-1, revision 1.1.1.4

1.1.1.4 ! root        1: Info file internals, produced by Makeinfo, -*- Text -*- from input
        !             2: file internals.texinfo.
        !             3: 
        !             4: This file documents the internals of the GNU compiler.
        !             5: 
        !             6: Copyright (C) 1988 Free Software Foundation, Inc.
        !             7: 
        !             8: Permission is granted to make and distribute verbatim copies of this
        !             9: manual provided the copyright notice and this permission notice are
        !            10: preserved on all copies.
        !            11: 
        !            12: Permission is granted to copy and distribute modified versions of
        !            13: this manual under the conditions for verbatim copying, provided also
        !            14: that the section entitled ``GNU CC General Public License'' is
        !            15: included exactly as in the original, and provided that the entire
        !            16: resulting derived work is distributed under the terms of a permission
        !            17: notice identical to this one.
        !            18: 
        !            19: Permission is granted to copy and distribute translations of this
        !            20: manual into another language, under the above conditions for modified
        !            21: versions, except that the section entitled ``GNU CC General Public
        !            22: License'' and this permission notice may be included in translations
        !            23: approved by the Free Software Foundation instead of in the original
        !            24: English.
        !            25: 
1.1       root       26: 
                     27: 
1.1.1.2   root       28: File: internals,  Node: Top,  Next: Copying,  Up: (DIR)
1.1       root       29: 
                     30: Introduction
                     31: ************
                     32: 
1.1.1.4 ! root       33: This manual documents how to run, install and port the GNU C
        !            34: compiler, as well as its new features and incompatibilities, and how
        !            35: to report bugs.
1.1.1.2   root       36: 
1.1       root       37: * Menu:
                     38: 
                     39: * Copying::         GNU CC General Public License says
                     40:                      how you can copy and share GNU CC.
1.1.1.2   root       41: * Contributors::    People who have contributed to GNU CC.
                     42: * Options::         Command options supported by `gcc'.
1.1       root       43: * Installation::    How to configure, compile and install GNU CC.
1.1.1.3   root       44: * Trouble::         If you have trouble installing GNU CC.
1.1.1.2   root       45: * Incompatibilities:: Incompatibilities of GNU CC.
                     46: * Extensions::      GNU extensions to the C language.
                     47: * Bugs::            How to report bugs (if you want to get them fixed).
1.1       root       48: * Portability::     Goals of GNU CC's portability features.
1.1.1.2   root       49: * Interface::       Function-call interface of GNU CC output.
1.1       root       50: * Passes::          Order of passes, what they do, and what each file is for.
                     51: * RTL::             The intermediate representation that most passes work on.
                     52: * Machine Desc::    How to write machine description instruction patterns.
                     53: * Machine Macros::  How to write the machine description C macros.
                     54: 
1.1.1.4 ! root       55:  
1.1       root       56: 
1.1.1.2   root       57: File: internals,  Node: Copying,  Next: Contributors,  Prev: Top,  Up: Top
1.1       root       58: 
                     59: GNU CC GENERAL PUBLIC LICENSE
                     60: *****************************
                     61: 
1.1.1.4 ! root       62:                         (Clarified 11 Feb 1988)
1.1       root       63: 
1.1.1.4 ! root       64:   The license agreements of most software companies keep you at the
        !            65: mercy of those companies.  By contrast, our general public license is
        !            66: intended to give everyone the right to share GNU CC.  To make sure
        !            67: that you get the rights we want you to have, we need to make
        !            68: restrictions that forbid anyone to deny you these rights or to ask
        !            69: you to surrender the rights.  Hence this license agreement.
        !            70: 
        !            71:   Specifically, we want to make sure that you have the right to give
        !            72: away copies of GNU CC, that you receive source code or else can get
        !            73: it if you want it, that you can change GNU CC or use pieces of it in
        !            74: new free programs, and that you know you can do these things.
1.1       root       75: 
1.1.1.2   root       76:   To make sure that everyone has such rights, we have to forbid you to
1.1.1.4 ! root       77: deprive anyone else of these rights.  For example, if you distribute
        !            78: copies of GNU CC, you must give the recipients all the rights that
        !            79: you have.  You must make sure that they, too, receive or can get the
        !            80: source code.  And you must tell them their rights.
        !            81: 
        !            82:   Also, for our own protection, we must make certain that everyone
        !            83: finds out that there is no warranty for GNU CC.  If GNU CC is
        !            84: modified by someone else and passed on, we want its recipients to
        !            85: know that what they have is not what we distributed, so that any
        !            86: problems introduced by others will not reflect on our reputation.
        !            87: 
        !            88:   Therefore we (Richard Stallman and the Free Software Foundation,
        !            89: Inc.) make the following terms which say what you must do to be
        !            90: allowed to distribute or change GNU CC.
1.1       root       91: 
                     92: COPYING POLICIES
                     93: ================
                     94: 
1.1.1.4 ! root       95:   1. You may copy and distribute verbatim copies of GNU CC source
        !            96:      code as you receive it, in any medium, provided that you
        !            97:      conspicuously and appropriately publish on each copy a valid
        !            98:      copyright notice ``Copyright (C) 1988 Free Software Foundation,
        !            99:      Inc.'' (or with whatever year is appropriate); keep intact the
        !           100:      notices on all files that refer to this License Agreement and to
        !           101:      the absence of any warranty; and give any other recipients of
        !           102:      the GNU CC program a copy of this License Agreement along with
        !           103:      the program.  You may charge a distribution fee for the physical
        !           104:      act of transferring a copy.
        !           105: 
        !           106:   2. You may modify your copy or copies of GNU CC or any portion of
        !           107:      it, and copy and distribute such modifications under the terms
        !           108:      of Paragraph 1 above, provided that you also do the following:
        !           109: 
        !           110:         * cause the modified files to carry prominent notices stating
        !           111:           that you changed the files and the date of any change; and
        !           112: 
        !           113:         * cause the whole of any work that you distribute or publish,
        !           114:           that in whole or in part contains or is a derivative of GNU
        !           115:           CC or any part thereof, to be licensed at no charge to all
        !           116:           third parties on terms identical to those contained in this
        !           117:           License Agreement (except that you may choose to grant more
        !           118:           extensive warranty protection to some or all third parties,
        !           119:           at your option).
1.1.1.2   root      120: 
1.1       root      121:         * You may charge a distribution fee for the physical act of
1.1.1.4 ! root      122:           transferring a copy, and you may at your option offer
        !           123:           warranty protection in exchange for a fee.
1.1       root      124: 
1.1.1.4 ! root      125:      Mere aggregation of another unrelated program with this program
        !           126:      (or its derivative) on a volume of a storage or distribution
        !           127:      medium does not bring the other program under the scope of these
        !           128:      terms.
        !           129: 
        !           130:   3. You may copy and distribute GNU CC (or a portion or derivative
        !           131:      of it, under Paragraph 2) in object code or executable form
        !           132:      under the terms of Paragraphs 1 and 2 above provided that you
        !           133:      also do one of the following:
        !           134: 
        !           135:         * accompany it with the complete corresponding
        !           136:           machine-readable source code, which must be distributed
        !           137:           under the terms of Paragraphs 1 and 2 above; or,
1.1.1.2   root      138: 
                    139:         * accompany it with a written offer, valid for at least three
                    140:           years, to give any third party free (except for a nominal
                    141:           shipping charge) a complete machine-readable copy of the
1.1.1.4 ! root      142:           corresponding source code, to be distributed under the
        !           143:           terms of Paragraphs 1 and 2 above; or,
1.1.1.2   root      144: 
1.1.1.4 ! root      145:         * accompany it with the information you received as to where
        !           146:           the corresponding source code may be obtained.  (This
        !           147:           alternative is allowed only for noncommercial distribution
        !           148:           and only if you received the program in object code or
        !           149:           executable form alone.)
        !           150: 
        !           151:      For an executable file, complete source code means all the
        !           152:      source code for all modules it contains; but, as a special
        !           153:      exception, it need not include source code for modules which are
        !           154:      standard libraries that accompany the operating system on which
        !           155:      the executable file runs.
        !           156: 
        !           157:   4. You may not copy, sublicense, distribute or transfer GNU CC
        !           158:      except as expressly provided under this License Agreement.  Any
        !           159:      attempt otherwise to copy, sublicense, distribute or transfer
        !           160:      GNU CC is void and your rights to use the program under this
        !           161:      License agreement shall be automatically terminated.  However,
        !           162:      parties who have received computer software programs from you
        !           163:      with this License Agreement will not have their licenses
        !           164:      terminated so long as such parties remain in full compliance.
        !           165: 
        !           166:   5. If you wish to incorporate parts of GNU CC into other free
        !           167:      programs whose distribution conditions are different, write to
        !           168:      the Free Software Foundation at 675 Mass Ave, Cambridge, MA
        !           169:      02139.  We have not yet worked out a simple rule that can be
        !           170:      stated here, but we will often permit this.  We will be guided
        !           171:      by the two goals of preserving the free status of all
        !           172:      derivatives of our free software and of promoting the sharing
        !           173:      and reuse of software.
        !           174: 
        !           175: Your comments and suggestions about our licensing policies and our
        !           176: software are welcome!  Please contact the Free Software Foundation,
        !           177: Inc., 675 Mass Ave, Cambridge, MA 02139, or call (617) 876-3296.
1.1       root      178: 
                    179: NO WARRANTY
                    180: ===========
                    181: 
                    182:   BECAUSE GNU CC IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY NO
1.1.1.4 ! root      183: WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW.  EXCEPT
        !           184: WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC,
        !           185: RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE GNU CC "AS IS"
        !           186: WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
        !           187: BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
        !           188: FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY
        !           189: AND PERFORMANCE OF GNU CC IS WITH YOU.  SHOULD GNU CC PROVE
        !           190: DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
        !           191: CORRECTION.
        !           192: 
        !           193:  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M. 
        !           194: STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY
        !           195: WHO MAY MODIFY AND REDISTRIBUTE GNU CC AS PERMITTED ABOVE, BE LIABLE
        !           196: TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER
        !           197: SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
        !           198: OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
        !           199: DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES
        !           200: OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) GNU
        !           201: CC, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES,
        !           202: OR FOR ANY CLAIM BY ANY OTHER PARTY.
        !           203: 
1.1       root      204: 
                    205: 
1.1.1.2   root      206: File: internals,  Node: Contributors,  Next: Options,  Prev: Copying,  Up: Top
                    207: 
                    208: Contributors to GNU CC
                    209: **********************
                    210: 
1.1.1.4 ! root      211: In addition to Richard Stallman, several people have written parts of
        !           212: GNU CC.
1.1.1.2   root      213: 
1.1.1.4 ! root      214:    * The idea of using RTL and some of the optimization ideas came
        !           215:      from the U. of Arizona Portable Optimizer, written by Jack
        !           216:      Davidson and Christopher Fraser.  See ``Register Allocation and
        !           217:      Exhaustive Peephole Optimization'', Software Practice and
        !           218:      Experience 14 (9), Sept. 1984, 857-866.
1.1.1.2   root      219: 
                    220:    * Paul Rubin wrote most of the preprocessor.
                    221: 
                    222:    * Leonard Tower wrote parts of the parser, RTL generator, RTL
                    223:      definitions, and of the Vax machine description.
                    224: 
                    225:    * Ted Lemon wrote parts of the RTL reader and printer.
                    226: 
1.1.1.4 ! root      227:    * Nobuyuki Hikichi of Software Research Associates, Tokyo,
        !           228:      contributed the support for the SONY NEWS machine.
        !           229: 
        !           230:    * Charles LaBrec contributed the support for the Integrated
        !           231:      Solutions 68020 system.
        !           232: 
        !           233:    * Michael Tiemann of MCC wrote most of the description of the
        !           234:      National Semiconductor 32000 series cpu.  He also wrote the code
        !           235:      for inline function integration and for the SPARC cpu and
        !           236:      Motorola 88000 cpu and part of the Sun FPA support.
1.1.1.2   root      237: 
1.1.1.4 ! root      238:    * Jan Stein of the Chalmers Computer Society provided support for
        !           239:      Genix, as well as part of the 32000 machine description.
1.1       root      240: 
1.1.1.4 ! root      241:    * Randy Smith finished the Sun FPA support.
1.1       root      242: 
1.1.1.3   root      243:    * Robert Brown implemented the support for Encore 32000 systems.
                    244: 
1.1.1.4 ! root      245:    * David Kashtan of SRI adapted GNU CC to the Vomit-Making System.
1.1.1.2   root      246: 
                    247:    * Alex Crain provided changes for the 3b1.
                    248: 
1.1.1.4 ! root      249:    * Greg Satz and Chris Hanson assisted in making GNU CC work on
        !           250:      HP-UX for the 9000 series 300.
        !           251: 
        !           252:    * William Schelter did most of the work on the Intel 80386 support.
        !           253: 
1.1.1.2   root      254: 
                    255: 
                    256: File: internals,  Node: Options,  Next: Installation,  Prev: Contributors,  Up: Top
                    257: 
                    258: GNU CC Command Options
                    259: **********************
                    260: 
1.1.1.4 ! root      261: The GNU C compiler uses a command syntax much like the Unix C compiler.
        !           262: The `gcc' program accepts options and file names as operands. 
        !           263: Multiple single-letter options may *not* be grouped: `-dr' is very
        !           264: different from `-d -r'.
1.1.1.2   root      265: 
                    266: When you invoke GNU CC, it normally does preprocessing, compilation,
1.1.1.4 ! root      267: assembly and linking.  File names which end in `.c' are taken as C
        !           268: source to be preprocessed and compiled; compiler output files plus
        !           269: any input files with names ending in `.s' are assembled; then the
        !           270: resulting object files, plus any other input files, are linked
        !           271: together to produce an executable.
        !           272: 
        !           273: Command options allow you to stop this process at an intermediate
        !           274: stage.  For example, the `-c' option says not to run the linker. 
        !           275: Then the output consists of object files output by the assembler.
        !           276: 
        !           277: Other command options are passed on to one stage.  Some options
        !           278: control the preprocessor and others the compiler itself.  Yet other
        !           279: options control the assembler and linker; these are not documented
        !           280: here because the GNU assembler and linker are not yet released.
        !           281: 
        !           282: Here are the options to control the overall compilation process,
        !           283: including those that say whether to link, whether to assemble, and so
        !           284: on.
1.1.1.2   root      285: 
                    286: `-o FILE'
1.1.1.4 ! root      287:      Place output in file FILE.  This applies regardless to whatever
        !           288:      sort of output is being produced, whether it be an executable
        !           289:      file, an object file, an assembler file or preprocessed C code.
        !           290: 
        !           291:      If `-o' is not specified, the default is to put an executable
        !           292:      file in `a.out', the object file `SOURCE.c' in `SOURCE.o', an
        !           293:      assembler file in `SOURCE.s', and preprocessed C on standard
        !           294:      output.
1.1.1.2   root      295: 
                    296: `-c'
1.1.1.4 ! root      297:      Compile or assemble the source files, but do not link.  Produce
        !           298:      object files with names made by replacing `.c' or `.s' with `.o'
        !           299:      at the end of the input file names.  Do nothing at all for
        !           300:      object files specified as input.
1.1.1.2   root      301: 
                    302: `-S'
1.1.1.4 ! root      303:      Compile into assembler code but do not assemble.  The assembler
        !           304:      output file name is made by replacing `.c' with `.s' at the end
        !           305:      of the input file name.  Do nothing at all for assembler source
        !           306:      files or object files specified as input.
1.1.1.2   root      307: 
                    308: `-E'
                    309:      Run only the C preprocessor.  Preprocess all the C source files
                    310:      specified and output the results to standard output.
                    311: 
                    312: `-v'
1.1.1.4 ! root      313:      Compiler driver program prints the commands it executes as it
        !           314:      runs the preprocessor, compiler proper, assembler and linker. 
        !           315:      Some of these are directed to print their own version numbers.
1.1.1.2   root      316: 
                    317: `-BPREFIX'
1.1.1.4 ! root      318:      Compiler driver program tries PREFIX as a prefix for each
        !           319:      program it tries to run.  These programs are `cpp', `cc1', `as'
        !           320:      and `ld'.
        !           321: 
        !           322:      For each subprogram to be run, the compiler driver first tries
        !           323:      the `-B' prefix, if any.  If that name is not found, or if `-B'
        !           324:      was not specified, the driver tries two standard prefixes, which
        !           325:      are `/usr/lib/gcc-' and `/usr/local/lib/gcc-'.  If neither of
        !           326:      those results in a file name that is found, the unmodified
        !           327:      program name is searched for using the directories specified in
        !           328:      your `PATH' environment variable.
        !           329: 
        !           330:      The run-time support file `gnulib' is also searched for using
        !           331:      the `-B' prefix, if needed.  If it is not found there, the two
        !           332:      standard prefixes above are tried, and that is all.  The file is
        !           333:      left out of the link if it is not found by those means.  Most of
        !           334:      the time, on most machines, you can do without it.
1.1.1.2   root      335: 
                    336: These options control the details of C compilation itself.
                    337: 
                    338: `-ansi'
                    339:      Support all ANSI standard C programs.
                    340: 
1.1.1.4 ! root      341:      This turns off certain features of GNU C that are incompatible
        !           342:      with ANSI C, such as the `asm', `inline' and `typeof' keywords,
        !           343:      and predefined macros such as `unix' and `vax' that identify the
        !           344:      type of system you are using.  It also enables the undesirable
        !           345:      and rarely used ANSI trigraph feature.
        !           346: 
        !           347:      The `-ansi' option does not cause non-ANSI programs to be
        !           348:      rejected gratuitously.  For that, `-pedantic' is required in
        !           349:      addition to `-ansi'.
        !           350: 
        !           351:      The macro `__STRICT_ANSI__' is predefined when the `-ansi'
        !           352:      option is used.  Some header files may notice this macro and
        !           353:      refrain from declaring certain functions or defining certain
        !           354:      macros that the ANSI standard doesn't call for; this is to avoid
        !           355:      interfering with any programs that might use these names for
        !           356:      other things.
1.1.1.2   root      357: 
                    358: `-traditional'
                    359:      Attempt to support some aspects of traditional C compilers. 
                    360:      Specifically:
                    361: 
1.1.1.4 ! root      362:         * All `extern' declarations take effect globally even if they
        !           363:           are written inside of a function definition.  This includes
        !           364:           implicit declarations of functions.
1.1.1.2   root      365: 
1.1.1.4 ! root      366:         * The keywords `typeof', `inline', `signed', `const' and
        !           367:           `volatile' are not recognized.
1.1.1.2   root      368: 
                    369:         * Comparisons between pointers and integers are always allowed.
                    370: 
1.1.1.4 ! root      371:         * Integer types `unsigned short' and `unsigned char' promote
        !           372:           to `unsigned int'.
1.1.1.2   root      373: 
1.1.1.4 ! root      374:         * Out-of-range floating point literals are not an error.
1.1.1.2   root      375: 
1.1.1.4 ! root      376:         * In the preprocessor, comments convert to nothing at all,
        !           377:           rather than to a space.  This allows traditional token
        !           378:           concatenation.
        !           379: 
        !           380:         * In the preprocessor, macro arguments are recognized within
        !           381:           string constants in a macro definition (and their values
        !           382:           are stringified, though without additional quote marks,
        !           383:           when they appear in such a context).  The preprocessor
        !           384:           always considers a string constant to end at a newline.
1.1.1.2   root      385: 
                    386: `-O'
1.1.1.4 ! root      387:      Optimize.  Optimizing compilation takes somewhat more time, and
        !           388:      a lot more memory for a large function.
1.1.1.2   root      389: 
1.1.1.4 ! root      390:      Without `-O', the compiler's goal is to reduce the cost of
        !           391:      compilation and to make debugging produce the expected results. 
        !           392:      Statements are independent: if you stop the program with a
        !           393:      breakpoint between statements, you can then assign a new value
        !           394:      to any variable or change the program counter to any other
        !           395:      statement in the function and get exactly the results you would
        !           396:      expect from the source code.
        !           397: 
        !           398:      Without `-O', only variables declared `register' are allocated
        !           399:      in registers.  The resulting compiled code is a little worse
        !           400:      than produced by PCC without `-O'.
1.1.1.2   root      401: 
1.1.1.4 ! root      402:      With `-O', the compiler tries to reduce code size and execution
        !           403:      time.
1.1.1.2   root      404: 
                    405:      Some of the `-f' options described below turn specific kinds of
                    406:      optimization on or off.
                    407: 
                    408: `-g'
1.1.1.4 ! root      409:      Produce debugging information in the operating system's native
        !           410:      format (for DBX or SDB).
1.1.1.2   root      411: 
1.1.1.4 ! root      412:      Unlike most other C compilers, GNU CC allows you to use `-g'
        !           413:      with `-O'.  The shortcuts taken by optimized code may
        !           414:      occasionally produce surprising results: some variables you
        !           415:      declared may not exist at all; flow of control may briefly move
        !           416:      where you did not expect it; some statements may not be executed
        !           417:      because they compute constant results or their values were
        !           418:      already at hand; some statements may execute in different places
        !           419:      because they were moved out of loops.  Nevertheless it proves
        !           420:      possible to debug optimized output.  This makes it reasonable to
        !           421:      use the optimizer for programs that might have bugs.
1.1.1.2   root      422: 
                    423: `-gg'
1.1.1.4 ! root      424:      Produce debugging information in GDB's own format.  This
        !           425:      requires the GNU assembler and linker in order to work.
1.1.1.2   root      426: 
                    427: `-w'
                    428:      Inhibit all warning messages.
                    429: 
                    430: `-W'
                    431:      Print extra warning messages for these events:
                    432: 
1.1.1.4 ! root      433:         * An automatic variable is used without first being
        !           434:           initialized.
1.1.1.2   root      435: 
                    436:           These warnings are possible only in optimizing compilation,
1.1.1.4 ! root      437:           because they require data flow information that is computed
        !           438:           only when optimizing.  They occur only for variables that
        !           439:           are candidates for register allocation.  Therefore, they do
        !           440:           not occur for a variable that is declared `volatile', or
        !           441:           whose address is taken, or whose size is other than 1, 2, 4
        !           442:           or 8 bytes.  Also, they do not occur for structures, unions
        !           443:           or arrays, even when they are in registers.
        !           444: 
        !           445:           Note that there may be no warning about a variable that is
        !           446:           used only to compute a value that itself is never used,
        !           447:           because such computations may be deleted by the flow
        !           448:           analysis pass before the warnings are printed.
        !           449: 
        !           450:           These warnings are made optional because GNU CC is not
        !           451:           smart enough to see all the reasons why the code might be
        !           452:           correct despite appearing to have an error.  Here is one
        !           453:           example of how this can happen:
1.1.1.2   root      454: 
                    455:                {
                    456:                  int x;
                    457:                  switch (y)
                    458:                    {
                    459:                    case 1: x = 1;
                    460:                      break;
                    461:                    case 2: x = 4;
                    462:                      break;
                    463:                    case 3: x = 5;
                    464:                    }
                    465:                  foo (x);
                    466:                }
                    467: 
                    468:           If the value of `y' is always 1, 2 or 3, then `x' is always
                    469:           initialized, but GNU CC doesn't know this.  Here is another
                    470:           common case:
                    471: 
                    472:                {
                    473:                  int save_y;
                    474:                  if (change_y) save_y = y, y = new_y;
                    475:                  ...
                    476:                  if (change_y) y = save_y;
                    477:                }
                    478: 
1.1.1.4 ! root      479:           This has no bug because `save_y' is used only if it is set.
1.1.1.2   root      480: 
1.1.1.4 ! root      481:         * A nonvolatile automatic variable might be changed by a call
        !           482:           to `longjmp'.  These warnings as well are possible only in
1.1.1.2   root      483:           optimizing compilation.
                    484: 
1.1.1.4 ! root      485:           The compiler sees only the calls to `setjmp'.  It cannot
        !           486:           know where `longjmp' will be called; in fact, a signal
        !           487:           handler could call it at any point in the code.  As a
        !           488:           result, you may get a warning even when there is in fact no
        !           489:           problem because `longjmp' cannot in fact be called at the
        !           490:           place which would cause a problem.
        !           491: 
        !           492:         * A function can return either with or without a value. 
        !           493:           (Falling off the end of the function body is considered
        !           494:           returning without a value.)  For example, this function
        !           495:           would inspire such a warning:
1.1.1.2   root      496: 
                    497:                foo (a)
                    498:                {
                    499:                  if (a > 0)
                    500:                    return a;
                    501:                }
                    502: 
1.1.1.4 ! root      503:           Spurious warnings can occur because GNU CC does not realize
        !           504:           that certain functions (including `abort' and `longjmp')
        !           505:           will never return.
1.1.1.2   root      506: 
1.1.1.4 ! root      507:      In the future, other useful warnings may also be enabled by this
        !           508:      option.
1.1.1.2   root      509: 
                    510: `-Wimplicit'
                    511:      Warn whenever a function is implicitly declared.
                    512: 
                    513: `-Wreturn-type'
1.1.1.4 ! root      514:      Warn whenever a function is defined with a return-type that
        !           515:      defaults to `int'.  Also warn about any `return' statement with
        !           516:      no return-value in a function whose return-type is not `void'.
1.1.1.2   root      517: 
                    518: `-Wcomment'
                    519:      Warn whenever a comment-start sequence `/*' appears in a comment.
                    520: 
1.1.1.3   root      521: `-Wall'
                    522:      All of the above `-W' options combined.
                    523: 
1.1.1.4 ! root      524: `-Wwrite-strings'
        !           525:      Give string constants the type `const char[LENGTH]' so that
        !           526:      copying the address of one into a non-`const' `char *' pointer
        !           527:      will get a warning.  These warnings will help you find at
        !           528:      compile time code that can try to write into a string constant,
        !           529:      but only if you have been very careful about using `const' in
        !           530:      declarations and prototypes.  Otherwise, it will just be a
        !           531:      nuisance; this is why we did not make `-Wall' request these
        !           532:      warnings.
        !           533: 
1.1.1.2   root      534: `-p'
1.1.1.4 ! root      535:      Generate extra code to write profile information suitable for
        !           536:      the analysis program `prof'.
1.1.1.2   root      537: 
                    538: `-pg'
1.1.1.4 ! root      539:      Generate extra code to write profile information suitable for
        !           540:      the analysis program `gprof'.
1.1.1.2   root      541: 
1.1.1.3   root      542: `-lLIBRARY'
1.1.1.4 ! root      543:      Search a standard list of directories for a library named
        !           544:      LIBRARY, which is actually a file named `libLIBRARY.a'.  The
        !           545:      linker uses this file as if it had been specified precisely by
        !           546:      name.
        !           547: 
        !           548:      The directories searched include several standard system
        !           549:      directories plus any that you specify with `-L'.
        !           550: 
        !           551:      Normally the files found this way are library files--archive
        !           552:      files whose members are object files.  The linker handles an
        !           553:      archive file by scanning through it for members which define
        !           554:      symbols that have so far been referenced but not defined.  But
        !           555:      if the file that is found is an ordinary object file, it is
        !           556:      linked in the usual fashion.  The only difference between using
        !           557:      an `-l' option and specifying a file name is that `-l' searches
        !           558:      several directories.
1.1.1.2   root      559: 
1.1.1.3   root      560: `-LDIR'
1.1.1.4 ! root      561:      Add directory DIR to the list of directories to be searched for
        !           562:      `-l'.
1.1.1.3   root      563: 
1.1.1.2   root      564: `-nostdlib'
                    565:      Don't use the standard system libraries and startup files when
1.1.1.4 ! root      566:      linking.  Only the files you specify (plus `gnulib') will be
        !           567:      passed to the linker.
1.1.1.2   root      568: 
                    569: `-mMACHINESPEC'
1.1.1.4 ! root      570:      Machine-dependent option specifying something about the type of
        !           571:      target machine.  These options are defined by the macro
        !           572:      `TARGET_SWITCHES' in the machine description.  The default for
        !           573:      the options is also defined by that macro, which enables you to
        !           574:      change the defaults.
        !           575: 
        !           576:      These are the `-m' options defined in the 68000 machine
        !           577:      description:
        !           578: 
        !           579:     `-m68020'
        !           580:     `-mc68020'
        !           581:           Generate output for a 68020 (rather than a 68000).  This is
        !           582:           the default if you use the unmodified sources.
1.1.1.2   root      583: 
1.1.1.4 ! root      584:     `-m68000'
        !           585:     `-mc68000'
1.1.1.2   root      586:           Generate output for a 68000 (rather than a 68020).
                    587: 
1.1.1.4 ! root      588:     `-m68881'
        !           589:           Generate output containing 68881 instructions for floating
        !           590:           point.  This is the default if you use the unmodified
        !           591:           sources.
        !           592: 
        !           593:     `-mfpa'
        !           594:           Generate output containing Sun FPA instructions for
        !           595:           floating point.
1.1.1.2   root      596: 
1.1.1.4 ! root      597:     `-msoft-float'
1.1.1.2   root      598:           Generate output containing library calls for floating point.
                    599: 
1.1.1.4 ! root      600:     `-mshort'
1.1.1.2   root      601:           Consider type `int' to be 16 bits wide, like `short int'.
                    602: 
1.1.1.4 ! root      603:     `-mnobitfield'
1.1.1.2   root      604:           Do not use the bit-field instructions.  `-m68000' implies
                    605:           `-mnobitfield'.
                    606: 
1.1.1.4 ! root      607:     `-mbitfield'
1.1.1.2   root      608:           Do use the bit-field instructions.  `-m68020' implies
1.1.1.4 ! root      609:           `-mbitfield'.  This is the default if you use the
        !           610:           unmodified sources.
1.1.1.2   root      611: 
1.1.1.4 ! root      612:     `-mrtd'
        !           613:           Use a different function-calling convention, in which
        !           614:           functions that take a fixed number of arguments return with
        !           615:           the `rtd' instruction, which pops their arguments while
        !           616:           returning.  This saves one instruction in the caller since
        !           617:           there is no need to pop the arguments there.
        !           618: 
        !           619:           This calling convention is incompatible with the one
        !           620:           normally used on Unix, so you cannot use it if you need to
        !           621:           call libraries compiled with the Unix compiler.
        !           622: 
        !           623:           Also, you must provide function prototypes for all
        !           624:           functions that take variable numbers of arguments
        !           625:           (including `printf'); otherwise incorrect code will be
        !           626:           generated for calls to those functions.
        !           627: 
        !           628:           In addition, seriously incorrect code will result if you
        !           629:           call a function with too many arguments.  (Normally, extra
        !           630:           arguments are harmlessly ignored.)
1.1.1.2   root      631: 
                    632:           The `rtd' instruction is supported by the 68010 and 68020
                    633:           processors, but not by the 68000.
                    634: 
                    635:      These `-m' options are defined in the Vax machine description:
                    636: 
1.1.1.4 ! root      637:     `-munix'
        !           638:           Do not output certain jump instructions (`aobleq' and so
        !           639:           on) that the Unix assembler for the Vax cannot handle
        !           640:           across long ranges.
        !           641: 
        !           642:     `-mgnu'
        !           643:           Do output those jump instructions, on the assumption that
        !           644:           you will assemble with the GNU assembler.
1.1.1.2   root      645: 
1.1.1.4 ! root      646:     `-mg'
1.1.1.3   root      647:           Output code for g-format floating point numbers instead of
                    648:           d-format.
                    649: 
1.1.1.2   root      650: `-fFLAG'
                    651:      Specify machine-independent flags.  These are the flags:
                    652: 
1.1.1.4 ! root      653:     `-ffloat-store'
1.1.1.2   root      654:           Do not store floating-point variables in registers.  This
1.1.1.4 ! root      655:           prevents undesirable excess precision on machines such as
        !           656:           the 68000 where the floating registers (of the 68881) keep
        !           657:           more precision than a `double' is supposed to have.
        !           658: 
        !           659:           For most programs, the excess precision does only good, but
        !           660:           a few programs rely on the precise definition of IEEE
        !           661:           floating point.  Use `-ffloat-store' for such programs.
        !           662: 
        !           663:     `-fno-asm'
        !           664:           Do not recognize `asm', `inline' or `typeof' as a keyword. 
        !           665:           These words may then be used as identifiers.
        !           666: 
        !           667:     `-fno-defer-pop'
        !           668:           Always pop the arguments to each function call as soon as
        !           669:           that function returns.  Normally the compiler (when
        !           670:           optimizing) lets arguments accumulate on the stack for
        !           671:           several function calls and pops them all at once.
        !           672: 
        !           673:     `-fcombine-regs'
        !           674:           Allow the combine pass to combine an instruction that
        !           675:           copies one register into another.  This might or might not
        !           676:           produce better code when used in addition to `-O'.  I am
        !           677:           interested in hearing about the difference this makes.
        !           678: 
        !           679:     `-fforce-mem'
        !           680:           Force memory operands to be copied into registers before
        !           681:           doing arithmetic on them.  This may produce better code by
        !           682:           making all memory references potential common
        !           683:           subexpressions.  When they are not common subexpressions,
        !           684:           instruction combination should eliminate the separate
        !           685:           register-load.  I am interested in hearing about the
        !           686:           difference this makes.
1.1.1.2   root      687: 
1.1.1.4 ! root      688:     `-fforce-addr'
        !           689:           Force memory address constants to be copied into registers
        !           690:           before doing arithmetic on them.  This may produce better
        !           691:           code just as `-fforce-mem' may.  I am interested in hearing
1.1.1.2   root      692:           about the difference this makes.
                    693: 
1.1.1.4 ! root      694:     `-fomit-frame-pointer'
        !           695:           Don't keep the frame pointer in a register for functions
        !           696:           that don't need one.  This avoids the instructions to save,
        !           697:           set up and restore frame pointers; it also makes an extra
        !           698:           register available in many functions.  *It also makes
        !           699:           debugging impossible.*
1.1.1.2   root      700: 
                    701:           On some machines, such as the Vax, this flag has no effect,
1.1.1.4 ! root      702:           because the standard calling sequence automatically handles
        !           703:           the frame pointer and nothing is saved by pretending it
        !           704:           doesn't exist.  The machine-description macro
        !           705:           `FRAME_POINTER_REQUIRED' controls whether a target machine
        !           706:           supports this flag.  *Note Registers::.
        !           707: 
        !           708:     `-finline-functions'
        !           709:           Integrate all simple functions into their callers.  The
        !           710:           compiler heuristically decides which functions are simple
        !           711:           enough to be worth integrating in this way.
        !           712: 
        !           713:           If all calls to a given function are integrated, and the
        !           714:           function is declared `static', then the function is
        !           715:           normally not output as assembler code in its own right.
        !           716: 
        !           717:     `-fkeep-inline-functions'
        !           718:           Even if all calls to a given function are integrated, and
        !           719:           the function is declared `static', nevertheless output a
        !           720:           separate run-time callable version of the function.
        !           721: 
        !           722:     `-fwritable-strings'
        !           723:           Store string constants in the writable data segment and
        !           724:           don't uniquize them.  This is for compatibility with old
        !           725:           programs which assume they can write into string constants.
        !           726:           Writing into string constants is a very bad idea;
        !           727:           ``constants'' should be constant.
        !           728: 
        !           729:     `-fno-function-cse'
        !           730:           Do not put function addresses in registers; make each
        !           731:           instruction that calls a constant function contain the
        !           732:           function's address explicitly.
        !           733: 
        !           734:           This option results in less efficient code, but some
        !           735:           strange hacks that alter the assembler output may be
        !           736:           confused by the optimizations performed when this option is
        !           737:           not used.
        !           738: 
        !           739:     `-fvolatile'
        !           740:           Consider all memory references through pointers to be
        !           741:           volatile.
1.1.1.2   root      742: 
1.1.1.4 ! root      743:     `-funsigned-char'
1.1.1.2   root      744:           Let the type `char' be the unsigned, like `unsigned char'.
                    745: 
1.1.1.4 ! root      746:           Each kind of machine has a default for what `char' should
        !           747:           be.  It is either like `unsigned char' by default or like
        !           748:           `signed char' by default.  (Actually, at present, the
        !           749:           default is always signed.)
        !           750: 
        !           751:           The type `char' is always a distinct type from either
        !           752:           `signed char' or `unsigned char', even though its behavior
        !           753:           is always just like one of those two.
1.1.1.2   root      754: 
1.1.1.4 ! root      755:     `-fsigned-char'
1.1.1.2   root      756:           Let the type `char' be signed, like `signed char'.
                    757: 
1.1.1.4 ! root      758:     `-ffixed-REG'
        !           759:           Treat the register named REG as a fixed register; generated
        !           760:           code should never refer to it (except perhaps as a stack
        !           761:           pointer, frame pointer or in some other fixed role).
        !           762: 
        !           763:           REG must be the name of a register.  The register names
        !           764:           accepted are machine-specific and are defined in the
        !           765:           `REGISTER_NAMES' macro in the machine description macro file.
        !           766: 
        !           767:     `-fcall-used-REG'
        !           768:           Treat the register named REG as an allocatable register
        !           769:           that is clobbered by function calls.  It may be allocated
        !           770:           for temporaries or variables that do not live across a call.
        !           771:           Functions compiled this way will not save and restore the
        !           772:           register REG.
        !           773: 
        !           774:           Use of this flag for a register that has a fixed pervasive
        !           775:           role in the machine's execution model, such as the stack
        !           776:           pointer or frame pointer, will produce disastrous results.
        !           777: 
        !           778:     `-fcall-saved-REG'
        !           779:           Treat the register named REG as an allocatable register
        !           780:           saved by functions.  It may be allocated even for
        !           781:           temporaries or variables that live across a call. 
        !           782:           Functions compiled this way will save and restore the
        !           783:           register REG if they use it.
        !           784: 
        !           785:           Use of this flag for a register that has a fixed pervasive
        !           786:           role in the machine's execution model, such as the stack
        !           787:           pointer or frame pointer, will produce disastrous results.
        !           788: 
        !           789:           A different sort of disaster will result from the use of
        !           790:           this flag for a register in which function values are may
        !           791:           be returned.
1.1.1.2   root      792: 
                    793: `-dLETTERS'
1.1.1.4 ! root      794:      Says to make debugging dumps at times specified by LETTERS. 
        !           795:      Here are the possible letters:
1.1.1.2   root      796: 
1.1.1.4 ! root      797:     `r'
1.1       root      798:           Dump after RTL generation.
1.1.1.4 ! root      799: 
        !           800:     `j'
1.1       root      801:           Dump after first jump optimization.
1.1.1.4 ! root      802: 
        !           803:     `J'
1.1.1.2   root      804:           Dump after last jump optimization.
1.1.1.4 ! root      805: 
        !           806:     `s'
        !           807:           Dump after CSE (including the jump optimization that
        !           808:           sometimes follows CSE).
        !           809: 
        !           810:     `L'
1.1       root      811:           Dump after loop optimization.
1.1.1.4 ! root      812: 
        !           813:     `f'
1.1       root      814:           Dump after flow analysis.
1.1.1.4 ! root      815: 
        !           816:     `c'
1.1       root      817:           Dump after instruction combination.
1.1.1.4 ! root      818: 
        !           819:     `l'
1.1       root      820:           Dump after local register allocation.
1.1.1.4 ! root      821: 
        !           822:     `g'
1.1       root      823:           Dump after global register allocation.
1.1.1.4 ! root      824: 
        !           825:     `m'
1.1.1.2   root      826:           Print statistics on memory usage, at the end of the run.
                    827: 
                    828: `-pedantic'
1.1.1.4 ! root      829:      Issue all the warnings demanded by strict ANSI standard C;
        !           830:      reject all programs that use forbidden extensions.
1.1.1.2   root      831: 
1.1.1.4 ! root      832:      Valid ANSI standard C programs should compile properly with or
        !           833:      without this option (though a rare few will require `-ansi'). 
        !           834:      However, without this option, certain GNU extensions and
        !           835:      traditional C features are supported as well.  With this option,
        !           836:      they are rejected.  There is no reason to use this option; it
        !           837:      exists only to satisfy pedants.
        !           838: 
        !           839: These options control the C preprocessor, which is run on each C
        !           840: source file before actual compilation.  If you use the `-E' option,
        !           841: nothing is done except C preprocessing.  Some of these options make
        !           842: sense only together with `-E' because they request preprocessor
        !           843: output that is not suitable for actual compilation.
1.1.1.2   root      844: 
                    845: `-C'
1.1.1.4 ! root      846:      Tell the preprocessor not to discard comments.  Used with the
        !           847:      `-E' option.
1.1.1.2   root      848: 
                    849: `-IDIR'
1.1       root      850:      Search directory DIR for include files.
1.1.1.2   root      851: 
1.1.1.3   root      852: `-I-'
1.1.1.4 ! root      853:      Any directories specified with `-I' options before the `-I-'
        !           854:      option are searched only for the case of `#include "FILE"'; they
        !           855:      are not searched for `#include <FILE>'.
        !           856: 
        !           857:      If additional directories are specified with `-I' options after
        !           858:      the `-I-', these directories are searched for all `#include'
        !           859:      directives.  (Ordinarily *all* `-I' directories are used this
        !           860:      way.)
1.1.1.3   root      861: 
                    862:      In addition, the `-I-' option inhibits the use of the current
                    863:      directory as the first search directory for `#include "FILE"'. 
1.1.1.4 ! root      864:      Therefore, the current directory is searched only if it is
        !           865:      requested explicitly with `-I.'.  Specifying both `-I-' and
        !           866:      `-I.' allows you to control precisely which directories are
        !           867:      searched before the current one and which are searched after.
1.1.1.3   root      868: 
                    869: `-nostdinc'
1.1.1.4 ! root      870:      Do not search the standard system directories for header files. 
        !           871:      Only the directories you have specified with `-I' options (and
        !           872:      the current directory, if appropriate) are searched.
1.1.1.3   root      873: 
1.1.1.4 ! root      874:      Between `-nostdinc' and `-I-', you can eliminate all directories
        !           875:      from the search path except those you specify.
1.1.1.3   root      876: 
1.1.1.2   root      877: `-M'
1.1.1.4 ! root      878:      Tell the preprocessor to output a rule suitable for `make'
        !           879:      describing the dependencies of each source file.  For each
        !           880:      source file, the preprocessor outputs one `make'-rule whose
        !           881:      target is the object file name for that source file and whose
        !           882:      dependencies are all the files `#include'd in it.  This rule may
        !           883:      be a single line or may be continued with `\'-newline if it is
        !           884:      long.
1.1.1.2   root      885: 
                    886:      `-M' implies `-E'.
                    887: 
                    888: `-MM'
1.1.1.4 ! root      889:      Like `-M' but the output mentions only the user-header files
        !           890:      included with `#include "FILE"'.  System header files included
        !           891:      with `#include <FILE>' are omitted.
1.1.1.2   root      892: 
                    893:      `-MM' implies `-E'.
                    894: 
                    895: `-DMACRO'
1.1       root      896:      Define macro MACRO with the empty string as its definition.
1.1.1.2   root      897: 
                    898: `-DMACRO=DEFN'
1.1       root      899:      Define macro MACRO as DEFN.
1.1.1.2   root      900: 
                    901: `-UMACRO'
1.1       root      902:      Undefine macro MACRO.
1.1.1.2   root      903: 
                    904: `-T'
                    905:      Support ANSI C trigraphs.  You don't want to know about this
                    906:      brain-damage.  The `-ansi' option also has this effect.
1.1       root      907: 
1.1.1.4 ! root      908: 
1.1       root      909: 
1.1.1.3   root      910: File: internals,  Node: Installation,  Next: Trouble,  Prev: Options,  Up: Top
1.1       root      911: 
                    912: Installing GNU CC
                    913: *****************
                    914: 
1.1.1.2   root      915: Here is the procedure for installing GNU CC on a Unix system.
                    916: 
                    917: * Menu:
                    918: 
                    919: * VMS Install::   See below for installation on VMS.
                    920: 
1.1.1.4 ! root      921:   1. Edit `Makefile'.  If you are using HPUX, or any form of system
        !           922:      V, you must make a few changes described in comments at the
        !           923:      beginning of the file.
        !           924: 
        !           925:   2. On a Sequent system, go to the Berkeley universe.
        !           926: 
        !           927:   3. Choose configuration files.
        !           928: 
        !           929:         * Make a symbolic link named `config.h' to the top-level
        !           930:           config file for the machine you are using (*note
        !           931:           Config::.).  This file is responsible for defining
        !           932:           information about the host machine.  It includes `tm.h'.
        !           933: 
        !           934:           The file's name should be `config-MACHINE.h', with these
        !           935:           exceptions:
        !           936: 
        !           937:          `config-vms.h'
        !           938:                for vaxen running VMS.
        !           939: 
        !           940:          `config-vaxv.h'
        !           941:                for vaxen running system V.
        !           942: 
        !           943:          `config-i386v.h'
        !           944:                for Intel 80386's running system V.
        !           945: 
        !           946:          `config-sun4.h'
        !           947:                for Suns (model 3 or 4) running *operating system*
        !           948:                version 4.
        !           949: 
        !           950:          `config-hp9k3.h'
        !           951:                for the HP 9000 series 300.
        !           952: 
        !           953:          `config-gnx.h'
        !           954:                for the ns32000 running Genix
        !           955: 
        !           956:           If your system does not support symbolic links, you might
        !           957:           want to set up `config.h' to contain a `#include' command
        !           958:           which refers to the appropriate file.
        !           959: 
        !           960:         * Make a symbolic link named `tm.h' to the
        !           961:           machine-description macro file for your machine (its name
        !           962:           should be `tm-MACHINE.h').
1.1.1.2   root      963: 
1.1.1.4 ! root      964:           If your system is a 68000, don't use the file `tm-m68k.h'
        !           965:           directly.  Instead, use one of these files:
1.1.1.2   root      966: 
1.1.1.4 ! root      967:          `tm-sun3.h'
        !           968:                for Sun 3 machines.
1.1.1.2   root      969: 
1.1.1.4 ! root      970:          `tm-sun2.h'
        !           971:                for Sun 2 machines.
1.1.1.2   root      972: 
1.1.1.4 ! root      973:          `tm-3b1.h'
        !           974:                for AT&T 3b1 (aka 7300 Unix PC).
        !           975: 
        !           976:          `tm-isi68.h'
        !           977:                for Integrated Solutions systems.
        !           978: 
        !           979:          `tm-news800.h'
        !           980:                for SONY News systems.
        !           981: 
        !           982:          `tm-hp9k320.h'
        !           983:                for HPUX systems, if you are using GNU CC with the
        !           984:                system's assembler and linker.
        !           985: 
        !           986:          `tm-hp9k320g.h'
        !           987:                for HPUX systems, if you are using the GNU assembler,
        !           988:                linker and other utilities.  Not all of the pieces of
        !           989:                GNU software needed for this mode of operation are as
        !           990:                yet in distribution; full instructions will appear
        !           991:                here in the future.
        !           992: 
        !           993:           For the vax, use `tm-vax.h' on BSD Unix, `tm-vaxv.h' on
        !           994:           system V, or `tm-vms.h' on VMS.
        !           995: 
        !           996:           For the SPARC (Sun 4), use `tm-sparc.h'.
        !           997: 
        !           998:           For the Motorola 88000, use `tm-m88k.h'.  The support for
        !           999:           the 88000 has a few unfinished spots because there was no
        !          1000:           way to run the output.  Bugs are suspected in handling of
        !          1001:           branch-tables and in the function prologue and epilogue.
        !          1002: 
        !          1003:           For the 80386, don't use `tm-i386.h' directly.  Use
        !          1004:           `tm-i386v.h' if the target machine is running system V,
        !          1005:           `tm-seq386.h' for a Sequent 386 system, or `tm-compaq.h'
        !          1006:           for a Compaq.
        !          1007: 
        !          1008:           For the 32000, use `tm-sequent.h' if you are using a
        !          1009:           Sequent machine, or `tm-encore.h' for an Encore machine, or
        !          1010:           `tm-gnx.h' if you are using Genix version 3; otherwise,
1.1.1.3   root     1011:           perhaps `tm-ns32k.h' will work for you.
1.1.1.2   root     1012: 
1.1.1.4 ! root     1013:           Note that Genix has bugs in `alloca' and `malloc'; you must
        !          1014:           get the compiled versions of these from GNU Emacs and edit
        !          1015:           GNU CC's `Makefile' to use them.
        !          1016: 
        !          1017:           Note that Encore systems are supported only under BSD.
1.1.1.2   root     1018: 
                   1019:         * Make a symbolic link named `md' to the machine description
                   1020:           pattern file (its name should be `MACHINE.md').
                   1021: 
                   1022:         * Make a symbolic link named `aux-output.c' to the output
                   1023:           subroutine file for your machine (its name should be
1.1.1.4 ! root     1024:           `output-MACHINE.c').
1.1.1.2   root     1025: 
1.1.1.4 ! root     1026:   4. Make sure the Bison parser generator is installed.  (This is
        !          1027:      unnecessary if the Bison output files `c-parse.tab.c' and
        !          1028:      `cexp.c' are more recent than `c-parse.y' and `cexp.y' and you
        !          1029:      do not plan to change the `.y' files.)
        !          1030: 
        !          1031:      Note that if you have an old version of Bison you may get an
        !          1032:      error from the line with the `%expect' directive.  If so, simply
        !          1033:      remove that line from `c-parse.y' and proceed.
        !          1034: 
        !          1035:   5. If you are using a Sun, make sure the environment variable
        !          1036:      `FLOAT_OPTION' is not set.  If this option were set to `f68881'
        !          1037:      when `gnulib' is compiled, the resulting code would demand to be
        !          1038:      linked with a special startup file and will not link properly
        !          1039:      without special pains.
1.1.1.2   root     1040: 
1.1.1.4 ! root     1041:   6. Build the compiler.  Just type `make' in the compiler directory.
1.1.1.2   root     1042: 
1.1.1.4 ! root     1043:   7. Move the first-stage object files and executables into a
        !          1044:      subdirectory with this command:
1.1.1.2   root     1045: 
                   1046:           make stage1
                   1047: 
                   1048:      The files are moved into a subdirectory named `stage1'.  Once
1.1.1.4 ! root     1049:      installation is complete, you may wish to delete these files
        !          1050:      with `rm -r stage1'.
1.1.1.2   root     1051: 
1.1.1.4 ! root     1052:   8. Recompile the compiler with itself, with this command:
1.1.1.2   root     1053: 
                   1054:           make CC=stage1/gcc CFLAGS="-g -O -Bstage1/"
                   1055: 
1.1.1.4 ! root     1056:      On a 68000 or 68020 system lacking floating point hardware,
        !          1057:      unless you have selected a `tm.h' file that expects by default
        !          1058:      that there is no such hardware, do this instead:
1.1.1.2   root     1059: 
                   1060:           make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -msoft-float"
                   1061: 
1.1.1.4 ! root     1062:   9. If you wish to test the compiler by compiling it with itself one
        !          1063:      more time, do this:
1.1.1.2   root     1064: 
                   1065:           make stage2
1.1.1.4 ! root     1066:           Make CC=stage2/gcc CFLAGS="-g -O -Bstage2/"
1.1.1.2   root     1067:           foreach file (*.o)
                   1068:           cmp $file stage2/$file
                   1069:           end
                   1070: 
1.1.1.4 ! root     1071:      This will notify you if any of these stage 3 object files
        !          1072:      differs from those of stage 2.  Any difference, no matter how
        !          1073:      innocuous, indicates that the stage 2 compiler has compiled GNU
        !          1074:      CC incorrectly, and is therefore a potentially serious bug which
        !          1075:      you should investigate and report (*note Bugs::.).
        !          1076: 
        !          1077:      Aside from the `-B' option, the options should be the same as
        !          1078:      when you made stage 2.
1.1.1.2   root     1079: 
1.1.1.4 ! root     1080:  10. Install the compiler driver, the compiler's passes and run-time
        !          1081:      support.  You can use the following command:
1.1.1.2   root     1082: 
                   1083:           make install
                   1084: 
1.1.1.4 ! root     1085:      This copies the files `cc1', `cpp' and `gnulib' to files
        !          1086:      `gcc-cc1', `gcc-cpp' and `gcc-gnulib' in directory
        !          1087:      `/usr/local/lib', which is where the compiler driver program
        !          1088:      looks for them.  It also copies the driver program `gcc' into
        !          1089:      the directory `/usr/local', so that it appears in typical
        !          1090:      execution search paths.
        !          1091: 
        !          1092:      *Warning: there is a bug in `alloca' in the Sun library.  To
        !          1093:      avoid this bug, install the binaries of GNU CC that were
        !          1094:      compiled by GNU CC.  They use `alloca' as a built-in function
        !          1095:      and never the one in the library.*
        !          1096: 
        !          1097:      *Warning: the GNU CPP may not work for `ioctl.h', `ttychars.h'
        !          1098:      and other system header files unless the `-traditional' option
        !          1099:      is used.*  The bug is in the header files: at least on some
        !          1100:      machines, they rely on behavior that is incompatible with ANSI
        !          1101:      C.  This behavior consists of substituting for macro argument
        !          1102:      names when they appear inside of character constants.  The
        !          1103:      `-traditional' option tells GNU CC to behave the way these
        !          1104:      headers expect.
1.1.1.2   root     1105: 
1.1.1.4 ! root     1106:      Because of this problem, you might prefer to configure GNU CC to
        !          1107:      use the system's own C preprocessor.  To do so, make the file
1.1.1.2   root     1108:      `/usr/local/lib/gcc-cpp' a link to `/lib/cpp'.
                   1109: 
1.1.1.4 ! root     1110:      Alternatively, on Sun systems and 4.3BSD at least, you can
        !          1111:      correct the include files by running the shell script
        !          1112:      `fixincludes'.  This installs modified, corrected copies of the
        !          1113:      files `ioctl.h', `ttychars.h' and many others, in a special
        !          1114:      directory where only GNU CC will normally look for them.
1.1.1.2   root     1115: 
1.1.1.4 ! root     1116:      See the file `fixincludes' for a list of all the files we know
        !          1117:      to require correction.
1.1.1.2   root     1118: 
                   1119: If you cannot install the compiler's passes and run-time support in
1.1.1.4 ! root     1120: `/usr/local/lib', you can alternatively use the `-B' option to
        !          1121: specify a prefix by which they may be found.  The compiler
        !          1122: concatenates the prefix with the names  `cpp', `cc1' and `gnulib'. 
        !          1123: Thus, you can put the files in a directory `/usr/foo/gcc' and specify
        !          1124: `-B/usr/foo/gcc/' when you run GNU CC.
        !          1125: 
        !          1126: Also, you can specify an alternative default directory for these
        !          1127: files by setting the Make variable `libdir' when you make GNU CC.
        !          1128: 
1.1.1.2   root     1129: 
                   1130: 
                   1131: File: internals,  Node: VMS Install,  Prev: Installation,  Up: Installation
                   1132: 
                   1133: Installing GNU CC on VMS
                   1134: ========================
                   1135: 
1.1.1.4 ! root     1136: The VMS version of GNU CC is distributed in an unusual tape format
        !          1137: which consists of several tape files.  The first is a command file;
        !          1138: the second is an executable program which reads Unix tar format; the
        !          1139: third is another command file which uses this program to read the
        !          1140: remainder of the tape.
        !          1141: 
        !          1142: To load the tape, it suffices to mount it `/foreign' and then do
        !          1143: `@mta0:' to execute the command file at the beginning of the tape.
        !          1144: 
        !          1145: The tape contains executables and object files as well as sources, so
        !          1146: no compilation is necessary unless you change the sources.  (This is
        !          1147: a good thing, since you probably don't have any other C compiler.) 
        !          1148: If you must recompile, here is how:
        !          1149: 
        !          1150:   1. Copy the file `tm-vms.h' to `tm.h', `config-vms.h' to
        !          1151:      `config.h', `vax.md' to `md.' and `output-vax.c' to
        !          1152:      `aux-output.c'.
1.1.1.2   root     1153: 
                   1154:   2. Type `@make' to do recompile everything.
                   1155: 
1.1.1.4 ! root     1156: To install the `GCC' command so you can use the compiler easily, in
        !          1157: the same manner as you use the VMS C compiler, you must install the
        !          1158: VMS CLD file for GNU CC as follows:
        !          1159: 
        !          1160:   1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to
        !          1161:      point to the directories where the GNU CC executables
        !          1162:      (`gcc-cpp', `gcc-cc1', etc.) and the C include files are kept. 
        !          1163:      This should be done with the commands:
1.1.1.3   root     1164: 
                   1165:           $ assign /super /system disk:[gcc] gnu_cc
                   1166:           $ assign /super /system disk:[gcc.include] gnu_cc_include
                   1167: 
1.1.1.4 ! root     1168:      with the appropriate disk and directory names.  These commands
        !          1169:      can be placed in your system startup file so they will be
        !          1170:      executed whenever the machine is rebooted.
1.1.1.3   root     1171: 
                   1172:   2. Install the `GCC' command with the command line:
                   1173: 
                   1174:           $ set command /table=sys$library:dcltables gnu_cc:gcc
                   1175: 
1.1.1.4 ! root     1176:      Now you can invoke the compiler with a command like `gcc
        !          1177:      /verbose file.c', which is equivalent to the command `gcc -v -c
        !          1178:      file.c' in Unix.
        !          1179: 
1.1.1.3   root     1180: 
1.1.1.2   root     1181: 
1.1.1.3   root     1182: File: internals,  Node: Trouble,  Next: Incompatibilities,  Prev: Installation,  Up: Top
                   1183: 
                   1184: Trouble in Installation
                   1185: ***********************
                   1186: 
1.1.1.4 ! root     1187: Here are some of the things that have caused trouble for people
        !          1188: installing GNU CC.
1.1.1.2   root     1189: 
1.1.1.4 ! root     1190:    * On certain systems, defining certain environment variables such
        !          1191:      as `CC' can interfere with the functioning of `make'.
1.1.1.2   root     1192: 
1.1.1.4 ! root     1193:    * Cross compilation can run into trouble for certain machines
        !          1194:      because some target machines' assemblers require floating point
        !          1195:      numbers to be written as *integer* constants in certain contexts.
        !          1196: 
        !          1197:      The compiler writes these integer constants by examining the
        !          1198:      floating point value as an integer and printing that integer,
        !          1199:      because this is simple to write and independent of the details
        !          1200:      of the floating point representation.  But this does not work if
        !          1201:      the compiler is running on a different machine with an
        !          1202:      incompatible floating point format, or even a different
        !          1203:      byte-ordering.
        !          1204: 
        !          1205:      It is possible to fix this by writing machine-independent code
        !          1206:      which understands the floating point representation of the
        !          1207:      target machine.  I am not interested in doing that much work to
        !          1208:      compensate for bugs in assemblers.
1.1       root     1209: 
                   1210: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.