X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=gcc%2Fdoc%2Finvoke.texi;fp=gcc%2Fdoc%2Finvoke.texi;h=9ce803b79361178db7b2f249b06bc159f4628c97;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=62785ffd7890f22b6d3fc3b1c6e22228420dc652;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 62785ffd..9ce803b7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1,15 +1,21 @@ @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -@c 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +@c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +@c Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. @ignore +@c man begin INCLUDE +@include gcc-vers.texi +@c man end + @c man begin COPYRIGHT -Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, -1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.1 or +under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being ``GNU General Public License'' and ``Funding Free Software'', the Front-Cover texts being (a) (see below), and with @@ -36,21 +42,20 @@ gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}] [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}] [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}] - [@option{-o} @var{outfile}] @var{infile}@dots{} + [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{} Only the most useful options are listed here; see below for the remainder. @samp{g++} accepts mostly the same options as @samp{gcc}. @c man end @c man begin SEEALSO gpl(7), gfdl(7), fsf-funding(7), -cpp(1), gcov(1), g77(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1) -and the Info entries for @file{gcc}, @file{cpp}, @file{g77}, @file{as}, +cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1) +and the Info entries for @file{gcc}, @file{cpp}, @file{as}, @file{ld}, @file{binutils} and @file{gdb}. @c man end @c man begin BUGS For instructions on reporting bugs, see -@w{@uref{http://gcc.gnu.org/bugs.html}}. Use of the @command{gccbug} -script to report bugs is recommended. +@w{@value{BUGURL}}. @c man end @c man begin AUTHOR See the Info entry for @command{gcc}, or @@ -66,7 +71,6 @@ for contributors to GCC@. @cindex options, GCC command @c man begin DESCRIPTION - 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 @option{-c} option @@ -93,19 +97,20 @@ options for compiling C++ programs. @cindex options, grouping The @command{gcc} program accepts options and file names as operands. Many options have multi-letter names; therefore multiple single-letter options -may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d --r}}. +may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d +-v}}. @cindex order of options @cindex options, order You can mix options and other arguments. For the most part, the order -you use doesn't matter. Order does matter when you use several options -of the same kind; for example, if you specify @option{-L} more than once, -the directories are searched in the order specified. +you use doesn't matter. Order does matter when you use several +options of the same kind; for example, if you specify @option{-L} more +than once, the directories are searched in the order specified. Also, +the placement of the @option{-l} option is significant. Many options have long names starting with @samp{-f} or with -@samp{-W}---for example, @option{-fforce-mem}, -@option{-fstrength-reduce}, @option{-Wformat} and so on. Most of +@samp{-W}---for example, +@option{-fmove-loop-invariants}, @option{-Wformat} and so on. Most of these have both positive and negative forms; the negative form of @option{-ffoo} would be @option{-fno-foo}. This manual documents only one of these two forms, whichever one is not the default. @@ -115,14 +120,15 @@ only one of these two forms, whichever one is not the default. @xref{Option Index}, for an index to GCC's options. @menu -* Option Summary:: Brief list of all options, without explanations. +* Option Summary:: Brief list of all options, without explanations. * Overall Options:: Controlling the kind of output: an executable, object files, assembler files, or preprocessed source. -* Invoking G++:: Compiling C++ programs. +* Invoking G++:: Compiling C++ programs. * C Dialect Options:: Controlling the variant of C language compiled. * C++ Dialect Options:: Variations on C++. -* Objective-C Dialect Options:: Variations on Objective-C. +* Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C + and Objective-C++. * Language Independent Options:: Controlling how diagnostics should be formatted. * Warning Options:: How picky should the compiler be? @@ -141,6 +147,7 @@ only one of these two forms, whichever one is not the default. * Code Gen Options:: Specifying conventions for function calls, data layout and register usage. * Environment Variables:: Env vars that affect GCC. +* Precompiled Headers:: Compiling a header once, and using it many times. * Running Protoize:: Automatically adding or removing function prototypes. @end menu @@ -155,30 +162,27 @@ in the following sections. @table @emph @item Overall Options @xref{Overall Options,,Options Controlling the Kind of Output}. -@gccoptlist{ --c -S -E -o @var{file} -pipe -pass-exit-codes -x @var{language} @gol --v -### --help --target-help --version} +@gccoptlist{-c -S -E -o @var{file} -combine -pipe -pass-exit-codes @gol +-x @var{language} -v -### --help@r{[}=@var{class}@r{[},@dots{}@r{]]} --target-help @gol +--version -wrapper@@@var{file}} @item C Language Options @xref{C Dialect Options,,Options Controlling C Dialect}. -@gccoptlist{ --ansi -std=@var{standard} -aux-info @var{filename} @gol --fno-asm -fno-builtin -fno-builtin-@var{function} @gol --fhosted -ffreestanding @gol +@gccoptlist{-ansi -std=@var{standard} -fgnu89-inline @gol +-aux-info @var{filename} @gol +-fno-asm -fno-builtin -fno-builtin-@var{function} @gol +-fhosted -ffreestanding -fopenmp -fms-extensions @gol -trigraphs -no-integrated-cpp -traditional -traditional-cpp @gol --fallow-single-precision -fcond-mismatch @gol +-fallow-single-precision -fcond-mismatch -flax-vector-conversions @gol -fsigned-bitfields -fsigned-char @gol --funsigned-bitfields -funsigned-char @gol --fwritable-strings} +-funsigned-bitfields -funsigned-char} @item C++ Language Options @xref{C++ Dialect Options,,Options Controlling C++ Dialect}. -@gccoptlist{ --fno-access-control -fcheck-new -fconserve-space @gol --fno-const-strings -fdollars-in-identifiers @gol +@gccoptlist{-fabi-version=@var{n} -fno-access-control -fcheck-new @gol +-fconserve-space -ffriend-injection @gol -fno-elide-constructors @gol --fno-enforce-eh-specs -fexternal-templates @gol --falt-external-templates @gol +-fno-enforce-eh-specs @gol -ffor-scope -fno-for-scope -fno-gnu-keywords @gol -fno-implicit-templates @gol -fno-implicit-inline-templates @gol @@ -186,342 +190,327 @@ in the following sections. -fno-nonansi-builtins -fno-operator-names @gol -fno-optional-diags -fpermissive @gol -frepo -fno-rtti -fstats -ftemplate-depth-@var{n} @gol --fuse-cxa-atexit -fvtable-gc -fno-weak -nostdinc++ @gol --fno-default-inline -Wabi -Wctor-dtor-privacy @gol +-fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ @gol +-fno-default-inline -fvisibility-inlines-hidden @gol +-fvisibility-ms-compat @gol +-Wabi -Wctor-dtor-privacy @gol -Wnon-virtual-dtor -Wreorder @gol --Weffc++ -Wno-deprecated @gol +-Weffc++ -Wstrict-null-sentinel @gol -Wno-non-template-friend -Wold-style-cast @gol -Woverloaded-virtual -Wno-pmf-conversions @gol --Wsign-promo -Wsynth} - -@item Objective-C Language Options -@xref{Objective-C Dialect Options,,Options Controlling Objective-C Dialect}. -@gccoptlist{ --fconstant-string-class=@var{class-name} @gol --fgnu-runtime -fnext-runtime -gen-decls @gol --Wno-protocol -Wselector} +-Wsign-promo} + +@item Objective-C and Objective-C++ Language Options +@xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling +Objective-C and Objective-C++ Dialects}. +@gccoptlist{-fconstant-string-class=@var{class-name} @gol +-fgnu-runtime -fnext-runtime @gol +-fno-nil-receivers @gol +-fobjc-call-cxx-cdtors @gol +-fobjc-direct-dispatch @gol +-fobjc-exceptions @gol +-fobjc-gc @gol +-freplace-objc-classes @gol +-fzero-link @gol +-gen-decls @gol +-Wassign-intercept @gol +-Wno-protocol -Wselector @gol +-Wstrict-selector-match @gol +-Wundeclared-selector} @item Language Independent Options @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}. -@gccoptlist{ --fmessage-length=@var{n} @gol --fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}} +@gccoptlist{-fmessage-length=@var{n} @gol +-fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]} @gol +-fdiagnostics-show-option} @item Warning Options @xref{Warning Options,,Options to Request or Suppress Warnings}. -@gccoptlist{ --fsyntax-only -pedantic -pedantic-errors @gol --w -W -Wall -Waggregate-return @gol --Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment @gol --Wconversion -Wno-deprecated-declarations @gol --Wdisabled-optimization -Wdiv-by-zero -Werror @gol --Wfloat-equal -Wformat -Wformat=2 @gol --Wformat-nonliteral -Wformat-security @gol --Wimplicit -Wimplicit-int @gol --Wimplicit-function-declaration @gol --Werror-implicit-function-declaration @gol --Wimport -Winline @gol --Wlarger-than-@var{len} -Wlong-long @gol --Wmain -Wmissing-braces @gol --Wmissing-format-attribute -Wmissing-noreturn @gol --Wmultichar -Wno-format-extra-args -Wno-format-y2k @gol --Wno-import -Wpacked -Wpadded @gol --Wparentheses -Wpointer-arith -Wredundant-decls @gol +@gccoptlist{-fsyntax-only -pedantic -pedantic-errors @gol +-w -Wextra -Wall -Waddress -Waggregate-return -Warray-bounds @gol +-Wno-attributes -Wno-builtin-macro-redefined @gol +-Wc++-compat -Wc++0x-compat -Wcast-align -Wcast-qual @gol +-Wchar-subscripts -Wclobbered -Wcomment @gol +-Wconversion -Wcoverage-mismatch -Wno-deprecated @gol +-Wno-deprecated-declarations -Wdisabled-optimization @gol +-Wno-div-by-zero -Wempty-body -Wenum-compare -Wno-endif-labels @gol +-Werror -Werror=* @gol +-Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol +-Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol +-Wformat-security -Wformat-y2k @gol +-Wframe-larger-than=@var{len} -Wignored-qualifiers @gol +-Wimplicit -Wimplicit-function-declaration -Wimplicit-int @gol +-Winit-self -Winline @gol +-Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol +-Winvalid-pch -Wlarger-than=@var{len} -Wunsafe-loop-optimizations @gol +-Wlogical-op -Wlong-long @gol +-Wmain -Wmissing-braces -Wmissing-field-initializers @gol +-Wmissing-format-attribute -Wmissing-include-dirs @gol +-Wmissing-noreturn -Wno-mudflap @gol +-Wno-multichar -Wnonnull -Wno-overflow @gol +-Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol +-Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol +-Wpointer-arith -Wno-pointer-to-int-cast @gol +-Wredundant-decls @gol -Wreturn-type -Wsequence-point -Wshadow @gol --Wsign-compare -Wswitch -Wsystem-headers @gol --Wtrigraphs -Wundef -Wuninitialized @gol --Wunknown-pragmas -Wunreachable-code @gol +-Wsign-compare -Wsign-conversion -Wstack-protector @gol +-Wstrict-aliasing -Wstrict-aliasing=n @gol +-Wstrict-overflow -Wstrict-overflow=@var{n} @gol +-Wswitch -Wswitch-default -Wswitch-enum -Wsync-nand @gol +-Wsystem-headers -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized @gol +-Wunknown-pragmas -Wno-pragmas -Wunreachable-code @gol -Wunused -Wunused-function -Wunused-label -Wunused-parameter @gol --Wunused-value -Wunused-variable -Wwrite-strings} +-Wunused-value -Wunused-variable @gol +-Wvariadic-macros -Wvla @gol +-Wvolatile-register-var -Wwrite-strings} -@item C-only Warning Options -@gccoptlist{ --Wbad-function-cast -Wmissing-declarations @gol --Wmissing-prototypes -Wnested-externs @gol --Wstrict-prototypes -Wtraditional} +@item C and Objective-C-only Warning Options +@gccoptlist{-Wbad-function-cast -Wmissing-declarations @gol +-Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs @gol +-Wold-style-declaration -Wold-style-definition @gol +-Wstrict-prototypes -Wtraditional -Wtraditional-conversion @gol +-Wdeclaration-after-statement -Wpointer-sign} @item Debugging Options @xref{Debugging Options,,Options for Debugging Your Program or GCC}. -@gccoptlist{ --d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol --fdump-unnumbered -fdump-translation-unit@r{[}-@var{n}@r{]} @gol +@gccoptlist{-d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol +-fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol +-fdump-noaddr -fdump-unnumbered @gol +-fdump-translation-unit@r{[}-@var{n}@r{]} @gol -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol --fdump-tree-original@r{[}-@var{n}@r{]} -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol --fdump-tree-inlined@r{[}-@var{n}@r{]} @gol --fmem-report -fpretend-float @gol --fprofile-arcs -fsched-verbose=@var{n} @gol --ftest-coverage -ftime-report @gol --g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2 @gol +-fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol +-fdump-statistics @gol +-fdump-tree-all @gol +-fdump-tree-original@r{[}-@var{n}@r{]} @gol +-fdump-tree-optimized@r{[}-@var{n}@r{]} @gol +-fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol +-fdump-tree-ch @gol +-fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol +-fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol +-fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol +-fdump-tree-dom@r{[}-@var{n}@r{]} @gol +-fdump-tree-dse@r{[}-@var{n}@r{]} @gol +-fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol +-fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol +-fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol +-fdump-tree-nrv -fdump-tree-vect @gol +-fdump-tree-sink @gol +-fdump-tree-sra@r{[}-@var{n}@r{]} @gol +-fdump-tree-fre@r{[}-@var{n}@r{]} @gol +-fdump-tree-vrp@r{[}-@var{n}@r{]} @gol +-ftree-vectorizer-verbose=@var{n} @gol +-fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol +-feliminate-dwarf2-dups -feliminate-unused-debug-types @gol +-feliminate-unused-debug-symbols -femit-class-debug-always @gol +-fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol +-frandom-seed=@var{string} -fsched-verbose=@var{n} @gol +-fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol +-ftest-coverage -ftime-report -fvar-tracking @gol +-g -g@var{level} -gcoff -gdwarf-2 @gol -ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+ @gol +-fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol +-fdebug-prefix-map=@var{old}=@var{new} @gol +-femit-struct-debug-baseonly -femit-struct-debug-reduced @gol +-femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol -p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol -print-multi-directory -print-multi-lib @gol -print-prog-name=@var{program} -print-search-dirs -Q @gol +-print-sysroot -print-sysroot-headers-suffix @gol -save-temps -time} @item Optimization Options @xref{Optimize Options,,Options that Control Optimization}. @gccoptlist{ --falign-functions=@var{n} -falign-jumps=@var{n} @gol --falign-labels=@var{n} -falign-loops=@var{n} @gol --fbounds-check @gol --fbranch-probabilities -fcaller-saves -fcprop-registers @gol --fcse-follow-jumps -fcse-skip-blocks -fdata-sections @gol --fdelayed-branch -fdelete-null-pointer-checks @gol --fexpensive-optimizations -ffast-math -ffloat-store @gol --fforce-addr -fforce-mem -ffunction-sections @gol --fgcse -fgcse-lm -fgcse-sm @gol --finline-functions -finline-limit=@var{n} -fkeep-inline-functions @gol --fkeep-static-consts -fmerge-constants -fmerge-all-constants @gol --fmove-all-movables -fno-branch-count-reg @gol --fno-default-inline -fno-defer-pop @gol --fno-function-cse -fno-guess-branch-probability @gol --fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol --funsafe-math-optimizations -fno-trapping-math @gol --fomit-frame-pointer -foptimize-register-move @gol --foptimize-sibling-calls -fprefetch-loop-arrays @gol --freduce-all-givs -fregmove -frename-registers @gol --frerun-cse-after-loop -frerun-loop-opt @gol --fschedule-insns -fschedule-insns2 @gol --fno-sched-interblock -fno-sched-spec @gol --fsched-spec-load -fsched-spec-load-dangerous @gol --fsingle-precision-constant -fssa -fssa-ccp -fssa-dce @gol --fstrength-reduce -fstrict-aliasing -fthread-jumps @gol --ftrapv -funroll-all-loops -funroll-loops @gol +-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol +-falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol +-fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol +-fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol +-fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping @gol +-fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol +-fdata-sections -fdce -fdce @gol +-fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol +-fearly-inlining -fexpensive-optimizations -ffast-math @gol +-ffinite-math-only -ffloat-store -fforward-propagate @gol +-ffunction-sections -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol +-fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol +-finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol +-finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol +-fipa-pure-const -fipa-reference -fipa-struct-reorg @gol +-fipa-type-escape -fira-algorithm=@var{algorithm} @gol +-fira-region=@var{region} -fira-coalesce -fno-ira-share-save-slots @gol +-fno-ira-share-spill-slots -fira-verbose=@var{n} @gol +-fivopts -fkeep-inline-functions -fkeep-static-consts @gol +-floop-block -floop-interchange -floop-strip-mine @gol +-fmerge-all-constants -fmerge-constants -fmodulo-sched @gol +-fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol +-fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol +-fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol +-fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol +-fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol +-fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol +-fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol +-fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol +-fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol +-fprofile-generate=@var{path} @gol +-fprofile-use -fprofile-use=@var{path} -fprofile-values @gol +-freciprocal-math -fregmove -frename-registers -freorder-blocks @gol +-freorder-blocks-and-partition -freorder-functions @gol +-frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol +-frounding-math -frtl-abstract-sequences -fsched2-use-superblocks @gol +-fsched2-use-traces -fsched-spec-load -fsched-spec-load-dangerous @gol +-fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol +-fschedule-insns -fschedule-insns2 -fsection-anchors -fsee @gol +-fselective-scheduling -fselective-scheduling2 @gol +-fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol +-fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol +-fsplit-wide-types -fstack-protector -fstack-protector-all @gol +-fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol +-ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol +-ftree-copyrename -ftree-dce @gol +-ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im @gol +-ftree-loop-distribution @gol +-ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol +-ftree-parallelize-loops=@var{n} -ftree-pre -ftree-reassoc @gol +-ftree-sink -ftree-sra -ftree-switch-conversion @gol +-ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol +-funit-at-a-time -funroll-all-loops -funroll-loops @gol +-funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol +-fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol +-fwhole-program @gol --param @var{name}=@var{value} -O -O0 -O1 -O2 -O3 -Os} @item Preprocessor Options @xref{Preprocessor Options,,Options Controlling the Preprocessor}. -@gccoptlist{ --$ -A@var{question}=@var{answer} -A-@var{question}@r{[}=@var{answer}@r{]} @gol +@gccoptlist{-A@var{question}=@var{answer} @gol +-A-@var{question}@r{[}=@var{answer}@r{]} @gol -C -dD -dI -dM -dN @gol -D@var{macro}@r{[}=@var{defn}@r{]} -E -H @gol -idirafter @var{dir} @gol -include @var{file} -imacros @var{file} @gol -iprefix @var{file} -iwithprefix @var{dir} @gol -iwithprefixbefore @var{dir} -isystem @var{dir} @gol --M -MM -MF -MG -MP -MQ -MT -nostdinc -P -remap @gol --trigraphs -undef -U@var{macro} -Wp,@var{option}} +-imultilib @var{dir} -isysroot @var{dir} @gol +-M -MM -MF -MG -MP -MQ -MT -nostdinc @gol +-P -fworking-directory -remap @gol +-trigraphs -undef -U@var{macro} -Wp,@var{option} @gol +-Xpreprocessor @var{option}} @item Assembler Option @xref{Assembler Options,,Passing Options to the Assembler}. -@gccoptlist{ --Wa,@var{option}} +@gccoptlist{-Wa,@var{option} -Xassembler @var{option}} @item Linker Options @xref{Link Options,,Options for Linking}. -@gccoptlist{ -@var{object-file-name} -l@var{library} @gol --nostartfiles -nodefaultlibs -nostdlib @gol +@gccoptlist{@var{object-file-name} -l@var{library} @gol +-nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic @gol -s -static -static-libgcc -shared -shared-libgcc -symbolic @gol --Wl,@var{option} -Xlinker @var{option} @gol +-T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol -u @var{symbol}} @item Directory Options @xref{Directory Options,,Options for Directory Search}. -@gccoptlist{ --B@var{prefix} -I@var{dir} -I- -L@var{dir} -specs=@var{file}} +@gccoptlist{-B@var{prefix} -I@var{dir} -iquote@var{dir} -L@var{dir} +-specs=@var{file} -I- --sysroot=@var{dir}} @item Target Options @c I wrote this xref this way to avoid overfull hbox. -- rms @xref{Target Options}. -@gccoptlist{ --b @var{machine} -V @var{version}} +@gccoptlist{-V @var{version} -b @var{machine}} @item Machine Dependent Options @xref{Submodel Options,,Hardware Models and Configurations}. +@c This list is ordered alphanumerically by subsection name. +@c Try and put the significant identifier (CPU or system) first, +@c so users have a clue at guessing where the ones they want will be. -@emph{M680x0 Options} -@gccoptlist{ --m68000 -m68020 -m68020-40 -m68020-60 -m68030 -m68040 @gol --m68060 -mcpu32 -m5200 -m68881 -mbitfield -mc68000 -mc68020 @gol --mfpa -mnobitfield -mrtd -mshort -msoft-float -mpcrel @gol --malign-int -mstrict-align} - -@emph{M68hc1x Options} -@gccoptlist{ --m6811 -m6812 -m68hc11 -m68hc12 @gol --mauto-incdec -mshort -msoft-reg-count=@var{count}} - -@emph{VAX Options} -@gccoptlist{ --mg -mgnu -munix} - -@emph{SPARC Options} -@gccoptlist{ --mcpu=@var{cpu-type} @gol --mtune=@var{cpu-type} @gol --mcmodel=@var{code-model} @gol --m32 -m64 @gol --mapp-regs -mbroken-saverestore -mcypress @gol --mfaster-structs -mflat @gol --mfpu -mhard-float -mhard-quad-float @gol --mimpure-text -mlive-g0 -mno-app-regs @gol --mno-faster-structs -mno-flat -mno-fpu @gol --mno-impure-text -mno-stack-bias -mno-unaligned-doubles @gol --msoft-float -msoft-quad-float -msparclite -mstack-bias @gol --msupersparc -munaligned-doubles -mv8} - -@emph{Convex Options} -@gccoptlist{ --mc1 -mc2 -mc32 -mc34 -mc38 @gol --margcount -mnoargcount @gol --mlong32 -mlong64 @gol --mvolatile-cache -mvolatile-nocache} - -@emph{AMD29K Options} -@gccoptlist{ --m29000 -m29050 -mbw -mnbw -mdw -mndw @gol --mlarge -mnormal -msmall @gol --mkernel-registers -mno-reuse-arg-regs @gol --mno-stack-check -mno-storem-bug @gol --mreuse-arg-regs -msoft-float -mstack-check @gol --mstorem-bug -muser-registers} +@emph{ARC Options} +@gccoptlist{-EB -EL @gol +-mmangle-cpu -mcpu=@var{cpu} -mtext=@var{text-section} @gol +-mdata=@var{data-section} -mrodata=@var{readonly-data-section}} @emph{ARM Options} -@gccoptlist{ --mapcs-frame -mno-apcs-frame @gol --mapcs-26 -mapcs-32 @gol +@gccoptlist{-mapcs-frame -mno-apcs-frame @gol +-mabi=@var{name} @gol -mapcs-stack-check -mno-apcs-stack-check @gol -mapcs-float -mno-apcs-float @gol -mapcs-reentrant -mno-apcs-reentrant @gol -msched-prolog -mno-sched-prolog @gol -mlittle-endian -mbig-endian -mwords-little-endian @gol --malignment-traps -mno-alignment-traps @gol --msoft-float -mhard-float -mfpe @gol +-mfloat-abi=@var{name} -msoft-float -mhard-float -mfpe @gol -mthumb-interwork -mno-thumb-interwork @gol --mcpu=@var{name} -march=@var{name} -mfpe=@var{name} @gol +-mcpu=@var{name} -march=@var{name} -mfpu=@var{name} @gol -mstructure-size-boundary=@var{n} @gol --mbsd -mxopen -mno-symrename @gol -mabort-on-noreturn @gol -mlong-calls -mno-long-calls @gol -msingle-pic-base -mno-single-pic-base @gol -mpic-register=@var{reg} @gol -mnop-fun-dllimport @gol +-mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol -mpoke-function-name @gol -mthumb -marm @gol -mtpcs-frame -mtpcs-leaf-frame @gol --mcaller-super-interworking -mcallee-super-interworking } - -@emph{MN10200 Options} -@gccoptlist{ --mrelax} - -@emph{MN10300 Options} -@gccoptlist{ --mmult-bug -mno-mult-bug @gol --mam33 -mno-am33 @gol --mno-crt0 -mrelax} - -@emph{M32R/D Options} -@gccoptlist{ --m32rx -m32r -mcode-model=@var{model-type} -msdata=@var{sdata-type} @gol --G @var{num}} - -@emph{M88K Options} -@gccoptlist{ --m88000 -m88100 -m88110 -mbig-pic @gol --mcheck-zero-division -mhandle-large-shift @gol --midentify-revision -mno-check-zero-division @gol --mno-ocs-debug-info -mno-ocs-frame-position @gol --mno-optimize-arg-area -mno-serialize-volatile @gol --mno-underscores -mocs-debug-info @gol --mocs-frame-position -moptimize-arg-area @gol --mserialize-volatile -mshort-data-@var{num} -msvr3 @gol --msvr4 -mtrap-large-shift -muse-div-instruction @gol --mversion-03.00 -mwarn-passed-structs} - -@emph{RS/6000 and PowerPC Options} -@gccoptlist{ --mcpu=@var{cpu-type} @gol --mtune=@var{cpu-type} @gol --mpower -mno-power -mpower2 -mno-power2 @gol --mpowerpc -mpowerpc64 -mno-powerpc @gol --maltivec -mno-altivec @gol --mpowerpc-gpopt -mno-powerpc-gpopt @gol --mpowerpc-gfxopt -mno-powerpc-gfxopt @gol --mnew-mnemonics -mold-mnemonics @gol --mfull-toc -mminimal-toc -mno-fp-in-toc -mno-sum-in-toc @gol --m64 -m32 -mxl-call -mno-xl-call -mpe @gol --msoft-float -mhard-float -mmultiple -mno-multiple @gol --mstring -mno-string -mupdate -mno-update @gol --mfused-madd -mno-fused-madd -mbit-align -mno-bit-align @gol --mstrict-align -mno-strict-align -mrelocatable @gol --mno-relocatable -mrelocatable-lib -mno-relocatable-lib @gol --mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian @gol --mcall-aix -mcall-sysv -mcall-netbsd @gol --maix-struct-return -msvr4-struct-return @gol --mabi=altivec -mabi=no-altivec @gol --mprototype -mno-prototype @gol --msim -mmvme -mads -myellowknife -memb -msdata @gol --msdata=@var{opt} -mvxworks -G @var{num} -pthread} - -@emph{RT Options} -@gccoptlist{ --mcall-lib-mul -mfp-arg-in-fpregs -mfp-arg-in-gregs @gol --mfull-fp-blocks -mhc-struct-return -min-line-mul @gol --mminimum-fp-blocks -mnohc-struct-return} - -@emph{MIPS Options} -@gccoptlist{ --mabicalls -march=@var{cpu-type} -mtune=@var{cpu=type} @gol --mcpu=@var{cpu-type} -membedded-data -muninit-const-in-rodata @gol --membedded-pic -mfp32 -mfp64 -mfused-madd -mno-fused-madd @gol --mgas -mgp32 -mgp64 @gol --mgpopt -mhalf-pic -mhard-float -mint64 -mips1 @gol --mips2 -mips3 -mips4 -mlong64 -mlong32 -mlong-calls -mmemcpy @gol --mmips-as -mmips-tfile -mno-abicalls @gol --mno-embedded-data -mno-uninit-const-in-rodata @gol --mno-embedded-pic -mno-gpopt -mno-long-calls @gol --mno-memcpy -mno-mips-tfile -mno-rnames -mno-stats @gol --mrnames -msoft-float @gol --m4650 -msingle-float -mmad @gol --mstats -EL -EB -G @var{num} -nocpp @gol --mabi=32 -mabi=n32 -mabi=64 -mabi=eabi @gol --mfix7000 -mno-crt0 -mflush-func=@var{func} -mno-flush-func} - -@emph{i386 and x86-64 Options} -@gccoptlist{ --mcpu=@var{cpu-type} -march=@var{cpu-type} -mfpmath=@var{unit} @gol --masm=@var{dialect} -mno-fancy-math-387 @gol --mno-fp-ret-in-387 -msoft-float -msvr3-shlib @gol --mno-wide-multiply -mrtd -malign-double @gol --mpreferred-stack-boundary=@var{num} @gol --mmmx -msse -msse2 -m3dnow @gol --mthreads -mno-align-stringops -minline-all-stringops @gol --mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol --m96bit-long-double -mregparm=@var{num} -momit-leaf-frame-pointer @gol --mno-red-zone@gol --mcmodel=@var{code-model} @gol --m32 -m64} +-mcaller-super-interworking -mcallee-super-interworking @gol +-mtp=@var{name} @gol +-mword-relocations @gol +-mfix-cortex-m3-ldrd} -@emph{HPPA Options} -@gccoptlist{ --march=@var{architecture-type} @gol --mbig-switch -mdisable-fpregs -mdisable-indexing @gol --mfast-indirect-calls -mgas -mjump-in-delay @gol --mlong-load-store -mno-big-switch -mno-disable-fpregs @gol --mno-disable-indexing -mno-fast-indirect-calls -mno-gas @gol --mno-jump-in-delay -mno-long-load-store @gol --mno-portable-runtime -mno-soft-float @gol --mno-space-regs -msoft-float -mpa-risc-1-0 @gol --mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime @gol --mschedule=@var{cpu-type} -mspace-regs} +@emph{AVR Options} +@gccoptlist{-mmcu=@var{mcu} -msize -mno-interrupts @gol +-mcall-prologues -mno-tablejump -mtiny-stack -mint8} + +@emph{Blackfin Options} +@gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol +-msim -momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer @gol +-mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly @gol +-mlow-64k -mno-low64k -mstack-check-l1 -mid-shared-library @gol +-mno-id-shared-library -mshared-library-id=@var{n} @gol +-mleaf-id-shared-library -mno-leaf-id-shared-library @gol +-msep-data -mno-sep-data -mlong-calls -mno-long-calls @gol +-mfast-fp -minline-plt -mmulticore -mcorea -mcoreb -msdram @gol +-micplb} -@emph{Intel 960 Options} -@gccoptlist{ --m@var{cpu-type} -masm-compat -mclean-linkage @gol --mcode-align -mcomplex-addr -mleaf-procedures @gol --mic-compat -mic2.0-compat -mic3.0-compat @gol --mintel-asm -mno-clean-linkage -mno-code-align @gol --mno-complex-addr -mno-leaf-procedures @gol --mno-old-align -mno-strict-align -mno-tail-call @gol --mnumerics -mold-align -msoft-float -mstrict-align @gol --mtail-call} +@emph{CRIS Options} +@gccoptlist{-mcpu=@var{cpu} -march=@var{cpu} -mtune=@var{cpu} @gol +-mmax-stack-frame=@var{n} -melinux-stacksize=@var{n} @gol +-metrax4 -metrax100 -mpdebug -mcc-init -mno-side-effects @gol +-mstack-align -mdata-align -mconst-align @gol +-m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt @gol +-melf -maout -melinux -mlinux -sim -sim2 @gol +-mmul-bug-workaround -mno-mul-bug-workaround} + +@emph{CRX Options} +@gccoptlist{-mmac -mpush-args} + +@emph{Darwin Options} +@gccoptlist{-all_load -allowable_client -arch -arch_errors_fatal @gol +-arch_only -bind_at_load -bundle -bundle_loader @gol +-client_name -compatibility_version -current_version @gol +-dead_strip @gol +-dependency-file -dylib_file -dylinker_install_name @gol +-dynamic -dynamiclib -exported_symbols_list @gol +-filelist -flat_namespace -force_cpusubtype_ALL @gol +-force_flat_namespace -headerpad_max_install_names @gol +-iframework @gol +-image_base -init -install_name -keep_private_externs @gol +-multi_module -multiply_defined -multiply_defined_unused @gol +-noall_load -no_dead_strip_inits_and_terms @gol +-nofixprebinding -nomultidefs -noprebind -noseglinkedit @gol +-pagezero_size -prebind -prebind_all_twolevel_modules @gol +-private_bundle -read_only_relocs -sectalign @gol +-sectobjectsymbols -whyload -seg1addr @gol +-sectcreate -sectobjectsymbols -sectorder @gol +-segaddr -segs_read_only_addr -segs_read_write_addr @gol +-seg_addr_table -seg_addr_table_filename -seglinkedit @gol +-segprot -segs_read_only_addr -segs_read_write_addr @gol +-single_module -static -sub_library -sub_umbrella @gol +-twolevel_namespace -umbrella -undefined @gol +-unexported_symbols_list -weak_reference_mismatches @gol +-whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol +-mkernel -mone-byte-bool} @emph{DEC Alpha Options} -@gccoptlist{ --mno-fp-regs -msoft-float -malpha-as -mgas @gol +@gccoptlist{-mno-fp-regs -msoft-float -malpha-as -mgas @gol -mieee -mieee-with-inexact -mieee-conformant @gol -mfp-trap-mode=@var{mode} -mfp-rounding-mode=@var{mode} @gol -mtrap-precision=@var{mode} -mbuild-constants @gol @@ -529,159 +518,353 @@ in the following sections. -mbwx -mmax -mfix -mcix @gol -mfloat-vax -mfloat-ieee @gol -mexplicit-relocs -msmall-data -mlarge-data @gol +-msmall-text -mlarge-text @gol -mmemory-latency=@var{time}} @emph{DEC Alpha/VMS Options} -@gccoptlist{ --mvms-return-codes} - -@emph{Clipper Options} -@gccoptlist{ --mc300 -mc400} +@gccoptlist{-mvms-return-codes} + +@emph{FR30 Options} +@gccoptlist{-msmall-model -mno-lsim} + +@emph{FRV Options} +@gccoptlist{-mgpr-32 -mgpr-64 -mfpr-32 -mfpr-64 @gol +-mhard-float -msoft-float @gol +-malloc-cc -mfixed-cc -mdword -mno-dword @gol +-mdouble -mno-double @gol +-mmedia -mno-media -mmuladd -mno-muladd @gol +-mfdpic -minline-plt -mgprel-ro -multilib-library-pic @gol +-mlinked-fp -mlong-calls -malign-labels @gol +-mlibrary-pic -macc-4 -macc-8 @gol +-mpack -mno-pack -mno-eflags -mcond-move -mno-cond-move @gol +-moptimize-membar -mno-optimize-membar @gol +-mscc -mno-scc -mcond-exec -mno-cond-exec @gol +-mvliw-branch -mno-vliw-branch @gol +-mmulti-cond-exec -mno-multi-cond-exec -mnested-cond-exec @gol +-mno-nested-cond-exec -mtomcat-stats @gol +-mTLS -mtls @gol +-mcpu=@var{cpu}} + +@emph{GNU/Linux Options} +@gccoptlist{-muclibc} @emph{H8/300 Options} -@gccoptlist{ --mrelax -mh -ms -mint32 -malign-300} +@gccoptlist{-mrelax -mh -ms -mn -mint32 -malign-300} -@emph{SH Options} -@gccoptlist{ --m1 -m2 -m3 -m3e @gol --m4-nofpu -m4-single-only -m4-single -m4 @gol --m5-64media -m5-64media-nofpu @gol --m5-32media -m5-32media-nofpu @gol --m5-compact -m5-compact-nofpu @gol --mb -ml -mdalign -mrelax @gol --mbigtable -mfmovd -mhitachi -mnomacsave @gol --mieee -misize -mpadstruct -mspace @gol --mprefergot -musermode} +@emph{HPPA Options} +@gccoptlist{-march=@var{architecture-type} @gol +-mbig-switch -mdisable-fpregs -mdisable-indexing @gol +-mfast-indirect-calls -mgas -mgnu-ld -mhp-ld @gol +-mfixed-range=@var{register-range} @gol +-mjump-in-delay -mlinker-opt -mlong-calls @gol +-mlong-load-store -mno-big-switch -mno-disable-fpregs @gol +-mno-disable-indexing -mno-fast-indirect-calls -mno-gas @gol +-mno-jump-in-delay -mno-long-load-store @gol +-mno-portable-runtime -mno-soft-float @gol +-mno-space-regs -msoft-float -mpa-risc-1-0 @gol +-mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime @gol +-mschedule=@var{cpu-type} -mspace-regs -msio -mwsio @gol +-munix=@var{unix-std} -nolibdld -static -threads} -@emph{System V Options} -@gccoptlist{ --Qy -Qn -YP,@var{paths} -Ym,@var{dir}} +@emph{i386 and x86-64 Options} +@gccoptlist{-mtune=@var{cpu-type} -march=@var{cpu-type} @gol +-mfpmath=@var{unit} @gol +-masm=@var{dialect} -mno-fancy-math-387 @gol +-mno-fp-ret-in-387 -msoft-float @gol +-mno-wide-multiply -mrtd -malign-double @gol +-mpreferred-stack-boundary=@var{num} +-mincoming-stack-boundary=@var{num} +-mcld -mcx16 -msahf -mrecip @gol +-mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol +-maes -mpclmul @gol +-msse4a -m3dnow -mpopcnt -mabm -msse5 @gol +-mthreads -mno-align-stringops -minline-all-stringops @gol +-minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol +-mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol +-m96bit-long-double -mregparm=@var{num} -msseregparm @gol +-mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol +-momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs @gol +-mcmodel=@var{code-model} @gol +-m32 -m64 -mlarge-data-threshold=@var{num} @gol +-mfused-madd -mno-fused-madd -msse2avx} -@emph{ARC Options} -@gccoptlist{ --EB -EL @gol --mmangle-cpu -mcpu=@var{cpu} -mtext=@var{text-section} @gol --mdata=@var{data-section} -mrodata=@var{readonly-data-section}} +@emph{IA-64 Options} +@gccoptlist{-mbig-endian -mlittle-endian -mgnu-as -mgnu-ld -mno-pic @gol +-mvolatile-asm-stop -mregister-names -mno-sdata @gol +-mconstant-gp -mauto-pic -minline-float-divide-min-latency @gol +-minline-float-divide-max-throughput @gol +-minline-int-divide-min-latency @gol +-minline-int-divide-max-throughput @gol +-minline-sqrt-min-latency -minline-sqrt-max-throughput @gol +-mno-dwarf2-asm -mearly-stop-bits @gol +-mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol +-mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol +-mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol +-msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol +-msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol +-mno-sched-prefer-non-data-spec-insns @gol +-mno-sched-prefer-non-control-spec-insns @gol +-mno-sched-count-spec-in-critical-path} -@emph{TMS320C3x/C4x Options} -@gccoptlist{ --mcpu=@var{cpu} -mbig -msmall -mregparm -mmemparm @gol --mfast-fix -mmpyi -mbk -mti -mdp-isr-reload @gol --mrpts=@var{count} -mrptb -mdb -mloop-unsigned @gol --mparallel-insns -mparallel-mpy -mpreserve-float} +@emph{M32R/D Options} +@gccoptlist{-m32r2 -m32rx -m32r @gol +-mdebug @gol +-malign-loops -mno-align-loops @gol +-missue-rate=@var{number} @gol +-mbranch-cost=@var{number} @gol +-mmodel=@var{code-size-model-type} @gol +-msdata=@var{sdata-type} @gol +-mno-flush-func -mflush-func=@var{name} @gol +-mno-flush-trap -mflush-trap=@var{number} @gol +-G @var{num}} -@emph{V850 Options} -@gccoptlist{ --mlong-calls -mno-long-calls -mep -mno-ep @gol --mprolog-function -mno-prolog-function -mspace @gol --mtda=@var{n} -msda=@var{n} -mzda=@var{n} @gol --mv850 -mbig-switch} +@emph{M32C Options} +@gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}} -@emph{NS32K Options} -@gccoptlist{ --m32032 -m32332 -m32532 -m32081 -m32381 @gol --mmult-add -mnomult-add -msoft-float -mrtd -mnortd @gol --mregparam -mnoregparam -msb -mnosb @gol --mbitfield -mnobitfield -mhimem -mnohimem} +@emph{M680x0 Options} +@gccoptlist{-march=@var{arch} -mcpu=@var{cpu} -mtune=@var{tune} +-m68000 -m68020 -m68020-40 -m68020-60 -m68030 -m68040 @gol +-m68060 -mcpu32 -m5200 -m5206e -m528x -m5307 -m5407 @gol +-mcfv4e -mbitfield -mno-bitfield -mc68000 -mc68020 @gol +-mnobitfield -mrtd -mno-rtd -mdiv -mno-div -mshort @gol +-mno-short -mhard-float -m68881 -msoft-float -mpcrel @gol +-malign-int -mstrict-align -msep-data -mno-sep-data @gol +-mshared-library-id=n -mid-shared-library -mno-id-shared-library @gol +-mxgot -mno-xgot} -@emph{AVR Options} -@gccoptlist{ --mmcu=@var{mcu} -msize -minit-stack=@var{n} -mno-interrupts @gol --mcall-prologues -mno-tablejump -mtiny-stack} +@emph{M68hc1x Options} +@gccoptlist{-m6811 -m6812 -m68hc11 -m68hc12 -m68hcs12 @gol +-mauto-incdec -minmax -mlong-calls -mshort @gol +-msoft-reg-count=@var{count}} @emph{MCore Options} -@gccoptlist{ --mhardlit -mno-hardlit -mdiv -mno-div -mrelax-immediates @gol +@gccoptlist{-mhardlit -mno-hardlit -mdiv -mno-div -mrelax-immediates @gol -mno-relax-immediates -mwide-bitfields -mno-wide-bitfields @gol -m4byte-functions -mno-4byte-functions -mcallgraph-data @gol -mno-callgraph-data -mslow-bytes -mno-slow-bytes -mno-lsim @gol -mlittle-endian -mbig-endian -m210 -m340 -mstack-increment} -@emph{MMIX Options} -@gccoptlist{ --mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon -mabi=gnu @gol --mabi=mmixware -mzero-extend -mknuthdiv -mtoplevel-symbols @gol --melf -mbranch-predict -mno-branch-predict -mbase-addresses @gol --mno-base-addresses} - -@emph{IA-64 Options} -@gccoptlist{ --mbig-endian -mlittle-endian -mgnu-as -mgnu-ld -mno-pic @gol --mvolatile-asm-stop -mb-step -mregister-names -mno-sdata @gol --mconstant-gp -mauto-pic -minline-divide-min-latency @gol --minline-divide-max-throughput -mno-dwarf2-asm @gol --mfixed-range=@var{register-range}} - -@emph{D30V Options} -@gccoptlist{ --mextmem -mextmemory -monchip -mno-asm-optimize @gol --masm-optimize -mbranch-cost=@var{n} -mcond-exec=@var{n}} +@emph{MIPS Options} +@gccoptlist{-EL -EB -march=@var{arch} -mtune=@var{arch} @gol +-mips1 -mips2 -mips3 -mips4 -mips32 -mips32r2 @gol +-mips64 -mips64r2 @gol +-mips16 -mno-mips16 -mflip-mips16 @gol +-minterlink-mips16 -mno-interlink-mips16 @gol +-mabi=@var{abi} -mabicalls -mno-abicalls @gol +-mshared -mno-shared -mplt -mno-plt -mxgot -mno-xgot @gol +-mgp32 -mgp64 -mfp32 -mfp64 -mhard-float -msoft-float @gol +-msingle-float -mdouble-float -mdsp -mno-dsp -mdspr2 -mno-dspr2 @gol +-mfpu=@var{fpu-type} @gol +-msmartmips -mno-smartmips @gol +-mpaired-single -mno-paired-single -mdmx -mno-mdmx @gol +-mips3d -mno-mips3d -mmt -mno-mt -mllsc -mno-llsc @gol +-mlong64 -mlong32 -msym32 -mno-sym32 @gol +-G@var{num} -mlocal-sdata -mno-local-sdata @gol +-mextern-sdata -mno-extern-sdata -mgpopt -mno-gopt @gol +-membedded-data -mno-embedded-data @gol +-muninit-const-in-rodata -mno-uninit-const-in-rodata @gol +-mcode-readable=@var{setting} @gol +-msplit-addresses -mno-split-addresses @gol +-mexplicit-relocs -mno-explicit-relocs @gol +-mcheck-zero-division -mno-check-zero-division @gol +-mdivide-traps -mdivide-breaks @gol +-mmemcpy -mno-memcpy -mlong-calls -mno-long-calls @gol +-mmad -mno-mad -mfused-madd -mno-fused-madd -nocpp @gol +-mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400 @gol +-mfix-r10000 -mno-fix-r10000 -mfix-vr4120 -mno-fix-vr4120 @gol +-mfix-vr4130 -mno-fix-vr4130 -mfix-sb1 -mno-fix-sb1 @gol +-mflush-func=@var{func} -mno-flush-func @gol +-mbranch-cost=@var{num} -mbranch-likely -mno-branch-likely @gol +-mfp-exceptions -mno-fp-exceptions @gol +-mvr4130-align -mno-vr4130-align} -@emph{S/390 and zSeries Options} -@gccoptlist{ --mhard-float -msoft-float -mbackchain -mno-backchain @gol --msmall-exec -mno-small-exec -mmvcle -mno-mvcle @gol --m64 -m31 -mdebug -mno-debug} +@emph{MMIX Options} +@gccoptlist{-mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon -mabi=gnu @gol +-mabi=mmixware -mzero-extend -mknuthdiv -mtoplevel-symbols @gol +-melf -mbranch-predict -mno-branch-predict -mbase-addresses @gol +-mno-base-addresses -msingle-exit -mno-single-exit} -@emph{CRIS Options} -@gccoptlist{ --mcpu=@var{cpu} -march=@var{cpu} -mtune=@var{cpu} @gol --mmax-stack-frame=@var{n} -melinux-stacksize=@var{n} @gol --metrax4 -metrax100 -mpdebug -mcc-init -mno-side-effects @gol --mstack-align -mdata-align -mconst-align @gol --m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt @gol --melf -maout -melinux -mlinux -sim -sim2} +@emph{MN10300 Options} +@gccoptlist{-mmult-bug -mno-mult-bug @gol +-mam33 -mno-am33 @gol +-mam33-2 -mno-am33-2 @gol +-mreturn-pointer-on-d0 @gol +-mno-crt0 -mrelax} @emph{PDP-11 Options} -@gccoptlist{ --mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10 @gol +@gccoptlist{-mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10 @gol -mbcopy -mbcopy-builtin -mint32 -mno-int16 @gol -mint16 -mno-int32 -mfloat32 -mno-float64 @gol -mfloat64 -mno-float32 -mabshi -mno-abshi @gol -mbranch-expensive -mbranch-cheap @gol -msplit -mno-split -munix-asm -mdec-asm} +@emph{picoChip Options} +@gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} +-msymbol-as-address -mno-inefficient-warnings} + +@emph{PowerPC Options} +See RS/6000 and PowerPC Options. + +@emph{RS/6000 and PowerPC Options} +@gccoptlist{-mcpu=@var{cpu-type} @gol +-mtune=@var{cpu-type} @gol +-mpower -mno-power -mpower2 -mno-power2 @gol +-mpowerpc -mpowerpc64 -mno-powerpc @gol +-maltivec -mno-altivec @gol +-mpowerpc-gpopt -mno-powerpc-gpopt @gol +-mpowerpc-gfxopt -mno-powerpc-gfxopt @gol +-mmfcrf -mno-mfcrf -mpopcntb -mno-popcntb -mfprnd -mno-fprnd @gol +-mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol +-mnew-mnemonics -mold-mnemonics @gol +-mfull-toc -mminimal-toc -mno-fp-in-toc -mno-sum-in-toc @gol +-m64 -m32 -mxl-compat -mno-xl-compat -mpe @gol +-malign-power -malign-natural @gol +-msoft-float -mhard-float -mmultiple -mno-multiple @gol +-msingle-float -mdouble-float -msimple-fpu @gol +-mstring -mno-string -mupdate -mno-update @gol +-mavoid-indexed-addresses -mno-avoid-indexed-addresses @gol +-mfused-madd -mno-fused-madd -mbit-align -mno-bit-align @gol +-mstrict-align -mno-strict-align -mrelocatable @gol +-mno-relocatable -mrelocatable-lib -mno-relocatable-lib @gol +-mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian @gol +-mdynamic-no-pic -maltivec -mswdiv @gol +-mprioritize-restricted-insns=@var{priority} @gol +-msched-costly-dep=@var{dependence_type} @gol +-minsert-sched-nops=@var{scheme} @gol +-mcall-sysv -mcall-netbsd @gol +-maix-struct-return -msvr4-struct-return @gol +-mabi=@var{abi-type} -msecure-plt -mbss-plt @gol +-misel -mno-isel @gol +-misel=yes -misel=no @gol +-mspe -mno-spe @gol +-mspe=yes -mspe=no @gol +-mpaired @gol +-mgen-cell-microcode -mwarn-cell-microcode @gol +-mvrsave -mno-vrsave @gol +-mmulhw -mno-mulhw @gol +-mdlmzb -mno-dlmzb @gol +-mfloat-gprs=yes -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol +-mprototype -mno-prototype @gol +-msim -mmvme -mads -myellowknife -memb -msdata @gol +-msdata=@var{opt} -mvxworks -G @var{num} -pthread} + +@emph{S/390 and zSeries Options} +@gccoptlist{-mtune=@var{cpu-type} -march=@var{cpu-type} @gol +-mhard-float -msoft-float -mhard-dfp -mno-hard-dfp @gol +-mlong-double-64 -mlong-double-128 @gol +-mbackchain -mno-backchain -mpacked-stack -mno-packed-stack @gol +-msmall-exec -mno-small-exec -mmvcle -mno-mvcle @gol +-m64 -m31 -mdebug -mno-debug -mesa -mzarch @gol +-mtpf-trace -mno-tpf-trace -mfused-madd -mno-fused-madd @gol +-mwarn-framesize -mwarn-dynamicstack -mstack-size -mstack-guard} + +@emph{Score Options} +@gccoptlist{-meb -mel @gol +-mnhwloop @gol +-muls @gol +-mmac @gol +-mscore5 -mscore5u -mscore7 -mscore7d} + +@emph{SH Options} +@gccoptlist{-m1 -m2 -m2e -m3 -m3e @gol +-m4-nofpu -m4-single-only -m4-single -m4 @gol +-m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol +-m5-64media -m5-64media-nofpu @gol +-m5-32media -m5-32media-nofpu @gol +-m5-compact -m5-compact-nofpu @gol +-mb -ml -mdalign -mrelax @gol +-mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol +-mieee -mbitops -misize -minline-ic_invalidate -mpadstruct -mspace @gol +-mprefergot -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol +-mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol +-madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol +-minvalid-symbols} + +@emph{SPARC Options} +@gccoptlist{-mcpu=@var{cpu-type} @gol +-mtune=@var{cpu-type} @gol +-mcmodel=@var{code-model} @gol +-m32 -m64 -mapp-regs -mno-app-regs @gol +-mfaster-structs -mno-faster-structs @gol +-mfpu -mno-fpu -mhard-float -msoft-float @gol +-mhard-quad-float -msoft-quad-float @gol +-mimpure-text -mno-impure-text -mlittle-endian @gol +-mstack-bias -mno-stack-bias @gol +-munaligned-doubles -mno-unaligned-doubles @gol +-mv8plus -mno-v8plus -mvis -mno-vis +-threads -pthreads -pthread} + +@emph{SPU Options} +@gccoptlist{-mwarn-reloc -merror-reloc @gol +-msafe-dma -munsafe-dma @gol +-mbranch-hints @gol +-msmall-mem -mlarge-mem -mstdmain @gol +-mfixed-range=@var{register-range}} + +@emph{System V Options} +@gccoptlist{-Qy -Qn -YP,@var{paths} -Ym,@var{dir}} + +@emph{V850 Options} +@gccoptlist{-mlong-calls -mno-long-calls -mep -mno-ep @gol +-mprolog-function -mno-prolog-function -mspace @gol +-mtda=@var{n} -msda=@var{n} -mzda=@var{n} @gol +-mapp-regs -mno-app-regs @gol +-mdisable-callt -mno-disable-callt @gol +-mv850e1 @gol +-mv850e @gol +-mv850 -mbig-switch} + +@emph{VAX Options} +@gccoptlist{-mg -mgnu -munix} + +@emph{VxWorks Options} +@gccoptlist{-mrtp -non-static -Bstatic -Bdynamic @gol +-Xbind-lazy -Xbind-now} + +@emph{x86-64 Options} +See i386 and x86-64 Options. + +@emph{i386 and x86-64 Windows Options} +@gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll +-mnop-fun-dllimport -mthread -mwin32 -mwindows} + @emph{Xstormy16 Options} -@gccoptlist{ --msim} +@gccoptlist{-msim} @emph{Xtensa Options} -@gccoptlist{ --mbig-endian -mlittle-endian @gol --mdensity -mno-density @gol --mmac16 -mno-mac16 @gol --mmul16 -mno-mul16 @gol --mmul32 -mno-mul32 @gol --mnsa -mno-nsa @gol --mminmax -mno-minmax @gol --msext -mno-sext @gol --mbooleans -mno-booleans @gol --mhard-float -msoft-float @gol --mfused-madd -mno-fused-madd @gol --mserialize-volatile -mno-serialize-volatile @gol --mtext-section-literals -mno-text-section-literals @gol --mtarget-align -mno-target-align @gol --mlongcalls -mno-longcalls} +@gccoptlist{-mconst16 -mno-const16 @gol +-mfused-madd -mno-fused-madd @gol +-mserialize-volatile -mno-serialize-volatile @gol +-mtext-section-literals -mno-text-section-literals @gol +-mtarget-align -mno-target-align @gol +-mlongcalls -mno-longcalls} + +@emph{zSeries Options} +See S/390 and zSeries Options. @item Code Generation Options @xref{Code Gen Options,,Options for Code Generation Conventions}. -@gccoptlist{ --fcall-saved-@var{reg} -fcall-used-@var{reg} @gol --ffixed-@var{reg} -fexceptions @gol +@gccoptlist{-fcall-saved-@var{reg} -fcall-used-@var{reg} @gol +-ffixed-@var{reg} -fexceptions @gol -fnon-call-exceptions -funwind-tables @gol -fasynchronous-unwind-tables @gol -finhibit-size-directive -finstrument-functions @gol --fno-common -fno-ident -fno-gnu-linker @gol --fpcc-struct-return -fpic -fPIC @gol --freg-struct-return -fshared-data -fshort-enums @gol --fshort-double -fshort-wchar -fvolatile @gol --fvolatile-global -fvolatile-static @gol --fverbose-asm -fpack-struct -fstack-check @gol +-finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol +-finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol +-fno-common -fno-ident @gol +-fpcc-struct-return -fpic -fPIC -fpie -fPIE @gol +-fno-jump-tables @gol +-frecord-gcc-switches @gol +-freg-struct-return -fshort-enums @gol +-fshort-double -fshort-wchar @gol +-fverbose-asm -fpack-struct[=@var{n}] -fstack-check @gol -fstack-limit-register=@var{reg} -fstack-limit-symbol=@var{sym} @gol --fargument-alias -fargument-noalias @gol --fargument-noalias-global -fleading-underscore} +-fno-stack-limit -fargument-alias -fargument-noalias @gol +-fargument-noalias-global -fargument-noalias-anything @gol +-fleading-underscore -ftls-model=@var{model} @gol +-ftrapv -fwrapv -fbounds-check @gol +-fvisibility} @end table @menu @@ -690,7 +873,8 @@ in the following sections. or preprocessed source. * C Dialect Options:: Controlling the variant of C language compiled. * C++ Dialect Options:: Variations on C++. -* Objective-C Dialect Options:: Variations on Objective-C. +* Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C + and Objective-C++. * Language Independent Options:: Controlling how diagnostics should be formatted. * Warning Options:: How picky should the compiler be? @@ -710,10 +894,12 @@ in the following sections. @section Options Controlling the Kind of Output Compilation can involve up to four stages: preprocessing, compilation -proper, assembly and linking, always in that order. The first three -stages apply to an individual source file, and end by producing an -object file; linking combines all the object files (those newly -compiled, and those specified as input) into an executable file. +proper, assembly and linking, always in that order. GCC is capable of +preprocessing and compiling several files either into several +assembler input files, or into one assembler input file; then each +assembler input file produces an object file, and linking combines all +the object files (those newly compiled, and those specified as input) +into an executable file. @cindex file name suffix For any given input file, the file name suffix determines what kind of @@ -730,43 +916,78 @@ C source code which should not be preprocessed. C++ source code which should not be preprocessed. @item @var{file}.m -Objective-C source code. Note that you must link with the library -@file{libobjc.a} to make an Objective-C program work. +Objective-C source code. Note that you must link with the @file{libobjc} +library to make an Objective-C program work. @item @var{file}.mi Objective-C source code which should not be preprocessed. +@item @var{file}.mm +@itemx @var{file}.M +Objective-C++ source code. Note that you must link with the @file{libobjc} +library to make an Objective-C++ program work. Note that @samp{.M} refers +to a literal capital M@. + +@item @var{file}.mii +Objective-C++ source code which should not be preprocessed. + @item @var{file}.h -C header file (not to be compiled or linked). +C, C++, Objective-C or Objective-C++ header file to be turned into a +precompiled header. @item @var{file}.cc @itemx @var{file}.cp @itemx @var{file}.cxx @itemx @var{file}.cpp +@itemx @var{file}.CPP @itemx @var{file}.c++ @itemx @var{file}.C C++ source code which must be preprocessed. Note that in @samp{.cxx}, the last two letters must both be literally @samp{x}. Likewise, @samp{.C} refers to a literal capital C@. +@item @var{file}.mm +@itemx @var{file}.M +Objective-C++ source code which must be preprocessed. + +@item @var{file}.mii +Objective-C++ source code which should not be preprocessed. + +@item @var{file}.hh +@itemx @var{file}.H +@itemx @var{file}.hp +@itemx @var{file}.hxx +@itemx @var{file}.hpp +@itemx @var{file}.HPP +@itemx @var{file}.h++ +@itemx @var{file}.tcc +C++ header file to be turned into a precompiled header. + @item @var{file}.f @itemx @var{file}.for -@itemx @var{file}.FOR -Fortran source code which should not be preprocessed. +@itemx @var{file}.ftn +Fixed form Fortran source code which should not be preprocessed. @item @var{file}.F +@itemx @var{file}.FOR @itemx @var{file}.fpp @itemx @var{file}.FPP -Fortran source code which must be preprocessed (with the traditional +@itemx @var{file}.FTN +Fixed form Fortran source code which must be preprocessed (with the traditional preprocessor). -@item @var{file}.r -Fortran source code which must be preprocessed with a RATFOR -preprocessor (not included with GCC)@. +@item @var{file}.f90 +@itemx @var{file}.f95 +@itemx @var{file}.f03 +@itemx @var{file}.f08 +Free form Fortran source code which should not be preprocessed. -@xref{Overall Options,,Options Controlling the Kind of Output, g77, -Using and Porting GNU Fortran}, for more details of the handling of -Fortran input files. +@item @var{file}.F90 +@itemx @var{file}.F95 +@itemx @var{file}.F03 +@itemx @var{file}.F08 +Free form Fortran source code which must be preprocessed (with the +traditional preprocessor). @c FIXME: Descriptions of Java file types. @c @var{file}.java @@ -781,7 +1002,7 @@ instantiation), or a library unit renaming declaration (a package, generic, or subprogram renaming declaration). Such files are also called @dfn{specs}. -@itemx @var{file}.adb +@item @var{file}.adb Ada source code file containing a library unit body (a subprogram or package body). Such files are also called @dfn{bodies}. @@ -789,11 +1010,14 @@ package body). Such files are also called @dfn{bodies}. @c Pascal: @c @var{file}.p @c @var{file}.pas +@c Ratfor: +@c @var{file}.r @item @var{file}.s Assembler code. @item @var{file}.S +@itemx @var{file}.sx Assembler code which must be preprocessed. @item @var{other} @@ -810,15 +1034,16 @@ Specify explicitly the @var{language} for the following input files (rather than letting the compiler choose a default based on the file name suffix). This option applies to all following input files until the next @option{-x} option. Possible values for @var{language} are: -@example -c c-header cpp-output -c++ c++-cpp-output -objective-c objc-cpp-output +@smallexample +c c-header c-cpp-output +c++ c++-header c++-cpp-output +objective-c objective-c-header objective-c-cpp-output +objective-c++ objective-c++-header objective-c++-cpp-output assembler assembler-with-cpp ada -f77 f77-cpp-input ratfor +f77 f77-cpp-input f95 f95-cpp-input java -@end example +@end smallexample @item -x none Turn off any specification of a language, so that subsequent files are @@ -831,7 +1056,8 @@ Normally the @command{gcc} program will exit with the code of 1 if any phase of the compiler returns a non-success return code. If you specify @option{-pass-exit-codes}, the @command{gcc} program will instead return with numerically highest error produced by any phase that returned an error -indication. +indication. The C, C++, and Fortran frontends return 4, if an internal +compiler error is encountered. @end table If you only want some of the stages of compilation, you can use @@ -879,14 +1105,12 @@ Place output in file @var{file}. This applies regardless to whatever sort of output is being produced, whether it be an executable file, an object file, an assembler file or preprocessed C code. -Since only one output file can be specified, it does not make sense to -use @option{-o} when compiling more than one input file, unless you are -producing an executable file as output. - -If @option{-o} is not specified, the default is to put an executable file -in @file{a.out}, the object file for @file{@var{source}.@var{suffix}} in -@file{@var{source}.o}, its assembler file in @file{@var{source}.s}, and -all preprocessed C source on standard output. +If @option{-o} is not specified, the default is to put an executable +file in @file{a.out}, the object file for +@file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its +assembler file in @file{@var{source}.s}, a precompiled header file in +@file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on +standard output. @item -v @opindex v @@ -907,78 +1131,230 @@ various stages of compilation. This fails to work on some systems where the assembler is unable to read from a pipe; but the GNU assembler has no trouble. +@item -combine +@opindex combine +If you are compiling multiple source files, this option tells the driver +to pass all the source files to the compiler at once (for those +languages for which the compiler can handle this). This will allow +intermodule analysis (IMA) to be performed by the compiler. Currently the only +language for which this is supported is C@. If you pass source files for +multiple languages to the driver, using this option, the driver will invoke +the compiler(s) that support IMA once each, passing each compiler all the +source files appropriate for it. For those languages that do not support +IMA this option will be ignored, and the compiler will be invoked once for +each source file in that language. If you use this option in conjunction +with @option{-save-temps}, the compiler will generate multiple +pre-processed files +(one for each source file), but only one (combined) @file{.o} or +@file{.s} file. + @item --help @opindex help Print (on the standard output) a description of the command line options understood by @command{gcc}. If the @option{-v} option is also specified then @option{--help} will also be passed on to the various processes invoked by @command{gcc}, so that they can display the command line options -they accept. If the @option{-W} option is also specified then command -line options which have no documentation associated with them will also -be displayed. +they accept. If the @option{-Wextra} option has also been specified +(prior to the @option{--help} option), then command line options which +have no documentation associated with them will also be displayed. @item --target-help @opindex target-help -Print (on the standard output) a description of target specific command -line options for each tool. +Print (on the standard output) a description of target-specific command +line options for each tool. For some targets extra target-specific +information may also be printed. + +@item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]} +Print (on the standard output) a description of the command line +options understood by the compiler that fit into all specified classes +and qualifiers. These are the supported classes: + +@table @asis +@item @samp{optimizers} +This will display all of the optimization options supported by the +compiler. -@item --version -@opindex version -Display the version number and copyrights of the invoked GCC. +@item @samp{warnings} +This will display all of the options controlling warning messages +produced by the compiler. + +@item @samp{target} +This will display target-specific options. Unlike the +@option{--target-help} option however, target-specific options of the +linker and assembler will not be displayed. This is because those +tools do not currently support the extended @option{--help=} syntax. + +@item @samp{params} +This will display the values recognized by the @option{--param} +option. + +@item @var{language} +This will display the options supported for @var{language}, where +@var{language} is the name of one of the languages supported in this +version of GCC. + +@item @samp{common} +This will display the options that are common to all languages. @end table -@node Invoking G++ -@section Compiling C++ Programs +These are the supported qualifiers: -@cindex suffixes for C++ source -@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}. 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 @command{gcc}). +@table @asis +@item @samp{undocumented} +Display only those options which are undocumented. -@findex g++ -@findex c++ -However, C++ programs often require class libraries as well as a -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. -@command{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, @command{g++} is also -installed with the name @command{c++}. +@item @samp{joined} +Display options which take an argument that appears after an equal +sign in the same continuous piece of text, such as: +@samp{--help=target}. -@cindex invoking @command{g++} -When you compile C++ programs, you may specify many of the same -command-line options that you use for compiling programs in any -language; or command-line options meaningful for C and related -languages; or options that are meaningful only for C++ programs. -@xref{C Dialect Options,,Options Controlling C Dialect}, for -explanations of options for languages related to C@. -@xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for -explanations of options that are meaningful only for C++ programs. +@item @samp{separate} +Display options which take an argument that appears as a separate word +following the original option, such as: @samp{-o output-file}. +@end table -@node C Dialect Options -@section Options Controlling C Dialect -@cindex dialect options -@cindex language dialect options -@cindex options, dialect +Thus for example to display all the undocumented target-specific +switches supported by the compiler the following can be used: -The following options control the dialect of C (or languages derived -from C, such as C++ and Objective-C) that the compiler accepts: +@smallexample +--help=target,undocumented +@end smallexample -@table @gcctabopt -@cindex ANSI support -@cindex ISO support -@item -ansi -@opindex ansi -In C mode, support all ISO C89 programs. In C++ mode, -remove GNU extensions that conflict with ISO C++. +The sense of a qualifier can be inverted by prefixing it with the +@samp{^} character, so for example to display all binary warning +options (i.e., ones that are either on or off and that do not take an +argument), which have a description the following can be used: -This turns off certain features of GCC that are incompatible with ISO -C89 (when compiling C code), or of standard C++ (when compiling C++ code), +@smallexample +--help=warnings,^joined,^undocumented +@end smallexample + +The argument to @option{--help=} should not consist solely of inverted +qualifiers. + +Combining several classes is possible, although this usually +restricts the output by so much that there is nothing to display. One +case where it does work however is when one of the classes is +@var{target}. So for example to display all the target-specific +optimization options the following can be used: + +@smallexample +--help=target,optimizers +@end smallexample + +The @option{--help=} option can be repeated on the command line. Each +successive use will display its requested class of options, skipping +those that have already been displayed. + +If the @option{-Q} option appears on the command line before the +@option{--help=} option, then the descriptive text displayed by +@option{--help=} is changed. Instead of describing the displayed +options, an indication is given as to whether the option is enabled, +disabled or set to a specific value (assuming that the compiler +knows this at the point where the @option{--help=} option is used). + +Here is a truncated example from the ARM port of @command{gcc}: + +@smallexample + % gcc -Q -mabi=2 --help=target -c + The following options are target specific: + -mabi= 2 + -mabort-on-noreturn [disabled] + -mapcs [disabled] +@end smallexample + +The output is sensitive to the effects of previous command line +options, so for example it is possible to find out which optimizations +are enabled at @option{-O2} by using: + +@smallexample +-Q -O2 --help=optimizers +@end smallexample + +Alternatively you can discover which binary optimizations are enabled +by @option{-O3} by using: + +@smallexample +gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts +gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts +diff /tmp/O2-opts /tmp/O3-opts | grep enabled +@end smallexample + +@item --version +@opindex version +Display the version number and copyrights of the invoked GCC@. + +@item -wrapper +@opindex wrapper +Invoke all subcommands under a wrapper program. It takes a single +comma separated list as an argument, which will be used to invoke +the wrapper: + +@smallexample +gcc -c t.c -wrapper gdb,--args +@end smallexample + +This will invoke all subprograms of gcc under "gdb --args", +thus cc1 invocation will be "gdb --args cc1 ...". + +@include @value{srcdir}/../libiberty/at-file.texi +@end table + +@node Invoking G++ +@section Compiling C++ Programs + +@cindex suffixes for C++ source +@cindex C++ source file suffixes +C++ source files conventionally use one of the suffixes @samp{.C}, +@samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or +@samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp}, +@samp{.H}, or (for shared template code) @samp{.tcc}; and +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 @command{gcc}). + +@findex g++ +@findex c++ +However, the use of @command{gcc} does not add the C++ library. +@command{g++} is a program that calls GCC and treats @samp{.c}, +@samp{.h} and @samp{.i} files as C++ source files instead of C source +files unless @option{-x} is used, and automatically specifies linking +against the C++ library. This program is also useful when +precompiling a C header file with a @samp{.h} extension for use in C++ +compilations. On many systems, @command{g++} is also installed with +the name @command{c++}. + +@cindex invoking @command{g++} +When you compile C++ programs, you may specify many of the same +command-line options that you use for compiling programs in any +language; or command-line options meaningful for C and related +languages; or options that are meaningful only for C++ programs. +@xref{C Dialect Options,,Options Controlling C Dialect}, for +explanations of options for languages related to C@. +@xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for +explanations of options that are meaningful only for C++ programs. + +@node C Dialect Options +@section Options Controlling C Dialect +@cindex dialect options +@cindex language dialect options +@cindex options, dialect + +The following options control the dialect of C (or languages derived +from C, such as C++, Objective-C and Objective-C++) that the compiler +accepts: + +@table @gcctabopt +@cindex ANSI support +@cindex ISO support +@item -ansi +@opindex ansi +In C mode, this is equivalent to @samp{-std=c89}. In C++ mode, it is +equivalent to @samp{-std=c++98}. + +This turns off certain features of GCC that are incompatible with ISO +C90 (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 @@ -1004,56 +1380,104 @@ from declaring certain functions or defining certain macros that the ISO standard doesn't call for; this is to avoid interfering with any programs that might use these names for other things. -Functions which would normally be built in but do not have semantics +Functions that would normally be built in but do not have semantics defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in -functions with @option{-ansi} is used. @xref{Other Builtins,,Other +functions when @option{-ansi} is used. @xref{Other Builtins,,Other built-in functions provided by GCC}, for details of the functions affected. @item -std= @opindex std -Determine the language standard. This option is currently only -supported when compiling C@. A value for this option must be provided; -possible values are +Determine the language standard. @xref{Standards,,Language Standards +Supported by GCC}, for details of these standard versions. This option +is currently only supported when compiling C or C++. + +The compiler can accept several base standards, such as @samp{c89} or +@samp{c++98}, and GNU dialects of those standards, such as +@samp{gnu89} or @samp{gnu++98}. By specifying a base standard, the +compiler will accept all programs following that standard and those +using GNU extensions that do not contradict it. For example, +@samp{-std=c89} turns off certain features of GCC that are +incompatible with ISO C90, such as the @code{asm} and @code{typeof} +keywords, but not other GNU extensions that do not have a meaning in +ISO C90, such as omitting the middle term of a @code{?:} +expression. On the other hand, by specifying a GNU dialect of a +standard, all features the compiler support are enabled, even when +those features change the meaning of the base standard and some +strict-conforming programs may be rejected. The particular standard +is used by @option{-pedantic} to identify which features are GNU +extensions given that version of the standard. For example +@samp{-std=gnu89 -pedantic} would warn about C++ style @samp{//} +comments, while @samp{-std=gnu99 -pedantic} would not. + +A value for this option must be provided; possible values are @table @samp @item c89 @itemx iso9899:1990 -ISO C89 (same as @option{-ansi}). +Support all ISO C90 programs (certain GNU extensions that conflict +with ISO C90 are disabled). Same as @option{-ansi} for C code. @item iso9899:199409 -ISO C89 as modified in amendment 1. +ISO C90 as modified in amendment 1. @item c99 @itemx c9x @itemx iso9899:1999 @itemx iso9899:199x ISO C99. Note that this standard is not yet fully supported; see -@w{@uref{http://gcc.gnu.org/gcc-3.1/c99status.html}} for more information. The +@w{@uref{http://gcc.gnu.org/gcc-4.4/c99status.html}} for more information. The names @samp{c9x} and @samp{iso9899:199x} are deprecated. @item gnu89 -Default, ISO C89 plus GNU extensions (including some C99 features). +GNU dialect of ISO C90 (including some C99 features). This +is the default for C code. @item gnu99 -@item gnu9x -ISO C99 plus GNU extensions. When ISO C99 is fully implemented in GCC, +@itemx gnu9x +GNU dialect of ISO C99. When ISO C99 is fully implemented in GCC, this will become the default. The name @samp{gnu9x} is deprecated. -@end table +@item c++98 +The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for +C++ code. -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 @option{-std=c99} is not specified. +@item gnu++98 +GNU dialect of @option{-std=c++98}. This is the default for +C++ code. -The @option{-std} options specifying some version of ISO C have the same -effects as @option{-ansi}, except that features that were not in ISO C89 -but are in the specified version (for example, @samp{//} comments and -the @code{inline} keyword in ISO C99) are not disabled. +@item c++0x +The working draft of the upcoming ISO C++0x standard. This option +enables experimental features that are likely to be included in +C++0x. The working draft is constantly changing, and any feature that is +enabled by this flag may be removed from future versions of GCC if it is +not part of the C++0x standard. -@xref{Standards,,Language Standards Supported by GCC}, for details of -these standard versions. +@item gnu++0x +GNU dialect of @option{-std=c++0x}. This option enables +experimental features that may be removed in future versions of GCC. +@end table + +@item -fgnu89-inline +@opindex fgnu89-inline +The option @option{-fgnu89-inline} tells GCC to use the traditional +GNU semantics for @code{inline} functions when in C99 mode. +@xref{Inline,,An Inline Function is As Fast As a Macro}. This option +is accepted and ignored by GCC versions 4.1.3 up to but not including +4.3. In GCC versions 4.3 and later it changes the behavior of GCC in +C99 mode. Using this option is roughly equivalent to adding the +@code{gnu_inline} function attribute to all inline functions +(@pxref{Function Attributes}). + +The option @option{-fno-gnu89-inline} explicitly tells GCC to use the +C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it +specifies the default behavior). This option was first supported in +GCC 4.3. This option is not supported in C89 or gnu89 mode. + +The preprocessor macros @code{__GNUC_GNU_INLINE__} and +@code{__GNUC_STDC_INLINE__} may be used to check which semantics are +in effect for @code{inline} functions. @xref{Common Predefined +Macros,,,cpp,The C Preprocessor}. @item -aux-info @var{filename} @opindex aux-info @@ -1086,7 +1510,7 @@ switch only affects the @code{asm} and @code{typeof} keywords, since @code{inline} is a standard keyword in ISO C99. @item -fno-builtin -@itemx -fno-builtin-@var{function} @r{(C and Objective-C only)} +@itemx -fno-builtin-@var{function} @opindex fno-builtin @cindex built-in functions Don't recognize built-in functions that do not begin with @@ -1102,19 +1526,19 @@ instructions that adjust the stack directly, and calls to @code{memcpy} may become inline copy loops. The resulting code is often both smaller and faster, but since the function calls no longer appear as such, you cannot set a breakpoint on those calls, nor can you change the behavior -of the functions by linking with a different library. - -In C++, @option{-fno-builtin} is always in effect. The @option{-fbuiltin} -option has no effect. Therefore, in C++, the only way to get the -optimization benefits of built-in functions is to call the function -using the @samp{__builtin_} prefix. The GNU C++ Standard Library uses -built-in functions to implement many functions (like -@code{std::strchr}), so that you automatically get efficient code. - -With the @option{-fno-builtin-@var{function}} option, not available -when compiling C++, only the built-in function @var{function} is +of the functions by linking with a different library. In addition, +when a function is recognized as a built-in function, GCC may use +information about that function to warn about problems with calls to +that function, or to generate more efficient code, even if the +resulting code still contains calls to that function. For example, +warnings are given with @option{-Wformat} for bad calls to +@code{printf}, when @code{printf} is built in, and @code{strlen} is +known not to modify global memory. + +With the @option{-fno-builtin-@var{function}} option +only the built-in function @var{function} is disabled. @var{function} must not begin with @samp{__builtin_}. If a -function is named this is not built-in in this version of GCC, this +function is named that is not built-in in this version of GCC, this option is ignored. There is no corresponding @option{-fbuiltin-@var{function}} option; if you wish to enable built-in functions selectively when using @option{-fno-builtin} or @@ -1148,6 +1572,24 @@ This is equivalent to @option{-fno-hosted}. @xref{Standards,,Language Standards Supported by GCC}, for details of freestanding and hosted environments. +@item -fopenmp +@opindex fopenmp +@cindex openmp parallel +Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and +@code{!$omp} in Fortran. When @option{-fopenmp} is specified, the +compiler generates parallel code according to the OpenMP Application +Program Interface v2.5 @w{@uref{http://www.openmp.org/}}. This option +implies @option{-pthread}, and thus is only supported on targets that +have support for @option{-pthread}. + +@item -fms-extensions +@opindex fms-extensions +Accept some non-standard constructs used in Microsoft header files. + +Some cases of unnamed fields in structures and unions are only +accepted with this option. @xref{Unnamed Fields,,Unnamed struct/union +fields within structs/unions}, for details. + @item -trigraphs @opindex trigraphs Support ISO C trigraphs. The @option{-ansi} option (and @option{-std} @@ -1155,86 +1597,25 @@ options for strict ISO C conformance) implies @option{-trigraphs}. @item -no-integrated-cpp @opindex no-integrated-cpp -Invoke the external cpp during compilation. The default is to use the -integrated cpp (internal cpp). This option also allows a -user-supplied cpp via the @option{-B} option. This flag is applicable -in both C and C++ modes. +Performs a compilation in two passes: preprocessing and compiling. This +option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the +@option{-B} option. The user supplied compilation step can then add in +an additional preprocessing step after normal preprocessing but before +compiling. The default is to use the integrated cpp (internal cpp) -We do not guarantee to retain this option in future, and we may change -its semantics. +The semantics of this option will change if "cc1", "cc1plus", and +"cc1obj" are merged. @cindex traditional C language @cindex C language, traditional @item -traditional -@opindex traditional -Attempt to support some aspects of traditional C compilers. -Specifically: - -@itemize @bullet -@item -All @code{extern} declarations take effect globally even if they -are written inside of a function definition. This includes implicit -declarations of functions. - -@item -The newer keywords @code{typeof}, @code{inline}, @code{signed}, @code{const} -and @code{volatile} are not recognized. (You can still use the -alternative keywords such as @code{__typeof__}, @code{__inline__}, and -so on.) - -@item -Comparisons between pointers and integers are always allowed. - -@item -Integer types @code{unsigned short} and @code{unsigned char} promote -to @code{unsigned int}. - -@item -Out-of-range floating point literals are not an error. - -@item -Certain constructs which ISO regards as a single invalid preprocessing -number, such as @samp{0xe-0xd}, are treated as expressions instead. - -@item -String ``constants'' are not necessarily constant; they are stored in -writable space, and identical looking constants are allocated -separately. (This is the same as the effect of -@option{-fwritable-strings}.) - -@cindex @code{longjmp} and automatic variables -@item -All automatic variables not declared @code{register} are preserved by -@code{longjmp}. Ordinarily, GNU C follows ISO C: automatic variables -not declared @code{volatile} may be clobbered. - -@item -@cindex @samp{\x} -@cindex @samp{\a} -@cindex escape sequences, traditional -The character escape sequences @samp{\x} and @samp{\a} evaluate as the -literal characters @samp{x} and @samp{a} respectively. Without -@w{@option{-traditional}}, @samp{\x} is a prefix for the hexadecimal -representation of a character, and @samp{\a} produces a bell. -@end itemize - -This option is deprecated and may be removed. - -You may wish to use @option{-fno-builtin} as well as @option{-traditional} -if your program uses names that are normally GNU C built-in functions for -other purposes of its own. - -You cannot use @option{-traditional} if you include any header files that -rely on ISO C features. Some vendors are starting to ship systems with -ISO C header files and you cannot use @option{-traditional} on such -systems to compile files that include any system headers. - -The @option{-traditional} option also enables @option{-traditional-cpp}. - -@item -traditional-cpp +@itemx -traditional-cpp @opindex traditional-cpp -Attempt to support some aspects of traditional C preprocessors. -See the GNU CPP manual for details. +@opindex traditional +Formerly, these options caused GCC to attempt to emulate a pre-standard +C compiler. They are now only supported with the @option{-E} switch. +The preprocessor continues to support a pre-standard mode. See the GNU +CPP manual for details. @item -fcond-mismatch @opindex fcond-mismatch @@ -1242,6 +1623,12 @@ Allow conditional expressions with mismatched types in the second and third arguments. The value of such an expression is void. This option is not supported for C++. +@item -flax-vector-conversions +@opindex flax-vector-conversions +Allow implicit conversions between vectors with differing numbers of +elements and/or incompatible element types. This option should not be +used for new code. + @item -funsigned-char @opindex funsigned-char Let the type @code{char} be unsigned, like @code{unsigned char}. @@ -1281,32 +1668,6 @@ These options control whether a bit-field is signed or unsigned, when the declaration does not use either @code{signed} or @code{unsigned}. By default, such a bit-field is signed, because this is consistent: the basic integer types such as @code{int} are signed types. - -However, when @option{-traditional} is used, bit-fields are all unsigned -no matter what. - -@item -fwritable-strings -@opindex fwritable-strings -Store string constants in the writable data segment and don't uniquize -them. This is for compatibility with old programs which assume they can -write into string constants. The option @option{-traditional} also has -this effect. - -Writing into string constants is a very bad idea; ``constants'' should -be constant. - -@item -fallow-single-precision -@opindex fallow-single-precision -Do not promote single precision math operations to double precision, -even when compiling with @option{-traditional}. - -Traditional K&R C promotes all floating point operations to double -precision, regardless of the sizes of the operands. On the -architecture for which you are compiling, single precision may be faster -than double precision. If you must use @option{-traditional}, but want -to use single precision operations when the operands are single -precision, use this option. This option has no effect when compiling -with ISO or GNU C conventions (the default). @end table @node C++ Dialect Options @@ -1320,9 +1681,9 @@ for C++ programs; but you can also use most of the GNU compiler options regardless of what language your program is in. For example, you might compile a file @code{firstClass.C} like this: -@example +@smallexample g++ -g -frepo -O -c firstClass.C -@end example +@end smallexample @noindent In this example, only @option{-frepo} is an option meant @@ -1332,6 +1693,18 @@ language supported by GCC@. Here is a list of options that are @emph{only} for compiling C++ programs: @table @gcctabopt + +@item -fabi-version=@var{n} +@opindex fabi-version +Use version @var{n} of the C++ ABI@. Version 2 is the version of the +C++ ABI that first appeared in G++ 3.4. Version 1 is the version of +the C++ ABI that first appeared in G++ 3.2. Version 0 will always be +the version that conforms most closely to the C++ ABI specification. +Therefore, the ABI obtained using version 0 will change as ABI bugs +are fixed. + +The default is version 2. + @item -fno-access-control @opindex fno-access-control Turn off all access checking. This switch is mainly useful for working @@ -1340,14 +1713,14 @@ around bugs in the access control code. @item -fcheck-new @opindex fcheck-new Check that the pointer returned by @code{operator new} is non-null -before attempting to modify the storage allocated. The current Working -Paper requires that @code{operator new} never return a null pointer, so -this check is normally unnecessary. - -An alternative to using this option is to specify that your -@code{operator new} does not throw any exceptions; if you declare it -@samp{throw()}, G++ will check the return value. See also @samp{new -(nothrow)}. +before attempting to modify the storage allocated. This check is +normally unnecessary because the C++ standard specifies that +@code{operator new} will only return @code{0} if it is declared +@samp{throw()}, in which case the compiler will always check the +return value even without this option. In all other cases, when +@code{operator new} has a non-empty exception specification, memory +exhaustion is signalled by throwing @code{std::bad_alloc}. See also +@samp{new (nothrow)}. @item -fconserve-space @opindex fconserve-space @@ -1361,25 +1734,40 @@ two definitions were merged. This option is no longer useful on most targets, now that support has been added for putting variables into BSS without making them common. -@item -fno-const-strings -@opindex fno-const-strings -Give string constants type @code{char *} instead of type @code{const -char *}. By default, G++ uses type @code{const char *} as required by -the standard. Even if you use @option{-fno-const-strings}, you cannot -actually modify the value of a string constant, unless you also use -@option{-fwritable-strings}. - -This option might be removed in a future release of G++. For maximum -portability, you should structure your code so that it works with -string constants that have type @code{const char *}. - -@item -fdollars-in-identifiers -@opindex fdollars-in-identifiers -Accept @samp{$} in identifiers. You can also explicitly prohibit use of -@samp{$} with the option @option{-fno-dollars-in-identifiers}. (GNU C allows -@samp{$} by default on most target systems, but there are a few exceptions.) -Traditional C allowed the character @samp{$} to form part of -identifiers. However, ISO C and C++ forbid @samp{$} in identifiers. +@item -fno-deduce-init-list +@opindex fno-deduce-init-list +Disable deduction of a template type parameter as +std::initializer_list from a brace-enclosed initializer list, i.e. + +@smallexample +template auto forward(T t) -> decltype (realfn (t)) +@{ + return realfn (t); +@} + +void f() +@{ + forward(@{1,2@}); // call forward> +@} +@end smallexample + +This option is present because this deduction is an extension to the +current specification in the C++0x working draft, and there was +some concern about potential overload resolution problems. + +@item -ffriend-injection +@opindex ffriend-injection +Inject friend functions into the enclosing namespace, so that they are +visible outside the scope of the class in which they are declared. +Friend functions were documented to work this way in the old Annotated +C++ Reference Manual, and versions of G++ before 4.1 always worked +that way. However, in ISO C++ a friend function which is not declared +in an enclosing scope can only be found using argument dependent +lookup. This option causes friends to be injected as they were in +earlier releases. + +This option is for compatibility, and may be removed in a future +release of G++. @item -fno-elide-constructors @opindex fno-elide-constructors @@ -1390,28 +1778,13 @@ call the copy constructor in all cases. @item -fno-enforce-eh-specs @opindex 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 -@opindex fexternal-templates - -Cause @samp{#pragma interface} and @samp{implementation} to apply to -template instantiation; template instances are emitted or not according -to the location of the template definition. @xref{Template -Instantiation}, for more information. - -This option is deprecated. - -@item -falt-external-templates -@opindex falt-external-templates -Similar to @option{-fexternal-templates}, but template instances are -emitted or not according to the place where they are first instantiated. -@xref{Template Instantiation}, for more information. - -This option is deprecated. +Don't generate code to 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}. This does not give user code permission to throw +exceptions in violation of the exception specifications; the compiler +will still optimize based on the specifications, so throwing an +unexpected exception will result in undefined behavior. @item -ffor-scope @itemx -fno-for-scope @@ -1478,10 +1851,9 @@ a name having multiple meanings within a class. @item -fpermissive @opindex fpermissive -Downgrade messages about nonconformant code from errors to warnings. By -default, G++ effectively sets @option{-pedantic-errors} without -@option{-pedantic}; this option reverses that. This behavior and this -option are superseded by @option{-pedantic}, which works as it does for GNU C@. +Downgrade some diagnostics about nonconformant code from errors to +warnings. Thus, using @option{-fpermissive} will allow some +nonconforming code to compile. @item -frepo @opindex frepo @@ -1496,7 +1868,9 @@ 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. +needed. The @samp{dynamic_cast} operator can still be used for casts that +do not require runtime type information, i.e.@: casts to @code{void *} or to +unambiguous base classes. @item -fstats @opindex fstats @@ -1510,6 +1884,13 @@ A limit on the template instantiation depth is needed to detect endless recursions during template class instantiation. ANSI/ISO C++ conforming programs must not rely on a maximum depth greater than 17. +@item -fno-threadsafe-statics +@opindex fno-threadsafe-statics +Do not emit the extra code to use the routines specified in the C++ +ABI for thread-safe initialization of local statics. You can use this +option to reduce code size slightly in code that doesn't need to be +thread-safe. + @item -fuse-cxa-atexit @opindex fuse-cxa-atexit Register destructors for objects with static storage duration with the @@ -1518,16 +1899,73 @@ 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-gc -@opindex fvtable-gc -Emit special relocations for vtables and virtual function references -so that the linker can identify unused virtual functions and zero out -vtable slots that refer to them. This is most useful with -@option{-ffunction-sections} and @option{-Wl,--gc-sections}, in order to -also discard the functions themselves. +@item -fno-use-cxa-get-exception-ptr +@opindex fno-use-cxa-get-exception-ptr +Don't use the @code{__cxa_get_exception_ptr} runtime routine. This +will cause @code{std::uncaught_exception} to be incorrect, but is necessary +if the runtime routine is not available. + +@item -fvisibility-inlines-hidden +@opindex fvisibility-inlines-hidden +This switch declares that the user does not attempt to compare +pointers to inline methods where the addresses of the two functions +were taken in different shared objects. + +The effect of this is that GCC may, effectively, mark inline methods with +@code{__attribute__ ((visibility ("hidden")))} so that they do not +appear in the export table of a DSO and do not require a PLT indirection +when used within the DSO@. Enabling this option can have a dramatic effect +on load and link times of a DSO as it massively reduces the size of the +dynamic export table when the library makes heavy use of templates. + +The behavior of this switch is not quite the same as marking the +methods as hidden directly, because it does not affect static variables +local to the function or cause the compiler to deduce that +the function is defined in only one shared object. + +You may mark a method as having a visibility explicitly to negate the +effect of the switch for that method. For example, if you do want to +compare pointers to a particular inline method, you might mark it as +having default visibility. Marking the enclosing class with explicit +visibility will have no effect. + +Explicitly instantiated inline methods are unaffected by this option +as their linkage might otherwise cross a shared library boundary. +@xref{Template Instantiation}. + +@item -fvisibility-ms-compat +@opindex fvisibility-ms-compat +This flag attempts to use visibility settings to make GCC's C++ +linkage model compatible with that of Microsoft Visual Studio. + +The flag makes these changes to GCC's linkage model: + +@enumerate +@item +It sets the default visibility to @code{hidden}, like +@option{-fvisibility=hidden}. + +@item +Types, but not their members, are not hidden by default. + +@item +The One Definition Rule is relaxed for types without explicit +visibility specifications which are defined in more than one different +shared object: those declarations are permitted if they would have +been permitted when this option was not used. +@end enumerate + +In new code it is better to use @option{-fvisibility=hidden} and +export those classes which are intended to be externally visible. +Unfortunately it is possible for code to rely, perhaps accidentally, +on the Visual Studio behavior. -This optimization requires GNU as and GNU ld. Not all systems support -this option. @option{-Wl,--gc-sections} is ignored without @option{-static}. +Among the consequences of these changes are that static data members +of the same type with the same name but defined in different shared +objects will be different, so changing one will not change the other; +and that pointers to function members defined in different shared +objects may not compare equal. When this flag is given, it is a +violation of the ODR to define types with the same name differently. @item -fno-weak @opindex fno-weak @@ -1555,11 +1993,12 @@ Do not assume @samp{inline} for functions defined inside a class scope. functions will have linkage like inline functions; they just won't be inlined by default. -@item -Wabi @r{(C++ only)} +@item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)} @opindex Wabi +@opindex Wno-abi Warn when G++ generates code that is probably not compatible with the -vendor-neutral C++ ABI. Although an effort has been made to warn about -all such cases, there are probably some cases that are not warned about, +vendor-neutral C++ ABI@. Although an effort has been made to warn about +all such cases, there are probably some cases that are not warned about, even though G++ is generating incompatible code. There may also be cases where warnings are emitted even though the code that is generated will be compatible. @@ -1568,7 +2007,7 @@ You should rewrite your code to avoid these warnings if you are concerned about the fact that code generated by G++ may not be binary compatible with code generated by other compilers. -The known incompatibilites at this point include: +The known incompatibilities at this point include: @itemize @bullet @@ -1583,7 +2022,7 @@ struct B : public A @{ int f2 : 1; @}; @noindent In this case, G++ will place @code{B::f2} into the same byte -as@code{A::f1}; other compilers will not. You can avoid this problem +as@code{A::f1}; other compilers will not. You can avoid this problem by explicitly padding @code{A} so that its size is a multiple of the byte size on your platform; that will cause G++ and other compilers to layout @code{B} identically. @@ -1605,21 +2044,94 @@ explicitly padding @code{A} so that its size is a multiple of its alignment (ignoring virtual base classes); that will cause G++ and other compilers to layout @code{C} identically. +@item +Incorrect handling of bit-fields with declared widths greater than that +of their underlying types, when the bit-fields appear in a union. For +example: + +@smallexample +union U @{ int i : 4096; @}; +@end smallexample + +@noindent +Assuming that an @code{int} does not have 4096 bits, G++ will make the +union too small by the number of bits in an @code{int}. + +@item +Empty classes can be placed at incorrect offsets. For example: + +@smallexample +struct A @{@}; + +struct B @{ + A a; + virtual void f (); +@}; + +struct C : public B, public A @{@}; +@end smallexample + +@noindent +G++ will place the @code{A} base class of @code{C} at a nonzero offset; +it should be placed at offset zero. G++ mistakenly believes that the +@code{A} data member of @code{B} is already at offset zero. + +@item +Names of template functions whose types involve @code{typename} or +template template parameters can be mangled incorrectly. + +@smallexample +template +void f(typename Q::X) @{@} + +template