-@c Copyright (C) 1988, 89, 92-98, 1999 Free Software Foundation, Inc.
+@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@node Invoking GCC
-@chapter GNU CC Command Options
-@cindex GNU CC command options
+@chapter GCC Command Options
+@cindex GCC command options
@cindex command options
-@cindex options, GNU CC command
+@cindex options, GCC command
-When you invoke GNU CC, it normally does preprocessing, compilation,
+When you invoke GCC, it normally does preprocessing, compilation,
assembly and linking. The ``overall options'' allow you to stop this
process at an intermediate stage. For example, the @samp{-c} option
says not to run the linker. Then the output consists of object files
documented here, since you rarely need to use any of them.
@cindex C compilation options
-Most of the command line options that you can use with GNU CC are useful
+Most of the command line options that you can use with GCC are useful
for C programs; when an option is only useful with another language
(usually C++), the explanation says so explicitly. If the description
for a particular option does not mention a source language, you can use
* Link Options:: Specifying libraries and so on.
* Directory Options:: Where to find header files and libraries.
Where to find the compiler executable files.
-* Target Options:: Running a cross-compiler, or an old version of GNU CC.
+* Spec Files:: How to pass switches to sub-processes.
+* Target Options:: Running a cross-compiler, or an old version of GCC.
* Submodel Options:: Specifying minor hardware or convention variations,
such as 68010 vs 68020.
* Code Gen Options:: Specifying conventions for function calls, data layout
and register usage.
-* Environment Variables:: Env vars that affect GNU CC.
+* Environment Variables:: Env vars that affect GCC.
* Running Protoize:: Automatically adding or removing function prototypes.
@end menu
@item Overall Options
@xref{Overall Options,,Options Controlling the Kind of Output}.
@smallexample
--c -S -E -o @var{file} -pipe -v --help -x @var{language}
+-c -S -E -o @var{file} -pipe -pass-exit-codes -v --help -x @var{language}
@end smallexample
@item C Language Options
@xref{C Dialect Options,,Options Controlling C Dialect}.
@smallexample
--ansi -flang-isoc9x -fallow-single-precision -fcond-mismatch -fno-asm
+-ansi -fstd -fallow-single-precision -fcond-mismatch -fno-asm
-fno-builtin -ffreestanding -fhosted -fsigned-bitfields -fsigned-char
-funsigned-bitfields -funsigned-char -fwritable-strings
-traditional -traditional-cpp -trigraphs
@item C++ Language Options
@xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
@smallexample
--fno-access-control -fcheck-new -fconserve-space -fdollars-in-identifiers
--fno-elide-constructors -fexternal-templates -ffor-scope
--fno-for-scope -fno-gnu-keywords -fguiding-decls -fhandle-signatures
--fhonor-std -fhuge-objects -fno-implicit-templates -finit-priority
--fno-implement-inlines -fname-mangling-version-@var{n} -fno-default-inline
--foperator-names -fno-optional-diags -frepo -fstrict-prototype
--fsquangle -ftemplate-depth-@var{n} -fthis-is-variable -fvtable-thunks
--nostdinc++ -Wctor-dtor-privacy -Wno-deprecated -Weffc++
--Wno-non-template-friend
--Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual
--Wno-pmf-conversions -Wreorder -Wsign-promo -Wsynth
+-fno-access-control -fcheck-new -fconserve-space
+-fdollars-in-identifiers -fno-elide-constructors -fexternal-templates
+-ffor-scope -fno-for-scope -fno-gnu-keywords -fguiding-decls -fhonor-std
+-fhuge-objects -fno-implicit-templates -finit-priority
+-fno-implement-inlines -fname-mangling-version-@var{n}
+-fno-default-inline -fno-operator-names -fno-optional-diags -fpermissive
+-frepo -fstrict-prototype -fsquangle -ftemplate-depth-@var{n}
+-fuse-cxa-atexit -fvtable-thunks -nostdinc++ -Wctor-dtor-privacy
+-Wno-deprecated -Weffc++ -Wno-non-template-friend -Wnon-virtual-dtor
+-Wold-style-cast -Woverloaded-virtual -Wno-pmf-conversions -Wreorder
+-Wsign-promo -Wsynth
@end smallexample
@item Warning Options
@xref{Warning Options,,Options to Request or Suppress Warnings}.
@smallexample
-fsyntax-only -pedantic -pedantic-errors
--w -W -Wall -Waggregate-return -Wbad-function-cast
+-w -W -Wall -Waggregate-return
-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment
-Wconversion -Werror -Wformat
-Wid-clash-@var{len} -Wimplicit -Wimplicit-int
-Wimplicit-function-declaration -Wimport
--Werror-implicit-function-declaration -Winline
+-Werror-implicit-function-declaration -Wfloat-equal -Winline
-Wlarger-than-@var{len} -Wlong-long
-Wmain -Wmissing-declarations -Wmissing-noreturn
--Wmissing-prototypes -Wmultichar -Wnested-externs -Wno-import
+-Wmultichar -Wno-import -Wpacked -Wpadded
-Wparentheses -Wpointer-arith -Wredundant-decls
--Wreturn-type -Wshadow -Wsign-compare -Wstrict-prototypes
--Wswitch -Wtraditional
--Wtrigraphs -Wundef -Wuninitialized -Wunused -Wwrite-strings
--Wunknown-pragmas
+-Wreturn-type -Wshadow -Wsign-compare -Wswitch
+-Wtrigraphs -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code
+-Wunused -Wwrite-strings
+@end smallexample
+
+@item C-only Warning Options
+@smallexample
+-Wbad-function-cast -Wmissing-prototypes -Wnested-externs
+-Wstrict-prototypes -Wtraditional
@end smallexample
@item Debugging Options
@xref{Debugging Options,,Options for Debugging Your Program or GCC}.
@smallexample
--a -ax -d@var{letters} -fdump-unnumbered -fpretend-float
--fprofile-arcs -ftest-coverage
+-a -ax -d@var{letters} -fdump-unnumbered -fdump-translation-unit-@var{file}
+-fpretend-float -fprofile-arcs -ftest-coverage
-g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2
-ggdb -gstabs -gstabs+ -gxcoff -gxcoff+
-p -pg -print-file-name=@var{library} -print-libgcc-file-name
--print-prog-name=@var{program} -print-search-dirs -save-temps
+-print-prog-name=@var{program} -print-search-dirs -save-temps -time
@end smallexample
@item Optimization Options
@xref{Optimize Options,,Options that Control Optimization}.
@smallexample
--fbranch-probabilities -foptimize-register-moves
+-falign-functions=@var{n} -falign-labels=@var{n} -falign-loops=@var{n}
+-falign-jumps=@var{n} -fbranch-probabilities
-fcaller-saves -fcse-follow-jumps -fcse-skip-blocks
--fdelayed-branch -fexpensive-optimizations
--ffast-math -ffloat-store -fforce-addr -fforce-mem
--fdata-sections -ffunction-sections -fgcse
--finline-functions -finline-limit-@var{n} -fkeep-inline-functions
--fno-default-inline -fno-defer-pop -fno-function-cse
--fno-inline -fno-peephole -fomit-frame-pointer -fregmove
--frerun-cse-after-loop -frerun-loop-opt -fschedule-insns
--fschedule-insns2 -fstrength-reduce -fthread-jumps
--funroll-all-loops -funroll-loops
--fmove-all-movables -freduce-all-givs -fstrict-aliasing
+-fdelayed-branch -fdelete-null-pointer-checks -fexpensive-optimizations
+-ffast-math -ffloat-store -fforce-addr -fforce-mem -fno-math-errno
+-fdata-sections -ffunction-sections -fgcse
+-finline-functions -finline-limit=@var{n} -fkeep-inline-functions
+-fmove-all-movables -fno-default-inline -fno-defer-pop
+-fno-function-cse -fno-inline -fno-peephole
+-fomit-frame-pointer -foptimize-register-moves -foptimize-sibling-calls
+-fregmove -frerun-cse-after-loop -frerun-loop-opt -freduce-all-givs
+-fschedule-insns -fschedule-insns2 -fstrength-reduce
+-fstrict-aliasing -fthread-jumps -funroll-all-loops
+-funroll-loops
-O -O0 -O1 -O2 -O3 -Os
@end smallexample
@emph{M680x0 Options}
-m68000 -m68020 -m68020-40 -m68020-60 -m68030 -m68040
-m68060 -mcpu32 -m5200 -m68881 -mbitfield -mc68000 -mc68020
--mfpa -mnobitfield -mrtd -mshort -msoft-float
--malign-int
+-mfpa -mnobitfield -mrtd -mshort -msoft-float -mpcrel
+-malign-int -mstrict-align
@emph{VAX Options}
-mg -mgnu -munix
-mcpu=@var{cpu type}
-mtune=@var{cpu type}
-mcmodel=@var{code model}
--malign-jumps=@var{num} -malign-loops=@var{num}
--malign-functions=@var{num}
-m32 -m64
--mapp-regs -mbroken-saverestore -mcypress -mepilogue
--mflat -mfpu -mhard-float -mhard-quad-float
--mimpure-text -mlive-g0 -mno-app-regs -mno-epilogue
--mno-flat -mno-fpu -mno-impure-text
--mno-stack-bias -mno-unaligned-doubles
+-mapp-regs -mbroken-saverestore -mcypress
+-mepilogue -mfaster-structs -mflat
+-mfpu -mhard-float -mhard-quad-float
+-mimpure-text -mlive-g0 -mno-app-regs
+-mno-epilogue -mno-faster-structs -mno-flat -mno-fpu
+-mno-impure-text -mno-stack-bias -mno-unaligned-doubles
-msoft-float -msoft-quad-float -msparclite -mstack-bias
-msupersparc -munaligned-doubles -mv8
-mapcs-reentrant -mno-apcs-reentrant
-msched-prolog -mno-sched-prolog
-mlittle-endian -mbig-endian -mwords-little-endian
--mshort-load-bytes -mno-short-load-bytes -mshort-load-words -mno-short-load-words
+-malignment-traps -mno-alignment-traps
-msoft-float -mhard-float -mfpe
-mthumb-interwork -mno-thumb-interwork
-mcpu= -march= -mfpe=
-mstructure-size-boundary=
-mbsd -mxopen -mno-symrename
-mabort-on-noreturn
--mno-sched-prolog
+-mlong-calls -mno-long-calls
+-mnop-fun-dllimport -mno-nop-fun-dllimport
+-msingle-pic-base -mno-single-pic-base
+-mpic-register=
@emph{Thumb Options}
-mtpcs-frame -mno-tpcs-frame
-mlittle-endian -mbig-endian
-mthumb-interwork -mno-thumb-interwork
-mstructure-size-boundary=
+-mnop-fun-dllimport -mno-nop-fun-dllimport
+-mcallee-super-interworking -mno-callee-super-interworking
+-mcaller-super-interworking -mno-caller-super-interworking
+-msingle-pic-base -mno-single-pic-base
+-mpic-register=
@emph{MN10200 Options}
-mrelax
@emph{MN10300 Options}
-mmult-bug
-mno-mult-bug
+-mam33
+-mno-am33
-mrelax
@emph{M32R/D Options}
-mcpu=@var{cpu type}
-mtune=@var{cpu type}
-mpower -mno-power -mpower2 -mno-power2
--mpowerpc -mno-powerpc
+-mpowerpc -mpowerpc64 -mno-powerpc
-mpowerpc-gpopt -mno-powerpc-gpopt
-mpowerpc-gfxopt -mno-powerpc-gfxopt
--mnew-mnemonics -mno-new-mnemonics
+-mnew-mnemonics -mold-mnemonics
-mfull-toc -mminimal-toc -mno-fop-in-toc -mno-sum-in-toc
--maix64 -maix32 -mxl-call -mno-xl-call -mthreads -mpe
+-m64 -m32 -mxl-call -mno-xl-call -mthreads -mpe
-msoft-float -mhard-float -mmultiple -mno-multiple
-mstring -mno-string -mupdate -mno-update
-mfused-madd -mno-fused-madd -mbit-align -mno-bit-align
-mminimum-fp-blocks -mnohc-struct-return
@emph{MIPS Options}
--mabicalls -mcpu=@var{cpu type} -membedded-data
+-mabicalls -mcpu=@var{cpu type} -membedded-data -muninit-const-in-rodata
-membedded-pic -mfp32 -mfp64 -mgas -mgp32 -mgp64
-mgpopt -mhalf-pic -mhard-float -mint64 -mips1
-mips2 -mips3 -mips4 -mlong64 -mlong32 -mlong-calls -mmemcpy
-mmips-as -mmips-tfile -mno-abicalls
--mno-embedded-data -mno-embedded-pic
+-mno-embedded-data -mno-uninit-const-in-rodata -mno-embedded-pic
-mno-gpopt -mno-long-calls
-mno-memcpy -mno-mips-tfile -mno-rnames -mno-stats
-mrnames -msoft-float
-m4650 -msingle-float -mmad
-mstats -EL -EB -G @var{num} -nocpp
-mabi=32 -mabi=n32 -mabi=64 -mabi=eabi
+-mfix7000 -mno-crt0
@emph{i386 Options}
-mcpu=@var{cpu type}
-mno-wide-multiply -mrtd -malign-double
-mreg-alloc=@var{list} -mregparm=@var{num}
-malign-jumps=@var{num} -malign-loops=@var{num}
--malign-functions=@var{num} -mpreferred_stack_boundary=@var{num}
+-malign-functions=@var{num} -mpreferred-stack-boundary=@var{num}
+-mthreads -mno-align-stringops -minline-all-stringops
+-mpush-args -maccumulate-outgoing-args
@emph{HPPA Options}
-march=@var{architecture type}
-mlong-load-store -mno-big-switch -mno-disable-fpregs
-mno-disable-indexing -mno-fast-indirect-calls -mno-gas
-mno-jump-in-delay -mno-long-load-store
--mno-portable-runtime -mno-soft-float -mno-space
+-mno-portable-runtime -mno-soft-float
-mno-space-regs -msoft-float -mpa-risc-1-0
-mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime
--mschedule=@var{cpu type} -mspace -mspace-regs
+-mschedule=@var{cpu type} -mspace-regs
@emph{Intel 960 Options}
-m@var{cpu type} -masm-compat -mclean-linkage
-m32032 -m32332 -m32532 -m32081 -m32381 -mmult-add -mnomult-add
-msoft-float -mrtd -mnortd -mregparam -mnoregparam -msb -mnosb
-mbitfield -mnobitfield -mhimem -mnohimem
+
+@emph{AVR Options}
+-mmcu=@var{mcu} -msize -minit-stack=@var{n} -mno-interrupts
+-mcall-prologues
+
+@emph{MCore Options}
+-mhardlit, -mno-hardlit -mdiv -mno-div -mrelax-immediates
+-mno-relax-immediates -mwide-bitfields -mno-wide-bitfields
+-m4byte-functions -mno-4byte-functions -mcallgraph-data
+-mno-callgraph-data -mslow-bytes -mno-slow-bytes -mno-lsim
+-mlittle-endian -mbig-endian -m210 -m340 -mstack-increment
@end smallexample
@item Code Generation Options
@xref{Code Gen Options,,Options for Code Generation Conventions}.
@smallexample
-fcall-saved-@var{reg} -fcall-used-@var{reg}
--fexceptions -ffixed-@var{reg} -finhibit-size-directive
+-fexceptions -funwind-tables -ffixed-@var{reg} -finhibit-size-directive
-fcheck-memory-usage -fprefix-function-name
-fno-common -fno-ident -fno-gnu-linker
-fpcc-struct-return -fpic -fPIC
-freg-struct-return -fshared-data -fshort-enums
-fshort-double -fvolatile -fvolatile-global -fvolatile-static
-fverbose-asm -fpack-struct -fstack-check
+-fstack-limit-register=@var{reg} -fstack-limit-symbol=@var{sym}
-fargument-alias -fargument-noalias
-fargument-noalias-global
-fleading-underscore
* Link Options:: Specifying libraries and so on.
* Directory Options:: Where to find header files and libraries.
Where to find the compiler executable files.
-* Target Options:: Running a cross-compiler, or an old version of GNU CC.
+* Spec Files:: How to pass switches to sub-processes.
+* Target Options:: Running a cross-compiler, or an old version of GCC.
@end menu
@node Overall Options
Turn off any specification of a language, so that subsequent files are
handled according to their file name suffixes (as they are if @samp{-x}
has not been used at all).
+
+@item -pass-exit-codes
+Normally the @code{gcc} program will exit with the code of 1 if any
+phase of the compiler returns a non-success return code. If you specify
+@samp{-pass-exit-codes}, the @code{gcc} program will instead return with
+numerically highest error produced by any phase that returned an error
+indication.
@end table
If you only want some of the stages of compilation, you can use
@cindex C++ source file suffixes
C++ source files conventionally use one of the suffixes @samp{.C},
@samp{.cc}, @samp{.cpp}, @samp{.c++}, @samp{.cp}, or @samp{.cxx};
-preprocessed C++ files use the suffix @samp{.ii}. GNU CC recognizes
+preprocessed C++ files use the suffix @samp{.ii}. GCC recognizes
files with these names and compiles them as C++ programs even if you
call the compiler the same way as for compiling C programs (usually with
the name @code{gcc}).
compiler that understands the C++ language---and under some
circumstances, you might want to compile programs from standard input,
or otherwise without a suffix that flags them as C++ programs.
-@code{g++} is a program that calls GNU CC with the default language
+@code{g++} is a program that calls GCC with the default language
set to C++, and automatically specifies linking against the C++
library. On many systems, the script @code{g++} is also
installed with the name @code{c++}.
@table @code
@cindex ANSI support
@item -ansi
-Support all ANSI standard C programs.
+In C mode, support all ANSI standard C programs. In C++ mode,
+remove GNU extensions that conflict with ISO C++.
+@c shouldn't we be saying "ISO"?
-This turns off certain features of GNU C that are incompatible with ANSI
-C, such as the @code{asm}, @code{inline} and @code{typeof} keywords, and
+This turns off certain features of GCC that are incompatible with ANSI
+C (when compiling C code), or of standard C++ (when compiling C++ code),
+such as the @code{asm} and @code{typeof} keywords, and
predefined macros such as @code{unix} and @code{vax} that identify the
type of system you are using. It also enables the undesirable and
-rarely used ANSI trigraph feature, and it disables recognition of C++
-style @samp{//} comments.
+rarely used ANSI trigraph feature. For the C compiler,
+it disables recognition of C++ style @samp{//} comments as well as
+the @code{inline} keyword.
The alternate keywords @code{__asm__}, @code{__extension__},
@code{__inline__} and @code{__typeof__} continue to work despite
The functions @code{alloca}, @code{abort}, @code{exit}, and
@code{_exit} are not builtin functions when @samp{-ansi} is used.
-@item -flang-isoc9x
-Enable support for features found in the C9X standard. In particular,
-enable support for the C9X @code{restrict} keyword.
+@item -fstd=
+Determine the language standard. A value for this option must be provided;
+possible values are
+
+@itemize @minus
+@item iso9899:1990
+Same as -ansi
+
+@item iso9899:199409
+ISO C as modified in amend. 1
+
+@item iso9899:199x
+ISO C 9x
+
+@item c89
+same as -std=iso9899:1990
+
+@item c9x
+same as -std=iso9899:199x
+
+@item gnu89
+default, iso9899:1990 + gnu extensions
+
+@item gnu9x
+iso9899:199x + gnu extensions
+@end itemize
-Even when this option is not specified, you can still use some C9X
-features in so far as they do not conflict with previous C standards.
-For example, you may use @code{__restrict__} even when -flang-isoc9x
-is not specified.
+Even when this option is not specified, you can still use some of the
+features of newer standards in so far as they do not conflict with
+previous C standards. For example, you may use @code{__restrict__} even
+when -fstd=c9x is not specified.
@item -fno-asm
Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
@findex abs
@findex alloca
@findex cos
+@findex cosf
+@findex cosl
@findex exit
+@findex _exit
@findex fabs
+@findex fabsf
+@findex fabsl
@findex ffs
@findex labs
@findex memcmp
@findex memcpy
+@findex memset
@findex sin
+@findex sinf
+@findex sinl
@findex sqrt
+@findex sqrtf
+@findex sqrtl
@findex strcmp
@findex strcpy
@findex strlen
Don't recognize builtin functions that do not begin with @samp{__builtin_}
as prefix. Currently, the functions affected include @code{abort},
-@code{abs}, @code{alloca}, @code{cos}, @code{exit}, @code{fabs},
-@code{ffs}, @code{labs}, @code{memcmp}, @code{memcpy}, @code{sin},
-@code{sqrt}, @code{strcmp}, @code{strcpy}, and @code{strlen}.
+@code{abs}, @code{alloca}, @code{cos}, @code{cosf}, @code{cosl},
+@code{exit}, @code{_exit}, @code{fabs}, @code{fabsf}, @code{fabsl},
+@code{ffs}, @code{labs}, @code{memcmp}, @code{memcpy}, @code{memset},
+@code{sin}, @code{sinf}, @code{sinl}, @code{sqrt}, @code{sqrtf},
+@code{sqrtl}, @code{strcmp}, @code{strcpy}, and @code{strlen}.
GCC normally generates special code to handle certain builtin functions
more efficiently; for instance, calls to @code{alloca} may become single
cannot set a breakpoint on those calls, nor can you change the behavior
of the functions by linking with a different library.
-The @samp{-ansi} option prevents @code{alloca} and @code{ffs} from being
-builtin functions, since these functions do not have an ANSI standard
-meaning.
+The @samp{-ansi} option prevents @code{alloca}, @code{ffs} and @code{_exit}
+from being builtin functions, since these functions do not have an ANSI
+standard meaning.
@item -fhosted
@cindex hosted environment
precision, use this option. This option has no effect when compiling
with ANSI or GNU C conventions (the default).
+@item -fshort-wchar
+Override the underlying type for @samp{wchar_t} to be @samp{short
+unsigned int} instead of the default for the target. This option is
+useful for building programs to run under WINE.
@end table
@node C++ Dialect Options
@noindent
In this example, only @samp{-frepo} is an option meant
only for C++ programs; you can use the other options with any
-language supported by GNU CC.
+language supported by GCC.
Here is a list of options that are @emph{only} for compiling C++ programs:
Specifying this option disables that optimization, and forces g++ to
call the copy constructor in all cases.
+@item -fno-enforce-eh-specs
+Don't check for violation of exception specifications at runtime. This
+option violates the C++ standard, but may be useful for reducing code
+size in production builds, much like defining @samp{NDEBUG}. The compiler
+will still optimize based on the exception specifications.
+
@item -fexternal-templates
Cause template instantiations to obey @samp{#pragma interface} and
@samp{implementation}; template instances are emitted or not according
@itemx -fno-for-scope
If -ffor-scope is specified, the scope of variables declared in
a @i{for-init-statement} is limited to the @samp{for} loop itself,
-as specified by the draft C++ standard.
+as specified by the C++ standard.
If -fno-for-scope is specified, the scope of variables declared in
a @i{for-init-statement} extends to the end of the enclosing scope,
as was the case in old versions of gcc, and other (traditional)
otherwise be invalid, or have different behavior.
@item -fno-gnu-keywords
-Do not recognize @code{classof}, @code{headof}, @code{signature},
-@code{sigof} or @code{typeof} as a keyword, so that code can use these
-words as identifiers. You can use the keywords @code{__classof__},
-@code{__headof__}, @code{__signature__}, @code{__sigof__}, and
-@code{__typeof__} instead. @samp{-ansi} implies
-@samp{-fno-gnu-keywords}.
+Do not recognize @code{typeof} as a keyword, so that code can use these
+words as identifiers. You can use the keywords @code{__typeof__}
+instead. @samp{-ansi} implies @samp{-fno-gnu-keywords}.
@item -fguiding-decls
Treat a function declaration with the same type as a potential function
ABI, all C++ code, @emph{including libgcc.a} must be built with the same
setting of this option.
-@item -fhandle-signatures
-Recognize the @code{signature} and @code{sigof} keywords for specifying
-abstract types. The default (@samp{-fno-handle-signatures}) is not to
-recognize them. @xref{C++ Signatures, Type Abstraction using
-Signatures}.
-
@item -fhonor-std
Treat the @code{namespace std} as a namespace, instead of ignoring
it. For compatibility with earlier versions of g++, the compiler will,
Like all options that change the ABI, all C++ code, @emph{including
libgcc} must be built with the same setting of this option.
+@item -fmessage-length=@var{n}
+Try to format error messages so that they fit on lines of about @var{n}
+characters. The default is 72 characters. If @var{n} is zero, then no
+line-wrapping will be done; each error message will appear on a single
+line.
+
@item -fno-implicit-templates
Never emit code for non-inline templates which are instantiated
implicitly (i.e. by use); only emit code for explicit instantiations.
controlled by @samp{#pragma implementation}. This will cause linker
errors if these functions are not inlined everywhere they are called.
+@item -fms-extensions
+Disable pedwarns about constructs used in MFC, such as implicit int and
+getting a pointer to member function via non-standard syntax.
+
@item -fname-mangling-version-@var{n}
Control the way in which names are mangled. Version 0 is compatible
with versions of g++ before 2.8. Version 1 is the default. Version 1
Like all options that change the ABI, all C++ code, @emph{including
libgcc} must be built with the same setting of this option.
-@item -foperator-names
-Recognize the operator name keywords @code{and}, @code{bitand},
+@item -fno-operator-names
+Do not treat the operator name keywords @code{and}, @code{bitand},
@code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
-synonyms for the symbols they refer to. @samp{-ansi} implies
-@samp{-foperator-names}.
+synonyms as keywords.
@item -fno-optional-diags
Disable diagnostics that the standard says a compiler does not need to
Downgrade messages about nonconformant code from errors to warnings. By
default, g++ effectively sets @samp{-pedantic-errors} without
@samp{-pedantic}; this option reverses that. This behavior and this
-option are superceded by @samp{-pedantic}, which works as it does for GNU C.
+option are superseded by @samp{-pedantic}, which works as it does for GNU C.
@item -frepo
Enable automatic template instantiation. This option also implies
information.
@item -fno-rtti
-Disable generation of the information used by C++ runtime type
-identification features (@samp{dynamic_cast} and @samp{typeid}). If you
-don't use those parts of the language (or exception handling, which uses
-@samp{dynamic_cast} internally), you can save some space by using this
-flag.
+Disable generation of information about every class with virtual
+functions for use by the C++ runtime type identification features
+(@samp{dynamic_cast} and @samp{typeid}). If you don't use those parts
+of the language, you can save some space by using this flag. Note that
+exception handling uses the same information, but it will generate it as
+needed.
@item -fstrict-prototype
Within an @samp{extern "C"} linkage specification, treat a function
endless recursions during template class instantiation. ANSI/ISO C++
conforming programs must not rely on a maximum depth greater than 17.
-@item -fthis-is-variable
-Permit assignment to @code{this}. The incorporation of user-defined
-free store management into C++ has made assignment to @samp{this} an
-anachronism. Therefore, by default it is invalid to assign to
-@code{this} within a class member function; that is, GNU C++ treats
-@samp{this} in a member function of class @code{X} as a non-lvalue of
-type @samp{X *}. However, for backwards compatibility, you can make it
-valid with @samp{-fthis-is-variable}.
+@item -fuse-cxa-atexit
+Register destructors for objects with static storage duration with the
+@code{__cxa_atexit} function rather than the @code{atexit} function.
+This option is required for fully standards-compliant handling of static
+destructors, but will only work if your C library supports
+@code{__cxa_atexit}.
@item -fvtable-thunks
Use @samp{thunks} to implement the virtual function dispatch table
for example, @samp{-Wno-implicit}. This manual lists only one of the
two forms, whichever is not the default.
-These options control the amount and kinds of warnings produced by GNU
-CC:
+These options control the amount and kinds of warnings produced by GCC:
@table @code
@cindex syntax checking
@xref{Alternate Keywords}.
This option is not intended to be @i{useful}; it exists only to satisfy
-pedants who would otherwise claim that GNU CC fails to support the ANSI
+pedants who would otherwise claim that GCC fails to support the ANSI
standard.
Some users try to use @samp{-pedantic} to check programs for strict ANSI
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
Warn if parentheses are omitted in certain contexts, such
as when there is an assignment in a context where a truth value
(@pxref{Variable Attributes}).
@item -Wuninitialized
-An automatic variable is used without first being initialized.
+Warn if an automatic variable is used without first being initialized or
+if a variable may be clobbered by a @code{setjmp} call.
These warnings are possible only in optimizing compilation,
because they require data flow information that is computed only
computations may be deleted by data flow analysis before the warnings
are printed.
-These warnings are made optional because GNU CC is not smart
+These warnings are made optional because GCC is not smart
enough to see all the reasons why the code might be correct
despite appearing to have an error. Here is one example of how
this can happen:
@noindent
If the value of @code{y} is always 1, 2 or 3, then @code{x} is
-always initialized, but GNU CC doesn't know this. Here is
+always initialized, but GCC doesn't know this. Here is
another common case:
@smallexample
@noindent
This has no bug because @code{save_y} is used only if it is set.
+@cindex @code{longjmp} warnings
+This option also warns when a nonvolatile automatic variable might be
+changed by a call to @code{longjmp}. These warnings as well are possible
+only in optimizing compilation.
+
+The compiler sees only the calls to @code{setjmp}. It cannot know
+where @code{longjmp} will be called; in fact, a signal handler could
+call it at any point in the code. As a result, you may get a warning
+even when there is in fact no problem because @code{longjmp} cannot
+in fact be called at the place which would cause a problem.
+
Some spurious warnings can be avoided if you declare all the functions
you use that never return as @code{noreturn}. @xref{Function
Attributes}.
+@item -Wreorder (C++ only)
+@cindex reordering, warning
+@cindex warning for reordering of member initializers
+Warn when the order of member initializers given in the code does not
+match the order in which they must be executed. For instance:
+
@item -Wunknown-pragmas
@cindex warning for unknown pragmas
@cindex unknown pragmas, warning
Print extra warning messages for these events:
@itemize @bullet
-@cindex @code{longjmp} warnings
-@item
-A nonvolatile automatic variable might be changed by a call to
-@code{longjmp}. These warnings as well are possible only in
-optimizing compilation.
-
-The compiler sees only the calls to @code{setjmp}. It cannot know
-where @code{longjmp} will be called; in fact, a signal handler could
-call it at any point in the code. As a result, you may get a warning
-even when there is in fact no problem because @code{longjmp} cannot
-in fact be called at the place which would cause a problem.
-
@item
A function can return either with or without a value. (Falling
off the end of the function body is considered returning without
@end smallexample
@end itemize
-@item -Wtraditional
+@item -Wfloat-equal
+Warn if floating point values are used in equality comparisons.
+
+The idea behind this is that sometimes it is convenient (for the
+programmer) to consider floating-point values as approximations to
+infinitely precise real numbers. If you are doing this, then you need
+to compute (by analysing the code, or in some other way) the maximum or
+likely maximum error that the computation introduces, and allow for it
+when performing comparisons (and when producing output, but that's a
+different problem). In particular, instead of testing for equality, you
+would check to see whether the two values have ranges that overlap; and
+this is done with the relational operators, so equality comparisons are
+probably mistaken.
+
+@item -Wtraditional (C only)
Warn about certain constructs that behave differently in traditional and
ANSI C.
@item
A non-@code{static} function declaration follows a @code{static} one.
This construct is not accepted by some traditional C compilers.
+
+@item
+The ANSI type of an integer constant has a different width or
+signedness from its traditional type. This warning is only issued if
+the base of the constant is ten. I.e. hexadecimal or octal values, which
+typically represent bit patterns, are not warned about.
+
+@item
+Usage of ANSI string concatenation is detected.
@end itemize
@item -Wundef
convenience in calculations with @code{void *} pointers and pointers
to functions.
-@item -Wbad-function-cast
+@item -Wbad-function-cast (C only)
Warn whenever a function call is cast to a non-matching type.
For example, warn if @code{int malloc()} is cast to @code{anything *}.
called. (In languages where you can return an array, this also elicits
a warning.)
-@item -Wstrict-prototypes
+@item -Wstrict-prototypes (C only)
Warn if a function is declared or defined without specifying the
argument types. (An old-style function definition is permitted without
a warning if preceded by a declaration which specifies the argument
types.)
-@item -Wmissing-prototypes
+@item -Wmissing-prototypes (C only)
Warn if a global function is defined without a previous prototype
declaration. This warning is issued even if the definition itself
provides a prototype. The aim is to detect global functions that fail
adding the @code{noreturn} attribute, otherwise subtle code generation
bugs could be introduced.
+@item -Wpacked
+Warn if a structure is given the packed attribute, but the packed
+attribute has no effect on the layout or size of the structure.
+Such structures may be mis-aligned for little benefit. For
+instance, in this code, the variable @code{f.x} in @code{struct bar}
+will be misaligned even though @code{struct bar} does not itself
+have the packed attribute:
+
+@smallexample
+@group
+struct foo @{
+ int x;
+ char a, b, c, d;
+@} __attribute__((packed));
+struct bar @{
+ char z;
+ struct foo f;
+@};
+@end group
+@end smallexample
+
+@item -Wpadded
+Warn if padding is included in a structure, either to align an element
+of the structure or to align the whole structure. Sometimes when this
+happens it is possible to rearrange the fields of the structure to
+reduce the padding and so make the structure smaller.
+
@item -Wredundant-decls
Warn if anything is declared more than once in the same scope, even in
cases where multiple declaration is valid and changes nothing.
-@item -Wnested-externs
-Warn if an @code{extern} declaration is encountered within an function.
+@item -Wnested-externs (C only)
+Warn if an @code{extern} declaration is encountered within a function.
+
+@item -Wunreachable-code
+Warn if the compiler detects that code will never be executed.
+
+This option is intended to warn when the compiler detects that at
+least a whole line of source code will never be executed, because
+some condition is never satisfied or because it is after a
+procedure that never returns.
+
+It is possible for this option to produce a warning even though there
+are circumstances under which part of the affected line can be executed,
+so care should be taken when removing apparently-unreachable code.
+
+For instance, when a function is inlined, a warning may mean that the
+line is unreachable in only one inlined copy of the function.
+
+This option is not made part of @samp{-Wall} because in a debugging
+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.
@item -Winline
-Warn if a function can not be inlined, and either it was declared as inline,
-or else the @samp{-finline-functions} option was given.
+Warn if a function can not be inlined and it was declared as inline.
@item -Wlong-long
Warn if @samp{long long} type is used. This is default. To inhibit
@end table
@node Debugging Options
-@section Options for Debugging Your Program or GNU CC
+@section Options for Debugging Your Program or GCC
@cindex options, debugging
@cindex debugging information options
-GNU CC has various special options that are used for debugging
+GCC has various special options that are used for debugging
either your program or GCC:
@table @code
@samp{-gxcoff+}, @samp{-gxcoff}, @samp{-gdwarf-1+}, or @samp{-gdwarf-1}
(see below).
-Unlike most other C compilers, GNU CC allows you to use @samp{-g} with
+Unlike most other C compilers, GCC allows you to use @samp{-g} with
@samp{-O}. The shortcuts taken by optimized code may occasionally
produce surprising results: some variables you declared may not exist
at all; flow of control may briefly move where you did not expect it;
Nevertheless it proves possible to debug optimized output. This makes
it reasonable to use the optimizer for programs that might have bugs.
-The following options are useful when GNU CC is generated with the
+The following options are useful when GCC is generated with the
capability for more than one debugging format.
@item -ggdb
@item -fprofile-arcs
Instrument @dfn{arcs} during compilation. For each function of your
-program, GNU CC creates a program flow graph, then finds a spanning tree
+program, GCC creates a program flow graph, then finds a spanning tree
for the graph. Only arcs that are not on the spanning tree have to be
instrumented: the compiler adds code to count the number of times that these
arcs are executed. When an arc is the only exit or only entrance to a
@need 2000
@item -ftest-coverage
Create data files for the @code{gcov} code-coverage utility
-(@pxref{Gcov,, @code{gcov}: a GNU CC Test Coverage Program}).
+(@pxref{Gcov,, @code{gcov}: a GCC Test Coverage Program}).
The data file names begin with the name of your source file:
@table @code
@samp{-fprofile-arcs}).
@end table
-@item -Q
-Makes the compiler print out each function name as it is compiled, and
-print some statistics about each pass when it finishes.
-
@item -d@var{letters}
Says to make debugging dumps during compilation at times specified by
@var{letters}. This is used for debugging the compiler. The file names
-for most of the dumps are made by appending a word to the source file
-name (e.g. @file{foo.c.rtl} or @file{foo.c.jump}). Here are the
-possible letters for use in @var{letters}, and their meanings:
+for most of the dumps are made by appending a pass number and a word to
+the source file name (e.g. @file{foo.c.00.rtl} or @file{foo.c.01.jump}).
+Here are the possible letters for use in @var{letters}, and their meanings:
@table @samp
+@item A
+Annotate the assembler output with miscellaneous debugging information.
@item b
-Dump after computing branch probabilities, to @file{@var{file}.bp}.
+Dump after computing branch probabilities, to @file{@var{file}.07.bp}.
@item c
-Dump after instruction combination, to the file @file{@var{file}.combine}.
+Dump after instruction combination, to the file @file{@var{file}.09.combine}.
@item d
-Dump after delayed branch scheduling, to @file{@var{file}.dbr}.
+Dump after delayed branch scheduling, to @file{@var{file}.19.dbr}.
@item D
Dump all macro definitions, at the end of preprocessing, in addition to
normal output.
-@item r
-Dump after RTL generation, to @file{@var{file}.rtl}.
-@item j
-Dump after first jump optimization, to @file{@var{file}.jump}.
@item F
-Dump after purging ADDRESSOF, to @file{@var{file}.addressof}.
+Dump after purging ADDRESSOF, to @file{@var{file}.03.addressof}.
@item f
-Dump after flow analysis, to @file{@var{file}.flow}.
+Dump after flow analysis, to @file{@var{file}.08.flow}.
@item g
-Dump after global register allocation, to @file{@var{file}.greg}.
+Dump after global register allocation, to @file{@var{file}.13.greg}.
@item G
-Dump after GCSE, to @file{@var{file}.gcse}.
+Dump after GCSE, to @file{@var{file}.04.gcse}.
@item j
-Dump after first jump optimization, to @file{@var{file}.jump}.
+Dump after first jump optimization, to @file{@var{file}.01.jump}.
@item J
-Dump after last jump optimization, to @file{@var{file}.jump2}.
+Dump after last jump optimization, to @file{@var{file}.17.jump2}.
@item k
-Dump after conversion from registers to stack, to @file{@var{file}.stack}.
+Dump after conversion from registers to stack, to @file{@var{file}.20.stack}.
@item l
-Dump after local register allocation, to @file{@var{file}.lreg}.
+Dump after local register allocation, to @file{@var{file}.12.lreg}.
@item L
-Dump after loop optimization, to @file{@var{file}.loop}.
+Dump after loop optimization, to @file{@var{file}.05.loop}.
@item M
Dump after performing the machine dependent reorganisation pass, to
-@file{@var{file}.mach}.
+@file{@var{file}.18.mach}.
@item N
-Dump after the register move pass, to @file{@var{file}.regmove}.
+Dump after the register move pass, to @file{@var{file}.10.regmove}.
@item r
-Dump after RTL generation, to @file{@var{file}.rtl}.
+Dump after RTL generation, to @file{@var{file}.00.rtl}.
@item R
-Dump after the second instruction scheduling pass, to @file{@var{file}.sched2}.
+Dump after the second instruction scheduling pass, to
+@file{@var{file}.16.sched2}.
@item s
Dump after CSE (including the jump optimization that sometimes follows
-CSE), to @file{@var{file}.cse}.
+CSE), to @file{@var{file}.02.cse}.
@item S
-Dump after the first instruction scheduling pass, to @file{@var{file}.sched}.
+Dump after the first instruction scheduling pass, to
+@file{@var{file}.11.sched}.
@item t
Dump after the second CSE pass (including the jump optimization that
-sometimes follows CSE), to @file{@var{file}.cse2}.
+sometimes follows CSE), to @file{@var{file}.06.cse2}.
@item a
Produce all the dumps listed above.
@item m
Annotate the assembler output with a comment indicating which
pattern and alternative was used. The length of each instruction is
also printed.
+@item v
+For each of the other indicated dump files (except for
+@file{@var{file}.00.rtl}), dump a representation of the control flow graph
+suitible for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
+@item w
+Dump after the second flow pass to @file{@var{file}.14.flow2}.
@item x
Just generate RTL for a function instead of compiling it. Usually used
with @samp{r}.
@item y
Dump debugging information during parsing, to standard error.
-@item A
-Annotate the assembler output with miscellaneous debugging information.
+@item z
+Dump after the peephole2 pass to @file{@var{file}.15.peephole2}.
@end table
@item -fdump-unnumbered
use diff on debugging dumps for compiler invokations with different
options, in particular with and without -g.
+@item -fdump-translation-unit-@var{file} (C++ only)
+Dump a representation of the tree structure for the entire translation
+unit to @var{file}.
+
@item -fpretend-float
When running a cross-compiler, pretend that the target machine uses the
same floating point format as the host machine. This causes incorrect
output of the actual floating constants, but the actual instruction
-sequence will probably be the same as GNU CC would make when running on
+sequence will probably be the same as GCC would make when running on
the target machine.
@item -save-temps
compiling @file{foo.c} with @samp{-c -save-temps} would produce files
@file{foo.i} and @file{foo.s}, as well as @file{foo.o}.
+@item -time
+Report the CPU time taken by each subprocess in the compilation
+sequence. For C source files, this is the preprocessor, compiler
+proper, and assembler. The output looks like this:
+
+@smallexample
+# cpp 0.04 0.04
+# cc1 0.12 0.01
+# as 0.00 0.01
+@end smallexample
+
+The first number on each line is the ``user time,'' that is time spent
+executing the program itself. The second number is ``system time,''
+time spent executing operating system routines on behalf of the program.
+Both numbers are in seconds.
+
@item -print-file-name=@var{library}
Print the full absolute name of the library file @var{library} that
would be used when linking---and don't do anything else. With this
-option, GNU CC does not compile or link anything; it just prints the
+option, GCC does not compile or link anything; it just prints the
file name.
@item -print-prog-name=@var{program}
on other flags.@refill
@item -O2
-Optimize even more. GNU CC performs nearly all supported optimizations
+Optimize even more. GCC performs nearly all supported optimizations
that do not involve a space-speed tradeoff. The compiler does not
perform loop unrolling or function inlining when you specify @samp{-O2}.
As compared to @samp{-O}, this option increases both compilation time
in many functions. @strong{It also makes debugging impossible on
some machines.}
+@item -foptimize-sibling-calls
+Optimize sibling and tail recursive calls.
+
@ifset INTERNALS
On some machines, such as the Vax, this flag has no effect, because
the standard calling sequence automatically handles the frame pointer
declared @code{static}, then the function is normally not output as
assembler code in its own right.
-@item -finline-limit-@var{n}
+@item -finline-limit=@var{n}
By default, gcc limits the size of functions that can be inlined. This flag
allows the control of this limit for functions that are explicitly marked as
inline (ie marked with the inline keyword or defined within the class
Emit variables declared @code{static const} when optimization isn't turned
on, even if the variables aren't referenced.
-GNU CC enables this option by default. If you want to force the compiler to
+GCC enables this option by default. If you want to force the compiler to
check if the variable was referenced, regardless of whether or not
optimization is turned on, use the @samp{-fno-keep-static-consts} option.
it can result in incorrect output for programs which depend on
an exact implementation of IEEE or ANSI rules/specifications for
math functions.
+
+@item -fno-math-errno
+Do not set ERRNO after calling math functions that are executed
+with a single instruction, e.g., sqrt. A program that relies on
+IEEE exceptions for math error handling may want to use this flag
+for speed while maintaining IEEE arithmetic compatibility.
+
+The default is @samp{-fmath-errno}. The @samp{-ffast-math} option
+sets @samp{-fno-math-errno}.
@end table
@c following causes underfulls.. they don't look great, but we deal.
Perform a global common subexpression elimination pass.
This pass also performs global constant and copy propagation.
+@item -fdelete-null-pointer-checks
+Use global dataflow analysis to identify and eliminate useless null
+pointer checks. Programs which rely on NULL pointer dereferences @emph{not}
+halting the program may not work properly with this option. Use
+-fno-delete-null-pointer-checks to disable this optimizing for programs
+which depend on that behavior.
+
+
@item -fexpensive-optimizations
Perform a number of minor optimizations that are relatively expensive.
Attempt to reassign register numbers in move instructions and as
operands of other simple instructions in order to maximize the amount of
register tying. This is especially helpful on machines with two-operand
-instructions. GNU CC enables this optimization by default with @samp{-O2}
+instructions. GCC enables this optimization by default with @samp{-O2}
or higher.
Note @code{-fregmove} and @code{-foptimize-register-moves} are the same
@item -funroll-loops
Perform the optimization of loop unrolling. This is only done for loops
whose number of iterations can be determined at compile time or run time.
-@samp{-funroll-loop} implies both @samp{-fstrength-reduce} and
+@samp{-funroll-loops} implies both @samp{-fstrength-reduce} and
@samp{-frerun-cse-after-loop}.
@item -funroll-all-loops
strength-reduced.
@emph{Note:} When compiling programs written in Fortran,
-@samp{-fmove-all-moveables} and @samp{-freduce-all-givs} are enabled
+@samp{-fmove-all-movables} and @samp{-freduce-all-givs} are enabled
by default when you use the optimizer.
These options may generate better or worse code; results are highly
they have helped determine the efficacy of various
approaches to improving loop optimizations.
-Please let us (@code{egcs@@egcs.cygnus.com} and @code{fortran@@gnu.org})
+Please let us (@code{gcc@@gcc.gnu.org} and @code{fortran@@gnu.org})
know how use of these options affects
the performance of your production code.
We're very interested in code that runs @emph{slower}
@code{c_get_alias_set}.
@end ifset
+@item -falign-functions
+@itemx -falign-functions=@var{n}
+Align the start of functions to the next power-of-two greater than
+@var{n}, skipping up to @var{n} bytes. For instance,
+@samp{-falign-functions=32} aligns functions to the next 32-byte
+boundary, but @samp{-falign-functions=24} would align to the next
+32-byte boundary only if this can be done by skipping 23 bytes or less.
+
+@samp{-fno-align-functions} and @samp{-falign-functions=1} are
+equivalent and mean that functions will not be aligned.
+
+Some assemblers only support this flag when @var{n} is a power of two;
+in that case, it is rounded up.
+
+If @var{n} is not specified, use a machine-dependent default.
+
+@item -falign-labels
+@itemx -falign-labels=@var{n}
+Align all branch targets to a power-of-two boundary, skipping up to
+@var{n} bytes like @samp{-falign-functions}. This option can easily
+make code slower, because it must insert dummy operations for when the
+branch target is reached in the usual flow of the code.
+
+If @samp{-falign-loops} or @samp{-falign-jumps} are applicable and
+are greater than this value, then their values are used instead.
+
+If @var{n} is not specified, use a machine-dependent default which is
+very likely to be @samp{1}, meaning no alignment.
+
+@item -falign-loops
+@itemx -falign-loops=@var{n}
+Align loops to a power-of-two boundary, skipping up to @var{n} bytes
+like @samp{-falign-functions}. The hope is that the loop will be
+executed many times, which will make up for any execution of the dummy
+operations.
+
+If @var{n} is not specified, use a machine-dependent default.
+
+@item -falign-jumps
+@itemx -falign-jumps=@var{n}
+Align branch targets to a power-of-two boundary, for branch targets
+where the targets can only be reached by jumping, skipping up to @var{n}
+bytes like @samp{-falign-functions}. In this case, no dummy operations
+need be executed.
+
+If @var{n} is not specified, use a machine-dependent default.
+
@end table
@node Preprocessor Options
@cindex unresolved references and @code{-nodefaultlibs}
One of the standard libraries bypassed by @samp{-nostdlib} and
@samp{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
-that GNU CC uses to overcome shortcomings of particular machines, or special
+that GCC uses to overcome shortcomings of particular machines, or special
needs for some languages.
@ifset INTERNALS
-(@xref{Interface,,Interfacing to GNU CC Output}, for more discussion of
+(@xref{Interface,,Interfacing to GCC Output}, for more discussion of
@file{libgcc.a}.)
@end ifset
@ifclear INTERNALS
-(@xref{Interface,,Interfacing to GNU CC Output,gcc.info,Porting GNU CC},
+(@xref{Interface,,Interfacing to GCC Output,gcc.info,Porting GCC},
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 @samp{-nostdlib}
or @samp{-nodefaultlibs} you should usually specify @samp{-lgcc} as well.
-This ensures that you have no unresolved references to internal GNU CC
+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,,@code{collect2}}.)
@item -Xlinker @var{option}
Pass @var{option} as an option to the linker. You can use this to
-supply system-specific linker options which GNU CC does not know how to
+supply system-specific linker options which GCC does not know how to
recognize.
If you want to pass an option that takes an argument, you must use
are processed in order, from left to right.
@end table
+@node Spec Files
+@section Specifying subprocesses and the switches to pass to them
+@cindex Spec Files
+@code{GCC} is a driver program. It performs its job by invoking a
+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
+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
+be overridden by using the @samp{-specs=} command-line switch to specify
+a spec file.
+
+@dfn{Spec files} are plaintext files that are used to construct spec
+strings. They consist of a sequence of directives separated by blank
+lines. The type of directive is determined by the first non-whitespace
+character on the line and it can be one of the following:
+
+@table @code
+@item %@var{command}
+Issues a @var{command} to the spec file processor. The commands that can
+appear here are:
+
+@table @code
+@item %include <@var{file}>
+@cindex %include
+Search for @var{file} and insert its text at the current point in the
+specs file.
+
+@item %include_noerr <@var{file}>
+@cindex %include_noerr
+Just like @samp{%include}, but do not generate an error message if the include
+file cannot be found.
+
+@item %rename @var{old_name} @var{new_name}
+@cindex %rename
+Rename the spec string @var{old_name} to @var{new_name}.
+
+@end table
+
+@item *[@var{spec_name}]:
+This tells the compiler to create, override or delete the named spec
+string. All lines after this directive up to the next directive or
+blank line are considered to be the text for the spec string. If this
+results in an empty string then the spec will be deleted. (Or, if the
+spec did not exist, then nothing will happened.) Otherwise, if the spec
+does not currently exist a new spec will be created. If the spec does
+exist then its contents will be overridden by the text of this
+directive, unless the first character of that text is the @samp{+}
+character, in which case the text will be appended to the spec.
+
+@item [@var{suffix}]:
+Creates a new @samp{[@var{suffix}] spec} pair. All lines after this directive
+and up to the next directive or blank line are considered to make up the
+spec string for the indicated suffix. When the compiler encounters an
+input file with the named suffix, it will processes the spec string in
+order to work out how to compile that file. For example:
+
+@smallexample
+.ZZ:
+z-compile -input %i
+@end smallexample
+
+This says that any input file whose name ends in @samp{.ZZ} should be
+passed to the program @samp{z-compile}, which should be invoked with the
+command-line switch @samp{-input} and with the result of performing the
+@samp{%i} substitution. (See below.)
+
+As an alternative to providing a spec string, the text that follows a
+suffix directive can be one of the following:
+
+@table @code
+@item @@@var{language}
+This says that the suffix is an alias for a known @var{language}. This is
+similar to using the @code{-x} command-line switch to GCC to specify a
+language explicitly. For example:
+
+@smallexample
+.ZZ:
+@@c++
+@end smallexample
+
+Says that .ZZ files are, in fact, C++ source files.
+
+@item #@var{name}
+This causes an error messages saying:
+
+@smallexample
+@var{name} compiler not installed on this system.
+@end smallexample
+@end table
+
+GCC already has an extensive list of suffixes built into it.
+This directive will add an entry to the end of the list of suffixes, but
+since the list is searched from the end backwards, it is effectively
+possible to override earlier entries using this technique.
+
+@end table
+
+GCC has the following spec strings built into it. Spec files can
+override these strings or create their own. Note that individual
+targets can also add their own spec strings to this list.
+
+@smallexample
+asm Options to pass to the assembler
+asm_final Options to pass to the assembler post-processor
+cpp Options to pass to the C preprocessor
+cc1 Options to pass to the C compiler
+cc1plus Options to pass to the C++ compiler
+endfile Object files to include at the end of the link
+link Options to pass to the linker
+lib Libraries to include on the command line to the linker
+libgcc Decides which GCC support library to pass to the linker
+linker Sets the name of the linker
+predefines Defines to be passed to the C preprocessor
+signed_char Defines to pass to CPP to say whether @code{char} is signed by default
+startfile Object files to include at the start of the link
+@end smallexample
+
+Here is a small example of a spec file:
+
+@smallexample
+%rename lib old_lib
+
+*lib:
+--start-group -lgcc -lc -leval1 --end-group %(old_lib)
+@end smallexample
+
+This example renames the spec called @samp{lib} to @samp{old_lib} and
+then overrides the previous definition of @samp{lib} with a new one.
+The new definition adds in some extra command-line options before
+including the text of the old definition.
+
+@dfn{Spec strings} are a list of command-line options to be passed to their
+corresponding program. In addition, the spec strings can contain
+@samp{%}-prefixed sequences to substitute variable text or to
+conditionally insert text into the command line. Using these constructs
+it is possible to generate quite complex command lines.
+
+Here is a table of all defined @samp{%}-sequences for spec
+strings. Note that spaces are not generated automatically around the
+results of expanding these sequences. Therefore you can concatenate them
+together or combine them with constant text in a single argument.
+
+@table @code
+@item %%
+Substitute one @samp{%} into the program name or argument.
+
+@item %i
+Substitute the name of the input file being processed.
+
+@item %b
+Substitute the basename of the input file being processed.
+This is the substring up to (and not including) the last period
+and not including the directory.
+
+@item %d
+Marks the argument containing or following the @samp{%d} as a
+temporary file name, so that that file will be deleted if GCC exits
+successfully. Unlike @samp{%g}, this contributes no text to the
+argument.
+
+@item %g@var{suffix}
+Substitute a file name that has suffix @var{suffix} and is chosen
+once per compilation, and mark the argument in the same way as
+@samp{%d}. To reduce exposure to denial-of-service attacks, the file
+name is now chosen in a way that is hard to predict even when previously
+chosen file names are known. For example, @samp{%g.s ... %g.o ... %g.s}
+might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}. @var{suffix} matches
+the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
+treated exactly as if @samp{%O} had been preprocessed. Previously, @samp{%g}
+was simply substituted with a file name chosen once per compilation,
+without regard to any appended suffix (which was therefore treated
+just like ordinary text), making such attacks more likely to succeed.
+
+@item %u@var{suffix}
+Like @samp{%g}, but generates a new temporary file name even if
+@samp{%u@var{suffix}} was already seen.
+
+@item %U@var{suffix}
+Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
+new one if there is no such last file name. In the absence of any
+@samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
+the same suffix @emph{space}, so @samp{%g.s ... %U.s ... %g.s ... %U.s}
+would involve the generation of two distinct file names, one
+for each @samp{%g.s} and another for each @samp{%U.s}. Previously, @samp{%U} was
+simply substituted with a file name chosen for the previous @samp{%u},
+without regard to any appended suffix.
+
+@item %w
+Marks the argument containing or following the @samp{%w} as the
+designated output file of this compilation. This puts the argument
+into the sequence of arguments that @samp{%o} will substitute later.
+
+@item %o
+Substitutes the names of all the output files, with spaces
+automatically placed around them. You should write spaces
+around the @samp{%o} as well or the results are undefined.
+@samp{%o} is for use in the specs for running the linker.
+Input files whose names have no recognized suffix are not compiled
+at all, but they are included among the output files, so they will
+be linked.
+
+@item %O
+Substitutes the suffix for object files. Note that this is
+handled specially when it immediately follows @samp{%g, %u, or %U},
+because of the need for those to form complete file names. The
+handling is such that @samp{%O} is treated exactly as if it had already
+been substituted, except that @samp{%g, %u, and %U} do not currently
+support additional @var{suffix} characters following @samp{%O} as they would
+following, for example, @samp{.o}.
+
+@item %p
+Substitutes the standard macro predefinitions for the
+current target machine. Use this when running @code{cpp}.
+
+@item %P
+Like @samp{%p}, but puts @samp{__} before and after the name of each
+predefined macro, except for macros that start with @samp{__} or with
+@samp{_@var{L}}, where @var{L} is an uppercase letter. This is for ANSI
+C.
+
+@item %I
+Substitute a @samp{-iprefix} option made from GCC_EXEC_PREFIX.
+
+@item %s
+Current argument is the name of a library or startup file of some sort.
+Search for that file in a standard list of directories and substitute
+the full name found.
+
+@item %e@var{str}
+Print @var{str} as an error message. @var{str} is terminated by a newline.
+Use this when inconsistent options are detected.
+
+@item %|
+Output @samp{-} if the input for the current command is coming from a pipe.
+
+@item %(@var{name})
+Substitute the contents of spec string @var{name} at this point.
+
+@item %[@var{name}]
+Like @samp{%(...)} but put @samp{__} around @samp{-D} arguments.
+
+@item %x@{@var{option}@}
+Accumulate an option for @samp{%X}.
+
+@item %X
+Output the accumulated linker options specified by @samp{-Wl} or a @samp{%x}
+spec string.
+
+@item %Y
+Output the accumulated assembler options specified by @samp{-Wa}.
+
+@item %Z
+Output the accumulated preprocessor options specified by @samp{-Wp}.
+
+@item %v1
+Substitute the major version number of GCC.
+(For version 2.9.5, this is 2.)
+
+@item %v2
+Substitute the minor version number of GCC.
+(For version 2.9.5, this is 9.)
+
+@item %a
+Process the @code{asm} spec. This is used to compute the
+switches to be passed to the assembler.
+
+@item %A
+Process the @code{asm_final} spec. This is a spec string for
+passing switches to an assembler post-processor, if such a program is
+needed.
+
+@item %l
+Process the @code{link} spec. This is the spec for computing the
+command line passed to the linker. Typically it will make use of the
+@samp{%L %G %S %D and %E} sequences.
+
+@item %D
+Dump out a @samp{-L} option for each directory that GCC believes might
+contain startup files. If the target supports multilibs then the
+current multilib directory will be prepended to each of these paths.
+
+@item %L
+Process the @code{lib} spec. This is a spec string for deciding which
+libraries should be included on the command line to the linker.
+
+@item %G
+Process the @code{libgcc} spec. This is a spec string for deciding
+which GCC support library should be included on the command line to the linker.
+
+@item %S
+Process the @code{startfile} spec. This is a spec for deciding which
+object files should be the first ones passed to the linker. Typically
+this might be a file named @file{crt0.o}.
+
+@item %E
+Process the @code{endfile} spec. This is a spec string that specifies
+the last object files that will be passed to the linker.
+
+@item %C
+Process the @code{cpp} spec. This is used to construct the arguments
+to be passed to the C preprocessor.
+
+@item %c
+Process the @code{signed_char} spec. This is intended to be used
+to tell cpp whether a char is signed. It typically has the definition:
+@smallexample
+%@{funsigned-char:-D__CHAR_UNSIGNED__@}
+@end smallexample
+
+@item %1
+Process the @code{cc1} spec. This is used to construct the options to be
+passed to the actual C compiler (@samp{cc1}).
+
+@item %2
+Process the @code{cc1plus} spec. This is used to construct the options to be
+passed to the actual C++ compiler (@samp{cc1plus}).
+
+@item %*
+Substitute the variable part of a matched option. See below.
+Note that each comma in the substituted string is replaced by
+a single space.
+
+@item %@{@code{S}@}
+Substitutes the @code{-S} switch, if that switch was given to GCC.
+If that switch was not specified, this substitutes nothing. Note that
+the leading dash is omitted when specifying this option, and it is
+automatically inserted if the substitution is performed. Thus the spec
+string @samp{%@{foo@}} would match the command-line option @samp{-foo}
+and would output the command line option @samp{-foo}.
+
+@item %W@{@code{S}@}
+Like %@{@code{S}@} but mark last argument supplied within as a file to be
+deleted on failure.
+
+@item %@{@code{S}*@}
+Substitutes all the switches specified to GCC whose names start
+with @code{-S}, but which also take an argument. This is used for
+switches like @samp{-o, -D, -I}, etc. GCC considers @samp{-o foo} as being
+one switch whose names starts with @samp{o}. %@{o*@} would substitute this
+text, including the space. Thus two arguments would be generated.
+
+@item %@{^@code{S}*@}
+Like %@{@code{S}*@}, but don't put a blank between a switch and its
+argument. Thus %@{^o*@} would only generate one argument, not two.
+
+@item %@{<@code{S}@}
+Remove all occurences of @code{S} from the command line. Note - this
+command is position dependent. @samp{%} commands in the spec string
+before this option will see @code{S}, @samp{%} commands in the spec
+string after this option will not.
+
+@item %@{@code{S}*:@code{X}@}
+Substitutes @code{X} if one or more switches whose names start with
+@code{-S} are specified to GCC. Note that the tail part of the
+@code{-S} option (i.e. the part matched by the @samp{*}) will be substituted
+for each occurrence of @samp{%*} within @code{X}.
+
+@item %@{@code{S}:@code{X}@}
+Substitutes @code{X}, but only if the @samp{-S} switch was given to GCC.
+
+@item %@{!@code{S}:@code{X}@}
+Substitutes @code{X}, but only if the @samp{-S} switch was @emph{not} given to GCC.
+
+@item %@{|@code{S}:@code{X}@}
+Like %@{@code{S}:@code{X}@}, but if no @code{S} switch, substitute @samp{-}.
+
+@item %@{|!@code{S}:@code{X}@}
+Like %@{!@code{S}:@code{X}@}, but if there is an @code{S} switch, substitute @samp{-}.
+
+@item %@{.@code{S}:@code{X}@}
+Substitutes @code{X}, but only if processing a file with suffix @code{S}.
+
+@item %@{!.@code{S}:@code{X}@}
+Substitutes @code{X}, but only if @emph{not} processing a file with suffix @code{S}.
+
+@item %@{@code{S}|@code{P}:@code{X}@}
+Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC. This may be
+combined with @samp{!} and @samp{.} sequences as well, although they
+have a stronger binding than the @samp{|}. For example a spec string
+like this:
+
+@smallexample
+%@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
+@end smallexample
+
+will output the following command-line options from the following input
+command-line options:
+
+@smallexample
+fred.c -foo -baz
+jim.d -bar -boggle
+-d fred.c -foo -baz -boggle
+-d jim.d -bar -baz -boggle
+@end smallexample
+
+@end table
+
+The conditional text @code{X} in a %@{@code{S}:@code{X}@} or
+%@{!@code{S}:@code{X}@} construct may contain other nested @samp{%} constructs
+or spaces, or even newlines. They are processed as usual, as described
+above.
+
+The @samp{-O, -f, -m, and -W} switches are handled specifically in these
+constructs. If another value of @samp{-O} or the negated form of a @samp{-f, -m, or
+-W} switch is found later in the command line, the earlier switch
+value is ignored, except with @{@code{S}*@} where @code{S} is just one
+letter, which passes all matching options.
+
+The character @samp{|} at the beginning of the predicate text is used to indicate
+that a command should be piped to the following command, but only if @samp{-pipe}
+is specified.
+
+It is built into GCC which switches take arguments and which do not.
+(You might think it would be useful to generalize this to allow each
+compiler's spec to say which switches take arguments. But this cannot
+be done in a consistent fashion. GCC cannot even decide which input
+files have been specified without knowing which switches take arguments,
+and it must know which input files to compile in order to tell which
+compilers to run).
+
+GCC also knows implicitly that arguments starting in @samp{-l} are to be
+treated as compiler output files, and passed to the linker in their
+proper position among the other output files.
+
@node Target Options
@section Specifying Target Machine and Compiler Version
@cindex target options
@cindex compiler version, specifying
@cindex target machine, specifying
-By default, GNU CC compiles code for the same type of machine that you
+By default, GCC compiles code for the same type of machine that you
are using. However, it can also be installed as a cross-compiler, to
compile for some other type of machine. In fact, several different
-configurations of GNU CC, for different target machines, can be
+configurations of GCC, for different target machines, can be
installed side by side. Then you specify which one to use with the
@samp{-b} option.
-In addition, older and newer versions of GNU CC can be installed side
+In addition, older and newer versions of GCC can be installed side
by side. One of them (probably the newest) will be the default, but
you may sometimes wish to use another.
@table @code
@item -b @var{machine}
The argument @var{machine} specifies the target machine for compilation.
-This is useful when you have installed GNU CC as a cross-compiler.
+This is useful when you have installed GCC as a cross-compiler.
The value to use for @var{machine} is the same as was specified as the
-machine type when configuring GNU CC as a cross-compiler. For
+machine type when configuring GCC as a cross-compiler. For
example, if a cross-compiler was configured with @samp{configure
i386v}, meaning to compile for an 80386 running System V, then you
would specify @samp{-b i386v} to run that cross compiler.
the same type of machine that you are using.
@item -V @var{version}
-The argument @var{version} specifies which version of GNU CC to run.
+The argument @var{version} specifies which version of GCC to run.
This is useful when multiple versions are installed. For example,
-@var{version} might be @samp{2.0}, meaning to run GNU CC version 2.0.
+@var{version} might be @samp{2.0}, meaning to run GCC version 2.0.
The default version, when you do not specify @samp{-V}, is the last
-version of GNU CC that you installed.
+version of GCC that you installed.
@end table
The @samp{-b} and @samp{-V} options actually work by controlling part of
the file name used for the executable files and libraries used for
-compilation. A given version of GNU CC, for a given target machine, is
+compilation. A given version of GCC, for a given target machine, is
normally kept in the directory @file{/usr/local/lib/gcc-lib/@var{machine}/@var{version}}.@refill
Thus, sites can customize the effect of @samp{-b} or @samp{-V} either by
* V850 Options::
* ARC Options::
* NS32K Options::
+* AVR Options::
+* MCore Options::
@end menu
@node M680x0 Options
@item -malign-int
@itemx -mno-align-int
-Control whether GNU CC aligns @code{int}, @code{long}, @code{long long},
+Control whether GCC aligns @code{int}, @code{long}, @code{long long},
@code{float}, @code{double}, and @code{long double} variables on a 32-bit
boundary (@samp{-malign-int}) or a 16-bit boundary (@samp{-mno-align-int}).
Aligning variables on 32-bit boundaries produces code that runs somewhat
faster on processors with 32-bit busses at the expense of more memory.
-@strong{Warning:} if you use the @samp{-malign-int} switch, GNU CC will
+@strong{Warning:} if you use the @samp{-malign-int} switch, GCC will
align structures containing the above types differently than
most published application binary interface specifications for the m68k.
+@item -mpcrel
+Use the pc-relative addressing mode of the 68000 directly, instead of
+using a global offset table. At present, this option implies -fpic,
+allowing at most a 16-bit offset for pc-relative addressing. -fPIC is
+not presently supported with -mpcrel, though this could be supported for
+68020 and higher processors.
+
+@item -mno-strict-align
+@itemx -mstrict-align
+@kindex -mstrict-align
+Do not (do) assume that unaligned memory references will be handled by
+the system.
+
@end table
@node VAX Options
@samp{-msoft-float} changes the calling convention in the output file;
therefore, it is only useful if you compile @emph{all} of a program with
this option. In particular, you need to compile @file{libgcc.a}, the
-library that comes with GNU CC, with @samp{-msoft-float} in order for
+library that comes with GCC, with @samp{-msoft-float} in order for
this to work.
@item -mhard-quad-float
@itemx -munaligned-doubles
Assume that doubles have 8 byte alignment. This is the default.
-With @samp{-munaligned-doubles}, GNU CC assumes that doubles have 8 byte
+With @samp{-munaligned-doubles}, GCC assumes that doubles have 8 byte
alignment only if they are contained in another type, or if they have an
absolute address. Otherwise, it assumes they have 4 byte alignment.
Specifying this option avoids some rare compatibility problems with code
generated by other compilers. It is not the default because it results
in a performance loss, especially for floating point code.
+@item -mno-faster-structs
+@itemx -mfaster-structs
+With @samp{-mfaster-structs}, the compiler assumes that structures
+should have 8 byte alignment. This enables the use of pairs of
+@code{ldd} and @code{std} instructions for copies in structure
+assignment, in place of twice as many @code{ld} and @code{st} pairs.
+However, the use of this changed alignment directly violates the Sparc
+ABI. Thus, it's intended only for use on targets where the developer
+acknowledges that their resulting code will not be directly in line with
+the rules of the ABI.
+
@item -mv8
@itemx -msparclite
These two options select variations on the SPARC architecture.
multiply, integer divide step and scan (@code{ffs}) instructions which
exist in SPARClite but not in SPARC v7.
-These options are deprecated and will be deleted in GNU CC 2.9.
+These options are deprecated and will be deleted in a future GCC release.
They have been replaced with @samp{-mcpu=xxx}.
@item -mcypress
used in the SparcStation 10, 1000 and 2000 series. This flag also enables use
of the full SPARC v8 instruction set.
-These options are deprecated and will be deleted in GNU CC 2.9.
+These options are deprecated and will be deleted in a future GCC release.
They have been replaced with @samp{-mcpu=xxx}.
@item -mcpu=@var{cpu_type}
@samp{hypersparc}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
@samp{tsc701}, @samp{ultrasparc}.
-@item -malign-loops=@var{num}
-Align loops to a 2 raised to a @var{num} byte boundary. If
-@samp{-malign-loops} is not specified, the default is 2.
-
-@item -malign-jumps=@var{num}
-Align instructions that are only jumped to to a 2 raised to a @var{num}
-byte boundary. If @samp{-malign-jumps} is not specified, the default is 2.
-
-@item -malign-functions=@var{num}
-Align the start of functions to a 2 raised to @var{num} byte boundary.
-If @samp{-malign-functions} is not specified, the default is 2 if compiling
-for 32 bit sparc, and 5 if compiling for 64 bit sparc.
-
@end table
These @samp{-m} switches are supported in addition to the above
@item -mstack-bias
@itemx -mno-stack-bias
-With @samp{-mstack-bias}, GNU CC assumes that the stack pointer, and
+With @samp{-mstack-bias}, GCC assumes that the stack pointer, and
frame pointer if present, are offset by -2047 which must be added back
when making stack frame references.
Otherwise, assume no such offset is present.
@item -msoft-float
@kindex -msoft-float
Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not part of GNU CC.
+@strong{Warning:} the requisite libraries are not part of GCC.
Normally the facilities of the machine's usual C compiler are used, but
this can't be done directly in cross-compilation. You must make your
own arrangements to provide suitable library functions for
@kindex -mapcs-float
@kindex -mno-apcs-float
Pass floating point arguments using the float point registers. This is
-one of the variants of the APCS. This option is reccommended if the
+one of the variants of the APCS. This option is recommended if the
target hardware has a floating point unit or if a lot of floating point
arithmetic is going to be performed by the code. The default is
@samp{-mno-apcs-float}, since integer only code is slightly increased in
@kindex -msched-prolog
Prevent the reordering of instructions in the function prolog, or the
merging of those instruction with the instructions in the function's
-body. This means that all functions will start with a recognisable set
-of instructions (or in fact one of a chioce from a small set of
+body. This means that all functions will start with a recognizable set
+of instructions (or in fact one of a choice from a small set of
different function prologues), and this information can be used to
locate the start if functions inside an executable piece of code. The
default is @samp{-msched-prolog}.
@samp{-msoft-float} changes the calling convention in the output file;
therefore, it is only useful if you compile @emph{all} of a program with
this option. In particular, you need to compile @file{libgcc.a}, the
-library that comes with GNU CC, with @samp{-msoft-float} in order for
+library that comes with GCC, with @samp{-msoft-float} in order for
this to work.
@item -mlittle-endian
big-endian ARM processors generated by versions of the compiler prior to
2.8.
+@item -malignment-traps
+@kindex -malignment-traps
+Generate code that will not trap if the MMU has alignment traps enabled.
+On ARM architectures prior to ARMv4, there were no instructions to
+access half-word objects stored in memory. However, when reading from
+memory a feature of the ARM architecture allows a word load to be used,
+even if the address is unaligned, and the processor core will rotate the
+data as it is being loaded. This option tells the compiler that such
+misaligned accesses will cause a MMU trap and that it should instead
+synthesise the access as a series of byte accesses. The compiler can
+still use word accesses to load half-word data if it knows that the
+address is aligned to a word boundary.
+
+This option is ignored when compiling for ARM architecture 4 or later,
+since these processors have instructions to directly access half-word
+objects in memory.
+
+@item -mno-alignment-traps
+@kindex -mno-alignment-traps
+Generate code that assumes that the MMU will not trap unaligned
+accesses. This produces better code when the target instruction set
+does not have half-word memory operations (implementations prior to
+ARMv4).
+
+Note that you cannot use this option to access unaligned word objects,
+since the processor will only fetch one 32-bit aligned object from
+memory.
+
+The default setting for most targets is -mno-alignment-traps, since
+this produces better code when there are no half-word memory
+instructions available.
+
@item -mshort-load-bytes
@kindex -mshort-load-bytes
-Do not try to load half-words (eg @samp{short}s) by loading a word from
-an unaligned address. For some targets the MMU is configured to trap
-unaligned loads; use this option to generate code that is safe in these
-environments.
+This is a depreciated alias for @samp{-malignment-traps}.
@item -mno-short-load-bytes
@kindex -mno-short-load-bytes
-Use unaligned word loads to load half-words (eg @samp{short}s). This
-option produces more efficient code, but the MMU is sometimes configured
-to trap these instructions.
+This is a depreciated alias for @samp{-mno-alignment-traps}.
@item -mshort-load-words
@kindex -mshort-load-words
-This is a synonym for the @samp{-mno-short-load-bytes}.
+This is a depreciated alias for @samp{-mno-alignment-traps}.
@item -mno-short-load-words
@kindex -mno-short-load-words
-This is a synonym for the @samp{-mshort-load-bytes}.
+This is a depreciated alias for @samp{-malignment-traps}.
@item -mbsd
@kindex -mbsd
compiler is built for cross-compilation.
@item -mcpu=<name>
-@itemx -mtune=<name>
@kindex -mcpu=
-@kindex -mtune=
This specifies the name of the target ARM processor. GCC uses this name
to determine what kind of instructions it can use when generating
-assembly code. Permissable names are: arm2, arm250, arm3, arm6, arm60,
+assembly code. Permissible names are: arm2, arm250, arm3, arm6, arm60,
arm600, arm610, arm620, arm7, arm7m, arm7d, arm7dm, arm7di, arm7dmi,
arm70, arm700, arm700i, arm710, arm710c, arm7100, arm7500, arm7500fe,
arm7tdmi, arm8, strongarm, strongarm110, strongarm1100, arm8, arm810,
-arm9, arm9tdmi. @samp{-mtune=} is a synonym for @samp{-mcpue=} to
-support older versions of GCC.
+arm9, arm920, arm920t, arm9tdmi.
+
+@itemx -mtune=<name>
+@kindex -mtune=
+This option is very similar to the @samp{-mcpu=} option, except that
+instead of specifying the actual target processor type, and hence
+restricting which instructions can be used, it specifies that GCC should
+tune the performance of the code as if the target were of the type
+specified in this option, but still choosing the instructions that it
+will generate based on the cpu specified by a @samp{-mcpu=} option.
+For some arm implementations better performance can be obtained by using
+this option.
@item -march=<name>
@kindex -march=
This specifies the name of the target ARM architecture. GCC uses this
name to determine what kind of instructions it can use when generating
assembly code. This option can be used in conjunction with or instead
-of the @samp{-mcpu=} option. Permissable names are: armv2, armv2a,
-armv3, armv3m, armv4, armv4t
+of the @samp{-mcpu=} option. Permissible names are: armv2, armv2a,
+armv3, armv3m, armv4, armv4t, armv5.
@item -mfpe=<number>
@itemx -mfp=<number>
@kindex -mfpe=
@kindex -mfp=
This specifes the version of the floating point emulation available on
-the target. Permissable values are 2 and 3. @samp{-mfp=} is a synonym
+the target. Permissible values are 2 and 3. @samp{-mfp=} is a synonym
for @samp{-mfpe=} to support older versions of GCC.
@item -mstructure-size-boundary=<n>
@kindex -mstructure-size-boundary
The size of all structures and unions will be rounded up to a multiple
-of the number of bits set by this option. Permissable values are 8 and
+of the number of bits set by this option. Permissible values are 8 and
32. The default value varies for different toolchains. For the COFF
targeted toolchain the default value is 8. Specifying the larger number
-can produced faster, more efficient code, but can also increase the size
+can produce faster, more efficient code, but can also increase the size
of the program. The two values are potentially incompatible. Code
compiled with one value cannot necessarily expect to work with code or
libraries compiled with the other value, if they exchange information
Generate a call to the function abort at the end of a noreturn function.
It will be executed if the function tries to return.
+@item -mlong-calls
+@itemx -mno-long-calls
+Tells the compiler to perform function calls by first loading the
+address of the function into a register and then performing a subroutine
+call on this register. This switch is needed if the target function
+will lie outside of the 64 megabyte addressing range of the offset based
+version of subroutine call instruction.
+
+Even if this switch is enabled, not all function calls will be turned
+into long calls. The heuristic is that static functions, functions
+which have the @samp{short-call} attribute, functions that are inside
+the scope of a @samp{#pragma no_long_calls} directive and functions whose
+definitions have already been compiled within the current compilation
+unit, will not be turned into long calls. The exception to this rule is
+that weak function defintions, functions with the @samp{long-call}
+attribute or the @samp{section} attribute, and functions that are within
+the scope of a @samp{#pragma long_calls} directive, will always be
+turned into long calls.
+
+This feature is not enabled by default. Specifying
+@samp{--no-long-calls} will restore the default behaviour, 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
+pointers.
+
+@item -mnop-fun-dllimport
+@kindex -mnop-fun-dllimport
+Disable the support for the @emph{dllimport} attribute.
+
+@item -msingle-pic-base
+@kindex -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
+before execution begins.
+
+@item -mpic-register=<reg>
+@kindex -mpic-register=
+Specify the register to be used for PIC addressing. The default is R10
+unless stack-checking is enabled, when R9 is used.
+
@end table
@node Thumb Options
@item -mstructure-size-boundary=<n>
@kindex -mstructure-size-boundary
The size of all structures and unions will be rounded up to a multiple
-of the number of bits set by this option. Permissable values are 8 and
+of the number of bits set by this option. Permissible values are 8 and
32. The default value varies for different toolchains. For the COFF
targeted toolchain the default value is 8. Specifying the larger number
can produced faster, more efficient code, but can also increase the size
using structures or unions. Programmers are encouraged to use the 32
value as future versions of the toolchain may default to this value.
+@item -mnop-fun-dllimport
+@kindex -mnop-fun-dllimport
+Disable the support for the @emph{dllimport} attribute.
+
+@item -mcallee-super-interworking
+@kindex -mcallee-super-interworking
+Gives all externally visible functions in the file being compiled an ARM
+instruction set header which switches to Thumb mode before executing the
+rest of the function. This allows these functions to be called from
+non-interworking code.
+
+@item -mcaller-super-interworking
+@kindex -mcaller-super-interworking
+Allows calls via function pointers (including virtual functions) to
+execute correctly regardless of whether the target code has been
+compiled for interworking or not. There is a small overhead in the cost
+of executing a function pointer if this option is enabled.
+
+@item -msingle-pic-base
+@kindex -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
+before execution begins.
+
+@item -mpic-register=<reg>
+@kindex -mpic-register=
+Specify the register to be used for PIC addressing. The default is R10.
+
@end table
@node MN10200 Options
Do not generate code to avoid bugs in the multiply instructions for the
MN10300 processors.
+@item -mam33
+Generate code which uses features specific to the AM33 processor.
+
+@item -mno-am33
+Do not generate code which uses features specific to the AM33 processor. This
+is the default.
+
@item -mrelax
Indicate to the linker that it should perform a relaxation optimization pass
to shorten branches, calls and absolute memory addresses. This option only
@samp{-moptimize-arg-area} saves space by optimizing them, but this
conflicts with the 88open specifications. The opposite alternative,
@samp{-mno-optimize-arg-area}, agrees with 88open standards. By default
-GNU CC does not optimize the argument area.
+GCC does not optimize the argument area.
@item -mshort-data-@var{num}
@kindex -mshort-data-@var{num}
@samp{-msvr4} makes the C preprocessor recognize @samp{#pragma weak}
that is used on System V release 4.
@item
-@samp{-msvr4} makes GNU CC issue additional declaration directives used in
+@samp{-msvr4} makes GCC issue additional declaration directives used in
SVr4.
@end enumerate
@cindex bit shift overflow (88k)
@cindex large bit shifts (88k)
Include code to detect bit-shifts of more than 31 bits; respectively,
-trap such shifts or emit code to handle them properly. By default GNU CC
+trap such shifts or emit code to handle them properly. By default GCC
makes no special provision for large bit shifts.
@item -mwarn-passed-structs
Warn when a function passes a struct as an argument or result.
Structure-passing conventions have changed during the evolution of the C
language, and are often the source of portability problems. By default,
-GNU CC issues no such warning.
+GCC issues no such warning.
@end table
@node RS/6000 and PowerPC Options
@kindex -mpowerpc-gpopt
@kindex -mpowerpc-gfxopt
@kindex -mpowerpc64
-GNU CC supports two related instruction set architectures for the
+GCC supports two related instruction set architectures for the
RS/6000 and PowerPC. The @dfn{POWER} instruction set are those
instructions supported by the @samp{rios} chip set used in the original
RS/6000 systems and the @dfn{PowerPC} instruction set is the
You use these options to specify which instructions are available on the
processor you are using. The default value of these options is
-determined when configuring GNU CC. Specifying the
+determined when configuring GCC. Specifying the
@samp{-mcpu=@var{cpu_type}} overrides the specification of these
options. We recommend you use the @samp{-mcpu=@var{cpu_type}} option
rather than the options listed above.
-The @samp{-mpower} option allows GNU CC to generate instructions that
+The @samp{-mpower} option allows GCC to generate instructions that
are found only in the POWER architecture and to use the MQ register.
-Specifying @samp{-mpower2} implies @samp{-power} and also allows GNU CC
+Specifying @samp{-mpower2} implies @samp{-power} and also allows GCC
to generate instructions that are present in the POWER2 architecture but
not the original POWER architecture.
-The @samp{-mpowerpc} option allows GNU CC to generate instructions that
+The @samp{-mpowerpc} option allows GCC to generate instructions that
are found only in the 32-bit subset of the PowerPC architecture.
Specifying @samp{-mpowerpc-gpopt} implies @samp{-mpowerpc} and also allows
-GNU CC to use the optional PowerPC architecture instructions in the
+GCC to use the optional PowerPC architecture instructions in the
General Purpose group, including floating-point square root. Specifying
-@samp{-mpowerpc-gfxopt} implies @samp{-mpowerpc} and also allows GNU CC to
+@samp{-mpowerpc-gfxopt} implies @samp{-mpowerpc} and also allows GCC to
use the optional PowerPC architecture instructions in the Graphics
group, including floating-point select.
-The @samp{-mpowerpc64} option allows GNU CC to generate the additional
+The @samp{-mpowerpc64} option allows GCC to generate the additional
64-bit instructions that are found in the full PowerPC64 architecture
-and to treat GPRs as 64-bit, doubleword quantities. GNU CC defaults to
+and to treat GPRs as 64-bit, doubleword quantities. GCC defaults to
@samp{-mno-powerpc64}.
-If you specify both @samp{-mno-power} and @samp{-mno-powerpc}, GNU CC
+If you specify both @samp{-mno-power} and @samp{-mno-powerpc}, GCC
will use only the instructions in the common subset of both
architectures plus some special AIX common-mode calls, and will not use
the MQ register. Specifying both @samp{-mpower} and @samp{-mpowerpc}
-permits GNU CC to use any instruction from either architecture and to
+permits GCC to use any instruction from either architecture and to
allow use of the MQ register; specify this for the Motorola MPC601.
@item -mnew-mnemonics
defined for the PowerPC architecture, while @samp{-mold-mnemonics}
requests the assembler mnemonics defined for the POWER architecture.
Instructions defined in only one architecture have only one mnemonic;
-GNU CC uses that mnemonic irrespective of which of these options is
+GCC uses that mnemonic irrespective of which of these options is
specified.
-GNU CC defaults to the mnemonics appropriate for the architecture in
+GCC defaults to the mnemonics appropriate for the architecture in
use. Specifying @samp{-mcpu=@var{cpu_type}} sometimes overrides the
value of these option. Unless you are building a cross-compiler, you
should normally not specify either @samp{-mnew-mnemonics} or
@kindex -mcpu
Set architecture type, register usage, choice of mnemonics, and
instruction scheduling parameters for machine type @var{cpu_type}.
-Supported values for @var{cpu_type} are @samp{rs6000}, @samp{rios1},
-@samp{rios2}, @samp{rsc}, @samp{601}, @samp{602}, @samp{603},
-@samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{740},
-@samp{750}, @samp{power}, @samp{power2}, @samp{powerpc}, @samp{403},
-@samp{505}, @samp{801}, @samp{821}, @samp{823}, and @samp{860} and
-@samp{common}. @samp{-mcpu=power}, @samp{-mcpu=power2}, and
-@samp{-mcpu=powerpc} specify generic POWER, POWER2 and pure PowerPC
-(i.e., not MPC601) architecture machine types, with an appropriate,
+Supported values for @var{cpu_type} are @samp{rios}, @samp{rios1},
+@samp{rsc}, @samp{rios2}, @samp{rs64a}, @samp{601}, @samp{602},
+@samp{603}, @samp{603e}, @samp{604}, @samp{604e}, @samp{620},
+@samp{630}, @samp{740}, @samp{750}, @samp{power}, @samp{power2},
+@samp{powerpc}, @samp{403}, @samp{505}, @samp{801}, @samp{821},
+@samp{823}, and @samp{860} and @samp{common}. @samp{-mcpu=power},
+@samp{-mcpu=power2}, @samp{-mcpu=powerpc}, and @samp{-mcpu=powerpc64}
+specify generic POWER, POWER2, pure 32-bit PowerPC (i.e., not MPC601),
+and 64-bit PowerPC architecture machine types, with an appropriate,
generic processor model assumed for scheduling purposes.@refill
-@c overfull hbox here --bob 22 jul96
-@c original text between ignore ... end ignore
-@ignore
-Specifying any of the @samp{-mcpu=rios1}, @samp{-mcpu=rios2},
-@samp{-mcpu=rsc}, @samp{-mcpu=power}, or @samp{-mcpu=power2} options
-enables the @samp{-mpower} option and disables the @samp{-mpowerpc}
-option; @samp{-mcpu=601} enables both the @samp{-mpower} and
-@samp{-mpowerpc} options; all of @samp{-mcpu=602}, @samp{-mcpu=603},
-@samp{-mcpu=603e}, @samp{-mcpu=604}, @samp{-mcpu=604e},
-@samp{-mcpu=620}, @samp{-mcpu=403}, @samp{-mcpu=505}, @samp{-mcpu=801},
-@samp{-mcpu=821}, @samp{-mcpu=823}, @samp{-mcpu=860} and
-@samp{-mcpu=powerpc} enable the @samp{-mpowerpc} option and disable the
-@samp{-mpower} option; @samp{-mcpu=common} disables both the
-@samp{-mpower} and @samp{-mpowerpc} options.@refill
-@end ignore
-@c changed paragraph
Specifying any of the following options:
@samp{-mcpu=rios1}, @samp{-mcpu=rios2}, @samp{-mcpu=rsc},
@samp{-mcpu=power}, or @samp{-mcpu=power2}
enables the @samp{-mpower} option and disables the @samp{-mpowerpc} option;
@samp{-mcpu=601} enables both the @samp{-mpower} and @samp{-mpowerpc} options.
-All of @samp{-mcpu=602}, @samp{-mcpu=603}, @samp{-mcpu=603e},
-@samp{-mcpu=604}, @samp{-mcpu=620},
+All of @samp{-mcpu=rs64a}, @samp{-mcpu=602}, @samp{-mcpu=603},
+@samp{-mcpu=603e}, @samp{-mcpu=604}, @samp{-mcpu=620}, @samp{-mcpu=630},
+@samp{-mcpu=740}, and @samp{-mcpu=750}
enable the @samp{-mpowerpc} option and disable the @samp{-mpower} option.
Exactly similarly, all of @samp{-mcpu=403},
@samp{-mcpu=505}, @samp{-mcpu=821}, @samp{-mcpu=860} and @samp{-mcpu=powerpc}
enable the @samp{-mpowerpc} option and disable the @samp{-mpower} option.
@samp{-mcpu=common} disables both the
@samp{-mpower} and @samp{-mpowerpc} options.@refill
-@c end changes to prevent overfull hboxes
AIX versions 4 or greater selects @samp{-mcpu=common} by default, so
-that code will operate on all members of the RS/6000 and PowerPC
-families. In that case, GNU CC will use only the instructions in the
+that code will operate on all members of the RS/6000 POWER and PowerPC
+families. In that case, GCC will use only the instructions in the
common subset of both architectures plus some special AIX common-mode
-calls, and will not use the MQ register. GNU CC assumes a generic
+calls, and will not use the MQ register. GCC assumes a generic
processor model for scheduling purposes.
Specifying any of the options @samp{-mcpu=rios1}, @samp{-mcpu=rios2},
@samp{-mcpu=rsc}, @samp{-mcpu=power}, or @samp{-mcpu=power2} also
disables the @samp{new-mnemonics} option. Specifying @samp{-mcpu=601},
@samp{-mcpu=602}, @samp{-mcpu=603}, @samp{-mcpu=603e}, @samp{-mcpu=604},
-@samp{620}, @samp{403}, or @samp{-mcpu=powerpc} also enables the
-@samp{new-mnemonics} option.@refill
+@samp{-mcpu=620}, @samp{-mcpu=630}, @samp{-mcpu=403}, @samp{-mcpu=505},
+@samp{-mcpu=821}, @samp{-mcpu=860} or @samp{-mcpu=powerpc} also enables
+the @samp{new-mnemonics} option.@refill
Specifying @samp{-mcpu=403}, @samp{-mcpu=821}, or @samp{-mcpu=860} also
enables the @samp{-msoft-float} option.
@kindex -mminimal-toc
Modify generation of the TOC (Table Of Contents), which is created for
every executable file. The @samp{-mfull-toc} option is selected by
-default. In that case, GNU CC will allocate at least one TOC entry for
-each unique non-automatic variable reference in your program. GNU CC
+default. In that case, GCC will allocate at least one TOC entry for
+each unique non-automatic variable reference in your program. GCC
will also place floating-point constants in the TOC. However, only
16,384 entries are available in the TOC.
If you receive a linker error message that saying you have overflowed
the available TOC space, you can reduce the amount of TOC space used
with the @samp{-mno-fp-in-toc} and @samp{-mno-sum-in-toc} options.
-@samp{-mno-fp-in-toc} prevents GNU CC from putting floating-point
-constants in the TOC and @samp{-mno-sum-in-toc} forces GNU CC to
+@samp{-mno-fp-in-toc} prevents GCC from putting floating-point
+constants in the TOC and @samp{-mno-sum-in-toc} forces GCC to
generate code to calculate the sum of an address and a constant at
run-time instead of putting that sum into the TOC. You may specify one
-or both of these options. Each causes GNU CC to produce very slightly
+or both of these options. Each causes GCC to produce very slightly
slower and larger code at the expense of conserving TOC space.
If you still run out of space in the TOC even when you specify both of
these options, specify @samp{-mminimal-toc} instead. This option causes
-GNU CC to make only one TOC entry for every file. When you specify this
-option, GNU CC will produce code that is slower and larger but which
+GCC to make only one TOC entry for every file. When you specify this
+option, GCC will produce code that is slower and larger but which
uses extremely little TOC space. You may wish to use this option
only on files that contain less frequently executed code. @refill
-@item -maix64
-@itemx -maix32
-@kindex -maix64
-@kindex -maix32
-Enable AIX 64-bit ABI and calling convention: 64-bit pointers, 64-bit
+@item -m64
+@itemx -m32
+@kindex -m64
+@kindex -m32
+Enable 64-bit PowerPC ABI and calling convention: 64-bit pointers, 64-bit
@code{long} type, and the infrastructure needed to support them.
-Specifying @samp{-maix64} implies @samp{-mpowerpc64} and
-@samp{-mpowerpc}, while @samp{-maix32} disables the 64-bit ABI and
-implies @samp{-mno-powerpc64}. GNU CC defaults to @samp{-maix32}.
+Specifying @samp{-m64} implies @samp{-mpowerpc64} and
+@samp{-mpowerpc}, while @samp{-m32} disables the 64-bit ABI and
+implies @samp{-mno-powerpc64}. GCC defaults to @samp{-m32}.
@item -mxl-call
@itemx -mno-xl-call
@kindex -msoft-float
Generate code that does not use (uses) the floating-point register set.
Software floating point emulation is provided if you use the
-@samp{-msoft-float} option, and pass the option to GNU CC when linking.
+@samp{-msoft-float} option, and pass the option to GCC when linking.
@item -mmultiple
@itemx -mno-multiple
@item -msoft-float
Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not part of GNU CC.
+@strong{Warning:} the requisite libraries are not part of GCC.
Normally the facilities of the machine's usual C compiler are used, but
this can't be done directly in cross-compilation. You must make your
own arrangements to provide suitable library functions for
slightly slower code than the default, but reduces the amount of RAM required
when executing, and thus may be preferred for some embedded systems.
+@item -muninit-const-in-rodata
+@itemx -mno-uninit-const-in-rodata
+When used together with -membedded-data, it will always store uninitialized
+const variables in the read-only data section.
+
@item -msingle-float
@itemx -mdouble-float
The @samp{-msingle-float} switch tells gcc to assume that the floating
@item -nocpp
Tell the MIPS assembler to not run its preprocessor over user
assembler files (with a @samp{.s} suffix) when assembling them.
+
+@item -mfix7000
+Pass an option to gas which will cause nops to be inserted if
+the read of the destination register of an mfhi or mflo instruction
+occurs in the following two instructions.
+
+@item -no-crt0
+Do not include the default crt0.
@end table
@ifset INTERNALS
@item -msoft-float
Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not part of GNU CC.
+@strong{Warning:} the requisite libraries are not part of GCC.
Normally the facilities of the machine's usual C compiler are used, but
this can't be done directly in cross-compilation. You must make your
own arrangements to provide suitable library functions for
@item -malign-double
@itemx -mno-align-double
-Control whether GNU CC aligns @code{double}, @code{long double}, and
+Control whether GCC aligns @code{double}, @code{long double}, and
@code{long long} variables on a two word boundary or a one word
boundary. Aligning @code{double} variables on a two word boundary will
produce code that runs somewhat faster on a @samp{Pentium} at the
@item -msvr3-shlib
@itemx -mno-svr3-shlib
-Control whether GNU CC places uninitialized locals into @code{bss} or
+Control whether GCC places uninitialized locals into @code{bss} or
@code{data}. @samp{-msvr3-shlib} places these locals into @code{bss}.
These options are meaningful only on System V Release 3.
@item -mno-wide-multiply
@itemx -mwide-multiply
-Control whether GNU CC uses the @code{mul} and @code{imul} that produce
+Control whether GCC uses the @code{mul} and @code{imul} that produce
64 bit results in @code{eax:edx} from 32 bit operands to do @code{long
long} multiplies and 32-bit division by constants.
to stack space usage, such as embedded systems and operating system kernels,
may want to reduce the preferred alignment to
@samp{-mpreferred-stack-boundary=2}.
+
+@item -mpush-args
+@kindex -mpush-args
+Use PUSH operations to store outgoing parameters. This method is shorter
+and usually equally fast as method using SUB/MOV operations and is enabled
+by default. In some cases disabling it may improve performance because of
+improved scheduling and reduced dependencies.
+
+@item -maccumulate-outgoing-args
+@kindex -maccumulate-outgoing-args
+If enabled, the maximum amount of space required for outgoing arguments will be
+computed in the function prologue. This in faster on most modern CPUs
+because of reduced dependecies, improved scheduling and reduced stack usage
+when preferred stack boundary is not equal to 2. The drawback is a notable
+increase in code size. This switch implies -mno-push-args.
+
+@item -mthreads
+@kindex -mthreads
+Support thread-safe exception handling on @samp{Mingw32}. Code that relies
+on thread-safe exception handling must compile and link all code with the
+@samp{-mthreads} option. When compiling, @samp{-mthreads} defines
+@samp{-D_MT}; when linking, it links in a special thread helper library
+@samp{-lmingwthrd} which cleans up per thread exception handling data.
+
+@item -mno-align-stringops
+@kindex -mno-align-stringops
+Do not align destination of inlined string operations. This switch reduces
+code size and improves performance in case the destination is already aligned,
+but gcc don't know about it.
+
+@item -minline-all-stringops
+@kindex -minline-all-stringops
+By default GCC inlines string operations only when destination is known to be
+aligned at least to 4 byte boundary. This enables more inlining, increase code
+size, but may improve performance of code that depends on fast memcpy, strlen
+and memset for short lengths.
@end table
@node HPPA Options
This option will not work in the presense of shared libraries or nested
functions.
-@item -mspace
-Optimize for space rather than execution time. Currently this only
-enables out of line function prologues and epilogues. This option is
-incompatible with PIC code generation and profiling.
-
@item -mlong-load-store
Generate 3-instruction load and store sequences as sometimes required by
the HP-UX 10 linker. This is equivalent to the @samp{+k} option to
@samp{-msoft-float} changes the calling convention in the output file;
therefore, it is only useful if you compile @emph{all} of a program with
this option. In particular, you need to compile @file{libgcc.a}, the
-library that comes with GNU CC, with @samp{-msoft-float} in order for
+library that comes with GCC, with @samp{-msoft-float} in order for
this to work.
@end table
(@var{fpcr}, see Alpha architecture reference manual) controls the
rounding mode in effect. The C library initializes this register for
rounding towards plus infinity. Thus, unless your program modifies the
-@var{fpcr}, @samp{d} corresponds to round towards plus infinity.@end table
+@var{fpcr}, @samp{d} corresponds to round towards plus infinity.
+@end table
@item -mtrap-precision=@var{trap precision}
In the Alpha architecture, floating point traps are imprecise. This
means without software assistance it is impossible to recover from a
floating trap and program execution normally needs to be terminated.
-GNU CC can generate code that can assist operating system trap handlers
+GCC can generate code that can assist operating system trap handlers
in determining the exact location that caused a floating point trap.
Depending on the requirements of an application, different levels of
precisions can be selected:
IEEE-conformant math library routines will be linked in.
@item -mbuild-constants
-Normally GNU CC examines a 32- or 64-bit integer constant to
+Normally GCC examines a 32- or 64-bit integer constant to
see if it can construct it from smaller constants in two or three
instructions. If it cannot, it will output the constant as a literal and
generate code to load it from the data segment at runtime.
-Use this option to require GNU CC to construct @emph{all} integer constants
+Use this option to require GCC to construct @emph{all} integer constants
using code, even if it takes more instructions (the maximum is six).
You would typically use this option to build a shared library dynamic
@itemx -mno-cix
@itemx -mmax
@itemx -mno-max
-Indicate whether GNU CC should generate code to use the optional BWX,
+Indicate whether GCC should generate code to use the optional BWX,
CIX, and MAX instruction sets. The default is to use the instruction sets
supported by the CPU type specified via @samp{-mcpu=} option or that
-of the CPU on which GNU CC was built if none was specified.
+of the CPU on which GCC was built if none was specified.
@item -mcpu=@var{cpu_type}
Set the instruction set, register set, and instruction scheduling
parameters for machine type @var{cpu_type}. You can specify either the
-@samp{EV} style name or the corresponding chip number. GNU CC
+@samp{EV} style name or the corresponding chip number. GCC
supports scheduling parameters for the EV4 and EV5 family of processors
and will choose the default values for the instruction set from
the processor you specify. If you do not specify a processor type,
-GNU CC will default to the processor on which the compiler was built.
+GCC will default to the processor on which the compiler was built.
Supported values for @var{cpu_type} are
@end table
+@node AVR Options
+@subsection AVR Options
+@cindex AVR Options
+
+These options are defined for AVR implementations:
+
+@table @code
+@item -mmcu=@var{mcu}
+Specify ATMEL AVR mcu (at90s23xx,attiny22,at90s44xx,at90s85xx,atmega603,
+atmega103).
+
+@item -msize
+Output instruction size's to the asm file
+
+@item -minit-stack=@var{N}
+Specify the initial stack address
+
+@item -mno-interrupts
+Generated code is not compatible with hardware interrupts.
+Code size will be smaller.
+
+@item -mcall-prologues
+Functions prologues/epilogues expanded as call to appropriate
+subroutines. Code size will be smaller.
+@end table
+
+@node MCore Options
+@subsection MCore Options
+@cindex MCore options
+
+These are the @samp{-m} options defined for the Motorola M*Core
+processors.
+
+@table @code
+
+@item -mhardlit
+@itemx -mhardlit
+@itemx -mno-hardlit
+Inline constants into the code stream if it can be done in two
+instructions or less.
+
+@item -mdiv
+@itemx -mdiv
+@itemx -mno-div
+Use the divide instruction. (Enabled by default).
+
+@item -mrelax-immediate
+@itemx -mrelax-immediate
+@itemx -mno-relax-immediate
+Allow arbitary sized immediated in bit operations.
+
+@item -mwide-bitfields
+@itemx -mwide-bitfields
+@itemx -mno-wide-bitfields
+Always treat bitfields as int-sized.
+
+@item -m4byte-functions
+@itemx -m4byte-functions
+@itemx -mno-4byte-functions
+Force all functions to be aligfned to a four byte boundary.
+
+@item -mcallgraph-data
+@itemx -mcallgraph-data
+@itemx -mno-callgraph-data
+Emit callgraph information.
+
+@item -mslow-bytes
+@itemx -mslow-bytes
+@itemx -mno-slow-bytes
+Prefer word access when reading byte quantities.
+
+@item -mlittle-endian
+@itemx -mlittle-endian
+@itemx -mbig-endian
+Genreate code for a little endian target.
+
+@item -m210
+@itemx -m210
+@itemx -m340
+Generate code for the 210 processor.
+
+@end table
@node Code Gen Options
@table @code
@item -fexceptions
Enable exception handling. Generates extra code needed to propagate
-exceptions. For some targets, this implies generation of frame unwind
-information for all functions. This can produce significant data size
-overhead, although it does not affect execution.
-If you do not specify this option, it is enabled by
-default for languages like C++ which normally require exception handling,
-and disabled for languages like C that do not normally require it.
-However, when compiling C code that needs to interoperate properly with
-exception handlers written in C++, you may need to enable this option.
-You may also wish to disable this option is you are compiling older C++
-programs that don't use exception handling.
+exceptions. For some targets, this implies GNU CC will generate frame
+unwind information for all functions, which can produce significant data
+size overhead, although it does not affect execution. If you do not
+specify this option, GNU CC will enable it by default for languages like
+C++ which normally require exception handling, and disable itfor
+languages like C that do not normally require it. However, you may need
+to enable this option when compiling C code that needs to interoperate
+properly with exception handlers written in C++. You may also wish to
+disable this option if you are compiling older C++ programs that don't
+use exception handling.
+
+@item -funwind-tables
+Similar to @code{-fexceptions}, except that it will just generate any needed
+static data, but will not affect the generated code in any other way.
+You will normally not enable this option; instead, a language processor
+that needs this handling would enable it on your behalf.
@item -fpcc-struct-return
Return ``short'' @code{struct} and @code{union} values in memory like
longer ones, rather than in registers. This convention is less
efficient, but it has the advantage of allowing intercallability between
-GNU CC-compiled files and files compiled with other compilers.
+GCC-compiled files and files compiled with other compilers.
The precise convention for returning structures in memory depends
on the target configuration macros.
structures than @samp{-fpcc-struct-return}.
If you specify neither @samp{-fpcc-struct-return} nor its contrary
-@samp{-freg-struct-return}, GNU CC defaults to whichever convention is
-standard for the target. If there is no standard convention, GNU CC
-defaults to @samp{-fpcc-struct-return}, except on targets where GNU CC
+@samp{-freg-struct-return}, GCC defaults to whichever convention is
+standard for the target. If there is no standard convention, GCC
+defaults to @samp{-fpcc-struct-return}, except on targets where GCC
is the principal compiler. In those cases, we can choose the standard,
and we chose the more efficient register return alternative.
exists in one copy per process.
@item -fno-common
-Allocate even uninitialized global variables in the bss section of the
+Allocate even uninitialized global variables in the data section of the
object file, rather than generating them as common blocks. This has the
effect that if the same variable is declared (without @code{extern}) in
two different compilations, you will get an error when you link them.
linker is the standard method of handling them). Use this option when
you want to use a non-GNU linker, which also requires using the
@code{collect2} program to make sure the system linker includes
-constructors and destructors. (@code{collect2} is included in the GNU CC
+constructors and destructors. (@code{collect2} is included in the GCC
distribution.) For systems which @emph{must} use @code{collect2}, the
compiler driver @code{gcc} is configured to do this automatically.
@item -fvolatile-global
Consider all memory references to extern and global data items to
-be volatile. GNU CC does not consider static data items to be volatile
+be volatile. GCC does not consider static data items to be volatile
because of this switch.
@item -fvolatile-static
library, if supported for the target machine. Such code accesses all
constant addresses through a global offset table (GOT). The dynamic
loader resolves the GOT entries when the program starts (the dynamic
-loader is not part of GNU CC; it is part of the operating system). If
+loader is not part of GCC; it is part of the operating system). If
the GOT size for the linked executable exceeds a machine-specific
maximum size, you get an error message from the linker indicating that
@samp{-fpic} does not work; in that case, recompile with @samp{-fPIC}
on the m68k and RS/6000. The 386 has no such limit.)
Position-independent code requires special support, and therefore works
-only on certain machines. For the 386, GNU CC supports PIC for System V
+only on certain machines. For the 386, GCC supports PIC for System V
but not for the Sun 386i. Code generated for the IBM RS/6000 is always
position-independent.
the offsets of structure members won't agree with system libraries.
@item -fcheck-memory-usage
-Generate extra code to check each memory access. GNU CC will generate
+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}.
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
-@samp{-fprefix-function-name} option, which requests GNU CC to encapsulate
+@samp{-fprefix-function-name} option, which requests GCC to encapsulate
your code and make other functions look as if they were compiled with
@samp{-fcheck-memory-usage}. This is done by calling ``stubs'',
which are provided by the detector. If you cannot find or build
@samp{-fcheck-memory-usage} without @samp{-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. The
-compiler cannot understand what the @code{asm} statement will do, and
-therefore cannot generate the appropriate code, so it is rejected.
-However, the function attribute @code{no_check_memory_usage} will
-disable memory checking within a function, and @code{asm} statements can
-be put inside such functions. Inline expansion of a non-checked
-function within a checked function is permitted; the inline function's
-memory accesses won't be checked, but the rest will.
-
-If you move your @code{asm} statements to non-checked inline functions,
-but they do access memory, you can add calls to the support code in your
+@code{__asm__} keywords in functions with memory checking enabled. GNU
+CC 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} (see
+@pxref{Function Attributes}, GNU CC 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 GNU CC 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.
-@c FIXME: The support-routine interface is defined by the compiler and
-@c should be documented!
-
@item -fprefix-function-name
-Request GNU CC to add a prefix to the symbols generated for function names.
-GNU CC adds a prefix to the names of functions defined as well as
+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.
@end example
@noindent
-GNU CC will compile the code as if it was written:
+GCC will compile the code as if it was written:
@example
extern void prefix_bar (int);
void
a single-threaded environment since stack overflow is automatically
detected on nearly all systems if there is only one stack.
+Note that this switch does not actually cause checking to be done; the
+operating system must do that. The switch causes generation of code
+to ensure that the operating system sees the stack being extended.
+
+@item -fstack-limit-register=@var{reg}
+@itemx -fstack-limit-symbol=@var{sym}
+@itemx -fno-stack-limit
+Generate code to ensure that the stack does not grow beyond a certain value,
+either the value of a register or the address of a symbol. If the stack
+would grow beyond the value, a signal is raised. For most targets,
+the signal is raised before the stack overruns the boundary, so
+it is possible to catch the signal without taking special precautions.
+
+For instance, if the stack starts at address @samp{0x80000000} and grows
+downwards you can use the flags
+@samp{-fstack-limit-symbol=__stack_limit}
+@samp{-Wl,--defsym,__stack_limit=0x7ffe0000} which will enforce a stack
+limit of 128K.
+
@cindex aliasing of parameters
@cindex parameters, aliased
@item -fargument-alias
@end table
@node Environment Variables
-@section Environment Variables Affecting GNU CC
+@section Environment Variables Affecting GCC
@cindex environment variables
-This section describes several environment variables that affect how GNU
-CC operates. Some of them work by specifying directories or prefixes to use
+This section describes several environment variables that affect how GCC
+operates. Some of them work by specifying directories or prefixes to use
when searching for various kinds of files. Some are used to specify other
aspects of the compilation environment.
Note that you can also specify places to search using options such as
@samp{-B}, @samp{-I} and @samp{-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 GNU
-CC.
+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
@samp{-B}, @samp{-I} and @samp{-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 GNU
-CC. @xref{Driver}.
+in turn take precedence over those specified by the configuration of GCC.
+@xref{Driver}.
@end ifset
@table @code
@c @findex LC_TIME
@findex LC_ALL
@cindex locale
-These environment variables control the way that GNU CC uses
-localization information that allow GNU CC to work with different
-national conventions. GNU CC inspects the locale categories
+These environment variables control the way that GCC uses
+localization information that allow GCC to work with different
+national conventions. GCC inspects the locale categories
@code{LC_CTYPE} and @code{LC_MESSAGES} if it has been configured to do
so. These locale categories can be set to any value supported by your
installation. A typical value is @samp{en_UK} for English in the United
Kingdom.
The @code{LC_CTYPE} environment variable specifies character
-classification. GNU CC uses it to determine the character boundaries in
+classification. GCC uses it to determine the character boundaries in
a string; this is needed for some multibyte encodings that contain quote
and escape characters that would otherwise be interpreted as a string
end or escape.
If the @code{LC_ALL} environment variable is set, it overrides the value
of @code{LC_CTYPE} and @code{LC_MESSAGES}; otherwise, @code{LC_CTYPE}
and @code{LC_MESSAGES} default to the value of the @code{LANG}
-environment variable. If none of these variables are set, GNU CC
+environment variable. If none of these variables are set, GCC
defaults to traditional C English behavior.
@item TMPDIR
@findex TMPDIR
If @code{TMPDIR} is set, it specifies the directory to use for temporary
-files. GNU CC uses temporary files to hold the output of one stage of
+files. GCC uses temporary files to hold the output of one stage of
compilation which is to be used as input to the next stage: for example,
the output of the preprocessor, which is the input to the compiler
proper.
when this prefix is combined with the name of a subprogram, but you can
specify a prefix that ends with a slash if you wish.
-If GNU CC cannot find the subprogram using the specified prefix, it
+If @code{GCC_EXEC_PREFIX} is not set, GNU CC will attempt to figure out
+an appropriate prefix to use based on the pathname it was invoked with.
+
+If GCC cannot find the subprogram using the specified prefix, it
tries looking in the usual places for the subprogram.
The default value of @code{GCC_EXEC_PREFIX} is
In addition, the prefix is used in an unusual way in finding the
directories to search for header files. For each of the standard
directories whose name normally begins with @samp{/usr/local/lib/gcc-lib}
-(more precisely, with the value of @code{GCC_INCLUDE_DIR}), GNU CC tries
+(more precisely, with the value of @code{GCC_INCLUDE_DIR}), GCC tries
replacing that beginning with the specified prefix to produce an
-alternate directory name. Thus, with @samp{-Bfoo/}, GNU CC will search
+alternate directory name. Thus, with @samp{-Bfoo/}, GCC will search
@file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
These alternate directories are searched first; the standard directories
come next.
@item COMPILER_PATH
@findex COMPILER_PATH
The value of @code{COMPILER_PATH} is a colon-separated list of
-directories, much like @code{PATH}. GNU CC tries the directories thus
+directories, much like @code{PATH}. GCC tries the directories thus
specified when searching for subprograms, if it can't find the
subprograms using @code{GCC_EXEC_PREFIX}.
@findex LIBRARY_PATH
The value of @code{LIBRARY_PATH} is a colon-separated list of
directories, much like @code{PATH}. When configured as a native compiler,
-GNU CC tries the directories thus specified when searching for special
+GCC tries the directories thus specified when searching for special
linker files, if it can't find them using @code{GCC_EXEC_PREFIX}. Linking
-using GNU CC also uses these directories when searching for ordinary
+using GCC also uses these directories when searching for ordinary
libraries for the @samp{-l} option (but directories specified with
@samp{-L} come first).
@c @itemx OBJCPLUS_INCLUDE_PATH
These environment variables pertain to particular languages. Each
variable's value is a colon-separated list of directories, much like
-@code{PATH}. When GNU CC searches for header files, it tries the
+@code{PATH}. When GCC searches for header files, it tries the
directories listed in the variable for the language you are using, after
the directories specified with @samp{-I} but before the standard header
file directories.
The output from @code{protoize} or @code{unprotoize} replaces the
original source file. The original file is renamed to a name ending
-with @samp{.save}. If the @samp{.save} file already exists, then
-the source file is simply discarded.
+with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
+without the original @samp{.c} suffix). If the @samp{.save} (@samp{.sav}
+for DOS) file already exists, then the source file is simply discarded.
-@code{protoize} and @code{unprotoize} both depend on GNU CC itself to
+@code{protoize} and @code{unprotoize} both depend on GCC itself to
scan the program and collect information about the functions it uses.
-So neither of these programs will work until GNU CC is installed.
+So neither of these programs will work until GCC is installed.
Here is a table of the options you can use with @code{protoize} and
@code{unprotoize}. Each option works with both programs unless
the @var{compilation-options}, they are ignored.
@item -C
-Rename files to end in @samp{.C} instead of @samp{.c}.
-This is convenient if you are converting a C program to C++.
-This option applies only to @code{protoize}.
+Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
+systems) instead of @samp{.c}. This is convenient if you are converting
+a C program to C++. This option applies only to @code{protoize}.
@item -g
Add explicit global declarations. This means inserting explicit