home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / NextDeveloper / Source / GNU / cc / gcc.info-4 < prev    next >
Encoding:
GNU Info File  |  1993-10-22  |  40.5 KB  |  987 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. 
  31. File: gcc.info,  Node: RS/6000 and PowerPC Options,  Next: RT Options,  Prev: M88K Options,  Up: Submodel Options
  32.  
  33. IBM RS/6000 and PowerPC Options
  34. -------------------------------
  35.  
  36.    These `-m' options are defined for the IBM RS/6000 and PowerPC:
  37. `-mpower'
  38. `-mno-power'
  39. `-mpower2'
  40. `-mno-power2'
  41. `-mpowerpc'
  42. `-mno-powerpc'
  43. `-mpowerpcsqr'
  44. `-mno-powerpcsqr'
  45. `-mpowerpc64'
  46. `-mno-powerpc64'
  47.      GNU CC supports two related instruction set architectures for the
  48.      RS/6000 and PowerPC.  The "POWER" instruction set are those
  49.      instructions supported by the `rios' chip set used in the original
  50.      RS/6000 systems and the "PowerPC" instruction set is the
  51.      architecture of the Motorola MPC6xx microprocessors.  The PowerPC
  52.      architecture defines 64-bit instructions, but they are not
  53.      supported by any current processors.
  54.  
  55.      Neither architecture is a subset of the other.  However there is a
  56.      large common subset of instructions supported by both.  An MQ
  57.      register is included in processors supporting the POWER
  58.      architecture.
  59.  
  60.      You use these options to specify which instructions are available
  61.      on the processor you are using.  The default value of these
  62.      options is determined when configuring GNU CC.  Specifying the
  63.      `-mcpu=CPU_TYPE' overrides the specification of these options.  We
  64.      recommend you use that option rather than these.
  65.  
  66.      The `-mpower' option allows GNU CC to generate instructions that
  67.      are found only in the POWER architecture and to use the MQ
  68.      register.  Specifying `-mpower2' implies `-power' and also allows
  69.      GNU CC to generate instructions that are present in the POWER2
  70.      architecture but not the original POWER architecture.
  71.  
  72.      The `-mpowerpc' option allows GNU CC to generate instructions that
  73.      are found only in the 32-bit subset of the PowerPC architecture.
  74.      Specifying `-mpowerpcsqr' implies `-mpowerpc' and also allows GNU
  75.      CC to use the floating point square root instructions in the
  76.      PowerPC architecture but not in its first implementation.
  77.      Likewise, specifying `-mpowerpc64' implies `-mpowerpc' and also
  78.      allows GNU CC to use the 64-bit instructions in the PowerPC
  79.      architecture.
  80.  
  81.      If you specify both `-mno-power' and `-mno-powerpc', GNU CC will
  82.      use only the instructions in the common subset of both
  83.      architectures and will not use the MQ register.  Specifying both
  84.      `-mpower' and `-mpowerpc' permits GNU CC to use any instruction
  85.      from either architecture and to allow use of the MQ register;
  86.      specify this for the Motorola MPC601.
  87.  
  88. `-mnew-mnemonics'
  89. `-mold-mnemonics'
  90.      Select the mnemonics for GNU CC to use in the generated assembler
  91.      code.  `-mnew-mnemonics' requests GNU CC to produce output that
  92.      uses the assembler mnemonics defined for the PowerPC architecture
  93.      and the `-mold-mnemonics' requests GNU CC to use the assembler
  94.      mnemonics defined for the POWER architecture.  Instructions
  95.      defined in only one architecture have only one mnemonic; GNU CC
  96.      uses that mnemonic irrespective of which of thse options is
  97.      specified.
  98.  
  99.      PowerPC assemblers support both the old and new mnemonics, as will
  100.      later POWER assemblers.  Current POWER assemblers only support the
  101.      old mnemonics.  Specify `-mnew-mnemonics' if you have an assembler
  102.      that sypports them, otherwise specify `-mold-mnemonics'.
  103.  
  104.      The default value of these options depends on how GNU CC was
  105.      configured.  Specifing `-mcpu=CPU_TYPE' sometimes overrides the
  106.      value of these option.  Unless you are building a cross-compiled,
  107.      you should normally not specify either `-mnew-mnemonics' or
  108.      `-mold-mnemonics', but should instead accept the default.
  109.  
  110. `-mcpu=CPU_TYPE'
  111.      Set architecture type, register usage, choice of mnemonics, and
  112.      instruction scheduling parameters for machine type CPU_TYPE.  By
  113.      default, CPU_TYPE is the target system defined when GNU CC was
  114.      configured.  Supported values for CPU_TYPE are `rios1', `rios2',
  115.      `601', `603', `604', `620' and `all'.
  116.  
  117.      Specifying `-mcpu=rios1' or `-mcpu=rios2' enables the `-mpower'
  118.      option and disables the `-mpowerpc' option, `-mcpu=601' enables
  119.      both the `-mpower' and `-mpowerpc' options, `-mcpu=603' and
  120.      `-mcpu=604' enable the `-mpowerpc' option and disables the
  121.      `-mpower' option, and `-mcpu=620' enables both the `-mpowerpc' and
  122.      `-mpowerpc64' options and also disables the `-mpower' option.
  123.  
  124.      To generate code that will operate on all members of the RS/6000
  125.      and PowerPC family, specify `-mcpu=all'.  In that case, GNU CC will
  126.      only use instructions in the common subset and will not use the MQ
  127.      register.  The instruction scheduling parameters and choice of
  128.      mnemonics are not affected.
  129.  
  130.      Specifying `-mcpu=601', `-mcpu=603', `-mcpu=604', or `-mcpu=620'
  131.      also enables the `new-mnemonics' option.
  132.  
  133. `-mnormal-toc'
  134. `-mno-fp-in-toc'
  135. `-mminimal-toc'
  136.      Modify generation of the TOC (Table Of Contents), which is created
  137.      for every executable file.  The `-mnormal-toc' option is selected
  138.      by default.  In that case, GNU CC will allocate at least one TOC
  139.      entry for each unique non-automatic variable reference in your
  140.      program.  GNU CC will also place floating-point constants in the
  141.      TOC.  However, only 16K entries are available in the TOC.
  142.  
  143.      If you receive a linker error message that says you have
  144.      overflowed the available TOC space, recompile your files with
  145.      either the `-mno-fp-in-toc' or `-mminimal-toc' options.
  146.      `-mno-fp-in-toc' prevents GNU CC from putting floating-point
  147.      constants in the TOC.  `-mminimal-toc' causes GNU CC to make only
  148.      one TOC entry for every file.  Using the `-minimal-toc' option
  149.      produces slightly slower and larger code than the `-mnormal-toc' or
  150.      `-mno-fp-in-toc' options.  If you use floating-point, try the
  151.      `-mno-fp-in-toc' option before you specify `-mminimal-toc'.
  152.  
  153. 
  154. File: gcc.info,  Node: RT Options,  Next: MIPS Options,  Prev: RS/6000 and PowerPC Options,  Up: Submodel Options
  155.  
  156. IBM RT Options
  157. --------------
  158.  
  159.    These `-m' options are defined for the IBM RT PC:
  160.  
  161. `-min-line-mul'
  162.      Use an in-line code sequence for integer multiplies.  This is the
  163.      default.
  164.  
  165. `-mcall-lib-mul'
  166.      Call `lmul$$' for integer multiples.
  167.  
  168. `-mfull-fp-blocks'
  169.      Generate full-size floating point data blocks, including the
  170.      minimum amount of scratch space recommended by IBM.  This is the
  171.      default.
  172.  
  173. `-mminimum-fp-blocks'
  174.      Do not include extra scratch space in floating point data blocks.
  175.      This results in smaller code, but slower execution, since scratch
  176.      space must be allocated dynamically.
  177.  
  178. `-mfp-arg-in-fpregs'
  179.      Use a calling sequence incompatible with the IBM calling
  180.      convention in which floating point arguments are passed in
  181.      floating point registers.  Note that `varargs.h' and `stdargs.h'
  182.      will not work with floating point operands if this option is
  183.      specified.
  184.  
  185. `-mfp-arg-in-gregs'
  186.      Use the normal calling convention for floating point arguments.
  187.      This is the default.
  188.  
  189. `-mhc-struct-return'
  190.      Return structures of more than one word in memory, rather than in a
  191.      register.  This provides compatibility with the MetaWare HighC (hc)
  192.      compiler.  Use the option `-fpcc-struct-return' for compatibility
  193.      with the Portable C Compiler (pcc).
  194.  
  195. `-mnohc-struct-return'
  196.      Return some structures of more than one word in registers, when
  197.      convenient.  This is the default.  For compatibility with the
  198.      IBM-supplied compilers, use the option `-fpcc-struct-return' or the
  199.      option `-mhc-struct-return'.
  200.  
  201. 
  202. File: gcc.info,  Node: MIPS Options,  Next: i386 Options,  Prev: RT Options,  Up: Submodel Options
  203.  
  204. MIPS Options
  205. ------------
  206.  
  207.    These `-m' options are defined for the MIPS family of computers:
  208.  
  209. `-mcpu=CPU TYPE'
  210.      Assume the defaults for the machine type CPU TYPE when scheduling
  211.      instructions.  The default CPU TYPE is `default', which picks the
  212.      longest cycles times for any of the machines, in order that the
  213.      code run at reasonable rates on all MIPS cpu's.  Other choices for
  214.      CPU TYPE are `r2000', `r3000', `r4000', and `r6000'.  While
  215.      picking a specific CPU TYPE will schedule things appropriately for
  216.      that particular chip, the compiler will not generate any code that
  217.      does not meet level 1 of the MIPS ISA (instruction set
  218.      architecture) without the `-mips2' or `-mips3' switches being used.
  219.  
  220. `-mips2'
  221.      Issue instructions from level 2 of the MIPS ISA (branch likely,
  222.      square root instructions).  The `-mcpu=r4000' or `-mcpu=r6000'
  223.      switch must be used in conjunction with `-mips2'.
  224.  
  225. `-mips3'
  226.      Issue instructions from level 3 of the MIPS ISA (64 bit
  227.      instructions).  You must use the `-mcpu=r4000' switch along with
  228.      `-mips3'.
  229.  
  230. `-mint64'
  231. `-mlong64'
  232. `-mlonglong128'
  233.      These options don't work at present.
  234.  
  235. `-mmips-as'
  236.      Generate code for the MIPS assembler, and invoke `mips-tfile' to
  237.      add normal debug information.  This is the default for all
  238.      platforms except for the OSF/1 reference platform, using the
  239.      OSF/rose object format.  If the either of the `-gstabs' or
  240.      `-gstabs+' switches are used, the `mips-tfile' program will
  241.      encapsulate the stabs within MIPS ECOFF.
  242.  
  243. `-mgas'
  244.      Generate code for the GNU assembler.  This is the default on the
  245.      OSF/1 reference platform, using the OSF/rose object format.
  246.  
  247. `-mrnames'
  248. `-mno-rnames'
  249.      The `-mrnames' switch says to output code using the MIPS software
  250.      names for the registers, instead of the hardware names (ie, A0
  251.      instead of $4).  The GNU assembler does not support the `-mrnames'
  252.      switch, and the MIPS assembler will be instructed to run the MIPS
  253.      C preprocessor over the source file.  The `-mno-rnames' switch is
  254.      default.
  255.  
  256. `-mgpopt'
  257. `-mno-gpopt'
  258.      The `-mgpopt' switch says to write all of the data declarations
  259.      before the instructions in the text section, this allows the MIPS
  260.      assembler to generate one word memory references instead of using
  261.      two words for short global or static data items.  This is on by
  262.      default if optimization is selected.
  263.  
  264. `-mstats'
  265. `-mno-stats'
  266.      For each non-inline function processed, the `-mstats' switch
  267.      causes the compiler to emit one line to the standard error file to
  268.      print statistics about the program (number of registers saved,
  269.      stack size, etc.).
  270.  
  271. `-mmemcpy'
  272. `-mno-memcpy'
  273.      The `-mmemcpy' switch makes all block moves call the appropriate
  274.      string function (`memcpy' or `bcopy') instead of possibly
  275.      generating inline code.
  276.  
  277. `-mmips-tfile'
  278. `-mno-mips-tfile'
  279.      The `-mno-mips-tfile' switch causes the compiler not postprocess
  280.      the object file with the `mips-tfile' program, after the MIPS
  281.      assembler has generated it to add debug support.  If `mips-tfile'
  282.      is not run, then no local variables will be available to the
  283.      debugger.  In addition, `stage2' and `stage3' objects will have
  284.      the temporary file names passed to the assembler embedded in the
  285.      object file, which means the objects will not compare the same.
  286.      The `-mno-mips-tfile' switch should only be used when there are
  287.      bugs in the `mips-tfile' program that prevents compilation.
  288.  
  289. `-msoft-float'
  290.      Generate output containing library calls for floating point.
  291.      *Warning:* the requisite libraries are not part of GNU CC.
  292.      Normally the facilities of the machine's usual C compiler are
  293.      used, but this can't be done directly in cross-compilation.  You
  294.      must make your own arrangements to provide suitable library
  295.      functions for cross-compilation.
  296.  
  297. `-mhard-float'
  298.      Generate output containing floating point instructions.  This is
  299.      the default if you use the unmodified sources.
  300.  
  301. `-mfp64'
  302.      Assume that the FR bit in the status word is on, and that there
  303.      are 32 64-bit floating point registers, instead of 32 32-bit
  304.      floating point registers.  You must also specify the `-mcpu=r4000'
  305.      and `-mips3' switches.
  306.  
  307. `-mfp32'
  308.      Assume that there are 32 32-bit floating point registers.  This is
  309.      the default.
  310.  
  311. `-mabicalls'
  312. `-mno-abicalls'
  313.      Emit (or do not emit) the pseudo operations `.abicalls',
  314.      `.cpload', and `.cprestore' that some System V.4 ports use for
  315.      position independent code.
  316.  
  317. `-mlong-calls'
  318. `-mlong-calls'
  319.      Do all calls with the `JALR' instruction, which requires loading
  320.      up a function's address into a register before the call.  You need
  321.      to use this switch, if you call outside of the current 512
  322.      megabyte segment to functions that are not through pointers.
  323.  
  324. `-mhalf-pic'
  325. `-mno-half-pic'
  326.      Put pointers to extern references into the data section and load
  327.      them up, rather than put the references in the text section.
  328.  
  329. `-G NUM'
  330.      Put global and static items less than or equal to NUM bytes into
  331.      the small data or bss sections instead of the normal data or bss
  332.      section.  This allows the assembler to emit one word memory
  333.      reference instructions based on the global pointer (GP or $28),
  334.      instead of the normal two words used.  By default, NUM is 8 when
  335.      the MIPS assembler is used, and 0 when the GNU assembler is used.
  336.      The `-G NUM' switch is also passed to the assembler and linker.
  337.      All modules should be compiled with the same `-G NUM' value.
  338.  
  339. `-nocpp'
  340.      Tell the MIPS assembler to not run it's preprocessor over user
  341.      assembler files (with a `.s' suffix) when assembling them.
  342.  
  343.    These options are defined by the macro `TARGET_SWITCHES' in the
  344. machine description.  The default for the options is also defined by
  345. that macro, which enables you to change the defaults.
  346.  
  347. 
  348. File: gcc.info,  Node: i386 Options,  Next: HPPA Options,  Prev: MIPS Options,  Up: Submodel Options
  349.  
  350. Intel 386 Options
  351. -----------------
  352.  
  353.    These `-m' options are defined for the i386 family of computers:
  354.  
  355. `-m486'
  356. `-mno-486'
  357.      Control whether or not code is optimized for a 486 instead of an
  358.      386.  Code generated for an 486 will run on a 386 and vice versa.
  359.  
  360. `-msoft-float'
  361.      Generate output containing library calls for floating point.
  362.      *Warning:* the requisite libraries are not part of GNU CC.
  363.      Normally the facilities of the machine's usual C compiler are
  364.      used, but this can't be done directly in cross-compilation.  You
  365.      must make your own arrangements to provide suitable library
  366.      functions for cross-compilation.
  367.  
  368.      On machines where a function returns floating point results in the
  369.      80387 register stack, some floating point opcodes may be emitted
  370.      even if `-msoft-float' is used.
  371.  
  372. `-mno-fp-ret-in-387'
  373.      Do not use the FPU registers for return values of functions.
  374.  
  375.      The usual calling convention has functions return values of types
  376.      `float' and `double' in an FPU register, even if there is no FPU.
  377.      The idea is that the operating system should emulate an FPU.
  378.  
  379.      The option `-mno-fp-ret-in-387' causes such values to be returned
  380.      in ordinary CPU registers instead.
  381.  
  382. 
  383. File: gcc.info,  Node: HPPA Options,  Next: Intel 960 Options,  Prev: i386 Options,  Up: Submodel Options
  384.  
  385. HPPA Options
  386. ------------
  387.  
  388.    These `-m' options are defined for the HPPA family of computers:
  389.  
  390. `-mpa-risc-1-0'
  391.      Generate code for a PA 1.0 processor.
  392.  
  393. `-mpa-risc-1-1'
  394.      Generate code for a PA 1.1 processor.
  395.  
  396. `-mlong-calls'
  397.      Generate code which allows calls to functions greater than 256k
  398.      away from the caller when the caller and callee are in the same
  399.      source file.  Do not turn this option on unless code refuses to
  400.      link with "branch out of range errors" from the linker.
  401.  
  402. `-mdisable-fpregs'
  403.      Prevent floating point registers from being used in any manner.
  404.      This is necessary for compiling kernels which perform lazy context
  405.      switching of floating point registers.  If you use this option and
  406.      attempt to perform floating point operations, the compiler will
  407.      abort.
  408.  
  409. `-mdisable-indexing'
  410.      Prevent the compiler from using indexing address modes.  This
  411.      avoids some rather obscure problems when compiling MIG generated
  412.      code under MACH.
  413.  
  414. `-mtrailing-colon'
  415.      Add a colon to the end of label definitions (for ELF assemblers).
  416.  
  417. 
  418. File: gcc.info,  Node: Intel 960 Options,  Next: DEC Alpha Options,  Prev: HPPA Options,  Up: Submodel Options
  419.  
  420. Intel 960 Options
  421. -----------------
  422.  
  423.    These `-m' options are defined for the Intel 960 implementations:
  424.  
  425. `-mCPU TYPE'
  426.      Assume the defaults for the machine type CPU TYPE for some of the
  427.      other options, including instruction scheduling, floating point
  428.      support, and addressing modes.  The choices for CPU TYPE are `ka',
  429.      `kb', `mc', `ca', `cf', `sa', and `sb'.  The default is `kb'.
  430.  
  431. `-mnumerics'
  432. `-msoft-float'
  433.      The `-mnumerics' option indicates that the processor does support
  434.      floating-point instructions.  The `-msoft-float' option indicates
  435.      that floating-point support should not be assumed.
  436.  
  437. `-mleaf-procedures'
  438. `-mno-leaf-procedures'
  439.      Do (or do not) attempt to alter leaf procedures to be callable
  440.      with the `bal' instruction as well as `call'.  This will result in
  441.      more efficient code for explicit calls when the `bal' instruction
  442.      can be substituted by the assembler or linker, but less efficient
  443.      code in other cases, such as calls via function pointers, or using
  444.      a linker that doesn't support this optimization.
  445.  
  446. `-mtail-call'
  447. `-mno-tail-call'
  448.      Do (or do not) make additional attempts (beyond those of the
  449.      machine-independent portions of the compiler) to optimize
  450.      tail-recursive calls into branches.  You may not want to do this
  451.      because the detection of cases where this is not valid is not
  452.      totally complete.  The default is `-mno-tail-call'.
  453.  
  454. `-mcomplex-addr'
  455. `-mno-complex-addr'
  456.      Assume (or do not assume) that the use of a complex addressing
  457.      mode is a win on this implementation of the i960.  Complex
  458.      addressing modes may not be worthwhile on the K-series, but they
  459.      definitely are on the C-series.  The default is currently
  460.      `-mcomplex-addr' for all processors except the CB and CC.
  461.  
  462. `-mcode-align'
  463. `-mno-code-align'
  464.      Align code to 8-byte boundaries for faster fetching (or don't
  465.      bother).  Currently turned on by default for C-series
  466.      implementations only.
  467.  
  468. `-mic-compat'
  469. `-mic2.0-compat'
  470. `-mic3.0-compat'
  471.      Enable compatibility with iC960 v2.0 or v3.0.
  472.  
  473. `-masm-compat'
  474. `-mintel-asm'
  475.      Enable compatibility with the iC960 assembler.
  476.  
  477. `-mstrict-align'
  478. `-mno-strict-align'
  479.      Do not permit (do permit) unaligned accesses.
  480.  
  481. `-mold-align'
  482.      Enable structure-alignment compatibility with Intel's gcc release
  483.      version 1.3 (based on gcc 1.37).  Currently this is buggy in that
  484.      `#pragma align 1' is always assumed as well, and cannot be turned
  485.      off.
  486.  
  487. 
  488. File: gcc.info,  Node: DEC Alpha Options,  Next: Clipper Options,  Prev: Intel 960 Options,  Up: Submodel Options
  489.  
  490. DEC Alpha Options
  491. -----------------
  492.  
  493.    These `-m' options are defined for the DEC Alpha implementations:
  494.  
  495. `-mno-soft-float'
  496. `-msoft-float'
  497.      Use (do not use) the hardware floating-point instructions for
  498.      floating-point operations.  When `-msoft-float' is specified,
  499.      functions in `libgcc1.c' will be used to perform floating-point
  500.      operations.  Unless they are replaced by routines that emulate the
  501.      floating-point operations, or compiled in such a way as to call
  502.      such emulations routines, these routines will issue floating-point
  503.      operations.   If you are compiling for an Alpha without
  504.      floating-point operations, you must ensure that the library is
  505.      built so as not to call them.
  506.  
  507.      Note that Alpha implementations without floating-point operations
  508.      are required to have floating-point registers.
  509.  
  510. `-mfp-reg'
  511. `-mno-fp-regs'
  512.      Generate code that uses (does not use) the floating-point register
  513.      set.  `-mno-fp-regs' implies `-msoft-float'.  If the floating-point
  514.      register set is not used, floating point operands are passed in
  515.      integer registers as if they were integers and floating-point
  516.      results are passed in $0 instead of $f0.  This is a non-standard
  517.      calling sequence, so any function with a floating-point argument
  518.      or return value called by code compiled with `-mno-fp-regs' must
  519.      also be compiled with that option.
  520.  
  521.      A typical use of this option is building a kernel that does not
  522.      use, and hence need not save and restore, any floating-point
  523.      registers.
  524.  
  525. 
  526. File: gcc.info,  Node: Clipper Options,  Next: System V Options,  Prev: DEC Alpha Options,  Up: Submodel Options
  527.  
  528. Clipper Options
  529. ---------------
  530.  
  531.    These `-m' options are defined for the Clipper implementations:
  532.  
  533. `-mc300'
  534.      Produce code for a C300 Clipper processor. This is the default.
  535.  
  536. `-mc400'
  537.      Produce code for a C400 Clipper processor i.e. use floting point
  538.      registers f8..f15.
  539.  
  540. 
  541. File: gcc.info,  Node: System V Options,  Prev: Clipper Options,  Up: Submodel Options
  542.  
  543. Options for System V
  544. --------------------
  545.  
  546.    These additional options are available on System V Release 4 for
  547. compatibility with other compilers on those systems:
  548.  
  549. `-Qy'
  550.      Identify the versions of each tool used by the compiler, in a
  551.      `.ident' assembler directive in the output.
  552.  
  553. `-Qn'
  554.      Refrain from adding `.ident' directives to the output file (this is
  555.      the default).
  556.  
  557. `-YP,DIRS'
  558.      Search the directories DIRS, and no others, for libraries
  559.      specified with `-l'.
  560.  
  561. `-Ym,DIR'
  562.      Look in the directory DIR to find the M4 preprocessor.  The
  563.      assembler uses this option.
  564.  
  565. 
  566. File: gcc.info,  Node: Code Gen Options,  Next: Environment Variables,  Prev: Submodel Options,  Up: Invoking GCC
  567.  
  568. Options for Code Generation Conventions
  569. =======================================
  570.  
  571.    These machine-independent options control the interface conventions
  572. used in code generation.
  573.  
  574.    Most of them have both positive and negative forms; the negative form
  575. of `-ffoo' would be `-fno-foo'.  In the table below, only one of the
  576. forms is listed--the one which is not the default.  You can figure out
  577. the other form by either removing `no-' or adding it.
  578.  
  579. `-fpcc-struct-return'
  580.      Return "short" `struct' and `union' values in memory like longer
  581.      ones, rather than in registers.  This convention is less
  582.      efficient, but it has the advantage of allowing intercallability
  583.      between GNU CC-compiled files and files compiled with other
  584.      compilers.
  585.  
  586.      The precise convention for returning structures in memory depends
  587.      on the target configuration macros.
  588.  
  589.      Short structures and unions are those whose size and alignment
  590.      match that of some integer type.
  591.  
  592. `-freg-struct-return'
  593.      Use the convention that `struct' and `union' values are returned
  594.      in registers when possible.  This is more efficient for small
  595.      structures than `-fpcc-struct-return'.
  596.  
  597.      If you specify neither `-fpcc-struct-return' nor its contrary
  598.      `-freg-struct-return', GNU CC defaults to whichever convention is
  599.      standard for the target.  If there is no standard convention, GNU
  600.      CC defaults to `-fpcc-struct-return', except on targets where GNU
  601.      CC is the principal compiler.  In those cases, we can choose the
  602.      standard, and we chose the more efficient register return
  603.      alternative.
  604.  
  605. `-fshort-enums'
  606.      Allocate to an `enum' type only as many bytes as it needs for the
  607.      declared range of possible values.  Specifically, the `enum' type
  608.      will be equivalent to the smallest integer type which has enough
  609.      room.
  610.  
  611. `-fshort-double'
  612.      Use the same size for `double' as for `float'.
  613.  
  614. `-fshared-data'
  615.      Requests that the data and non-`const' variables of this
  616.      compilation be shared data rather than private data.  The
  617.      distinction makes sense only on certain operating systems, where
  618.      shared data is shared between processes running the same program,
  619.      while private data exists in one copy per process.
  620.  
  621. `-fno-common'
  622.      Allocate even uninitialized global variables in the bss section of
  623.      the object file, rather than generating them as common blocks.
  624.      This has the effect that if the same variable is declared (without
  625.      `extern') in two different compilations, you will get an error
  626.      when you link them.  The only reason this might be useful is if
  627.      you wish to verify that the program will work on other systems
  628.      which always work this way.
  629.  
  630. `-fno-ident'
  631.      Ignore the `#ident' directive.
  632.  
  633. `-fno-gnu-linker'
  634.      Do not output global initializations (such as C++ constructors and
  635.      destructors) in the form used by the GNU linker (on systems where
  636.      the GNU linker is the standard method of handling them).  Use this
  637.      option when you want to use a non-GNU linker, which also requires
  638.      using the `collect2' program to make sure the system linker
  639.      includes constructors and destructors.  (`collect2' is included in
  640.      the GNU CC distribution.)  For systems which *must* use
  641.      `collect2', the compiler driver `gcc' is configured to do this
  642.      automatically.
  643.  
  644. `-finhibit-size-directive'
  645.      Don't output a `.size' assembler directive, or anything else that
  646.      would cause trouble if the function is split in the middle, and the
  647.      two halves are placed at locations far apart in memory.  This
  648.      option is used when compiling `crtstuff.c'; you should not need to
  649.      use it for anything else.
  650.  
  651. `-fverbose-asm'
  652.      Put extra commentary information in the generated assembly code to
  653.      make it more readable.  This option is generally only of use to
  654.      those who actually need to read the generated assembly code
  655.      (perhaps while debugging the compiler itself).
  656.  
  657. `-fvolatile'
  658.      Consider all memory references through pointers to be volatile.
  659.  
  660. `-fvolatile-global'
  661.      Consider all memory references to extern and global data items to
  662.      be volatile.
  663.  
  664. `-fpic'
  665.      Generate position-independent code (PIC) suitable for use in a
  666.      shared library, if supported for the target machine.  Such code
  667.      accesses all constant addresses through a global offset table
  668.      (GOT).  If the GOT size for the linked executable exceeds a
  669.      machine-specific maximum size, you get an error message from the
  670.      linker indicating that `-fpic' does not work; in that case,
  671.      recompile with `-fPIC' instead.  (These maximums are 16k on the
  672.      m88k, 8k on the Sparc, and 32k on the m68k and RS/6000.  The 386
  673.      has no such limit.)
  674.  
  675.      Position-independent code requires special support, and therefore
  676.      works only on certain machines.  For the 386, GNU CC supports PIC
  677.      for System V but not for the Sun 386i.  Code generated for the IBM
  678.      RS/6000 is always position-independent.
  679.  
  680.      The GNU assembler does not fully support PIC.  Currently, you must
  681.      use some other assembler in order for PIC to work.  We would
  682.      welcome volunteers to upgrade GAS to handle this; the first part
  683.      of the job is to figure out what the assembler must do differently.
  684.  
  685. `-fPIC'
  686.      If supported for the target machine, emit position-independent
  687.      code, suitable for dynamic linking and avoiding any limit on the
  688.      size of the global offset table.  This option makes a difference
  689.      on the m68k, m88k and the Sparc.
  690.  
  691.      Position-independent code requires special support, and therefore
  692.      works only on certain machines.
  693.  
  694. `-ffixed-REG'
  695.      Treat the register named REG as a fixed register; generated code
  696.      should never refer to it (except perhaps as a stack pointer, frame
  697.      pointer or in some other fixed role).
  698.  
  699.      REG must be the name of a register.  The register names accepted
  700.      are machine-specific and are defined in the `REGISTER_NAMES' macro
  701.      in the machine description macro file.
  702.  
  703.      This flag does not have a negative form, because it specifies a
  704.      three-way choice.
  705.  
  706. `-fcall-used-REG'
  707.      Treat the register named REG as an allocatable register that is
  708.      clobbered by function calls.  It may be allocated for temporaries
  709.      or variables that do not live across a call.  Functions compiled
  710.      this way will not save and restore the register REG.
  711.  
  712.      Use of this flag for a register that has a fixed pervasive role in
  713.      the machine's execution model, such as the stack pointer or frame
  714.      pointer, will produce disastrous results.
  715.  
  716.      This flag does not have a negative form, because it specifies a
  717.      three-way choice.
  718.  
  719. `-fcall-saved-REG'
  720.      Treat the register named REG as an allocatable register saved by
  721.      functions.  It may be allocated even for temporaries or variables
  722.      that live across a call.  Functions compiled this way will save
  723.      and restore the register REG if they use it.
  724.  
  725.      Use of this flag for a register that has a fixed pervasive role in
  726.      the machine's execution model, such as the stack pointer or frame
  727.      pointer, will produce disastrous results.
  728.  
  729.      A different sort of disaster will result from the use of this flag
  730.      for a register in which function values may be returned.
  731.  
  732.      This flag does not have a negative form, because it specifies a
  733.      three-way choice.
  734.  
  735. `+e0'
  736. `+e1'
  737.      Control whether virtual function definitions in classes are used to
  738.      generate code, or only to define interfaces for their callers.
  739.      (C++ only).
  740.  
  741.      These options are provided for compatibility with `cfront' 1.x
  742.      usage; the recommended alternative GNU C++ usage is in flux.
  743.      *Note Declarations and Definitions in One Header: C++ Interface.
  744.  
  745.      With `+e0', virtual function definitions in classes are declared
  746.      `extern'; the declaration is used only as an interface
  747.      specification, not to generate code for the virtual functions (in
  748.      this compilation).
  749.  
  750.      With `+e1', G++ actually generates the code implementing virtual
  751.      functions defined in the code, and makes them publicly visible.
  752.  
  753. 
  754. File: gcc.info,  Node: Environment Variables,  Next: Running Protoize,  Prev: Code Gen Options,  Up: Invoking GCC
  755.  
  756. Environment Variables Affecting GNU CC
  757. ======================================
  758.  
  759.    This section describes several environment variables that affect how
  760. GNU CC operates.  They work by specifying directories or prefixes to use
  761. when searching for various kinds of files.
  762.  
  763.    Note that you can also specify places to search using options such as
  764. `-B', `-I' and `-L' (*note Directory Options::.).  These take
  765. precedence over places specified using environment variables, which in
  766. turn take precedence over those specified by the configuration of GNU
  767. CC.  *Note Driver::.
  768.  
  769. `TMPDIR'
  770.      If `TMPDIR' is set, it specifies the directory to use for temporary
  771.      files.  GNU CC uses temporary files to hold the output of one
  772.      stage of compilation which is to be used as input to the next
  773.      stage: for example, the output of the preprocessor, which is the
  774.      input to the compiler proper.
  775.  
  776. `GCC_EXEC_PREFIX'
  777.      If `GCC_EXEC_PREFIX' is set, it specifies a prefix to use in the
  778.      names of the subprograms executed by the compiler.  No slash is
  779.      added when this prefix is combined with the name of a subprogram,
  780.      but you can specify a prefix that ends with a slash if you wish.
  781.  
  782.      If GNU CC cannot find the subprogram using the specified prefix, it
  783.      tries looking in the usual places for the subprogram.
  784.  
  785.      Other prefixes specified with `-B' take precedence over this
  786.      prefix.
  787.  
  788.      This prefix is also used for finding files such as `crt0.o' that
  789.      are used for linking.
  790.  
  791.      In addition, the prefix is used in an unusual way in finding the
  792.      directories to search for header files.  For each of the standard
  793.      directories whose name normally begins with
  794.      `/usr/local/lib/gcc-lib' (more precisely, with the value of
  795.      `GCC_INCLUDE_DIR'), GNU CC tries replacing that beginning with the
  796.      specified prefix to produce an alternate directory name.  Thus,
  797.      with `-Bfoo/', GNU CC will search `foo/bar' where it would
  798.      normally search `/usr/local/lib/bar'.  These alternate directories
  799.      are searched first; the standard directories come next.
  800.  
  801. `COMPILER_PATH'
  802.      The value of `COMPILER_PATH' is a colon-separated list of
  803.      directories, much like `PATH'.  GNU CC tries the directories thus
  804.      specified when searching for subprograms, if it can't find the
  805.      subprograms using `GCC_EXEC_PREFIX'.
  806.  
  807. `LIBRARY_PATH'
  808.      The value of `LIBRARY_PATH' is a colon-separated list of
  809.      directories, much like `PATH'.  GNU CC tries the directories thus
  810.      specified when searching for special linker files, if it can't
  811.      find them using `GCC_EXEC_PREFIX'.  Linking using GNU CC also uses
  812.      these directories when searching for ordinary libraries for the
  813.      `-l' option (but directories specified with `-L' come first).
  814.  
  815. `C_INCLUDE_PATH'
  816. `CPLUS_INCLUDE_PATH'
  817. `OBJC_INCLUDE_PATH'
  818.      These environment variables pertain to particular languages.  Each
  819.      variable's value is a colon-separated list of directories, much
  820.      like `PATH'.  When GNU CC searches for header files, it tries the
  821.      directories listed in the variable for the language you are using,
  822.      after the directories specified with `-I' but before the standard
  823.      header file directories.
  824.  
  825. `DEPENDENCIES_OUTPUT'
  826.      If this variable is set, its value specifies how to output
  827.      dependencies for Make based on the header files processed by the
  828.      compiler.  This output looks much like the output from the `-M'
  829.      option (*note Preprocessor Options::.), but it goes to a separate
  830.      file, and is in addition to the usual results of compilation.
  831.  
  832.      The value of `DEPENDENCIES_OUTPUT' can be just a file name, in
  833.      which case the Make rules are written to that file, guessing the
  834.      target name from the source file name.  Or the value can have the
  835.      form `FILE TARGET', in which case the rules are written to file
  836.      FILE using TARGET as the target name.
  837.  
  838. 
  839. File: gcc.info,  Node: Running Protoize,  Prev: Environment Variables,  Up: Invoking GCC
  840.  
  841. Running Protoize
  842. ================
  843.  
  844.    The program `protoize' is an optional part of GNU C.  You can use it
  845. to add prototypes to a program, thus converting the program to ANSI C
  846. in one respect.  The companion program `unprotoize' does the reverse:
  847. it removes argument types from any prototypes that are found.
  848.  
  849.    When you run these programs, you must specify a set of source files
  850. as command line arguments.  The conversion programs start out by
  851. compiling these files to see what functions they define.  The
  852. information gathered about a file FOO is saved in a file named `FOO.X'.
  853.  
  854.    After scanning comes actual conversion.  The specified files are all
  855. eligible to be converted; any files they include (whether sources or
  856. just headers) are eligible as well.
  857.  
  858.    But not all the eligible files are converted.  By default,
  859. `protoize' and `unprotoize' convert only source and header files in the
  860. current directory.  You can specify additional directories whose files
  861. should be converted with the `-d DIRECTORY' option.  You can also
  862. specify particular files to exclude with the `-x FILE' option.  A file
  863. is converted if it is eligible, its directory name matches one of the
  864. specified directory names, and its name within the directory has not
  865. been excluded.
  866.  
  867.    Basic conversion with `protoize' consists of rewriting most function
  868. definitions and function declarations to specify the types of the
  869. arguments.  The only ones not rewritten are those for varargs functions.
  870.  
  871.    `protoize' optionally inserts prototype declarations at the
  872. beginning of the source file, to make them available for any calls that
  873. precede the function's definition.  Or it can insert prototype
  874. declarations with block scope in the blocks where undeclared functions
  875. are called.
  876.  
  877.    Basic conversion with `unprotoize' consists of rewriting most
  878. function declarations to remove any argument types, and rewriting
  879. function definitions to the old-style pre-ANSI form.
  880.  
  881.    Both conversion programs print a warning for any function
  882. declaration or definition that they can't convert.  You can suppress
  883. these warnings with `-q'.
  884.  
  885.    The output from `protoize' or `unprotoize' replaces the original
  886. source file.  The original file is renamed to a name ending with
  887. `.save'.  If the `.save' file already exists, then the source file is
  888. simply discarded.
  889.  
  890.    `protoize' and `unprotoize' both depend on GNU CC itself to scan the
  891. program and collect information about the functions it uses.  So
  892. neither of these programs will work until GNU CC is installed.
  893.  
  894.    Here is a table of the options you can use with `protoize' and
  895. `unprotoize'.  Each option works with both programs unless otherwise
  896. stated.
  897.  
  898. `-B DIRECTORY'
  899.      Look for the file `SYSCALLS.c.X' in DIRECTORY, instead of the
  900.      usual directory (normally `/usr/local/lib').  This file contains
  901.      prototype information about standard system functions.  This option
  902.      applies only to `protoize'.
  903.  
  904. `-c COMPILATION-OPTIONS'
  905.      Use  COMPILATION-OPTIONS as the options when running `gcc' to
  906.      produce the `.X' files.  The special option `-aux-info' is always
  907.      passed in addition, to tell `gcc' to write a `.X' file.
  908.  
  909.      Note that the compilation options must be given as a single
  910.      argument to `protoize' or `unprotoize'.  If you want to specify
  911.      several `gcc' options, you must quote the entire set of
  912.      compilation options to make them a single word in the shell.
  913.  
  914.      There are certain `gcc' arguments that you cannot use, because they
  915.      would produce the wrong kind of output.  These include `-g', `-O',
  916.      `-c', `-S', and `-o' If you include these in the
  917.      COMPILATION-OPTIONS, they are ignored.
  918.  
  919. `-C'
  920.      Rename files to end in `.C' instead of `.c'.  This is convenient
  921.      if you are converting a C program to C++.  This option applies
  922.      only to `protoize'.
  923.  
  924. `-g'
  925.      Add explicit global declarations.  This means inserting explicit
  926.      declarations at the beginning of each source file for each function
  927.      that is called in the file and was not declared.  These
  928.      declarations precede the first function definition that contains a
  929.      call to an undeclared function.  This option applies only to
  930.      `protoize'.
  931.  
  932. `-i STRING'
  933.      Indent old-style parameter declarations with the string STRING.
  934.      This option applies only to `protoize'.
  935.  
  936.      `unprotoize' converts prototyped function definitions to old-style
  937.      function definitions, where the arguments are declared between the
  938.      argument list and the initial `{'.  By default, `unprotoize' uses
  939.      five spaces as the indentation.  If you want to indent with just
  940.      one space instead, use `-i " "'.
  941.  
  942. `-k'
  943.      Keep the `.X' files.  Normally, they are deleted after conversion
  944.      is finished.
  945.  
  946. `-l'
  947.      Add explicit local declarations.  `protoize' with `-l' inserts a
  948.      prototype declaration for each function in each block which calls
  949.      the function without any declaration.  This option applies only to
  950.      `protoize'.
  951.  
  952. `-n'
  953.      Make no real changes.  This mode just prints information about the
  954.      conversions that would have been done without `-n'.
  955.  
  956. `-N'
  957.      Make no `.save' files.  The original files are simply deleted.
  958.      Use this option with caution.
  959.  
  960. `-p PROGRAM'
  961.      Use the program PROGRAM as the compiler.  Normally, the name `gcc'
  962.      is used.
  963.  
  964. `-q'
  965.      Work quietly.  Most warnings are suppressed.
  966.  
  967. `-v'
  968.      Print the version number, just like `-v' for `gcc'.
  969.  
  970.    If you need special compiler options to compile one of your program's
  971. source files, then you should generate that file's `.X' file specially,
  972. by running `gcc' on that source file with the appropriate options and
  973. the option `-aux-info'.  Then run `protoize' on the entire set of
  974. files.  `protoize' will use the existing `.X' file because it is newer
  975. than the source file.  For example:
  976.  
  977.      gcc -Dfoo=bar file1.c -aux-info
  978.      protoize *.c
  979.  
  980. You need to include the special files along with the rest in the
  981. `protoize' command, even though their `.X' files already exist, because
  982. otherwise they won't get converted.
  983.  
  984.    *Note Protoize Caveats::, for more information on how to use
  985. `protoize' successfully.
  986.  
  987.