home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / progtool / c / gcc / gcc258s.zoo / gcc.info-3 < prev    next >
Encoding:
GNU Info File  |  1993-11-30  |  44.9 KB  |  1,142 lines

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