home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / gcc-2.5.8-bin.lha / info / gcc.info-3 (.txt) < prev    next >
GNU Info File  |  1994-02-21  |  46KB  |  877 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 675 Massachusetts Avenue
  5. Cambridge, MA 02139 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided also
  12. that the sections entitled "GNU General Public License" and "Protect
  13. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  14. original, and provided that the entire resulting derived work is
  15. distributed under the terms of a permission notice identical to this
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that the sections entitled "GNU General Public
  19. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  20. permission notice, may be included in translations approved by the Free
  21. Software Foundation instead of in the original English.
  22. File: gcc.info,  Node: Optimize Options,  Next: Preprocessor Options,  Prev: Debugging Options,  Up: Invoking GCC
  23. Options That Control Optimization
  24. =================================
  25.    These options control various sorts of optimizations:
  26. `-O1'
  27.      Optimize.  Optimizing compilation takes somewhat more time, and a
  28.      lot more memory for a large function.
  29.      Without `-O', the compiler's goal is to reduce the cost of
  30.      compilation and to make debugging produce the expected results.
  31.      Statements are independent: if you stop the program with a
  32.      breakpoint between statements, you can then assign a new value to
  33.      any variable or change the program counter to any other statement
  34.      in the function and get exactly the results you would expect from
  35.      the source code.
  36.      Without `-O', only variables declared `register' are allocated in
  37.      registers.  The resulting compiled code is a little worse than
  38.      produced by PCC without `-O'.
  39.      With `-O', the compiler tries to reduce code size and execution
  40.      time.
  41.      When `-O' is specified, the two options `-fthread-jumps' and
  42.      `-fdelayed-branch' are turned on.  On some machines other flags may
  43.      also be turned on.
  44. `-O2'
  45.      Optimize even more.  Nearly all supported optimizations that do not
  46.      involve a space-speed tradeoff are performed.  As compared to `-O',
  47.      this option increases both compilation time and the performance of
  48.      the generated code.
  49.      `-O2' turns on all optional optimizations except for loop unrolling
  50.      and frame pointer elimination.
  51. `-O0'
  52.      Do not optimize.
  53.      If you use multiple `-O' options, with or without level numbers,
  54.      the last such option is the one that is effective.
  55.    Options of the form `-fFLAG' specify machine-independent flags.
  56. Most flags have both positive and negative forms; the negative form of
  57. `-ffoo' would be `-fno-foo'.  In the table below, only one of the forms
  58. is listed--the one which is not the default.  You can figure out the
  59. other form by either removing `no-' or adding it.
  60. `-ffloat-store'
  61.      Do not store floating point variables in registers, and inhibit
  62.      other options that might change whether a floating point value is
  63.      taken from a register or memory.
  64.      This option prevents undesirable excess precision on machines such
  65.      as the 68000 where the floating registers (of the 68881) keep more
  66.      precision than a `double' is supposed to have.  For most programs,
  67.      the excess precision does only good, but a few programs rely on the
  68.      precise definition of IEEE floating point.  Use `-ffloat-store' for
  69.      such programs.
  70. `-fno-default-inline'
  71.      Do not make member functions inline by default merely because they
  72.      are defined inside the class scope (C++ only).  Otherwise, when
  73.      you specify `-O', member functions defined inside class scope are
  74.      compiled inline by default; i.e., you don't need to add `inline'
  75.      in front of the member function name.
  76. `-fno-defer-pop'
  77.      Always pop the arguments to each function call as soon as that
  78.      function returns.  For machines which must pop arguments after a
  79.      function call, the compiler normally lets arguments accumulate on
  80.      the stack for several function calls and pops them all at once.
  81. `-fforce-mem'
  82.      Force memory operands to be copied into registers before doing
  83.      arithmetic on them.  This may produce better code by making all
  84.      memory references potential common subexpressions.  When they are
  85.      not common subexpressions, instruction combination should
  86.      eliminate the separate register-load.  I am interested in hearing
  87.      about the difference this makes.
  88. `-fforce-addr'
  89.      Force memory address constants to be copied into registers before
  90.      doing arithmetic on them.  This may produce better code just as
  91.      `-fforce-mem' may.  I am interested in hearing about the
  92.      difference this makes.
  93. `-fomit-frame-pointer'
  94.      Don't keep the frame pointer in a register for functions that
  95.      don't need one.  This avoids the instructions to save, set up and
  96.      restore frame pointers; it also makes an extra register available
  97.      in many functions.  *It also makes debugging impossible on some
  98.      machines.*
  99.      On some machines, such as the Vax, this flag has no effect, because
  100.      the standard calling sequence automatically handles the frame
  101.      pointer and nothing is saved by pretending it doesn't exist.  The
  102.      machine-description macro `FRAME_POINTER_REQUIRED' controls
  103.      whether a target machine supports this flag.  *Note Registers::.
  104. `-fno-inline'
  105.      Don't pay attention to the `inline' keyword.  Normally this option
  106.      is used to keep the compiler from expanding any functions inline.
  107.      Note that if you are not optimizing, no functions can be expanded
  108.      inline.
  109. `-finline-functions'
  110.      Integrate all simple functions into their callers.  The compiler
  111.      heuristically decides which functions are simple enough to be worth
  112.      integrating in this way.
  113.      If all calls to a given function are integrated, and the function
  114.      is declared `static', then the function is normally not output as
  115.      assembler code in its own right.
  116. `-fkeep-inline-functions'
  117.      Even if all calls to a given function are integrated, and the
  118.      function is declared `static', nevertheless output a separate
  119.      run-time callable version of the function.
  120. `-fno-function-cse'
  121.      Do not put function addresses in registers; make each instruction
  122.      that calls a constant function contain the function's address
  123.      explicitly.
  124.      This option results in less efficient code, but some strange hacks
  125.      that alter the assembler output may be confused by the
  126.      optimizations performed when this option is not used.
  127. `-ffast-math'
  128.      This option allows GCC to violate some ANSI or IEEE rules and/or
  129.      specifications in the interest of optimizing code for speed.  For
  130.      example, it allows the compiler to assume arguments to the `sqrt'
  131.      function are non-negative numbers.
  132.      This option should never be turned on by any `-O' option since it
  133.      can result in incorrect output for programs which depend on an
  134.      exact implementation of IEEE or ANSI rules/specifications for math
  135.      functions.
  136.    The following options control specific optimizations.  The `-O2'
  137. option turns on all of these optimizations except `-funroll-loops' and
  138. `-funroll-all-loops'.  On most machines, the `-O' option turns on the
  139. `-fthread-jumps' and `-fdelayed-branch' options, but specific machines
  140. may handle it differently.
  141.    You can use the following flags in the rare cases when "fine-tuning"
  142. of optimizations to be performed is desired.
  143. `-fstrength-reduce'
  144.      Perform the optimizations of loop strength reduction and
  145.      elimination of iteration variables.
  146. `-fthread-jumps'
  147.      Perform optimizations where we check to see if a jump branches to a
  148.      location where another comparison subsumed by the first is found.
  149.      If so, the first branch is redirected to either the destination of
  150.      the second branch or a point immediately following it, depending
  151.      on whether the condition is known to be true or false.
  152. `-fcse-follow-jumps'
  153.      In common subexpression elimination, scan through jump instructions
  154.      when the target of the jump is not reached by any other path.  For
  155.      example, when CSE encounters an `if' statement with an `else'
  156.      clause, CSE will follow the jump when the condition tested is
  157.      false.
  158. `-fcse-skip-blocks'
  159.      This is similar to `-fcse-follow-jumps', but causes CSE to follow
  160.      jumps which conditionally skip over blocks.  When CSE encounters a
  161.      simple `if' statement with no else clause, `-fcse-skip-blocks'
  162.      causes CSE to follow the jump around the body of the `if'.
  163. `-frerun-cse-after-loop'
  164.      Re-run common subexpression elimination after loop optimizations
  165.      has been performed.
  166. `-fexpensive-optimizations'
  167.      Perform a number of minor optimizations that are relatively
  168.      expensive.
  169. `-fdelayed-branch'
  170.      If supported for the target machine, attempt to reorder
  171.      instructions to exploit instruction slots available after delayed
  172.      branch instructions.
  173. `-fschedule-insns'
  174.      If supported for the target machine, attempt to reorder
  175.      instructions to eliminate execution stalls due to required data
  176.      being unavailable.  This helps machines that have slow floating
  177.      point or memory load instructions by allowing other instructions
  178.      to be issued until the result of the load or floating point
  179.      instruction is required.
  180. `-fschedule-insns2'
  181.      Similar to `-fschedule-insns', but requests an additional pass of
  182.      instruction scheduling after register allocation has been done.
  183.      This is especially useful on machines with a relatively small
  184.      number of registers and where memory load instructions take more
  185.      than one cycle.
  186. `-fcaller-saves'
  187.      Enable values to be allocated in registers that will be clobbered
  188.      by function calls, by emitting extra instructions to save and
  189.      restore the registers around such calls.  Such allocation is done
  190.      only when it seems to result in better code than would otherwise
  191.      be produced.
  192.      This option is enabled by default on certain machines, usually
  193.      those which have no call-preserved registers to use instead.
  194. `-funroll-loops'
  195.      Perform the optimization of loop unrolling.  This is only done for
  196.      loops whose number of iterations can be determined at compile time
  197.      or run time.  `-funroll-loop' implies both `-fstrength-reduce' and
  198.      `-frerun-cse-after-loop'.
  199. `-funroll-all-loops'
  200.      Perform the optimization of loop unrolling.  This is done for all
  201.      loops and usually makes programs run more slowly.
  202.      `-funroll-all-loops' implies `-fstrength-reduce' as well as
  203.      `-frerun-cse-after-loop'.
  204. `-fno-peephole'
  205.      Disable any machine-specific peephole optimizations.
  206. File: gcc.info,  Node: Preprocessor Options,  Next: Assembler Options,  Prev: Optimize Options,  Up: Invoking GCC
  207. Options Controlling the Preprocessor
  208. ====================================
  209.    These options control the C preprocessor, which is run on each C
  210. source file before actual compilation.
  211.    If you use the `-E' option, nothing is done except preprocessing.
  212. Some of these options make sense only together with `-E' because they
  213. cause the preprocessor output to be unsuitable for actual compilation.
  214. `-include FILE'
  215.      Process FILE as input before processing the regular input file.
  216.      In effect, the contents of FILE are compiled first.  Any `-D' and
  217.      `-U' options on the command line are always processed before
  218.      `-include FILE', regardless of the order in which they are
  219.      written.  All the `-include' and `-imacros' options are processed
  220.      in the order in which they are written.
  221. `-imacros FILE'
  222.      Process FILE as input, discarding the resulting output, before
  223.      processing the regular input file.  Because the output generated
  224.      from FILE is discarded, the only effect of `-imacros FILE' is to
  225.      make the macros defined in FILE available for use in the main
  226.      input.
  227.      Any `-D' and `-U' options on the command line are always processed
  228.      before `-imacros FILE', regardless of the order in which they are
  229.      written.  All the `-include' and `-imacros' options are processed
  230.      in the order in which they are written.
  231. `-idirafter DIR'
  232.      Add the directory DIR to the second include path.  The directories
  233.      on the second include path are searched when a header file is not
  234.      found in any of the directories in the main include path (the one
  235.      that `-I' adds to).
  236. `-iprefix PREFIX'
  237.      Specify PREFIX as the prefix for subsequent `-iwithprefix' options.
  238. `-iwithprefix DIR'
  239.      Add a directory to the second include path.  The directory's name
  240.      is made by concatenating PREFIX and DIR, where PREFIX was
  241.      specified previously with `-iprefix'.  If you have not specified a
  242.      prefix yet, the directory containing the installed passes of the
  243.      compiler is used as the default.
  244. `-iwithprefixbefore DIR'
  245.      Add a directory to the main include path.  The directory's name is
  246.      made by concatenating PREFIX and DIR, as in the case of
  247.      `-iwithprefix'.
  248. `-nostdinc'
  249.      Do not search the standard system directories for header files.
  250.      Only the directories you have specified with `-I' options (and the
  251.      current directory, if appropriate) are searched.  *Note Directory
  252.      Options::, for information on `-I'.
  253.      By using both `-nostdinc' and `-I-', you can limit the include-file
  254.      search path to only those directories you specify explicitly.
  255. `-undef'
  256.      Do not predefine any nonstandard macros.  (Including architecture
  257.      flags).
  258.      Run only the C preprocessor.  Preprocess all the C source files
  259.      specified and output the results to standard output or to the
  260.      specified output file.
  261.      Tell the preprocessor not to discard comments.  Used with the `-E'
  262.      option.
  263.      Tell the preprocessor not to generate `#line' commands.  Used with
  264.      the `-E' option.
  265.      Tell the preprocessor to output a rule suitable for `make'
  266.      describing the dependencies of each object file.  For each source
  267.      file, the preprocessor outputs one `make'-rule whose target is the
  268.      object file name for that source file and whose dependencies are
  269.      all the `#include' header files it uses.  This rule may be a
  270.      single line or may be continued with `\'-newline if it is long.
  271.      The list of rules is printed on standard output instead of the
  272.      preprocessed C program.
  273.      `-M' implies `-E'.
  274.      Another way to specify output of a `make' rule is by setting the
  275.      environment variable `DEPENDENCIES_OUTPUT' (*note Environment
  276.      Variables::.).
  277. `-MM'
  278.      Like `-M' but the output mentions only the user header files
  279.      included with `#include "FILE"'.  System header files included
  280.      with `#include <FILE>' are omitted.
  281. `-MD'
  282.      Like `-M' but the dependency information is written to files with
  283.      names made by replacing `.o' with `.d' at the end of the output
  284.      file names.  This is in addition to compiling the input files as
  285.      specified--`-MD' does not inhibit ordinary compilation the way
  286.      `-M' does.
  287.      The Mach utility `md' can be used to merge the `.d' files into a
  288.      single dependency file suitable for using with the `make' command.
  289. `-MMD'
  290.      Like `-MD' except mention only user header files, not system
  291.      header files.
  292.      Print the name of each header file used, in addition to other
  293.      normal activities.
  294. `-AQUESTION(ANSWER)'
  295.      Assert the answer ANSWER for QUESTION, in case it is tested with a
  296.      preprocessor conditional such as `#if #QUESTION(ANSWER)'.  `-A-'
  297.      disables the standard assertions that normally describe the target
  298.      machine.
  299. `-DMACRO'
  300.      Define macro MACRO with the string `1' as its definition.
  301. `-DMACRO=DEFN'
  302.      Define macro MACRO as DEFN.  All instances of `-D' on the command
  303.      line are processed before any `-U' options.
  304. `-UMACRO'
  305.      Undefine macro MACRO.  `-U' options are evaluated after all `-D'
  306.      options, but before any `-include' and `-imacros' options.
  307. `-dM'
  308.      Tell the preprocessor to output only a list of the macro
  309.      definitions that are in effect at the end of preprocessing.  Used
  310.      with the `-E' option.
  311. `-dD'
  312.      Tell the preprocessing to pass all macro definitions into the
  313.      output, in their proper sequence in the rest of the output.
  314. `-dN'
  315.      Like `-dD' except that the macro arguments and contents are
  316.      omitted.  Only `#define NAME' is included in the output.
  317. `-trigraphs'
  318.      Support ANSI C trigraphs.  You don't want to know about this
  319.      brain-damage.  The `-ansi' option also has this effect.
  320. File: gcc.info,  Node: Assembler Options,  Next: Link Options,  Prev: Preprocessor Options,  Up: Invoking GCC
  321. Passing Options to the Assembler
  322. ================================
  323. `-Wa,OPTION'
  324.      Pass OPTION as an option to the assembler.  If OPTION contains
  325.      commas, it is split into multiple options at the commas.
  326. File: gcc.info,  Node: Link Options,  Next: Directory Options,  Prev: Assembler Options,  Up: Invoking GCC
  327. Options for Linking
  328. ===================
  329.    These options come into play when the compiler links object files
  330. into an executable output file.  They are meaningless if the compiler is
  331. not doing a link step.
  332. `OBJECT-FILE-NAME'
  333.      A file name that does not end in a special recognized suffix is
  334.      considered to name an object file or library.  (Object files are
  335.      distinguished from libraries by the linker according to the file
  336.      contents.)  If linking is done, these object files are used as
  337.      input to the linker.
  338.      If any of these options is used, then the linker is not run, and
  339.      object file names should not be used as arguments.  *Note Overall
  340.      Options::.
  341. `-lLIBRARY'
  342.      Search the library named LIBRARY when linking.
  343.      It makes a difference where in the command you write this option;
  344.      the linker searches processes libraries and object files in the
  345.      order they are specified.  Thus, `foo.o -lz bar.o' searches
  346.      library `z' after file `foo.o' but before `bar.o'.  If `bar.o'
  347.      refers to functions in `z', those functions may not be loaded.
  348.      The linker searches a standard list of directories for the library,
  349.      which is actually a file named `libLIBRARY.a'.  The linker then
  350.      uses this file as if it had been specified precisely by name.
  351.      The directories searched include several standard system
  352.      directories plus any that you specify with `-L'.
  353.      Normally the files found this way are library files--archive files
  354.      whose members are object files.  The linker handles an archive
  355.      file by scanning through it for members which define symbols that
  356.      have so far been referenced but not defined.  But if the file that
  357.      is found is an ordinary object file, it is linked in the usual
  358.      fashion.  The only difference between using an `-l' option and
  359.      specifying a file name is that `-l' surrounds LIBRARY with `lib'
  360.      and `.a' and searches several directories.
  361. `-lobjc'
  362.      You need this special case of the `-l' option in order to link an
  363.      Objective C program.
  364. `-nostartfiles'
  365.      Do not use the standard system startup files when linking.  The
  366.      standard libraries are used normally.
  367. `-nostdlib'
  368.      Don't use the standard system libraries and startup files when
  369.      linking.  Only the files you specify will be passed to the linker.
  370. `-static'
  371.      On systems that support dynamic linking, this prevents linking
  372.      with the shared libraries.  On other systems, this option has no
  373.      effect.
  374. `-shared'
  375.      Produce a shared object which can then be linked with other
  376.      objects to form an executable.  Only a few systems support this
  377.      option.
  378. `-symbolic'
  379.      Bind references to global symbols when building a shared object.
  380.      Warn about any unresolved references (unless overridden by the
  381.      link editor option `-Xlinker -z -Xlinker defs').  Only a few
  382.      systems support this option.
  383. `-Xlinker OPTION'
  384.      Pass OPTION as an option to the linker.  You can use this to
  385.      supply system-specific linker options which GNU CC does not know
  386.      how to recognize.
  387.      If you want to pass an option that takes an argument, you must use
  388.      `-Xlinker' twice, once for the option and once for the argument.
  389.      For example, to pass `-assert definitions', you must write
  390.      `-Xlinker -assert -Xlinker definitions'.  It does not work to write
  391.      `-Xlinker "-assert definitions"', because this passes the entire
  392.      string as a single argument, which is not what the linker expects.
  393. `-Wl,OPTION'
  394.      Pass OPTION as an option to the linker.  If OPTION contains
  395.      commas, it is split into multiple options at the commas.
  396. `-u SYMBOL'
  397.      Pretend the symbol SYMBOL is undefined, to force linking of
  398.      library modules to define it.  You can use `-u' multiple times with
  399.      different symbols to force loading of additional library modules.
  400. File: gcc.info,  Node: Directory Options,  Next: Target Options,  Prev: Link Options,  Up: Invoking GCC
  401. Options for Directory Search
  402. ============================
  403.    These options specify directories to search for header files, for
  404. libraries and for parts of the compiler:
  405. `-IDIR'
  406.      Append directory DIR to the list of directories searched for
  407.      include files.
  408. `-I-'
  409.      Any directories you specify with `-I' options before the `-I-'
  410.      option are searched only for the case of `#include "FILE"'; they
  411.      are not searched for `#include <FILE>'.
  412.      If additional directories are specified with `-I' options after
  413.      the `-I-', these directories are searched for all `#include'
  414.      directives.  (Ordinarily *all* `-I' directories are used this way.)
  415.      In addition, the `-I-' option inhibits the use of the current
  416.      directory (where the current input file came from) as the first
  417.      search directory for `#include "FILE"'.  There is no way to
  418.      override this effect of `-I-'.  With `-I.' you can specify
  419.      searching the directory which was current when the compiler was
  420.      invoked.  That is not exactly the same as what the preprocessor
  421.      does by default, but it is often satisfactory.
  422.      `-I-' does not inhibit the use of the standard system directories
  423.      for header files.  Thus, `-I-' and `-nostdinc' are independent.
  424. `-LDIR'
  425.      Add directory DIR to the list of directories to be searched for
  426.      `-l'.
  427. `-BPREFIX'
  428.      This option specifies where to find the executables, libraries and
  429.      data files of the compiler itself.
  430.      The compiler driver program runs one or more of the subprograms
  431.      `cpp', `cc1', `as' and `ld'.  It tries PREFIX as a prefix for each
  432.      program it tries to run, both with and without `MACHINE/VERSION/'
  433.      (*note Target Options::.).
  434.      For each subprogram to be run, the compiler driver first tries the
  435.      `-B' prefix, if any.  If that name is not found, or if `-B' was
  436.      not specified, the driver tries two standard prefixes, which are
  437.      `/usr/lib/gcc/' and `/gnu/lib/gcc-lib/'.  If neither of those
  438.      results in a file name that is found, the unmodified program name
  439.      is searched for using the directories specified in your `PATH'
  440.      environment variable.
  441.      `-B' prefixes that effectively specify directory names also apply
  442.      to libraries in the linker, because the compiler translates these
  443.      options into `-L' options for the linker.
  444.      The run-time support file `libgcc.a' can also be searched for using
  445.      the `-B' prefix, if needed.  If it is not found there, the two
  446.      standard prefixes above are tried, and that is all.  The file is
  447.      left out of the link if it is not found by those means.
  448.      Another way to specify a prefix much like the `-B' prefix is to use
  449.      the environment variable `GCC_EXEC_PREFIX'.  *Note Environment
  450.      Variables::.
  451. File: gcc.info,  Node: Target Options,  Next: Submodel Options,  Prev: Directory Options,  Up: Invoking GCC
  452. Specifying Target Machine and Compiler Version
  453. ==============================================
  454.    By default, GNU CC compiles code for the same type of machine that
  455. you are using.  However, it can also be installed as a cross-compiler,
  456. to compile for some other type of machine.  In fact, several different
  457. configurations of GNU CC, for different target machines, can be
  458. installed side by side.  Then you specify which one to use with the
  459. `-b' option.
  460.    In addition, older and newer versions of GNU CC can be installed side
  461. by side.  One of them (probably the newest) will be the default, but
  462. you may sometimes wish to use another.
  463. `-b MACHINE'
  464.      The argument MACHINE specifies the target machine for compilation.
  465.      This is useful when you have installed GNU CC as a cross-compiler.
  466.      The value to use for MACHINE is the same as was specified as the
  467.      machine type when configuring GNU CC as a cross-compiler.  For
  468.      example, if a cross-compiler was configured with `configure
  469.      i386v', meaning to compile for an 80386 running System V, then you
  470.      would specify `-b i386v' to run that cross compiler.
  471.      When you do not specify `-b', it normally means to compile for the
  472.      same type of machine that you are using.
  473. `-V VERSION'
  474.      The argument VERSION specifies which version of GNU CC to run.
  475.      This is useful when multiple versions are installed.  For example,
  476.      VERSION might be `2.0', meaning to run GNU CC version 2.0.
  477.      The default version, when you do not specify `-V', is controlled
  478.      by the way GNU CC is installed.  Normally, it will be a version
  479.      that is recommended for general use.
  480.    The `-b' and `-V' options actually work by controlling part of the
  481. file name used for the executable files and libraries used for
  482. compilation.  A given version of GNU CC, for a given target machine, is
  483. normally kept in the directory `/gnu/lib/gcc-lib/MACHINE/VERSION'.
  484.    Thus, sites can customize the effect of `-b' or `-V' either by
  485. changing the names of these directories or adding alternate names (or
  486. symbolic links).  If in directory `/gnu/lib/gcc-lib/' the file `80386'
  487. is a link to the file `i386v', then `-b 80386' becomes an alias for `-b
  488. i386v'.
  489.    In one respect, the `-b' or `-V' do not completely change to a
  490. different compiler: the top-level driver program `gcc' that you
  491. originally invoked continues to run and invoke the other executables
  492. (preprocessor, compiler per se, assembler and linker) that do the real
  493. work.  However, since no real work is done in the driver program, it
  494. usually does not matter that the driver program in use is not the one
  495. for the specified target and version.
  496.    The only way that the driver program depends on the target machine is
  497. in the parsing and handling of special machine-specific options.
  498. However, this is controlled by a file which is found, along with the
  499. other executables, in the directory for the specified version and
  500. target machine.  As a result, a single installed driver program adapts
  501. to any specified target machine and compiler version.
  502.    The driver program executable does control one significant thing,
  503. however: the default version and target machine.  Therefore, you can
  504. install different instances of the driver program, compiled for
  505. different targets or versions, under different names.
  506.    For example, if the driver for version 2.0 is installed as `ogcc'
  507. and that for version 2.1 is installed as `gcc', then the command `gcc'
  508. will use version 2.1 by default, while `ogcc' will use 2.0 by default.
  509. However, you can choose either version with either command with the
  510. `-V' option.
  511. File: gcc.info,  Node: Submodel Options,  Next: Code Gen Options,  Prev: Target Options,  Up: Invoking GCC
  512. Hardware Models and Configurations
  513. ==================================
  514.    Earlier we discussed the standard option `-b' which chooses among
  515. different installed compilers for completely different target machines,
  516. such as Vax vs. 68000 vs. 80386.
  517.    In addition, each of these target machine types can have its own
  518. special options, starting with `-m', to choose among various hardware
  519. models or configurations--for example, 68010 vs 68020, floating
  520. coprocessor or none.  A single installed version of the compiler can
  521. compile for any model or configuration, according to the options
  522. specified.
  523.    Some configurations of the compiler also support additional special
  524. options, usually for compatibility with other compilers on the same
  525. platform.
  526.    These options are defined by the macro `TARGET_SWITCHES' in the
  527. machine description.  The default for the options is also defined by
  528. that macro, which enables you to change the defaults.
  529. * Menu:
  530. * M680x0 Options::
  531. * VAX Options::
  532. * SPARC Options::
  533. * Convex Options::
  534. * AMD29K Options::
  535. * M88K Options::
  536. * RS/6000 and PowerPC Options::
  537. * RT Options::
  538. * MIPS Options::
  539. * i386 Options::
  540. * HPPA Options::
  541. * Intel 960 Options::
  542. * DEC Alpha Options::
  543. * Clipper Options::
  544. * System V Options::
  545. File: gcc.info,  Node: M680x0 Options,  Next: VAX Options,  Up: Submodel Options
  546. M680x0 Options
  547. --------------
  548.    These are the `-m' options defined for the 68000 series.  The default
  549. values for these options depends on which style of 68000 was selected
  550. when the compiler was configured; the defaults for the most common
  551. choices are given below.
  552. `-m68000'
  553. `-mc68000'
  554.      Generate output for a 68000.  This is the default when the
  555.      compiler is configured for 68000-based systems.
  556. `-m68020'
  557. `-mc68020'
  558.      Generate output for a 68020.  This is the default when the
  559.      compiler is configured for 68020-based systems.
  560. `-m68881'
  561.      Generate output containing 68881 instructions for floating point.
  562.      This is the default for most 68020 systems unless `-nfp' was
  563.      specified when the compiler was configured.
  564. `-m68030'
  565.      Generate output for a 68030.  This is the default when the
  566.      compiler is configured for 68030-based systems.
  567. `-m68040'
  568.      Generate output for a 68040.  This is the default when the
  569.      compiler is configured for 68040-based systems.
  570.      This option inhibits the use of 68881/68882 instructions that have
  571.      to be emulated by software on the 68040.  If your 68040 does not
  572.      have code to emulate those instructions, use `-m68040'.
  573. `-m68020-40'
  574.      Generate output for a 68040, without using any of the new
  575.      instructions.  This results in code which can run relatively
  576.      efficiently on either a 68020/68881 or a 68030 or a 68040.  The
  577.      generated code does use the 68881 instructions that are emulated
  578.      on the 68040.
  579. `-mfpa'
  580.      Generate output containing Sun FPA instructions for floating point.
  581. `-msoft-float'
  582.      Generate output containing library calls for floating point.
  583.      *Warning:* the requisite libraries are not part of GNU CC.
  584.      Normally the facilities of the machine's usual C compiler are
  585.      used, but this can't be done directly in cross-compilation.  You
  586.      must make your own arrangements to provide suitable library
  587.      functions for cross-compilation.
  588. `-mshort'
  589.      Consider type `int' to be 16 bits wide, like `short int'.
  590. `-mnobitfield'
  591.      Do not use the bit-field instructions.  The `-m68000' option
  592.      implies `-mnobitfield'.
  593. `-mbitfield'
  594.      Do use the bit-field instructions.  The `-m68020' option implies
  595.      `-mbitfield'.  This is the default if you use a configuration
  596.      designed for a 68020.
  597. `-mrtd'
  598.      Use a different function-calling convention, in which functions
  599.      that take a fixed number of arguments return with the `rtd'
  600.      instruction, which pops their arguments while returning.  This
  601.      saves one instruction in the caller since there is no need to pop
  602.      the arguments there.
  603.      This calling convention is incompatible with the one normally used
  604.      on Unix, so you cannot use it if you need to call libraries
  605.      compiled with the Unix compiler.
  606.      Also, you must provide function prototypes for all functions that
  607.      take variable numbers of arguments (including `printf'); otherwise
  608.      incorrect code will be generated for calls to those functions.
  609.      In addition, seriously incorrect code will result if you call a
  610.      function with too many arguments.  (Normally, extra arguments are
  611.      harmlessly ignored.)
  612.      The `rtd' instruction is supported by the 68010 and 68020
  613.      processors, but not by the 68000.
  614. File: gcc.info,  Node: VAX Options,  Next: SPARC Options,  Prev: M680x0 Options,  Up: Submodel Options
  615. VAX Options
  616. -----------
  617.    These `-m' options are defined for the Vax:
  618. `-munix'
  619.      Do not output certain jump instructions (`aobleq' and so on) that
  620.      the Unix assembler for the Vax cannot handle across long ranges.
  621. `-mgnu'
  622.      Do output those jump instructions, on the assumption that you will
  623.      assemble with the GNU assembler.
  624. `-mg'
  625.      Output code for g-format floating point numbers instead of
  626.      d-format.
  627. File: gcc.info,  Node: SPARC Options,  Next: Convex Options,  Prev: VAX Options,  Up: Submodel Options
  628. SPARC Options
  629. -------------
  630.    These `-m' switches are supported on the SPARC:
  631. `-mfpu'
  632. `-mhard-float'
  633.      Generate output containing floating point instructions.  This is
  634.      the default.
  635. `-mno-fpu'
  636. `-msoft-float'
  637.      Generate output containing library calls for floating point.
  638.      *Warning:* there is no GNU floating-point library for SPARC.
  639.      Normally the facilities of the machine's usual C compiler are
  640.      used, but this cannot be done directly in cross-compilation.  You
  641.      must make your own arrangements to provide suitable library
  642.      functions for cross-compilation.
  643.      `-msoft-float' changes the calling convention in the output file;
  644.      therefore, it is only useful if you compile *all* of a program with
  645.      this option.  In particular, you need to compile `libgcc.a', the
  646.      library that comes with GNU CC, with `-msoft-float' in order for
  647.      this to work.
  648. `-mno-epilogue'
  649. `-mepilogue'
  650.      With `-mepilogue' (the default), the compiler always emits code for
  651.      function exit at the end of each function.  Any function exit in
  652.      the middle of the function (such as a return statement in C) will
  653.      generate a jump to the exit code at the end of the function.
  654.      With `-mno-epilogue', the compiler tries to emit exit code inline
  655.      at every function exit.
  656. `-mv8'
  657. `-msparclite'
  658.      These two options select variations on the SPARC architecture.
  659.      By default (unless specifically configured for the Fujitsu
  660.      SPARClite), GCC generates code for the v7 variant of the SPARC
  661.      architecture.
  662.      `-mv8' will give you SPARC v8 code.  The only difference from v7
  663.      code is that the compiler emits the integer multiply and integer
  664.      divide instructions which exist in SPARC v8 but not in SPARC v7.
  665.      `-msparclite' will give you SPARClite code.  This adds the integer
  666.      multiply, integer divide step and scan (`ffs') instructions which
  667.      exist in SPARClite but not in SPARC v7.
  668. File: gcc.info,  Node: Convex Options,  Next: AMD29K Options,  Prev: SPARC Options,  Up: Submodel Options
  669. Convex Options
  670. --------------
  671.    These `-m' options are defined for Convex:
  672. `-mc1'
  673.      Generate output for C1.  The code will run on any Convex machine.
  674.      The preprocessor symbol `__convex__c1__' is defined.
  675. `-mc2'
  676.      Generate output for C2.  Uses instructions not available on C1.
  677.      Scheduling and other optimizations are chosen for max performance
  678.      on C2.  The preprocessor symbol `__convex_c2__' is defined.
  679. `-mc32'
  680.      Generate output for C32xx.  Uses instructions not available on C1.
  681.      Scheduling and other optimizations are chosen for max performance
  682.      on C32.  The preprocessor symbol `__convex_c32__' is defined.
  683. `-mc34'
  684.      Generate output for C34xx.  Uses instructions not available on C1.
  685.      Scheduling and other optimizations are chosen for max performance
  686.      on C34.  The preprocessor symbol `__convex_c34__' is defined.
  687. `-mc38'
  688.      Generate output for C38xx.  Uses instructions not available on C1.
  689.      Scheduling and other optimizations are chosen for max performance
  690.      on C38.  The preprocessor symbol `__convex_c38__' is defined.
  691. `-margcount'
  692.      Generate code which puts an argument count in the word preceding
  693.      each argument list.  This is compatible with regular CC, and a few
  694.      programs may need the argument count word.  GDB and other
  695.      source-level debuggers do not need it; this info is in the symbol
  696.      table.
  697. `-mnoargcount'
  698.      Omit the argument count word.  This is the default.
  699. `-mvolatile-cache'
  700.      Allow volatile references to be cached.  This is the default.
  701. `-mvolatile-nocache'
  702.      Volatile references bypass the data cache, going all the way to
  703.      memory.  This is only needed for multi-processor code that does
  704.      not use standard synchronization instructions.  Making
  705.      non-volatile references to volatile locations will not necessarily
  706.      work.
  707. `-mlong32'
  708.      Type long is 32 bits, the same as type int.  This is the default.
  709. `-mlong64'
  710.      Type long is 64 bits, the same as type long long.  This option is
  711.      useless, because no library support exists for it.
  712. File: gcc.info,  Node: AMD29K Options,  Next: M88K Options,  Prev: Convex Options,  Up: Submodel Options
  713. AMD29K Options
  714. --------------
  715.    These `-m' options are defined for the AMD Am29000:
  716. `-mdw'
  717.      Generate code that assumes the `DW' bit is set, i.e., that byte and
  718.      halfword operations are directly supported by the hardware.  This
  719.      is the default.
  720. `-mnodw'
  721.      Generate code that assumes the `DW' bit is not set.
  722. `-mbw'
  723.      Generate code that assumes the system supports byte and halfword
  724.      write operations.  This is the default.
  725. `-mnbw'
  726.      Generate code that assumes the systems does not support byte and
  727.      halfword write operations.  `-mnbw' implies `-mnodw'.
  728. `-msmall'
  729.      Use a small memory model that assumes that all function addresses
  730.      are either within a single 256 KB segment or at an absolute
  731.      address of less than 256k.  This allows the `call' instruction to
  732.      be used instead of a `const', `consth', `calli' sequence.
  733. `-mnormal'
  734.      Use the normal memory model: Generate `call' instructions only when
  735.      calling functions in the same file and `calli' instructions
  736.      otherwise.  This works if each file occupies less than 256 KB but
  737.      allows the entire executable to be larger than 256 KB.  This is
  738.      the default.
  739. `-mlarge'
  740.      Always use `calli' instructions.  Specify this option if you expect
  741.      a single file to compile into more than 256 KB of code.
  742. `-m29050'
  743.      Generate code for the Am29050.
  744. `-m29000'
  745.      Generate code for the Am29000.  This is the default.
  746. `-mkernel-registers'
  747.      Generate references to registers `gr64-gr95' instead of to
  748.      registers `gr96-gr127'.  This option can be used when compiling
  749.      kernel code that wants a set of global registers disjoint from
  750.      that used by user-mode code.
  751.      Note that when this option is used, register names in `-f' flags
  752.      must use the normal, user-mode, names.
  753. `-muser-registers'
  754.      Use the normal set of global registers, `gr96-gr127'.  This is the
  755.      default.
  756. `-mstack-check'
  757.      Insert a call to `__msp_check' after each stack adjustment.  This
  758.      is often used for kernel code.
  759. File: gcc.info,  Node: M88K Options,  Next: RS/6000 and PowerPC Options,  Prev: AMD29K Options,  Up: Submodel Options
  760. M88K Options
  761. ------------
  762.    These `-m' options are defined for Motorola 88k architectures:
  763. `-m88000'
  764.      Generate code that works well on both the m88100 and the m88110.
  765. `-m88100'
  766.      Generate code that works best for the m88100, but that also runs
  767.      on the m88110.
  768. `-m88110'
  769.      Generate code that works best for the m88110, and may not run on
  770.      the m88100.
  771. `-mbig-pic'
  772.      Obsolete option to be removed from the next revision.  Use `-fPIC'.
  773. `-midentify-revision'
  774.      Include an `ident' directive in the assembler output recording the
  775.      source file name, compiler name and version, timestamp, and
  776.      compilation flags used.
  777. `-mno-underscores'
  778.      In assembler output, emit symbol names without adding an underscore
  779.      character at the beginning of each name.  The default is to use an
  780.      underscore as prefix on each name.
  781. `-mocs-debug-info'
  782. `-mno-ocs-debug-info'
  783.      Include (or omit) additional debugging information (about
  784.      registers used in each stack frame) as specified in the 88open
  785.      Object Compatibility Standard, "OCS".  This extra information
  786.      allows debugging of code that has had the frame pointer
  787.      eliminated.  The default for DG/UX, SVr4, and Delta 88 SVr3.2 is
  788.      to include this information; other 88k configurations omit this
  789.      information by default.
  790. `-mocs-frame-position'
  791.      When emitting COFF debugging information for automatic variables
  792.      and parameters stored on the stack, use the offset from the
  793.      canonical frame address, which is the stack pointer (register 31)
  794.      on entry to the function.  The DG/UX, SVr4, Delta88 SVr3.2, and
  795.      BCS configurations use `-mocs-frame-position'; other 88k
  796.      configurations have the default `-mno-ocs-frame-position'.
  797. `-mno-ocs-frame-position'
  798.      When emitting COFF debugging information for automatic variables
  799.      and parameters stored on the stack, use the offset from the frame
  800.      pointer register (register 30).  When this option is in effect,
  801.      the frame pointer is not eliminated when debugging information is
  802.      selected by the -g switch.
  803. `-moptimize-arg-area'
  804. `-mno-optimize-arg-area'
  805.      Control how function arguments are stored in stack frames.
  806.      `-moptimize-arg-area' saves space by optimizing them, but this
  807.      conflicts with the 88open specifications.  The opposite
  808.      alternative, `-mno-optimize-arg-area', agrees with 88open
  809.      standards.  By default GNU CC does not optimize the argument area.
  810. `-mshort-data-NUM'
  811.      Generate smaller data references by making them relative to `r0',
  812.      which allows loading a value using a single instruction (rather
  813.      than the usual two).  You control which data references are
  814.      affected by specifying NUM with this option.  For example, if you
  815.      specify `-mshort-data-512', then the data references affected are
  816.      those involving displacements of less than 512 bytes.
  817.      `-mshort-data-NUM' is not effective for NUM greater than 64k.
  818. `-mserialize-volatile'
  819. `-mno-serialize-volatile'
  820.      Do, or do not, generate code to guarantee sequential consistency of
  821.      volatile memory references.
  822.      GNU CC always guarantees consistency by default.
  823.      The order of memory references made by the m88110 processor does
  824.      not always match the order of the instructions requesting those
  825.      references.  In particular, a load instruction may execute before
  826.      a preceding store instruction.  Such reordering violates
  827.      sequential consistency of volatile memory references, when there
  828.      are multiple processors.
  829.      The extra code generated to guarantee consistency may affect the
  830.      performance of your application.  If you know that you can safely
  831.      forgo this guarantee, you may use the option
  832.      `-mno-serialize-volatile'.
  833. `-msvr4'
  834. `-msvr3'
  835.      Turn on (`-msvr4') or off (`-msvr3') compiler extensions related
  836.      to System V release 4 (SVr4).  This controls the following:
  837.        1. Which variant of the assembler syntax to emit (which you can
  838.           select independently using `-mversion-03.00').
  839.        2. `-msvr4' makes the C preprocessor recognize `#pragma weak'
  840.           that is used on System V release 4.
  841.        3. `-msvr4' makes GNU CC issue additional declaration directives
  842.           used in SVr4.
  843.      `-msvr3' is the default for all m88k configurations except the
  844.      SVr4 configuration.
  845. `-mversion-03.00'
  846.      In the DG/UX configuration, there are two flavors of SVr4.  This
  847.      option modifies `-msvr4' to select whether the hybrid-COFF or
  848.      real-ELF flavor is used.  All other configurations ignore this
  849.      option.
  850. `-mno-check-zero-division'
  851. `-mcheck-zero-division'
  852.      Early models of the 88k architecture had problems with division by
  853.      zero; in particular, many of them didn't trap.  Use these options
  854.      to avoid including (or to include explicitly) additional code to
  855.      detect division by zero and signal an exception.  All GNU CC
  856.      configurations for the 88k use `-mcheck-zero-division' by default.
  857. `-muse-div-instruction'
  858.      Do not emit code to check both the divisor and dividend when doing
  859.      signed integer division to see if either is negative, and adjust
  860.      the signs so the divide is done using non-negative numbers.
  861.      Instead, rely on the operating system to calculate the correct
  862.      value when the `div' instruction traps.  This results in different
  863.      behavior when the most negative number is divided by -1, but is
  864.      useful when most or all signed integer divisions are done with
  865.      positive numbers.
  866. `-mtrap-large-shift'
  867. `-mhandle-large-shift'
  868.      Include code to detect bit-shifts of more than 31 bits;
  869.      respectively, trap such shifts or emit code to handle them
  870.      properly.  By default GNU CC makes no special provision for large
  871.      bit shifts.
  872. `-mwarn-passed-structs'
  873.      Warn when a function passes a struct as an argument or result.
  874.      Structure-passing conventions have changed during the evolution of
  875.      the C language, and are often the source of portability problems.
  876.      By default, GNU CC issues no such warning.
  877.