home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / gcc / gcc.info-5 (.txt) < prev    next >
GNU Info File  |  1995-06-16  |  42KB  |  801 lines

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