home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / UNIX / GNU / gcc-2.7.2.3.1-I / info / gcc.info-5 < prev    next >
Encoding:
GNU Info File  |  1997-09-12  |  46.0 KB  |  1,147 lines

  1. This is Info file gcc.info, produced by Makeinfo version 1.67 from the
  2. input 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 59 Temple Place - Suite 330
  7. Boston, MA 02111-1307 USA
  8.  
  9.    Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995 Free Software
  10. Foundation, Inc.
  11.  
  12.    Permission is granted to make and distribute verbatim copies of this
  13. manual provided the copyright notice and this permission notice are
  14. preserved on all copies.
  15.  
  16.    Permission is granted to copy and distribute modified versions of
  17. this manual under the conditions for verbatim copying, provided also
  18. that the sections entitled "GNU General Public License," "Funding for
  19. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  20. included exactly as in the original, and provided that the entire
  21. resulting derived work is distributed under the terms of a permission
  22. notice identical to this one.
  23.  
  24.    Permission is granted to copy and distribute translations of this
  25. manual into another language, under the above conditions for modified
  26. versions, except that the sections entitled "GNU General Public
  27. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  28. `Look And Feel'", and this permission notice, may be included in
  29. translations approved by the Free Software Foundation instead of in the
  30. original English.
  31.  
  32. 
  33. File: gcc.info,  Node: RT Options,  Next: MIPS Options,  Prev: RS/6000 and PowerPC Options,  Up: Submodel Options
  34.  
  35. IBM RT Options
  36. --------------
  37.  
  38.    These `-m' options are defined for the IBM RT PC:
  39.  
  40. `-min-line-mul'
  41.      Use an in-line code sequence for integer multiplies.  This is the
  42.      default.
  43.  
  44. `-mcall-lib-mul'
  45.      Call `lmul$$' for integer multiples.
  46.  
  47. `-mfull-fp-blocks'
  48.      Generate full-size floating point data blocks, including the
  49.      minimum amount of scratch space recommended by IBM.  This is the
  50.      default.
  51.  
  52. `-mminimum-fp-blocks'
  53.      Do not include extra scratch space in floating point data blocks.
  54.      This results in smaller code, but slower execution, since scratch
  55.      space must be allocated dynamically.
  56.  
  57. `-mfp-arg-in-fpregs'
  58.      Use a calling sequence incompatible with the IBM calling
  59.      convention in which floating point arguments are passed in
  60.      floating point registers.  Note that `varargs.h' and `stdargs.h'
  61.      will not work with floating point operands if this option is
  62.      specified.
  63.  
  64. `-mfp-arg-in-gregs'
  65.      Use the normal calling convention for floating point arguments.
  66.      This is the default.
  67.  
  68. `-mhc-struct-return'
  69.      Return structures of more than one word in memory, rather than in a
  70.      register.  This provides compatibility with the MetaWare HighC (hc)
  71.      compiler.  Use the option `-fpcc-struct-return' for compatibility
  72.      with the Portable C Compiler (pcc).
  73.  
  74. `-mnohc-struct-return'
  75.      Return some structures of more than one word in registers, when
  76.      convenient.  This is the default.  For compatibility with the
  77.      IBM-supplied compilers, use the option `-fpcc-struct-return' or the
  78.      option `-mhc-struct-return'.
  79.  
  80. 
  81. File: gcc.info,  Node: MIPS Options,  Next: i386 Options,  Prev: RT Options,  Up: Submodel Options
  82.  
  83. MIPS Options
  84. ------------
  85.  
  86.    These `-m' options are defined for the MIPS family of computers:
  87.  
  88. `-mcpu=CPU TYPE'
  89.      Assume the defaults for the machine type CPU TYPE when scheduling
  90.      instructions.  The choices for CPU TYPE are `r2000', `r3000',
  91.      `r4000', `r4400', `r4600', and `r6000'.  While picking a specific
  92.      CPU TYPE will schedule things appropriately for that particular
  93.      chip, the compiler will not generate any code that does not meet
  94.      level 1 of the MIPS ISA (instruction set architecture) without the
  95.      `-mips2' or `-mips3' switches being used.
  96.  
  97. `-mips1'
  98.      Issue instructions from level 1 of the MIPS ISA.  This is the
  99.      default.  `r3000' is the default CPU TYPE at this ISA level.
  100.  
  101. `-mips2'
  102.      Issue instructions from level 2 of the MIPS ISA (branch likely,
  103.      square root instructions).  `r6000' is the default CPU TYPE at this
  104.      ISA level.
  105.  
  106. `-mips3'
  107.      Issue instructions from level 3 of the MIPS ISA (64 bit
  108.      instructions).  `r4000' is the default CPU TYPE at this ISA level.
  109.      This option does not change the sizes of any of the C data types.
  110.  
  111. `-mfp32'
  112.      Assume that 32 32-bit floating point registers are available.
  113.      This is the default.
  114.  
  115. `-mfp64'
  116.      Assume that 32 64-bit floating point registers are available.
  117.      This is the default when the `-mips3' option is used.
  118.  
  119. `-mgp32'
  120.      Assume that 32 32-bit general purpose registers are available.
  121.      This is the default.
  122.  
  123. `-mgp64'
  124.      Assume that 32 64-bit general purpose registers are available.
  125.      This is the default when the `-mips3' option is used.
  126.  
  127. `-mint64'
  128.      Types long, int, and pointer are 64 bits.  This works only if
  129.      `-mips3' is also specified.
  130.  
  131. `-mlong64'
  132.      Types long and pointer are 64 bits, and type int is 32 bits.  This
  133.      works only if `-mips3' is also specified.
  134.  
  135. `-mmips-as'
  136.      Generate code for the MIPS assembler, and invoke `mips-tfile' to
  137.      add normal debug information.  This is the default for all
  138.      platforms except for the OSF/1 reference platform, using the
  139.      OSF/rose object format.  If the either of the `-gstabs' or
  140.      `-gstabs+' switches are used, the `mips-tfile' program will
  141.      encapsulate the stabs within MIPS ECOFF.
  142.  
  143. `-mgas'
  144.      Generate code for the GNU assembler.  This is the default on the
  145.      OSF/1 reference platform, using the OSF/rose object format.
  146.  
  147. `-mrnames'
  148. `-mno-rnames'
  149.      The `-mrnames' switch says to output code using the MIPS software
  150.      names for the registers, instead of the hardware names (ie, A0
  151.      instead of $4).  The only known assembler that supports this option
  152.      is the Algorithmics assembler.
  153.  
  154. `-mgpopt'
  155. `-mno-gpopt'
  156.      The `-mgpopt' switch says to write all of the data declarations
  157.      before the instructions in the text section, this allows the MIPS
  158.      assembler to generate one word memory references instead of using
  159.      two words for short global or static data items.  This is on by
  160.      default if optimization is selected.
  161.  
  162. `-mstats'
  163. `-mno-stats'
  164.      For each non-inline function processed, the `-mstats' switch
  165.      causes the compiler to emit one line to the standard error file to
  166.      print statistics about the program (number of registers saved,
  167.      stack size, etc.).
  168.  
  169. `-mmemcpy'
  170. `-mno-memcpy'
  171.      The `-mmemcpy' switch makes all block moves call the appropriate
  172.      string function (`memcpy' or `bcopy') instead of possibly
  173.      generating inline code.
  174.  
  175. `-mmips-tfile'
  176. `-mno-mips-tfile'
  177.      The `-mno-mips-tfile' switch causes the compiler not postprocess
  178.      the object file with the `mips-tfile' program, after the MIPS
  179.      assembler has generated it to add debug support.  If `mips-tfile'
  180.      is not run, then no local variables will be available to the
  181.      debugger.  In addition, `stage2' and `stage3' objects will have
  182.      the temporary file names passed to the assembler embedded in the
  183.      object file, which means the objects will not compare the same.
  184.      The `-mno-mips-tfile' switch should only be used when there are
  185.      bugs in the `mips-tfile' program that prevents compilation.
  186.  
  187. `-msoft-float'
  188.      Generate output containing library calls for floating point.
  189.      *Warning:* the requisite libraries are not part of GNU CC.
  190.      Normally the facilities of the machine's usual C compiler are
  191.      used, but this can't be done directly in cross-compilation.  You
  192.      must make your own arrangements to provide suitable library
  193.      functions for cross-compilation.
  194.  
  195. `-mhard-float'
  196.      Generate output containing floating point instructions.  This is
  197.      the default if you use the unmodified sources.
  198.  
  199. `-mabicalls'
  200. `-mno-abicalls'
  201.      Emit (or do not emit) the pseudo operations `.abicalls',
  202.      `.cpload', and `.cprestore' that some System V.4 ports use for
  203.      position independent code.
  204.  
  205. `-mlong-calls'
  206. `-mno-long-calls'
  207.      Do all calls with the `JALR' instruction, which requires loading
  208.      up a function's address into a register before the call.  You need
  209.      to use this switch, if you call outside of the current 512
  210.      megabyte segment to functions that are not through pointers.
  211.  
  212. `-mhalf-pic'
  213. `-mno-half-pic'
  214.      Put pointers to extern references into the data section and load
  215.      them up, rather than put the references in the text section.
  216.  
  217. `-membedded-pic'
  218. `-mno-embedded-pic'
  219.      Generate PIC code suitable for some embedded systems.  All calls
  220.      are made using PC relative address, and all data is addressed
  221.      using the $gp register.  This requires GNU as and GNU ld which do
  222.      most of the work.
  223.  
  224. `-membedded-data'
  225. `-mno-embedded-data'
  226.      Allocate variables to the read-only data section first if
  227.      possible, then next in the small data section if possible,
  228.      otherwise in data.  This gives slightly slower code than the
  229.      default, but reduces the amount of RAM required when executing,
  230.      and thus may be preferred for some embedded systems.
  231.  
  232. `-msingle-float'
  233. `-mdouble-float'
  234.      The `-msingle-float' switch tells gcc to assume that the floating
  235.      point coprocessor only supports single precision operations, as on
  236.      the `r4650' chip.  The `-mdouble-float' switch permits gcc to use
  237.      double precision operations.  This is the default.
  238.  
  239. `-mmad'
  240. `-mno-mad'
  241.      Permit use of the `mad', `madu' and `mul' instructions, as on the
  242.      `r4650' chip.
  243.  
  244. `-m4650'
  245.      Turns on `-msingle-float', `-mmad', and, at least for now,
  246.      `-mcpu=r4650'.
  247.  
  248. `-EL'
  249.      Compile code for the processor in little endian mode.  The
  250.      requisite libraries are assumed to exist.
  251.  
  252. `-EB'
  253.      Compile code for the processor in big endian mode.  The requisite
  254.      libraries are assumed to exist.
  255.  
  256. `-G NUM'
  257.      Put global and static items less than or equal to NUM bytes into
  258.      the small data or bss sections instead of the normal data or bss
  259.      section.  This allows the assembler to emit one word memory
  260.      reference instructions based on the global pointer (GP or $28),
  261.      instead of the normal two words used.  By default, NUM is 8 when
  262.      the MIPS assembler is used, and 0 when the GNU assembler is used.
  263.      The `-G NUM' switch is also passed to the assembler and linker.
  264.      All modules should be compiled with the same `-G NUM' value.
  265.  
  266. `-nocpp'
  267.      Tell the MIPS assembler to not run it's preprocessor over user
  268.      assembler files (with a `.s' suffix) when assembling them.
  269.  
  270.    These options are defined by the macro `TARGET_SWITCHES' in the
  271. machine description.  The default for the options is also defined by
  272. that macro, which enables you to change the defaults.
  273.  
  274. 
  275. File: gcc.info,  Node: i386 Options,  Next: HPPA Options,  Prev: MIPS Options,  Up: Submodel Options
  276.  
  277. Intel 386 Options
  278. -----------------
  279.  
  280.    These `-m' options are defined for the i386 family of computers:
  281.  
  282. `-m486'
  283. `-m386'
  284.      Control whether or not code is optimized for a 486 instead of an
  285.      386.  Code generated for an 486 will run on a 386 and vice versa.
  286.  
  287. `-mieee-fp'
  288. `-mno-ieee-fp'
  289.      Control whether or not the compiler uses IEEE floating point
  290.      comparisons.  These handle correctly the case where the result of a
  291.      comparison is unordered.
  292.  
  293. `-msoft-float'
  294.      Generate output containing library calls for floating point.
  295.      *Warning:* the requisite libraries are not part of GNU CC.
  296.      Normally the facilities of the machine's usual C compiler are
  297.      used, but this can't be done directly in cross-compilation.  You
  298.      must make your own arrangements to provide suitable library
  299.      functions for cross-compilation.
  300.  
  301.      On machines where a function returns floating point results in the
  302.      80387 register stack, some floating point opcodes may be emitted
  303.      even if `-msoft-float' is used.
  304.  
  305. `-mno-fp-ret-in-387'
  306.      Do not use the FPU registers for return values of functions.
  307.  
  308.      The usual calling convention has functions return values of types
  309.      `float' and `double' in an FPU register, even if there is no FPU.
  310.      The idea is that the operating system should emulate an FPU.
  311.  
  312.      The option `-mno-fp-ret-in-387' causes such values to be returned
  313.      in ordinary CPU registers instead.
  314.  
  315. `-mno-fancy-math-387'
  316.      Some 387 emulators do not support the `sin', `cos' and `sqrt'
  317.      instructions for the 387.  Specify this option to avoid generating
  318.      those instructions. This option is the default on FreeBSD.  As of
  319.      revision 2.6.1, these instructions are not generated unless you
  320.      also use the `-ffast-math' switch.
  321.  
  322. `-malign-double'
  323. `-mno-align-double'
  324.      Control whether GNU CC aligns `double', `long double', and `long
  325.      long' variables on a two word boundary or a one word boundary.
  326.      Aligning `double' variables on a two word boundary will produce
  327.      code that runs somewhat faster on a `Pentium' at the expense of
  328.      more memory.
  329.  
  330.      *Warning:* if you use the `-malign-double' switch, structures
  331.      containing the above types will be aligned differently than the
  332.      published application binary interface specifications for the 386.
  333.  
  334. `-msvr3-shlib'
  335. `-mno-svr3-shlib'
  336.      Control whether GNU CC places uninitialized locals into `bss' or
  337.      `data'.  `-msvr3-shlib' places these locals into `bss'.  These
  338.      options are meaningful only on System V Release 3.
  339.  
  340. `-mno-wide-multiply'
  341. `-mwide-multiply'
  342.      Control whether GNU CC uses the `mul' and `imul' that produce 64
  343.      bit results in `eax:edx' from 32 bit operands to do `long long'
  344.      multiplies and 32-bit division by constants.
  345.  
  346. `-mrtd'
  347.      Use a different function-calling convention, in which functions
  348.      that take a fixed number of arguments return with the `ret' NUM
  349.      instruction, which pops their arguments while returning.  This
  350.      saves one instruction in the caller since there is no need to pop
  351.      the arguments there.
  352.  
  353.      You can specify that an individual function is called with this
  354.      calling sequence with the function attribute `stdcall'.  You can
  355.      also override the `-mrtd' option by using the function attribute
  356.      `cdecl'. *Note Function Attributes::
  357.  
  358.      *Warning:* this calling convention is incompatible with the one
  359.      normally used on Unix, so you cannot use it if you need to call
  360.      libraries compiled with the Unix compiler.
  361.  
  362.      Also, you must provide function prototypes for all functions that
  363.      take variable numbers of arguments (including `printf'); otherwise
  364.      incorrect code will be generated for calls to those functions.
  365.  
  366.      In addition, seriously incorrect code will result if you call a
  367.      function with too many arguments.  (Normally, extra arguments are
  368.      harmlessly ignored.)
  369.  
  370. `-mreg-alloc=REGS'
  371.      Control the default allocation order of integer registers.  The
  372.      string REGS is a series of letters specifying a register.  The
  373.      supported letters are: `a' allocate EAX; `b' allocate EBX; `c'
  374.      allocate ECX; `d' allocate EDX; `S' allocate ESI; `D' allocate
  375.      EDI; `B' allocate EBP.
  376.  
  377. `-mregparm=NUM'
  378.      Control how many registers are used to pass integer arguments.  By
  379.      default, no registers are used to pass arguments, and at most 3
  380.      registers can be used.  You can control this behavior for a
  381.      specific function by using the function attribute `regparm'.
  382.      *Note Function Attributes::
  383.  
  384.      *Warning:* if you use this switch, and NUM is nonzero, then you
  385.      must build all modules with the same value, including any
  386.      libraries.  This includes the system libraries and startup modules.
  387.  
  388. `-malign-loops=NUM'
  389.      Align loops to a 2 raised to a NUM byte boundary.  If
  390.      `-malign-loops' is not specified, the default is 2.
  391.  
  392. `-malign-jumps=NUM'
  393.      Align instructions that are only jumped to to a 2 raised to a NUM
  394.      byte boundary.  If `-malign-jumps' is not specified, the default is
  395.      2 if optimizing for a 386, and 4 if optimizing for a 486.
  396.  
  397. `-malign-functions=NUM'
  398.      Align the start of functions to a 2 raised to NUM byte boundary.
  399.      If `-malign-jumps' is not specified, the default is 2 if optimizing
  400.      for a 386, and 4 if optimizing for a 486.
  401.  
  402. 
  403. File: gcc.info,  Node: HPPA Options,  Next: Intel 960 Options,  Prev: i386 Options,  Up: Submodel Options
  404.  
  405. HPPA Options
  406. ------------
  407.  
  408.    These `-m' options are defined for the HPPA family of computers:
  409.  
  410. `-mpa-risc-1-0'
  411.      Generate code for a PA 1.0 processor.
  412.  
  413. `-mpa-risc-1-1'
  414.      Generate code for a PA 1.1 processor.
  415.  
  416. `-mjump-in-delay'
  417.      Fill delay slots of function calls with unconditional jump
  418.      instructions by modifying the return pointer for the function call
  419.      to be the target of the conditional jump.
  420.  
  421. `-mmillicode-long-calls'
  422.      Generate code which assumes millicode routines can not be reached
  423.      by the standard millicode call sequence, linker-generated
  424.      long-calls, or linker-modified millicode calls.  In practice this
  425.      should only be needed for dynamicly linked executables with
  426.      extremely large SHLIB_INFO sections.
  427.  
  428. `-mdisable-fpregs'
  429.      Prevent floating point registers from being used in any manner.
  430.      This is necessary for compiling kernels which perform lazy context
  431.      switching of floating point registers.  If you use this option and
  432.      attempt to perform floating point operations, the compiler will
  433.      abort.
  434.  
  435. `-mdisable-indexing'
  436.      Prevent the compiler from using indexing address modes.  This
  437.      avoids some rather obscure problems when compiling MIG generated
  438.      code under MACH.
  439.  
  440. `-mfast-indirect-calls'
  441.      Generate code which performs faster indirect calls.  Such code is
  442.      suitable for kernels and for static linking.  The fast indirect
  443.      call code will fail miserably if it's part of a dynamically linked
  444.      executable and in the presense of nested functions.
  445.  
  446. `-mportable-runtime'
  447.      Use the portable calling conventions proposed by HP for ELF
  448.      systems.
  449.  
  450. `-mgas'
  451.      Enable the use of assembler directives only GAS understands.
  452.  
  453. `-mschedule=CPU TYPE'
  454.      Schedule code according to the constraints for the machine type
  455.      CPU TYPE.  The choices for CPU TYPE are `700' for 7N0 machines,
  456.      `7100' for 7N5 machines, and `7100' for 7N2 machines.  `700' is
  457.      the default for CPU TYPE.
  458.  
  459.      Note the `7100LC' scheduling information is incomplete and using
  460.      `7100LC' often leads to bad schedules.  For now it's probably best
  461.      to use `7100' instead of `7100LC' for the 7N2 machines.
  462.  
  463. `-msoft-float'
  464.      Generate output containing library calls for floating point.
  465.      *Warning:* the requisite libraries are not available for all HPPA
  466.      targets.  Normally the facilities of the machine's usual C
  467.      compiler are used, but this cannot be done directly in
  468.      cross-compilation.  You must make your own arrangements to provide
  469.      suitable library functions for cross-compilation.  The embedded
  470.      target `hppa1.1-*-pro' does provide software floating point
  471.      support.
  472.  
  473.      `-msoft-float' changes the calling convention in the output file;
  474.      therefore, it is only useful if you compile *all* of a program with
  475.      this option.  In particular, you need to compile `libgcc.a', the
  476.      library that comes with GNU CC, with `-msoft-float' in order for
  477.      this to work.
  478.  
  479. 
  480. File: gcc.info,  Node: Intel 960 Options,  Next: DEC Alpha Options,  Prev: HPPA Options,  Up: Submodel Options
  481.  
  482. Intel 960 Options
  483. -----------------
  484.  
  485.    These `-m' options are defined for the Intel 960 implementations:
  486.  
  487. `-mCPU TYPE'
  488.      Assume the defaults for the machine type CPU TYPE for some of the
  489.      other options, including instruction scheduling, floating point
  490.      support, and addressing modes.  The choices for CPU TYPE are `ka',
  491.      `kb', `mc', `ca', `cf', `sa', and `sb'.  The default is `kb'.
  492.  
  493. `-mnumerics'
  494. `-msoft-float'
  495.      The `-mnumerics' option indicates that the processor does support
  496.      floating-point instructions.  The `-msoft-float' option indicates
  497.      that floating-point support should not be assumed.
  498.  
  499. `-mleaf-procedures'
  500. `-mno-leaf-procedures'
  501.      Do (or do not) attempt to alter leaf procedures to be callable
  502.      with the `bal' instruction as well as `call'.  This will result in
  503.      more efficient code for explicit calls when the `bal' instruction
  504.      can be substituted by the assembler or linker, but less efficient
  505.      code in other cases, such as calls via function pointers, or using
  506.      a linker that doesn't support this optimization.
  507.  
  508. `-mtail-call'
  509. `-mno-tail-call'
  510.      Do (or do not) make additional attempts (beyond those of the
  511.      machine-independent portions of the compiler) to optimize
  512.      tail-recursive calls into branches.  You may not want to do this
  513.      because the detection of cases where this is not valid is not
  514.      totally complete.  The default is `-mno-tail-call'.
  515.  
  516. `-mcomplex-addr'
  517. `-mno-complex-addr'
  518.      Assume (or do not assume) that the use of a complex addressing
  519.      mode is a win on this implementation of the i960.  Complex
  520.      addressing modes may not be worthwhile on the K-series, but they
  521.      definitely are on the C-series.  The default is currently
  522.      `-mcomplex-addr' for all processors except the CB and CC.
  523.  
  524. `-mcode-align'
  525. `-mno-code-align'
  526.      Align code to 8-byte boundaries for faster fetching (or don't
  527.      bother).  Currently turned on by default for C-series
  528.      implementations only.
  529.  
  530. `-mic-compat'
  531. `-mic2.0-compat'
  532. `-mic3.0-compat'
  533.      Enable compatibility with iC960 v2.0 or v3.0.
  534.  
  535. `-masm-compat'
  536. `-mintel-asm'
  537.      Enable compatibility with the iC960 assembler.
  538.  
  539. `-mstrict-align'
  540. `-mno-strict-align'
  541.      Do not permit (do permit) unaligned accesses.
  542.  
  543. `-mold-align'
  544.      Enable structure-alignment compatibility with Intel's gcc release
  545.      version 1.3 (based on gcc 1.37).  Currently this is buggy in that
  546.      `#pragma align 1' is always assumed as well, and cannot be turned
  547.      off.
  548.  
  549. 
  550. File: gcc.info,  Node: DEC Alpha Options,  Next: Clipper Options,  Prev: Intel 960 Options,  Up: Submodel Options
  551.  
  552. DEC Alpha Options
  553. -----------------
  554.  
  555.    These `-m' options are defined for the DEC Alpha implementations:
  556.  
  557. `-mno-soft-float'
  558. `-msoft-float'
  559.      Use (do not use) the hardware floating-point instructions for
  560.      floating-point operations.  When `-msoft-float' is specified,
  561.      functions in `libgcc1.c' will be used to perform floating-point
  562.      operations.  Unless they are replaced by routines that emulate the
  563.      floating-point operations, or compiled in such a way as to call
  564.      such emulations routines, these routines will issue floating-point
  565.      operations.   If you are compiling for an Alpha without
  566.      floating-point operations, you must ensure that the library is
  567.      built so as not to call them.
  568.  
  569.      Note that Alpha implementations without floating-point operations
  570.      are required to have floating-point registers.
  571.  
  572. `-mfp-reg'
  573. `-mno-fp-regs'
  574.      Generate code that uses (does not use) the floating-point register
  575.      set.  `-mno-fp-regs' implies `-msoft-float'.  If the floating-point
  576.      register set is not used, floating point operands are passed in
  577.      integer registers as if they were integers and floating-point
  578.      results are passed in $0 instead of $f0.  This is a non-standard
  579.      calling sequence, so any function with a floating-point argument
  580.      or return value called by code compiled with `-mno-fp-regs' must
  581.      also be compiled with that option.
  582.  
  583.      A typical use of this option is building a kernel that does not
  584.      use, and hence need not save and restore, any floating-point
  585.      registers.
  586.  
  587. 
  588. File: gcc.info,  Node: Clipper Options,  Next: H8/300 Options,  Prev: DEC Alpha Options,  Up: Submodel Options
  589.  
  590. Clipper Options
  591. ---------------
  592.  
  593.    These `-m' options are defined for the Clipper implementations:
  594.  
  595. `-mc300'
  596.      Produce code for a C300 Clipper processor. This is the default.
  597.  
  598. `-mc400'
  599.      Produce code for a C400 Clipper processor i.e. use floating point
  600.      registers f8..f15.
  601.  
  602. 
  603. File: gcc.info,  Node: H8/300 Options,  Next: System V Options,  Prev: Clipper Options,  Up: Submodel Options
  604.  
  605. H8/300 Options
  606. --------------
  607.  
  608.    These `-m' options are defined for the H8/300 implementations:
  609.  
  610. `-mrelax'
  611.      Shorten some address references at link time, when possible; uses
  612.      the linker option `-relax'.  *Note `ld' and the H8/300:
  613.      (ld.info)H8/300, for a fuller description.
  614.  
  615. `-mh'
  616.      Generate code for the H8/300H.
  617.  
  618. 
  619. File: gcc.info,  Node: System V Options,  Prev: H8/300 Options,  Up: Submodel Options
  620.  
  621. Options for System V
  622. --------------------
  623.  
  624.    These additional options are available on System V Release 4 for
  625. compatibility with other compilers on those systems:
  626.  
  627. `-Qy'
  628.      Identify the versions of each tool used by the compiler, in a
  629.      `.ident' assembler directive in the output.
  630.  
  631. `-Qn'
  632.      Refrain from adding `.ident' directives to the output file (this is
  633.      the default).
  634.  
  635. `-YP,DIRS'
  636.      Search the directories DIRS, and no others, for libraries
  637.      specified with `-l'.
  638.  
  639. `-Ym,DIR'
  640.      Look in the directory DIR to find the M4 preprocessor.  The
  641.      assembler uses this option.
  642.  
  643. 
  644. File: gcc.info,  Node: Code Gen Options,  Next: Environment Variables,  Prev: Submodel Options,  Up: Invoking GCC
  645.  
  646. Options for Code Generation Conventions
  647. =======================================
  648.  
  649.    These machine-independent options control the interface conventions
  650. used in code generation.
  651.  
  652.    Most of them have both positive and negative forms; the negative form
  653. of `-ffoo' would be `-fno-foo'.  In the table below, only one of the
  654. forms is listed--the one which is not the default.  You can figure out
  655. the other form by either removing `no-' or adding it.
  656.  
  657. `-fpcc-struct-return'
  658.      Return "short" `struct' and `union' values in memory like longer
  659.      ones, rather than in registers.  This convention is less
  660.      efficient, but it has the advantage of allowing intercallability
  661.      between GNU CC-compiled files and files compiled with other
  662.      compilers.
  663.  
  664.      The precise convention for returning structures in memory depends
  665.      on the target configuration macros.
  666.  
  667.      Short structures and unions are those whose size and alignment
  668.      match that of some integer type.
  669.  
  670. `-freg-struct-return'
  671.      Use the convention that `struct' and `union' values are returned
  672.      in registers when possible.  This is more efficient for small
  673.      structures than `-fpcc-struct-return'.
  674.  
  675.      If you specify neither `-fpcc-struct-return' nor its contrary
  676.      `-freg-struct-return', GNU CC defaults to whichever convention is
  677.      standard for the target.  If there is no standard convention, GNU
  678.      CC defaults to `-fpcc-struct-return', except on targets where GNU
  679.      CC is the principal compiler.  In those cases, we can choose the
  680.      standard, and we chose the more efficient register return
  681.      alternative.
  682.  
  683. `-fshort-enums'
  684.      Allocate to an `enum' type only as many bytes as it needs for the
  685.      declared range of possible values.  Specifically, the `enum' type
  686.      will be equivalent to the smallest integer type which has enough
  687.      room.
  688.  
  689. `-fshort-double'
  690.      Use the same size for `double' as for `float'.
  691.  
  692. `-fshared-data'
  693.      Requests that the data and non-`const' variables of this
  694.      compilation be shared data rather than private data.  The
  695.      distinction makes sense only on certain operating systems, where
  696.      shared data is shared between processes running the same program,
  697.      while private data exists in one copy per process.
  698.  
  699. `-fno-common'
  700.      Allocate even uninitialized global variables in the bss section of
  701.      the object file, rather than generating them as common blocks.
  702.      This has the effect that if the same variable is declared (without
  703.      `extern') in two different compilations, you will get an error
  704.      when you link them.  The only reason this might be useful is if
  705.      you wish to verify that the program will work on other systems
  706.      which always work this way.
  707.  
  708. `-fno-ident'
  709.      Ignore the `#ident' directive.
  710.  
  711. `-fno-gnu-linker'
  712.      Do not output global initializations (such as C++ constructors and
  713.      destructors) in the form used by the GNU linker (on systems where
  714.      the GNU linker is the standard method of handling them).  Use this
  715.      option when you want to use a non-GNU linker, which also requires
  716.      using the `collect2' program to make sure the system linker
  717.      includes constructors and destructors.  (`collect2' is included in
  718.      the GNU CC distribution.)  For systems which *must* use
  719.      `collect2', the compiler driver `gcc' is configured to do this
  720.      automatically.
  721.  
  722. `-finhibit-size-directive'
  723.      Don't output a `.size' assembler directive, or anything else that
  724.      would cause trouble if the function is split in the middle, and the
  725.      two halves are placed at locations far apart in memory.  This
  726.      option is used when compiling `crtstuff.c'; you should not need to
  727.      use it for anything else.
  728.  
  729. `-fverbose-asm'
  730.      Put extra commentary information in the generated assembly code to
  731.      make it more readable.  This option is generally only of use to
  732.      those who actually need to read the generated assembly code
  733.      (perhaps while debugging the compiler itself).
  734.  
  735. `-fvolatile'
  736.      Consider all memory references through pointers to be volatile.
  737.  
  738. `-fvolatile-global'
  739.      Consider all memory references to extern and global data items to
  740.      be volatile.
  741.  
  742. `-fpic'
  743.      Generate position-independent code (PIC) suitable for use in a
  744.      shared library, if supported for the target machine.  Such code
  745.      accesses all constant addresses through a global offset table
  746.      (GOT).  If the GOT size for the linked executable exceeds a
  747.      machine-specific maximum size, you get an error message from the
  748.      linker indicating that `-fpic' does not work; in that case,
  749.      recompile with `-fPIC' instead.  (These maximums are 16k on the
  750.      m88k, 8k on the Sparc, and 32k on the m68k and RS/6000.  The 386
  751.      has no such limit.)
  752.  
  753.      Position-independent code requires special support, and therefore
  754.      works only on certain machines.  For the 386, GNU CC supports PIC
  755.      for System V but not for the Sun 386i.  Code generated for the IBM
  756.      RS/6000 is always position-independent.
  757.  
  758.      The GNU assembler does not fully support PIC.  Currently, you must
  759.      use some other assembler in order for PIC to work.  We would
  760.      welcome volunteers to upgrade GAS to handle this; the first part
  761.      of the job is to figure out what the assembler must do differently.
  762.  
  763. `-fPIC'
  764.      If supported for the target machine, emit position-independent
  765.      code, suitable for dynamic linking and avoiding any limit on the
  766.      size of the global offset table.  This option makes a difference
  767.      on the m68k, m88k and the Sparc.
  768.  
  769.      Position-independent code requires special support, and therefore
  770.      works only on certain machines.
  771.  
  772. `-ffixed-REG'
  773.      Treat the register named REG as a fixed register; generated code
  774.      should never refer to it (except perhaps as a stack pointer, frame
  775.      pointer or in some other fixed role).
  776.  
  777.      REG must be the name of a register.  The register names accepted
  778.      are machine-specific and are defined in the `REGISTER_NAMES' macro
  779.      in the machine description macro file.
  780.  
  781.      This flag does not have a negative form, because it specifies a
  782.      three-way choice.
  783.  
  784. `-fcall-used-REG'
  785.      Treat the register named REG as an allocatable register that is
  786.      clobbered by function calls.  It may be allocated for temporaries
  787.      or variables that do not live across a call.  Functions compiled
  788.      this way will not save and restore the register REG.
  789.  
  790.      Use of this flag for a register that has a fixed pervasive role in
  791.      the machine's execution model, such as the stack pointer or frame
  792.      pointer, will produce disastrous results.
  793.  
  794.      This flag does not have a negative form, because it specifies a
  795.      three-way choice.
  796.  
  797. `-fcall-saved-REG'
  798.      Treat the register named REG as an allocatable register saved by
  799.      functions.  It may be allocated even for temporaries or variables
  800.      that live across a call.  Functions compiled this way will save
  801.      and restore the register REG if they use it.
  802.  
  803.      Use of this flag for a register that has a fixed pervasive role in
  804.      the machine's execution model, such as the stack pointer or frame
  805.      pointer, will produce disastrous results.
  806.  
  807.      A different sort of disaster will result from the use of this flag
  808.      for a register in which function values may be returned.
  809.  
  810.      This flag does not have a negative form, because it specifies a
  811.      three-way choice.
  812.  
  813. `-fpack-struct'
  814.      Pack all structure members together without holes.  Usually you
  815.      would not want to use this option, since it makes the code
  816.      suboptimal, and the offsets of structure members won't agree with
  817.      system libraries.
  818.  
  819. `-fstack-check'
  820.      Generate code to verify that you do not go beyond the boundary of
  821.      the stack.  You should specify this flag if you are running in an
  822.      environment with multiple threads, but only rarely need to specify
  823.      it in a single-threaded environment since stack overflow is
  824.      automatically detected on nearly all systems if there is only one
  825.      stack.
  826.  
  827. `+e0'
  828. `+e1'
  829.      Control whether virtual function definitions in classes are used to
  830.      generate code, or only to define interfaces for their callers.
  831.      (C++ only).
  832.  
  833.      These options are provided for compatibility with `cfront' 1.x
  834.      usage; the recommended alternative GNU C++ usage is in flux.
  835.      *Note Declarations and Definitions in One Header: C++ Interface.
  836.  
  837.      With `+e0', virtual function definitions in classes are declared
  838.      `extern'; the declaration is used only as an interface
  839.      specification, not to generate code for the virtual functions (in
  840.      this compilation).
  841.  
  842.      With `+e1', G++ actually generates the code implementing virtual
  843.      functions defined in the code, and makes them publicly visible.
  844.  
  845. `-fargument-alias'
  846. `-fargument-noalias'
  847. `-fargument-noalias-global'
  848.      Specify the possible relationships among parameters and between
  849.      parameters and global data.
  850.  
  851.      `-fargument-alias' specifies that arguments (parameters) may alias
  852.      each other and may alias global storage.  `-fargument-noalias'
  853.      specifies that arguments do not alias each other, but may alias
  854.      global storage.  `-fargument-noalias-global' specifies that
  855.      arguments do not alias each other and do not alias global storage.
  856.  
  857.      For code written in C, C++, and Objective-C, `-fargument-alias' is
  858.      the default.  For code written in Fortran,
  859.      `-fargument-noalias-global' is the default, though this is
  860.      pertinent only on systems where `g77' is installed.  (See the
  861.      documentation for other compilers for information on the defaults
  862.      for their respective languages.)
  863.  
  864.      Normally, `gcc' assumes that a write through a pointer passed as a
  865.      parameter to the current function might modify a value pointed to
  866.      by another pointer passed as a parameter, or in global storage.
  867.  
  868.      For example, consider this code:
  869.  
  870.           void x(int *i, int *j)
  871.           {
  872.             extern int k;
  873.           
  874.             ++*i;
  875.             ++*j;
  876.             ++k;
  877.           }
  878.  
  879.      When compiling the above function, `gcc' assumes that `i' might be
  880.      a pointer to the same variable as `j', and that either `i', `j',
  881.      or both might be a pointer to `k'.
  882.  
  883.      Therefore, `gcc' does not assume it can generate code to read
  884.      `*i', `*j', and `k' into separate registers, increment each
  885.      register, then write the incremented values back out.
  886.  
  887.      Instead, `gcc' must generate code that reads `*i', increments it,
  888.      and writes it back before reading `*j', in case `i' and `j' are
  889.      aliased, and, similarly, that writes `*j' before reading `k'.  The
  890.      result is code that, on many systems, takes longer to execute, due
  891.      to the way many processors schedule instruction execution.
  892.  
  893.      Compiling the above code with the `-fargument-noalias' option
  894.      allows `gcc' to assume that `i' and `j' do not alias each other,
  895.      but either might alias `k'.
  896.  
  897.      Compiling the above code with the `-fargument-noalias-global'
  898.      option allows `gcc' to assume that no combination of `i', `j', and
  899.      `k' are aliases for each other.
  900.  
  901.      *Note:* Use the `-fargument-noalias' and
  902.      `-fargument-noalias-global' options with care.  While they can
  903.      result in faster executables, they can also result in executables
  904.      with subtle bugs, bugs that show up only when compiled for
  905.      specific target systems, or bugs that show up only when compiled
  906.      by specific versions of `g77'.
  907.  
  908. 
  909. File: gcc.info,  Node: Environment Variables,  Next: Running Protoize,  Prev: Code Gen Options,  Up: Invoking GCC
  910.  
  911. Environment Variables Affecting GNU CC
  912. ======================================
  913.  
  914.    This section describes several environment variables that affect how
  915. GNU CC operates.  They work by specifying directories or prefixes to use
  916. when searching for various kinds of files.
  917.  
  918.    Note that you can also specify places to search using options such as
  919. `-B', `-I' and `-L' (*note Directory Options::.).  These take
  920. precedence over places specified using environment variables, which in
  921. turn take precedence over those specified by the configuration of GNU
  922. CC.  *Note Driver::.
  923.  
  924. `TMPDIR'
  925.      If `TMPDIR' is set, it specifies the directory to use for temporary
  926.      files.  GNU CC uses temporary files to hold the output of one
  927.      stage of compilation which is to be used as input to the next
  928.      stage: for example, the output of the preprocessor, which is the
  929.      input to the compiler proper.
  930.  
  931. `GCC_EXEC_PREFIX'
  932.      If `GCC_EXEC_PREFIX' is set, it specifies a prefix to use in the
  933.      names of the subprograms executed by the compiler.  No slash is
  934.      added when this prefix is combined with the name of a subprogram,
  935.      but you can specify a prefix that ends with a slash if you wish.
  936.  
  937.      If GNU CC cannot find the subprogram using the specified prefix, it
  938.      tries looking in the usual places for the subprogram.
  939.  
  940.      The default value of `GCC_EXEC_PREFIX' is `PREFIX/lib/gcc-lib/'
  941.      where PREFIX is the value of `prefix' when you ran the `configure'
  942.      script.
  943.  
  944.      Other prefixes specified with `-B' take precedence over this
  945.      prefix.
  946.  
  947.      This prefix is also used for finding files such as `crt0.o' that
  948.      are used for linking.
  949.  
  950.      In addition, the prefix is used in an unusual way in finding the
  951.      directories to search for header files.  For each of the standard
  952.      directories whose name normally begins with
  953.      `/usr/local/lib/gcc-lib' (more precisely, with the value of
  954.      `GCC_INCLUDE_DIR'), GNU CC tries replacing that beginning with the
  955.      specified prefix to produce an alternate directory name.  Thus,
  956.      with `-Bfoo/', GNU CC will search `foo/bar' where it would
  957.      normally search `/usr/local/lib/bar'.  These alternate directories
  958.      are searched first; the standard directories come next.
  959.  
  960. `COMPILER_PATH'
  961.      The value of `COMPILER_PATH' is a colon-separated list of
  962.      directories, much like `PATH'.  GNU CC tries the directories thus
  963.      specified when searching for subprograms, if it can't find the
  964.      subprograms using `GCC_EXEC_PREFIX'.
  965.  
  966. `LIBRARY_PATH'
  967.      The value of `LIBRARY_PATH' is a colon-separated list of
  968.      directories, much like `PATH'.  When configured as a native
  969.      compiler, GNU CC tries the directories thus specified when
  970.      searching for special linker files, if it can't find them using
  971.      `GCC_EXEC_PREFIX'.  Linking using GNU CC also uses these
  972.      directories when searching for ordinary libraries for the `-l'
  973.      option (but directories specified with `-L' come first).
  974.  
  975. `C_INCLUDE_PATH'
  976. `CPLUS_INCLUDE_PATH'
  977. `OBJC_INCLUDE_PATH'
  978.      These environment variables pertain to particular languages.  Each
  979.      variable's value is a colon-separated list of directories, much
  980.      like `PATH'.  When GNU CC searches for header files, it tries the
  981.      directories listed in the variable for the language you are using,
  982.      after the directories specified with `-I' but before the standard
  983.      header file directories.
  984.  
  985. `DEPENDENCIES_OUTPUT'
  986.      If this variable is set, its value specifies how to output
  987.      dependencies for Make based on the header files processed by the
  988.      compiler.  This output looks much like the output from the `-M'
  989.      option (*note Preprocessor Options::.), but it goes to a separate
  990.      file, and is in addition to the usual results of compilation.
  991.  
  992.      The value of `DEPENDENCIES_OUTPUT' can be just a file name, in
  993.      which case the Make rules are written to that file, guessing the
  994.      target name from the source file name.  Or the value can have the
  995.      form `FILE TARGET', in which case the rules are written to file
  996.      FILE using TARGET as the target name.
  997.  
  998. 
  999. File: gcc.info,  Node: Running Protoize,  Prev: Environment Variables,  Up: Invoking GCC
  1000.  
  1001. Running Protoize
  1002. ================
  1003.  
  1004.    The program `protoize' is an optional part of GNU C.  You can use it
  1005. to add prototypes to a program, thus converting the program to ANSI C
  1006. in one respect.  The companion program `unprotoize' does the reverse:
  1007. it removes argument types from any prototypes that are found.
  1008.  
  1009.    When you run these programs, you must specify a set of source files
  1010. as command line arguments.  The conversion programs start out by
  1011. compiling these files to see what functions they define.  The
  1012. information gathered about a file FOO is saved in a file named `FOO.X'.
  1013.  
  1014.    After scanning comes actual conversion.  The specified files are all
  1015. eligible to be converted; any files they include (whether sources or
  1016. just headers) are eligible as well.
  1017.  
  1018.    But not all the eligible files are converted.  By default,
  1019. `protoize' and `unprotoize' convert only source and header files in the
  1020. current directory.  You can specify additional directories whose files
  1021. should be converted with the `-d DIRECTORY' option.  You can also
  1022. specify particular files to exclude with the `-x FILE' option.  A file
  1023. is converted if it is eligible, its directory name matches one of the
  1024. specified directory names, and its name within the directory has not
  1025. been excluded.
  1026.  
  1027.    Basic conversion with `protoize' consists of rewriting most function
  1028. definitions and function declarations to specify the types of the
  1029. arguments.  The only ones not rewritten are those for varargs functions.
  1030.  
  1031.    `protoize' optionally inserts prototype declarations at the
  1032. beginning of the source file, to make them available for any calls that
  1033. precede the function's definition.  Or it can insert prototype
  1034. declarations with block scope in the blocks where undeclared functions
  1035. are called.
  1036.  
  1037.    Basic conversion with `unprotoize' consists of rewriting most
  1038. function declarations to remove any argument types, and rewriting
  1039. function definitions to the old-style pre-ANSI form.
  1040.  
  1041.    Both conversion programs print a warning for any function
  1042. declaration or definition that they can't convert.  You can suppress
  1043. these warnings with `-q'.
  1044.  
  1045.    The output from `protoize' or `unprotoize' replaces the original
  1046. source file.  The original file is renamed to a name ending with
  1047. `.save'.  If the `.save' file already exists, then the source file is
  1048. simply discarded.
  1049.  
  1050.    `protoize' and `unprotoize' both depend on GNU CC itself to scan the
  1051. program and collect information about the functions it uses.  So
  1052. neither of these programs will work until GNU CC is installed.
  1053.  
  1054.    Here is a table of the options you can use with `protoize' and
  1055. `unprotoize'.  Each option works with both programs unless otherwise
  1056. stated.
  1057.  
  1058. `-B DIRECTORY'
  1059.      Look for the file `SYSCALLS.c.X' in DIRECTORY, instead of the
  1060.      usual directory (normally `/usr/local/lib').  This file contains
  1061.      prototype information about standard system functions.  This option
  1062.      applies only to `protoize'.
  1063.  
  1064. `-c COMPILATION-OPTIONS'
  1065.      Use  COMPILATION-OPTIONS as the options when running `gcc' to
  1066.      produce the `.X' files.  The special option `-aux-info' is always
  1067.      passed in addition, to tell `gcc' to write a `.X' file.
  1068.  
  1069.      Note that the compilation options must be given as a single
  1070.      argument to `protoize' or `unprotoize'.  If you want to specify
  1071.      several `gcc' options, you must quote the entire set of
  1072.      compilation options to make them a single word in the shell.
  1073.  
  1074.      There are certain `gcc' arguments that you cannot use, because they
  1075.      would produce the wrong kind of output.  These include `-g', `-O',
  1076.      `-c', `-S', and `-o' If you include these in the
  1077.      COMPILATION-OPTIONS, they are ignored.
  1078.  
  1079. `-C'
  1080.      Rename files to end in `.C' instead of `.c'.  This is convenient
  1081.      if you are converting a C program to C++.  This option applies
  1082.      only to `protoize'.
  1083.  
  1084. `-g'
  1085.      Add explicit global declarations.  This means inserting explicit
  1086.      declarations at the beginning of each source file for each function
  1087.      that is called in the file and was not declared.  These
  1088.      declarations precede the first function definition that contains a
  1089.      call to an undeclared function.  This option applies only to
  1090.      `protoize'.
  1091.  
  1092. `-i STRING'
  1093.      Indent old-style parameter declarations with the string STRING.
  1094.      This option applies only to `protoize'.
  1095.  
  1096.      `unprotoize' converts prototyped function definitions to old-style
  1097.      function definitions, where the arguments are declared between the
  1098.      argument list and the initial `{'.  By default, `unprotoize' uses
  1099.      five spaces as the indentation.  If you want to indent with just
  1100.      one space instead, use `-i " "'.
  1101.  
  1102. `-k'
  1103.      Keep the `.X' files.  Normally, they are deleted after conversion
  1104.      is finished.
  1105.  
  1106. `-l'
  1107.      Add explicit local declarations.  `protoize' with `-l' inserts a
  1108.      prototype declaration for each function in each block which calls
  1109.      the function without any declaration.  This option applies only to
  1110.      `protoize'.
  1111.  
  1112. `-n'
  1113.      Make no real changes.  This mode just prints information about the
  1114.      conversions that would have been done without `-n'.
  1115.  
  1116. `-N'
  1117.      Make no `.save' files.  The original files are simply deleted.
  1118.      Use this option with caution.
  1119.  
  1120. `-p PROGRAM'
  1121.      Use the program PROGRAM as the compiler.  Normally, the name `gcc'
  1122.      is used.
  1123.  
  1124. `-q'
  1125.      Work quietly.  Most warnings are suppressed.
  1126.  
  1127. `-v'
  1128.      Print the version number, just like `-v' for `gcc'.
  1129.  
  1130.    If you need special compiler options to compile one of your program's
  1131. source files, then you should generate that file's `.X' file specially,
  1132. by running `gcc' on that source file with the appropriate options and
  1133. the option `-aux-info'.  Then run `protoize' on the entire set of
  1134. files.  `protoize' will use the existing `.X' file because it is newer
  1135. than the source file.  For example:
  1136.  
  1137.      gcc -Dfoo=bar file1.c -aux-info
  1138.      protoize *.c
  1139.  
  1140. You need to include the special files along with the rest in the
  1141. `protoize' command, even though their `.X' files already exist, because
  1142. otherwise they won't get converted.
  1143.  
  1144.    *Note Protoize Caveats::, for more information on how to use
  1145. `protoize' successfully.
  1146.  
  1147.