Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be included in translations
-approved by the Free Software Foundation instead of in the original
-English.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'' and ``Funding
+Free Software'', the Front-Cover texts being (a) (see below), and with
+the Back-Cover Texts being (b) (see below). A copy of the license is
+included in the gfdl(7) man page.
+
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
@c man end
@c Set file name and title for the man page.
@setfilename gcc
remainder. @samp{g++} accepts mostly the same options as @samp{gcc}.
@c man end
@c man begin SEEALSO
+gpl(7), gfdl(7), fsf-funding(7),
cpp(1), gcov(1), g77(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
and the Info entries for @file{gcc}, @file{cpp}, @file{g77}, @file{as},
@file{ld}, @file{binutils} and @file{gdb}.
@xref{C Dialect Options,,Options Controlling C Dialect}.
@gccoptlist{
-ansi -std=@var{standard} -aux-info @var{filename} @gol
--fno-asm -fno-builtin @gol
+-fno-asm -fno-builtin -fno-builtin-@var{function} @gol
-fhosted -ffreestanding @gol
-trigraphs -traditional -traditional-cpp @gol
-fallow-single-precision -fcond-mismatch @gol
-fsyntax-only -pedantic -pedantic-errors @gol
-w -W -Wall -Waggregate-return @gol
-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment @gol
--Wconversion -Wdisabled-optimization -Werror @gol
+-Wconversion -Wdisabled-optimization -Wdiv-by-zero -Werror @gol
-Wfloat-equal -Wformat -Wformat=2 @gol
-Wformat-nonliteral -Wformat-security @gol
-Wimplicit -Wimplicit-int @gol
@item Debugging Options
@xref{Debugging Options,,Options for Debugging Your Program or GCC}.
@gccoptlist{
--a -ax -d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol
+-d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol
-fdump-unnumbered
-fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
-fdump-tree-original@r{[}-@var{n}@r{]} -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
-fmem-report -fpretend-float @gol
-fprofile-arcs -ftest-coverage -ftime-report @gol
-g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2 @gol
--ggdb -gstabs -gstabs+ -gxcoff -gxcoff+ @gol
+-ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+ @gol
-p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol
-print-multi-directory -print-multi-lib @gol
-print-prog-name=@var{program} -print-search-dirs -Q @gol
@gccoptlist{
-falign-functions=@var{n} -falign-jumps=@var{n} @gol
-falign-labels=@var{n} -falign-loops=@var{n} @gol
--fbranch-probabilities -fcaller-saves @gol
+-fbranch-probabilities -fcaller-saves -fcprop-registers @gol
-fcse-follow-jumps -fcse-skip-blocks -fdata-sections @gol
-fdelayed-branch -fdelete-null-pointer-checks @gol
-fexpensive-optimizations -ffast-math -ffloat-store @gol
-fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
-funsafe-math-optimizations -fno-trapping-math @gol
-fomit-frame-pointer -foptimize-register-move @gol
--foptimize-sibling-calls -freduce-all-givs @gol
+-foptimize-sibling-calls -fprefetch-loop-arrays -freduce-all-givs @gol
-fregmove -frename-registers @gol
-frerun-cse-after-loop -frerun-loop-opt @gol
-fschedule-insns -fschedule-insns2 @gol
@emph{M32R/D Options}
@gccoptlist{
--mcode-model=@var{model-type} -msdata=@var{sdata-type} @gol
+-m32rx -m32r -mcode-model=@var{model-type} -msdata=@var{sdata-type} @gol
-G @var{num}}
@emph{M88K Options}
-mtune=@var{cpu-type} @gol
-mpower -mno-power -mpower2 -mno-power2 @gol
-mpowerpc -mpowerpc64 -mno-powerpc @gol
+-maltivec -mno-altivec @gol
-mpowerpc-gpopt -mno-powerpc-gpopt @gol
-mpowerpc-gfxopt -mno-powerpc-gfxopt @gol
-mnew-mnemonics -mold-mnemonics @gol
-mno-relocatable -mrelocatable-lib -mno-relocatable-lib @gol
-mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian @gol
-mcall-aix -mcall-sysv -mcall-netbsd @gol
+-maix-struct-return -msvr4-struct-return
+-mabi=altivec @gol
-mprototype -mno-prototype @gol
-msim -mmvme -mads -myellowknife -memb -msdata @gol
-msdata=@var{opt} -mvxworks -G @var{num}}
-m4650 -msingle-float -mmad @gol
-mstats -EL -EB -G @var{num} -nocpp @gol
-mabi=32 -mabi=n32 -mabi=64 -mabi=eabi @gol
--mfix7000 -mno-crt0}
+-mfix7000 -mno-crt0 -mflush-func=@var{func} -mno-flush-func}
@emph{i386 and x86-64 Options}
@gccoptlist{
--mcpu=@var{cpu-type} -march=@var{cpu-type} @gol
--mintel-syntax -mieee-fp -mno-fancy-math-387 @gol
+-mcpu=@var{cpu-type} -march=@var{cpu-type} -mfpmath=@var{unit} @gol
+-masm=@var{dialect} -mno-fancy-math-387 @gol
-mno-fp-ret-in-387 -msoft-float -msvr3-shlib @gol
-mno-wide-multiply -mrtd -malign-double @gol
-mpreferred-stack-boundary=@var{num} @gol
--mmmx -msse -m3dnow @gol
+-mmmx -msse -msse2 -msse-math -m3dnow @gol
-mthreads -mno-align-stringops -minline-all-stringops @gol
-mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol
-m96bit-long-double -mregparm=@var{num} -momit-leaf-frame-pointer @gol
-mbwx -mno-bwx -mcix -mno-cix -mmax -mno-max @gol
-mmemory-latency=@var{time}}
+@emph{DEC Alpha/VMS Options}
+@gccoptlist{
+-mvms-return-codes}
+
@emph{Clipper Options}
@gccoptlist{
-mc300 -mc400}
-mno-callgraph-data -mslow-bytes -mno-slow-bytes -mno-lsim @gol
-mlittle-endian -mbig-endian -m210 -m340 -mstack-increment}
+@emph{MMIX Options}
+@gccoptlist{
+-mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon -mabi=gnu @gol
+-mabi=mmixware -mzero-extend -mknuthdiv -mtoplevel-symbols @gol
+-melf}
+
@emph{IA-64 Options}
@gccoptlist{
-mbig-endian -mlittle-endian -mgnu-as -mgnu-ld -mno-pic @gol
-ffixed-@var{reg} -fexceptions @gol
-fnon-call-exceptions -funwind-tables -fasynchronous-unwind-tables @gol
-finhibit-size-directive -finstrument-functions @gol
--fcheck-memory-usage -fprefix-function-name @gol
-fno-common -fno-ident -fno-gnu-linker @gol
-fpcc-struct-return -fpic -fPIC @gol
-freg-struct-return -fshared-data -fshort-enums @gol
@c @var{file}.zip
@c @var{file}.jar
+@item @var{file}.ads
+Ada source code file which contains a library unit declaration (a
+declaration of a package, subprogram, or generic, or a generic
+instantiation), or a library unit renaming declaration (a package,
+generic, or subprogram renaming declaration). Such files are also
+called @dfn{specs}.
+
+@itemx @var{file}.adb
+Ada source code file containing a library unit body (a subprogram or
+package body). Such files are also called @dfn{bodies}.
+
@c GCC also knows about some suffixes for languages not yet included:
-@c Ada:
-@c @var{file}.ads
-@c @var{file}.adb
-@c @var{file}.ada
@c Pascal:
@c @var{file}.p
@c @var{file}.pas
c++ c++-cpp-output
objective-c objc-cpp-output
assembler assembler-with-cpp
+ada
+chill
f77 f77-cpp-input ratfor
-java chill
+java
@end example
-@c Also f77-version, for internal use only.
@item -x none
Turn off any specification of a language, so that subsequent files are
@code{inline} is a standard keyword in ISO C99.
@item -fno-builtin
+@itemx -fno-builtin-@var{function} @r{(C and Objective-C only)}
@opindex fno-builtin
@cindex built-in functions
Don't recognize built-in functions that do not begin with
built-in functions to implement many functions (like
@code{std::strchr}), so that you automatically get efficient code.
+With the @option{-fno-builtin-@var{function}} option, not available
+when compiling C++, only the built-in function @var{function} is
+disabled. @var{function} must not begin with @samp{__builtin_}. If a
+function is named this is not built-in in this version of GCC, this
+option is ignored. There is no corresponding
+@option{-fbuiltin-@var{function}} option; if you wish to enable
+built-in functions selectively when using @option{-fno-builtin} or
+@option{-ffreestanding}, you may define macros such as:
+
+@smallexample
+#define abs(n) __builtin_abs ((n))
+#define strcpy(d, s) __builtin_strcpy ((d), (s))
+@end smallexample
+
@item -fhosted
@opindex fhosted
@cindex hosted environment
representation of a character, and @samp{\a} produces a bell.
@end itemize
+This option is deprecated and may be removed.
+
You may wish to use @option{-fno-builtin} as well as @option{-traditional}
if your program uses names that are normally GNU C built-in functions for
other purposes of its own.
case the message is too long to fit on a single physical line and has to
be wrapped, the source location won't be emitted (as prefix) again,
over and over, in subsequent continuation lines. This is the default
-behaviour.
+behavior.
@item -fdiagnostics-show-location=every-line
Only meaningful in line-wrapping mode. Instructs the diagnostic
@code{printf} or @code{scanf} format function. The C standard specifies
that such arguments are ignored.
+Where the unused arguments lie between used arguments that are
+specified with @samp{$} operand number specifications, normally
+warnings are still given, since the implementation could not know what
+type to pass to @code{va_arg} to skip the unused arguments. However,
+in the case of @code{scanf} formats, this option will suppress the
+warning if the unused arguments are all pointers, since the Single
+Unix Specification says that such unused arguments are allowed.
+
@item -Wformat-nonliteral
@opindex Wformat-nonliteral
If @option{-Wformat} is specified, also warn if the format string is not a
int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
@end smallexample
-@item -Wmultichar
-@opindex Wmultichar
-Warn if a multicharacter constant (@samp{'FOOF'}) is used. Usually they
-indicate a typo in the user's code, as they have implementation-defined
-values, and should not be used in portable code.
-
@item -Wparentheses
@opindex Wparentheses
Warn if parentheses are omitted in certain contexts, such
that are easy to avoid (or modify to prevent the warning), even in
conjunction with macros.
+@item -Wdiv-by-zero
+@opindex Wno-div-by-zero
+@opindex Wdiv-by-zero
+Warn about compile-time integer division by zero. This is default. To
+inhibit the warning messages, use @option{-Wno-div-by-zero}. Floating
+point division by zero is not warned about, as it can be a legitimate
+way of obtaining infinities and NaNs.
+
+@item -Wmultichar
+@opindex Wno-multichar
+@opindex Wmultichar
+Warn if a multicharacter constant (@samp{'FOOF'}) is used. This is
+default. To inhibit the warning messages, use @option{-Wno-multichar}.
+Usually they indicate a typo in the user's code, as they have
+implementation-defined values, and should not be used in portable code.
+
@item -Wsystem-headers
@opindex Wsystem-headers
@cindex warnings from system headers
understands but would ignore because the @samp{#} does not appear as the
first character on the line. It also suggests you hide directives like
@samp{#pragma} not understood by traditional C by indenting them. Some
-traditional implementations would not recognise @samp{#elif}, so it
+traditional implementations would not recognize @samp{#elif}, so it
suggests avoiding it altogether.
@item
version of a program there is often substantial code which checks
correct functioning of the program and is, hopefully, unreachable
because the program does work. Another common use of unreachable
-code is to provide behaviour which is selectable at compile-time.
+code is to provide behavior which is selectable at compile-time.
@item -Winline
@opindex Winline
crash or
refuse to read the program. If you want to control for certain whether
to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
-@option{-gxcoff+}, @option{-gxcoff}, @option{-gdwarf-1+}, or @option{-gdwarf-1}
-(see below).
+@option{-gxcoff+}, @option{-gxcoff}, @option{-gdwarf-1+}, @option{-gdwarf-1},
+or @option{-gvms} (see below).
Unlike most other C compilers, GCC allows you to use @option{-g} with
@option{-O}. The shortcuts taken by optimized code may occasionally
Produce debugging information in DWARF version 2 format (if that is
supported). This is the format used by DBX on IRIX 6.
+@item -gvms
+@opindex gvms
+Produce debugging information in VMS debug format (if that is
+supported). This is the format used by DEBUG on VMS systems.
+
@item -g@var{level}
@itemx -ggdb@var{level}
@itemx -gstabs@var{level}
@itemx -gxcoff@var{level}
@itemx -gdwarf@var{level}
@itemx -gdwarf-2@var{level}
+@itemx -gvms@var{level}
Request debugging information and also use @var{level} to specify how
much information. The default level is 2.
Makes the compiler print some statistics about permanent memory
allocation when it finishes.
-@item -ax
-@opindex ax
-Generate extra code to profile basic blocks. Your executable will
-produce output that is a superset of that produced when @option{-a} is
-used. Additional output is the source and target address of the basic
-blocks where a jump takes place, the number of times a jump is executed,
-and (optionally) the complete sequence of basic blocks being executed.
-The output is appended to file @file{bb.out}.
-
-You can examine different profiling aspects without recompilation. Your
-executable will read a list of function names from file @file{bb.in}.
-Profiling starts when a function on the list is entered and stops when
-that invocation is exited. To exclude a function from profiling, prefix
-its name with @samp{-}. If a function name is not unique, you can
-disambiguate it by writing it in the form
-@samp{/path/filename.d:functionname}. Your executable will write the
-available paths and filenames in file @file{bb.out}.
-
-Several function names have a special meaning:
-@table @code
-@item __bb_jumps__
-Write source, target and frequency of jumps to file @file{bb.out}.
-@item __bb_hidecall__
-Exclude function calls from frequency count.
-@item __bb_showret__
-Include function returns in frequency count.
-@item __bb_trace__
-Write the sequence of basic blocks executed to file @file{bbtrace.gz}.
-The file will be compressed using the program @samp{gzip}, which must
-exist in your @env{PATH}. On systems without the @samp{popen}
-function, the file will be named @file{bbtrace} and will not be
-compressed. @strong{Profiling for even a few seconds on these systems
-will produce a very large file.} Note: @code{__bb_hidecall__} and
-@code{__bb_showret__} will not affect the sequence written to
-@file{bbtrace.gz}.
-@end table
-
-Here's a short example using different profiling parameters
-in file @file{bb.in}. Assume function @code{foo} consists of basic blocks
-1 and 2 and is called twice from block 3 of function @code{main}. After
-the calls, block 3 transfers control to block 4 of @code{main}.
-
-With @code{__bb_trace__} and @code{main} contained in file @file{bb.in},
-the following sequence of blocks is written to file @file{bbtrace.gz}:
-0 3 1 2 1 2 4. The return from block 2 to block 3 is not shown, because
-the return is to a point inside the block and not to the top. The
-block address 0 always indicates, that control is transferred
-to the trace from somewhere outside the observed functions. With
-@samp{-foo} added to @file{bb.in}, the blocks of function
-@code{foo} are removed from the trace, so only 0 3 4 remains.
-
-With @code{__bb_jumps__} and @code{main} contained in file @file{bb.in},
-jump frequencies will be written to file @file{bb.out}. The
-frequencies are obtained by constructing a trace of blocks
-and incrementing a counter for every neighbouring pair of blocks
-in the trace. The trace 0 3 1 2 1 2 4 displays the following
-frequencies:
-
-@example
-Jump from block 0x0 to block 0x3 executed 1 time(s)
-Jump from block 0x3 to block 0x1 executed 1 time(s)
-Jump from block 0x1 to block 0x2 executed 2 time(s)
-Jump from block 0x2 to block 0x1 executed 1 time(s)
-Jump from block 0x2 to block 0x4 executed 1 time(s)
-@end example
-
-With @code{__bb_hidecall__}, control transfer due to call instructions
-is removed from the trace, that is the trace is cut into three parts: 0
-3 4, 0 1 2 and 0 1 2. With @code{__bb_showret__}, control transfer due
-to return instructions is added to the trace. The trace becomes: 0 3 1
-2 3 1 2 3 4. Note, that this trace is not the same, as the sequence
-written to @file{bbtrace.gz}. It is solely used for counting jump
-frequencies.
-
@item -fprofile-arcs
@opindex fprofile-arcs
Instrument @dfn{arcs} during compilation to generate coverage data
in many functions. @strong{It also makes debugging impossible on
some machines.}
-@ifset INTERNALS
-On some machines, such as the VAX, this flag has no effect, because
-the standard calling sequence automatically handles the frame pointer
-and nothing is saved by pretending it doesn't exist. The
-machine-description macro @code{FRAME_POINTER_REQUIRED} controls
-whether a target machine supports this flag. @xref{Registers}.
-@end ifset
-@ifclear INTERNALS
On some machines, such as the VAX, this flag has no effect, because
the standard calling sequence automatically handles the frame pointer
and nothing is saved by pretending it doesn't exist. The
machine-description macro @code{FRAME_POINTER_REQUIRED} controls
whether a target machine supports this flag. @xref{Registers,,Register
-Usage, gcc.info, Using and Porting GCC}.
-@end ifclear
+Usage, gccint, GNU Compiler Collection (GCC) Internals}.
@item -foptimize-sibling-calls
@opindex foptimize-sibling-calls
constants) accross compilation units.
This option is default for optimized compilation if assembler and linker
-support it. Use @option{-fno-merge-constants} to inhibit this behaviour.
+support it. Use @option{-fno-merge-constants} to inhibit this behavior.
@item -fmerge-all-constants
Attempt to merge identical constants and identical variables.
arrays or initialized constant variables with integral or floating point
types. Languages like C or C++ require each non-automatic variable to
have distinct location, so using this option will result in non-conforming
-behaviour.
+behavior.
@item -fno-function-cse
@opindex fno-function-cse
@option{-funroll-all-loops} implies the same options as
@option{-funroll-loops},
+@item -fprefetch-loop-arrays
+@opindex fprefetch-loop-arrays
+If supported by the target machine, generate instructions to prefetch
+memory to improve the performance of loops that access large arrays.
@item -fmove-all-movables
@opindex fmove-all-movables
structure of the generated code, so you must use the same source code
and the same optimization options for both compilations.
-@ifset INTERNALS
With @option{-fbranch-probabilities}, GCC puts a @samp{REG_EXEC_COUNT}
note on the first instruction of each basic block, and a
@samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
used in one place: in @file{reorg.c}, instead of guessing which path a
branch is mostly to take, the @samp{REG_BR_PROB} values are used to
exactly determine which path is taken more often.
-@end ifset
@item -fno-guess-branch-probability
@opindex fno-guess-branch-probability
@}
@end example
-@ifset INTERNALS
Every language that wishes to perform language-specific alias analysis
should define a function that computes, given an @code{tree}
node, an alias set for the node. Nodes in different alias sets are not
allowed to alias. For an example, see the C front-end function
@code{c_get_alias_set}.
-@end ifset
@item -falign-functions
@itemx -falign-functions=@var{n}
make debugging impossible, since variables will no longer stay in
a ``home register''.
+@item -fno-cprop-registers
+@opindex fno-cprop-registers
+After register allocation and post-register allocation instruction splitting,
+we perform a copy-propagation pass to try to reduce scheduling dependencies
+and occasionally eliminate the copy.
+
@item --param @var{name}=@var{value}
@opindex param
In some places, GCC uses various constants to control the amount of
The maximum number of passes of GCSE to run.
@item max-pending-list-length
-The maximum number of pending dependancies scheduling will allow
+The maximum number of pending dependencies scheduling will allow
before flushing the current state and starting over. Large functions
with few branches or calls can create excessively large lists which
needlessly consume memory and resources.
@option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
that GCC uses to overcome shortcomings of particular machines, or special
needs for some languages.
-@ifset INTERNALS
-(@xref{Interface,,Interfacing to GCC Output}, for more discussion of
-@file{libgcc.a}.)
-@end ifset
-@ifclear INTERNALS
-(@xref{Interface,,Interfacing to GCC Output,gcc.info,Porting GCC},
+(@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
+Collection (GCC) Internals},
for more discussion of @file{libgcc.a}.)
-@end ifclear
In most cases, you need @file{libgcc.a} even when you want to avoid
other standard libraries. In other words, when you specify @option{-nostdlib}
or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
This ensures that you have no unresolved references to internal GCC
library subroutines. (For example, @samp{__main}, used to ensure C++
-constructors will be called; @pxref{Collect2,,@command{collect2}}.)
+constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
+GNU Compiler Collection (GCC) Internals}.)
@item -s
@opindex s
sequence of other programs to do the work of compiling, assembling and
linking. GCC interprets its command-line parameters and uses these to
deduce which programs it should invoke, and which command-line options
-it ought to place on their command lines. This behaviour is controlled
+it ought to place on their command lines. This behavior is controlled
by @dfn{spec strings}. In most cases there is one spec string for each
program that GCC can invoke, but a few programs have multiple spec
-strings to control their behaviour. The spec strings built into GCC can
+strings to control their behavior. The spec strings built into GCC can
be overridden by using the @option{-specs=} command-line switch to specify
a spec file.
options, usually for compatibility with other compilers on the same
platform.
-@ifset INTERNALS
These options are defined by the macro @code{TARGET_SWITCHES} in the
machine description. The default for the options is also defined by
that macro, which enables you to change the defaults.
-@end ifset
@menu
* M680x0 Options::
* HPPA Options::
* Intel 960 Options::
* DEC Alpha Options::
+* DEC Alpha/VMS Options::
* Clipper Options::
* H8/300 Options::
* SH Options::
* D30V Options::
* S/390 and zSeries Options::
* CRIS Options::
+* MMIX Options::
@end menu
@node M680x0 Options
@itemx -msupersparc
@opindex mcypress
@opindex msupersparc
-These two options select the processor for which the code is optimised.
+These two options select the processor for which the code is optimized.
With @option{-mcypress} (the default), the compiler optimizes code for the
Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx series.
turned into long calls.
This feature is not enabled by default. Specifying
-@option{-mno-long-calls} will restore the default behaviour, as will
+@option{-mno-long-calls} will restore the default behavior, as will
placing the function calls within the scope of a @samp{#pragma
long_calls_off} directive. Note these switches have no effect on how
the compiler generates code to handle function calls via function
@opindex msingle-pic-base
Treat the register used for PIC addressing as read-only, rather than
loading it in the prologue for each function. The run-time system is
-responsible for initialising this register with an appropriate value
+responsible for initializing this register with an appropriate value
before execution begins.
@item -mpic-register=@var{reg}
These @option{-m} options are defined for Mitsubishi M32R/D architectures:
@table @gcctabopt
+@item -m32rx
+@opindex m32rx
+Generate code for the M32R/X@.
+
+@item -m32r
+@opindex m32r
+Generate code for the M32R@. This is the default.
+
@item -mcode-model=small
@opindex mcode-model=small
Assume all objects live in the lower 16MB of memory (so that their addresses
architecture, registers, and mnemonics set by @option{-mcpu}, but the
scheduling parameters set by @option{-mtune}.
+@item -maltivec
+@itemx -mno-altivec
+@opindex maltivec
+@opindex mno-altivec
+These switches enable or disable the use of built-in functions that
+allow access to the AltiVec instruction set. You may also need to set
+@option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
+enhancements.
+
@item -mfull-toc
@itemx -mno-fp-in-toc
@itemx -mno-sum-in-toc
On System V.4 and embedded PowerPC systems compile code for the
NetBSD operating system.
+@item -maix-struct-return
+@opindex maix-struct-return
+Return all structures in memory (as specified by the AIX ABI)@.
+
+@item -msvr4-struct-return
+@opindex msvr4-struct-return
+Return structures smaller than 8 bytes in registers (as specified by the
+SVR4 ABI)@.
+
+@item -mabi=altivec
+@opindex mabi=altivec
+Extend the current ABI with AltiVec ABI extensions. This does not
+change the default ABI, instead it adds the AltiVec ABI extensions to
+the current ABI@.
+
@item -mprototype
@itemx -mno-prototype
@opindex mprototype
@item -no-crt0
@opindex no-crt0
Do not include the default crt0.
+
+@item -mflush-func=@var{func}
+@itemx -mno-flush-func
+@opindex mflush-func
+Specifies the function to call to flush the I and D caches, or to not
+call any such function. If called, the function must take the same
+arguments as the common @code{_flush_func()}, that is, the address of the
+memory range for which the cache is being flushed, the size of the
+memory range, and the number 3 (to flush both caches). The default
+depends on the target gcc was configured for, but commonly is either
+@samp{_flush_func} or @samp{__cpu_flush}.
@end table
-@ifset INTERNALS
These options are defined by the macro
@code{TARGET_SWITCHES} in the machine description. The default for the
options is also defined by that macro, which enables you to change the
defaults.
-@end ifset
@node i386 and x86-64 Options
@subsection Intel 386 and AMD x86-64 Options
@table @gcctabopt
@item -mcpu=@var{cpu-type}
@opindex mcpu
-Assume the defaults for the machine type @var{cpu-type} when scheduling
-instructions. The choices for @var{cpu-type} are @samp{i386},
-@samp{i486}, @samp{i586}, @samp{i686}, @samp{pentium},
-@samp{pentiumpro}, @samp{pentium4}, @samp{k6}, and @samp{athlon}
+Tune to @var{cpu-type} everything applicable about the generated code, except
+for the ABI and the set of available instructions. The choices for
+@var{cpu-type} are @samp{i386}, @samp{i486}, @samp{i586}, @samp{i686},
+@samp{pentium}, @samp{pentium-mmx}, @samp{pentiumpro}, @samp{pentium2},
+@samp{pentium3}, @samp{pentium4}, @samp{k6}, @samp{k6-2}, @samp{k6-3},
+@samp{athlon}, @samp{athlon-tbird}, @samp{athlon-4}, @samp{athlon-xp}
+and @samp{athlon-mp}.
While picking a specific @var{cpu-type} will schedule things appropriately
for that particular chip, the compiler will not generate any code that
@option{-mcpu=pentium}, and @option{-mcpu=pentiumpro} respectively.
These synonyms are deprecated.
-@item -mintel-syntax
-@opindex mintel-syntax
-Emit assembly using Intel syntax opcodes instead of AT&T syntax.
+@item -mfpmath=@var{unit}
+@opindex march
+generate floating point arithmetics for selected unit @var{unit}. the choices
+for @var{unit} are:
+
+@table @samp
+@item 387
+Use the standard 387 floating point coprocessor present majority of chips and
+emulated otherwise. Code compiled with this option will run almost everywhere.
+The temporary results are computed in 80bit precesion instead of precision
+specified by the type resulting in slightly different results compared to most
+of other chips. See @option{-ffloat-store} for more detailed description.
+
+This is the default choice for i386 compiler.
+
+@item sse
+Use scalar floating point instructions present in the SSE instruction set.
+This instruction set is supported by Pentium3 and newer chips, in the AMD line
+by Athlon-4, Athlon-xp and Athlon-mp chips. The earlier version of SSE
+instruction set supports only single precision arithmetics, thus the double and
+extended precision arithmetics is still done using 387. Later version, present
+only in Pentium4 and the future AMD x86-64 chips supports double precision
+arithmetics too.
+
+For i387 you need to use @option{-march=@var{cpu-type}}, @option{-msse} or
+@option{-msse2} switches to enable SSE extensions and make this option
+effective. For x86-64 compiler, these extensions are enabled by default.
+
+The resulting code should be considerably faster in majority of cases and avoid
+the numerical instability problems of 387 code, but may break some existing
+code that expects temporaries to be 80bit.
+
+This is the default choice for x86-64 compiler.
+
+@item sse,387
+Attempt to utilize both instruction sets at once. This effectivly double the
+amount of available registers and on chips with separate execution units for
+387 and SSE the execution resources too. Use this option with care, as it is
+still experimental, because gcc register allocator does not model separate
+functional units well resulting in instable performance.
+@end table
+
+@item -masm=@var{dialect}
+@opindex masm=@var{dialect}
+Output asm instructions using selected @var{dialect}. Supported choices are
+@samp{intel} or @samp{att} (the default one).
@item -mieee-fp
@itemx -mno-ieee-fp
@opindex mpreferred-stack-boundary
Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
byte boundary. If @option{-mpreferred-stack-boundary} is not specified,
-the default is 4 (16 bytes or 128 bits).
+the default is 4 (16 bytes or 128 bits), except when optimizing for code
+size (@option{-Os}), in which case the default is the minimum correct
+alignment (4 bytes for x86, and 8 bytes for x86-64).
-The stack is required to be aligned on a 4 byte boundary. On Pentium
-and PentiumPro, @code{double} and @code{long double} values should be
-aligned to an 8 byte boundary (see @option{-malign-double}) or suffer
-significant run time performance penalties. On Pentium III, the
+On Pentium and PentiumPro, @code{double} and @code{long double} values
+should be aligned to an 8 byte boundary (see @option{-malign-double}) or
+suffer significant run time performance penalties. On Pentium III, the
Streaming SIMD Extension (SSE) data type @code{__m128} suffers similar
penalties if it is not 16 byte aligned.
boundary will most likely misalign the stack. It is recommended that
libraries that use callbacks always use the default setting.
-This extra alignment does consume extra stack space. Code that is sensitive
-to stack space usage, such as embedded systems and operating system kernels,
-may want to reduce the preferred alignment to
-@option{-mpreferred-stack-boundary=2}.
+This extra alignment does consume extra stack space, and generally
+increases code size. Code that is sensitive to stack space usage, such
+as embedded systems and operating system kernels, may want to reduce the
+preferred alignment to @option{-mpreferred-stack-boundary=2}.
@item -mmmx
@itemx -mno-mmx
@item -msse
@itemx -mno-sse
+@item -msse2
+@itemx -mno-sse2
@item -m3dnow
@itemx -mno-3dnow
@opindex mmmx
@end table
@end table
+@node DEC Alpha/VMS Options
+@subsection DEC Alpha/VMS Options
+
+These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
+
+@table @gcctabopt
+@item -mvms-return-codes
+@opindex mvms-return-codes
+Return VMS condition codes from main. The default is to return POSIX
+style condition (e.g.@ error) codes.
+@end table
+
@node Clipper Options
@subsection Clipper Options
0x40000000 and zero-initialized data at 0x80000000.
@end table
+@node MMIX Options
+@subsection MMIX Options
+@cindex MMIX Options
+
+These options are defined for the MMIX:
+
+@table @code
+@item -mlibfuncs
+@itemx -mno-libfuncs
+Specify that intrinsic library functions are being compiled, passing all
+values in registers, no matter the size.
+
+@item -mepsilon
+@itemx -mno-epsilon
+Generate floating-point comparison instructions that compare with respect
+to the @code{rE} epsilon register.
+
+@item -mabi=mmixware
+@itemx -mabi=gnu
+Generate code that passes function parameters and return values that (in
+the called function) are seen as registers @code{$0} and up, as opposed to
+the GNU ABI which uses global registers @code{$231} and up.
+
+@item -mzero-extend
+@item -mno-zero-extend
+When reading data from memory in sizes shorter than 64 bits, use (do not
+use) zero-extending load instructions by default, rather than
+sign-extending ones.
+
+@item -mknuthdiv
+@itemx -mno-knuthdiv
+Make the result of a division yielding a remainder have the same sign as
+the divisor. With the default, @option{-mno-knuthdiv}, the sign of the
+remainder follows the sign of the dividend. Both methods are
+arithmetically valid, the latter being almost exclusively used.
+
+@item -mtoplevel-symbols
+@itemx -mno-toplevel-symbols
+Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
+code can be used with the @code{PREFIX} assembly directive.
+
+@item -melf
+Generate an executable in the ELF format, rather than the default
+@samp{mmo} format used by the @command{mmix} simulator.
+@end table
@node Code Gen Options
@section Options for Code Generation Conventions
not want to use this option, since it makes the code suboptimal, and
the offsets of structure members won't agree with system libraries.
-@item -fcheck-memory-usage
-@opindex fcheck-memory-usage
-Generate extra code to check each memory access. GCC will generate
-code that is suitable for a detector of bad memory accesses such as
-@file{Checker}.
-
-Normally, you should compile all, or none, of your code with this option.
-
-If you do mix code compiled with and without this option,
-you must ensure that all code that has side effects
-and that is called by code compiled with this option
-is, itself, compiled with this option.
-If you do not, you might get erroneous messages from the detector.
-
-If you use functions from a library that have side-effects (such as
-@code{read}), you might not be able to recompile the library and
-specify this option. In that case, you can enable the
-@option{-fprefix-function-name} option, which requests GCC to encapsulate
-your code and make other functions look as if they were compiled with
-@option{-fcheck-memory-usage}. This is done by calling ``stubs'',
-which are provided by the detector. If you cannot find or build
-stubs for every function you call, you might have to specify
-@option{-fcheck-memory-usage} without @option{-fprefix-function-name}.
-
-If you specify this option, you can not use the @code{asm} or
-@code{__asm__} keywords in functions with memory checking enabled. GCC
-cannot understand what the @code{asm} statement may do, and therefore
-cannot generate the appropriate code, so it will reject it. However, if
-you specify the function attribute @code{no_check_memory_usage}
-(@pxref{Function Attributes}), GCC will disable memory checking within a
-function; you may use @code{asm} statements inside such functions. You
-may have an inline expansion of a non-checked function within a checked
-function; in that case GCC will not generate checks for the inlined
-function's memory accesses.
-
-If you move your @code{asm} statements to non-checked inline functions
-and they do access memory, you can add calls to the support code in your
-inline function, to indicate any reads, writes, or copies being done.
-These calls would be similar to those done in the stubs described above.
-
-@item -fprefix-function-name
-@opindex fprefix-function-name
-Request GCC to add a prefix to the symbols generated for function names.
-GCC adds a prefix to the names of functions defined as well as
-functions called. Code compiled with this option and code compiled
-without the option can't be linked together, unless stubs are used.
-
-If you compile the following code with @option{-fprefix-function-name}
-@example
-extern void bar (int);
-void
-foo (int a)
-@{
- return bar (a + 5);
-@}
-@end example
-
-@noindent
-GCC will compile the code as if it was written:
-@example
-extern void prefix_bar (int);
-void
-prefix_foo (int a)
-@{
- return prefix_bar (a + 5);
-@}
-@end example
-This option is designed to be used with @option{-fcheck-memory-usage}.
-
@item -finstrument-functions
@opindex finstrument-functions
Generate instrumentation calls for entry and exit to functions. Just
when searching for various kinds of files. Some are used to specify other
aspects of the compilation environment.
-@ifclear INTERNALS
-Note that you can also specify places to search using options such as
-@option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}). These
-take precedence over places specified using environment variables, which
-in turn take precedence over those specified by the configuration of GCC@.
-
-@end ifclear
-@ifset INTERNALS
Note that you can also specify places to search using options such as
@option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}). These
take precedence over places specified using environment variables, which
in turn take precedence over those specified by the configuration of GCC@.
-@xref{Driver}.
-@end ifset
+@xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
+GNU Compiler Collection (GCC) Internals}.
@table @env
@item LANG