* doc/invoke.texi (-mcpu=power8): Document.
[official-gcc.git] / gcc / doc / invoke.texi
blobf6d3a588809771b2ac45ce422dc710f056426b09
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi.
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
15 2012
16 Free Software Foundation, Inc.
18 Permission is granted to copy, distribute and/or modify this document
19 under the terms of the GNU Free Documentation License, Version 1.3 or
20 any later version published by the Free Software Foundation; with the
21 Invariant Sections being ``GNU General Public License'' and ``Funding
22 Free Software'', the Front-Cover texts being (a) (see below), and with
23 the Back-Cover Texts being (b) (see below).  A copy of the license is
24 included in the gfdl(7) man page.
26 (a) The FSF's Front-Cover Text is:
28      A GNU Manual
30 (b) The FSF's Back-Cover Text is:
32      You have freedom to copy and modify this GNU Manual, like GNU
33      software.  Copies published by the Free Software Foundation raise
34      funds for GNU development.
35 @c man end
36 @c Set file name and title for the man page.
37 @setfilename gcc
38 @settitle GNU project C and C++ compiler
39 @c man begin SYNOPSIS
40 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
41     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
42     [@option{-W}@var{warn}@dots{}] [@option{-Wpedantic}]
43     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
44     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
45     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
46     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
48 Only the most useful options are listed here; see below for the
49 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
50 @c man end
51 @c man begin SEEALSO
52 gpl(7), gfdl(7), fsf-funding(7),
53 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
54 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
55 @file{ld}, @file{binutils} and @file{gdb}.
56 @c man end
57 @c man begin BUGS
58 For instructions on reporting bugs, see
59 @w{@value{BUGURL}}.
60 @c man end
61 @c man begin AUTHOR
62 See the Info entry for @command{gcc}, or
63 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
64 for contributors to GCC@.
65 @c man end
66 @end ignore
68 @node Invoking GCC
69 @chapter GCC Command Options
70 @cindex GCC command options
71 @cindex command options
72 @cindex options, GCC command
74 @c man begin DESCRIPTION
75 When you invoke GCC, it normally does preprocessing, compilation,
76 assembly and linking.  The ``overall options'' allow you to stop this
77 process at an intermediate stage.  For example, the @option{-c} option
78 says not to run the linker.  Then the output consists of object files
79 output by the assembler.
81 Other options are passed on to one stage of processing.  Some options
82 control the preprocessor and others the compiler itself.  Yet other
83 options control the assembler and linker; most of these are not
84 documented here, since you rarely need to use any of them.
86 @cindex C compilation options
87 Most of the command-line options that you can use with GCC are useful
88 for C programs; when an option is only useful with another language
89 (usually C++), the explanation says so explicitly.  If the description
90 for a particular option does not mention a source language, you can use
91 that option with all supported languages.
93 @cindex C++ compilation options
94 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
95 options for compiling C++ programs.
97 @cindex grouping options
98 @cindex options, grouping
99 The @command{gcc} program accepts options and file names as operands.  Many
100 options have multi-letter names; therefore multiple single-letter options
101 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
102 -v}}.
104 @cindex order of options
105 @cindex options, order
106 You can mix options and other arguments.  For the most part, the order
107 you use doesn't matter.  Order does matter when you use several
108 options of the same kind; for example, if you specify @option{-L} more
109 than once, the directories are searched in the order specified.  Also,
110 the placement of the @option{-l} option is significant.
112 Many options have long names starting with @samp{-f} or with
113 @samp{-W}---for example,
114 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
115 these have both positive and negative forms; the negative form of
116 @option{-ffoo} is @option{-fno-foo}.  This manual documents
117 only one of these two forms, whichever one is not the default.
119 @c man end
121 @xref{Option Index}, for an index to GCC's options.
123 @menu
124 * Option Summary::      Brief list of all options, without explanations.
125 * Overall Options::     Controlling the kind of output:
126                         an executable, object files, assembler files,
127                         or preprocessed source.
128 * Invoking G++::        Compiling C++ programs.
129 * C Dialect Options::   Controlling the variant of C language compiled.
130 * C++ Dialect Options:: Variations on C++.
131 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
132                         and Objective-C++.
133 * Language Independent Options:: Controlling how diagnostics should be
134                         formatted.
135 * Warning Options::     How picky should the compiler be?
136 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
137 * Optimize Options::    How much optimization?
138 * Preprocessor Options:: Controlling header files and macro definitions.
139                          Also, getting dependency information for Make.
140 * Assembler Options::   Passing options to the assembler.
141 * Link Options::        Specifying libraries and so on.
142 * Directory Options::   Where to find header files and libraries.
143                         Where to find the compiler executable files.
144 * Spec Files::          How to pass switches to sub-processes.
145 * Target Options::      Running a cross-compiler, or an old version of GCC.
146 * Submodel Options::    Specifying minor hardware or convention variations,
147                         such as 68010 vs 68020.
148 * Code Gen Options::    Specifying conventions for function calls, data layout
149                         and register usage.
150 * Environment Variables:: Env vars that affect GCC.
151 * Precompiled Headers:: Compiling a header once, and using it many times.
152 @end menu
154 @c man begin OPTIONS
156 @node Option Summary
157 @section Option Summary
159 Here is a summary of all the options, grouped by type.  Explanations are
160 in the following sections.
162 @table @emph
163 @item Overall Options
164 @xref{Overall Options,,Options Controlling the Kind of Output}.
165 @gccoptlist{-c  -S  -E  -o @var{file}  -no-canonical-prefixes  @gol
166 -pipe  -pass-exit-codes  @gol
167 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
168 --version -wrapper @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
169 -fdump-ada-spec@r{[}-slim@r{]} -fada-spec-parent=@var{arg} -fdump-go-spec=@var{file}}
171 @item C Language Options
172 @xref{C Dialect Options,,Options Controlling C Dialect}.
173 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
174 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
175 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
176 -fhosted  -ffreestanding -fopenmp -fms-extensions -fplan9-extensions @gol
177 -trigraphs  -traditional  -traditional-cpp @gol
178 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
179 -fsigned-bitfields  -fsigned-char @gol
180 -funsigned-bitfields  -funsigned-char}
182 @item C++ Language Options
183 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
184 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
185 -fconstexpr-depth=@var{n}  -ffriend-injection @gol
186 -fno-elide-constructors @gol
187 -fno-enforce-eh-specs @gol
188 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
189 -fno-implicit-templates @gol
190 -fno-implicit-inline-templates @gol
191 -fno-implement-inlines  -fms-extensions @gol
192 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
193 -fno-optional-diags  -fpermissive @gol
194 -fno-pretty-templates @gol
195 -frepo  -fno-rtti  -fstats  -ftemplate-backtrace-limit=@var{n} @gol
196 -ftemplate-depth=@var{n} @gol
197 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
198 -fno-default-inline  -fvisibility-inlines-hidden @gol
199 -fvisibility-ms-compat @gol
200 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
201 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
202 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
203 -Weffc++  -Wstrict-null-sentinel @gol
204 -Wno-non-template-friend  -Wold-style-cast @gol
205 -Woverloaded-virtual  -Wno-pmf-conversions @gol
206 -Wsign-promo}
208 @item Objective-C and Objective-C++ Language Options
209 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
210 Objective-C and Objective-C++ Dialects}.
211 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
212 -fgnu-runtime  -fnext-runtime @gol
213 -fno-nil-receivers @gol
214 -fobjc-abi-version=@var{n} @gol
215 -fobjc-call-cxx-cdtors @gol
216 -fobjc-direct-dispatch @gol
217 -fobjc-exceptions @gol
218 -fobjc-gc @gol
219 -fobjc-nilcheck @gol
220 -fobjc-std=objc1 @gol
221 -freplace-objc-classes @gol
222 -fzero-link @gol
223 -gen-decls @gol
224 -Wassign-intercept @gol
225 -Wno-protocol  -Wselector @gol
226 -Wstrict-selector-match @gol
227 -Wundeclared-selector}
229 @item Language Independent Options
230 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
231 @gccoptlist{-fmessage-length=@var{n}  @gol
232 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
233 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
235 @item Warning Options
236 @xref{Warning Options,,Options to Request or Suppress Warnings}.
237 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
238 -pedantic-errors @gol
239 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
240 -Wno-attributes -Wno-builtin-macro-redefined @gol
241 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
242 -Wchar-subscripts -Wclobbered  -Wcomment @gol
243 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
244 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
245 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
246 -Wno-endif-labels -Werror  -Werror=* @gol
247 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
248 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
249 -Wformat-security  -Wformat-y2k @gol
250 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
251 -Wignored-qualifiers @gol
252 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
253 -Winit-self  -Winline -Wmaybe-uninitialized @gol
254 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
255 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
256 -Wlogical-op -Wlong-long @gol
257 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
258 -Wmissing-include-dirs @gol
259 -Wno-mudflap @gol
260 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
261 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
262 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
263 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
264 -Wredundant-decls  -Wno-return-local-addr @gol
265 -Wreturn-type  -Wsequence-point  -Wshadow @gol
266 -Wsign-compare  -Wsign-conversion  -Wsizeof-pointer-memaccess @gol
267 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
268 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
269 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
270 -Wmissing-format-attribute @gol
271 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
272 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
273 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
274 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
275 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
276 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
277 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
278 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
279 -Wvla -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
281 @item C and Objective-C-only Warning Options
282 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
283 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
284 -Wold-style-declaration  -Wold-style-definition @gol
285 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
286 -Wdeclaration-after-statement -Wpointer-sign}
288 @item Debugging Options
289 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
290 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
291 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
292 -fdisable-ipa-@var{pass_name} @gol
293 -fdisable-rtl-@var{pass_name} @gol
294 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
295 -fdisable-tree-@var{pass_name} @gol
296 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
297 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
298 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
299 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
300 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
301 -fdump-passes @gol
302 -fdump-statistics @gol
303 -fdump-tree-all @gol
304 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
305 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
306 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
307 -fdump-tree-ch @gol
308 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
309 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
310 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
315 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
316 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
317 -fdump-tree-nrv -fdump-tree-vect @gol
318 -fdump-tree-sink @gol
319 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
320 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
321 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
322 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
323 -ftree-vectorizer-verbose=@var{n} @gol
324 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
325 -fdump-final-insns=@var{file} @gol
326 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
327 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
328 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
329 -fenable-@var{kind}-@var{pass} @gol
330 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
331 -fdebug-types-section -fmem-report-wpa @gol
332 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
333 -fopt-info @gol
334 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
335 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
336 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
337 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
338 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
339 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
340 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
341 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
342 -gvms  -gxcoff  -gxcoff+ @gol
343 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
344 -fdebug-prefix-map=@var{old}=@var{new} @gol
345 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
346 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
347 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
348 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
349 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
350 -print-sysroot -print-sysroot-headers-suffix @gol
351 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
353 @item Optimization Options
354 @xref{Optimize Options,,Options that Control Optimization}.
355 @gccoptlist{-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
356 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
357 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
358 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
359 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
360 -fcompare-elim -fcprop-registers -fcrossjumping @gol
361 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
362 -fcx-limited-range @gol
363 -fdata-sections -fdce -fdelayed-branch @gol
364 -fdelete-null-pointer-checks -fdevirtualize -fdse @gol
365 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
366 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
367 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
368 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
369 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
370 -fif-conversion2 -findirect-inlining @gol
371 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
372 -finline-small-functions -fipa-cp -fipa-cp-clone @gol
373 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
374 -fira-algorithm=@var{algorithm} @gol
375 -fira-region=@var{region} -fira-hoist-pressure @gol
376 -fira-loop-pressure -fno-ira-share-save-slots @gol
377 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
378 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
379 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
380 -floop-parallelize-all -flto -flto-compression-level @gol
381 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
382 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
383 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
384 -fno-default-inline @gol
385 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
386 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
387 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
388 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
389 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
390 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
391 -fprefetch-loop-arrays -fprofile-report @gol
392 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
393 -fprofile-generate=@var{path} @gol
394 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
395 -freciprocal-math -free -fregmove -frename-registers -freorder-blocks @gol
396 -freorder-blocks-and-partition -freorder-functions @gol
397 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
398 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
399 -fsched-spec-load -fsched-spec-load-dangerous @gol
400 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
401 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
402 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
403 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
404 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
405 -fselective-scheduling -fselective-scheduling2 @gol
406 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
407 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
408 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
409 -fstack-protector-all -fstrict-aliasing -fstrict-overflow @gol
410 -fthread-jumps -ftracer -ftree-bit-ccp @gol
411 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
412 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
413 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
414 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
415 -ftree-loop-if-convert-stores -ftree-loop-im @gol
416 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
417 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
418 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
419 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
420 -ftree-switch-conversion -ftree-tail-merge @gol
421 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
422 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
423 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
424 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
425 -fwhole-program -fwpa -fuse-linker-plugin @gol
426 --param @var{name}=@var{value}
427 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
429 @item Preprocessor Options
430 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
431 @gccoptlist{-A@var{question}=@var{answer} @gol
432 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
433 -C  -dD  -dI  -dM  -dN @gol
434 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
435 -idirafter @var{dir} @gol
436 -include @var{file}  -imacros @var{file} @gol
437 -iprefix @var{file}  -iwithprefix @var{dir} @gol
438 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
439 -imultilib @var{dir} -isysroot @var{dir} @gol
440 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
441 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
442 -remap -trigraphs  -undef  -U@var{macro}  @gol
443 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
445 @item Assembler Option
446 @xref{Assembler Options,,Passing Options to the Assembler}.
447 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
449 @item Linker Options
450 @xref{Link Options,,Options for Linking}.
451 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
452 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
453 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
454 -shared-libgcc  -symbolic @gol
455 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
456 -u @var{symbol}}
458 @item Directory Options
459 @xref{Directory Options,,Options for Directory Search}.
460 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
461 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
462 --sysroot=@var{dir} --no-sysroot-suffix}
464 @item Machine Dependent Options
465 @xref{Submodel Options,,Hardware Models and Configurations}.
466 @c This list is ordered alphanumerically by subsection name.
467 @c Try and put the significant identifier (CPU or system) first,
468 @c so users have a clue at guessing where the ones they want will be.
470 @emph{AArch64 Options}
471 @gccoptlist{-mbig-endian  -mlittle-endian @gol
472 -mgeneral-regs-only @gol
473 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
474 -mstrict-align @gol
475 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
476 -mtls-dialect=desc  -mtls-dialect=traditional @gol
477 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
479 @emph{Adapteva Epiphany Options}
480 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
481 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
482 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
483 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
484 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
485 -msplit-vecmove-early -m1reg-@var{reg}}
487 @emph{ARM Options}
488 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
489 -mabi=@var{name} @gol
490 -mapcs-stack-check  -mno-apcs-stack-check @gol
491 -mapcs-float  -mno-apcs-float @gol
492 -mapcs-reentrant  -mno-apcs-reentrant @gol
493 -msched-prolog  -mno-sched-prolog @gol
494 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
495 -mfloat-abi=@var{name} @gol
496 -mfp16-format=@var{name}
497 -mthumb-interwork  -mno-thumb-interwork @gol
498 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
499 -mstructure-size-boundary=@var{n} @gol
500 -mabort-on-noreturn @gol
501 -mlong-calls  -mno-long-calls @gol
502 -msingle-pic-base  -mno-single-pic-base @gol
503 -mpic-register=@var{reg} @gol
504 -mnop-fun-dllimport @gol
505 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
506 -mpoke-function-name @gol
507 -mthumb  -marm @gol
508 -mtpcs-frame  -mtpcs-leaf-frame @gol
509 -mcaller-super-interworking  -mcallee-super-interworking @gol
510 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
511 -mword-relocations @gol
512 -mfix-cortex-m3-ldrd @gol
513 -munaligned-access}
515 @emph{AVR Options}
516 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
517 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
518 -mstrict-X -mtiny-stack}
520 @emph{Blackfin Options}
521 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
522 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
523 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
524 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
525 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
526 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
527 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
528 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
529 -micplb}
531 @emph{C6X Options}
532 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
533 -msim -msdata=@var{sdata-type}}
535 @emph{CRIS Options}
536 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
537 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
538 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
539 -mstack-align  -mdata-align  -mconst-align @gol
540 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
541 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
542 -mmul-bug-workaround  -mno-mul-bug-workaround}
544 @emph{CR16 Options}
545 @gccoptlist{-mmac @gol
546 -mcr16cplus -mcr16c @gol
547 -msim -mint32 -mbit-ops
548 -mdata-model=@var{model}}
550 @emph{Darwin Options}
551 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
552 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
553 -client_name  -compatibility_version  -current_version @gol
554 -dead_strip @gol
555 -dependency-file  -dylib_file  -dylinker_install_name @gol
556 -dynamic  -dynamiclib  -exported_symbols_list @gol
557 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
558 -force_flat_namespace  -headerpad_max_install_names @gol
559 -iframework @gol
560 -image_base  -init  -install_name  -keep_private_externs @gol
561 -multi_module  -multiply_defined  -multiply_defined_unused @gol
562 -noall_load   -no_dead_strip_inits_and_terms @gol
563 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
564 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
565 -private_bundle  -read_only_relocs  -sectalign @gol
566 -sectobjectsymbols  -whyload  -seg1addr @gol
567 -sectcreate  -sectobjectsymbols  -sectorder @gol
568 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
569 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
570 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
571 -single_module  -static  -sub_library  -sub_umbrella @gol
572 -twolevel_namespace  -umbrella  -undefined @gol
573 -unexported_symbols_list  -weak_reference_mismatches @gol
574 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
575 -mkernel -mone-byte-bool}
577 @emph{DEC Alpha Options}
578 @gccoptlist{-mno-fp-regs  -msoft-float @gol
579 -mieee  -mieee-with-inexact  -mieee-conformant @gol
580 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
581 -mtrap-precision=@var{mode}  -mbuild-constants @gol
582 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
583 -mbwx  -mmax  -mfix  -mcix @gol
584 -mfloat-vax  -mfloat-ieee @gol
585 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
586 -msmall-text  -mlarge-text @gol
587 -mmemory-latency=@var{time}}
589 @emph{FR30 Options}
590 @gccoptlist{-msmall-model -mno-lsim}
592 @emph{FRV Options}
593 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
594 -mhard-float  -msoft-float @gol
595 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
596 -mdouble  -mno-double @gol
597 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
598 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
599 -mlinked-fp  -mlong-calls  -malign-labels @gol
600 -mlibrary-pic  -macc-4  -macc-8 @gol
601 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
602 -moptimize-membar -mno-optimize-membar @gol
603 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
604 -mvliw-branch  -mno-vliw-branch @gol
605 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
606 -mno-nested-cond-exec  -mtomcat-stats @gol
607 -mTLS -mtls @gol
608 -mcpu=@var{cpu}}
610 @emph{GNU/Linux Options}
611 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
612 -tno-android-cc -tno-android-ld}
614 @emph{H8/300 Options}
615 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
617 @emph{HPPA Options}
618 @gccoptlist{-march=@var{architecture-type} @gol
619 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
620 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
621 -mfixed-range=@var{register-range} @gol
622 -mjump-in-delay -mlinker-opt -mlong-calls @gol
623 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
624 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
625 -mno-jump-in-delay  -mno-long-load-store @gol
626 -mno-portable-runtime  -mno-soft-float @gol
627 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
628 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
629 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
630 -munix=@var{unix-std}  -nolibdld  -static  -threads}
632 @emph{i386 and x86-64 Options}
633 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
634 -mfpmath=@var{unit} @gol
635 -masm=@var{dialect}  -mno-fancy-math-387 @gol
636 -mno-fp-ret-in-387  -msoft-float @gol
637 -mno-wide-multiply  -mrtd  -malign-double @gol
638 -mpreferred-stack-boundary=@var{num} @gol
639 -mincoming-stack-boundary=@var{num} @gol
640 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
641 -mrecip -mrecip=@var{opt} @gol
642 -mvzeroupper -mprefer-avx128 @gol
643 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
644 -mavx2 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
645 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
646 -mbmi2 -mrtm -mlwp -mthreads @gol
647 -mno-align-stringops  -minline-all-stringops @gol
648 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
649 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
650 -m96bit-long-double -mlong-double-64 -mlong-double-80 @gol
651 -mregparm=@var{num}  -msseregparm @gol
652 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
653 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
654 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
655 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
656 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
657 -msse2avx -mfentry -m8bit-idiv @gol
658 -mavx256-split-unaligned-load -mavx256-split-unaligned-store}
660 @emph{i386 and x86-64 Windows Options}
661 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
662 -mnop-fun-dllimport -mthread @gol
663 -municode -mwin32 -mwindows -fno-set-stack-executable}
665 @emph{IA-64 Options}
666 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
667 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
668 -mconstant-gp  -mauto-pic  -mfused-madd @gol
669 -minline-float-divide-min-latency @gol
670 -minline-float-divide-max-throughput @gol
671 -mno-inline-float-divide @gol
672 -minline-int-divide-min-latency @gol
673 -minline-int-divide-max-throughput  @gol
674 -mno-inline-int-divide @gol
675 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
676 -mno-inline-sqrt @gol
677 -mdwarf2-asm -mearly-stop-bits @gol
678 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
679 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
680 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
681 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
682 -msched-spec-ldc -msched-spec-control-ldc @gol
683 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
684 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
685 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
686 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
688 @emph{LM32 Options}
689 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
690 -msign-extend-enabled -muser-enabled}
692 @emph{M32R/D Options}
693 @gccoptlist{-m32r2 -m32rx -m32r @gol
694 -mdebug @gol
695 -malign-loops -mno-align-loops @gol
696 -missue-rate=@var{number} @gol
697 -mbranch-cost=@var{number} @gol
698 -mmodel=@var{code-size-model-type} @gol
699 -msdata=@var{sdata-type} @gol
700 -mno-flush-func -mflush-func=@var{name} @gol
701 -mno-flush-trap -mflush-trap=@var{number} @gol
702 -G @var{num}}
704 @emph{M32C Options}
705 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
707 @emph{M680x0 Options}
708 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
709 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
710 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
711 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
712 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
713 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
714 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
715 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
716 -mxgot -mno-xgot}
718 @emph{MCore Options}
719 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
720 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
721 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
722 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
723 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
725 @emph{MeP Options}
726 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
727 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
728 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
729 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
730 -mtiny=@var{n}}
732 @emph{MicroBlaze Options}
733 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
734 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
735 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
736 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
737 -mxl-mode-@var{app-model}}
739 @emph{MIPS Options}
740 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
741 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
742 -mips64  -mips64r2 @gol
743 -mips16  -mno-mips16  -mflip-mips16 @gol
744 -minterlink-mips16  -mno-interlink-mips16 @gol
745 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
746 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
747 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
748 -mno-float -msingle-float  -mdouble-float  @gol
749 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
750 -mmcu -mmno-mcu @gol
751 -mfpu=@var{fpu-type} @gol
752 -msmartmips  -mno-smartmips @gol
753 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
754 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
755 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
756 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
757 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
758 -membedded-data  -mno-embedded-data @gol
759 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
760 -mcode-readable=@var{setting} @gol
761 -msplit-addresses  -mno-split-addresses @gol
762 -mexplicit-relocs  -mno-explicit-relocs @gol
763 -mcheck-zero-division  -mno-check-zero-division @gol
764 -mdivide-traps  -mdivide-breaks @gol
765 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
766 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
767 -mfix-24k -mno-fix-24k @gol
768 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
769 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
770 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
771 -mflush-func=@var{func}  -mno-flush-func @gol
772 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
773 -mfp-exceptions -mno-fp-exceptions @gol
774 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
775 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
777 @emph{MMIX Options}
778 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
779 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
780 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
781 -mno-base-addresses  -msingle-exit  -mno-single-exit}
783 @emph{MN10300 Options}
784 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
785 -mno-am33 -mam33 -mam33-2 -mam34 @gol
786 -mtune=@var{cpu-type} @gol
787 -mreturn-pointer-on-d0 @gol
788 -mno-crt0  -mrelax -mliw -msetlb}
790 @emph{Moxie Options}
791 @gccoptlist{-meb -mel -mno-crt0}
793 @emph{PDP-11 Options}
794 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
795 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
796 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
797 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
798 -mbranch-expensive  -mbranch-cheap @gol
799 -munix-asm  -mdec-asm}
801 @emph{picoChip Options}
802 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
803 -msymbol-as-address -mno-inefficient-warnings}
805 @emph{PowerPC Options}
806 See RS/6000 and PowerPC Options.
808 @emph{RL78 Options}
809 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
811 @emph{RS/6000 and PowerPC Options}
812 @gccoptlist{-mcpu=@var{cpu-type} @gol
813 -mtune=@var{cpu-type} @gol
814 -mcmodel=@var{code-model} @gol
815 -mpowerpc64 @gol
816 -maltivec  -mno-altivec @gol
817 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
818 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
819 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
820 -mfprnd  -mno-fprnd @gol
821 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
822 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
823 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
824 -malign-power  -malign-natural @gol
825 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
826 -msingle-float -mdouble-float -msimple-fpu @gol
827 -mstring  -mno-string  -mupdate  -mno-update @gol
828 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
829 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
830 -mstrict-align  -mno-strict-align  -mrelocatable @gol
831 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
832 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
833 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
834 -mprioritize-restricted-insns=@var{priority} @gol
835 -msched-costly-dep=@var{dependence_type} @gol
836 -minsert-sched-nops=@var{scheme} @gol
837 -mcall-sysv  -mcall-netbsd @gol
838 -maix-struct-return  -msvr4-struct-return @gol
839 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
840 -mblock-move-inline-limit=@var{num} @gol
841 -misel -mno-isel @gol
842 -misel=yes  -misel=no @gol
843 -mspe -mno-spe @gol
844 -mspe=yes  -mspe=no @gol
845 -mpaired @gol
846 -mgen-cell-microcode -mwarn-cell-microcode @gol
847 -mvrsave -mno-vrsave @gol
848 -mmulhw -mno-mulhw @gol
849 -mdlmzb -mno-dlmzb @gol
850 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
851 -mprototype  -mno-prototype @gol
852 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
853 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
854 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
855 -mno-recip-precision @gol
856 -mveclibabi=@var{type} -mfriz -mno-friz @gol
857 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
858 -msave-toc-indirect -mno-save-toc-indirect}
860 @emph{RX Options}
861 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
862 -mcpu=@gol
863 -mbig-endian-data -mlittle-endian-data @gol
864 -msmall-data @gol
865 -msim  -mno-sim@gol
866 -mas100-syntax -mno-as100-syntax@gol
867 -mrelax@gol
868 -mmax-constant-size=@gol
869 -mint-register=@gol
870 -mpid@gol
871 -mno-warn-multiple-fast-interrupts@gol
872 -msave-acc-in-interrupts}
874 @emph{S/390 and zSeries Options}
875 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
876 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
877 -mlong-double-64 -mlong-double-128 @gol
878 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
879 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
880 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
881 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
882 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
884 @emph{Score Options}
885 @gccoptlist{-meb -mel @gol
886 -mnhwloop @gol
887 -muls @gol
888 -mmac @gol
889 -mscore5 -mscore5u -mscore7 -mscore7d}
891 @emph{SH Options}
892 @gccoptlist{-m1  -m2  -m2e @gol
893 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
894 -m3  -m3e @gol
895 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
896 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
897 -m5-64media  -m5-64media-nofpu @gol
898 -m5-32media  -m5-32media-nofpu @gol
899 -m5-compact  -m5-compact-nofpu @gol
900 -mb  -ml  -mdalign  -mrelax @gol
901 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
902 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
903 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
904 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
905 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
906 -maccumulate-outgoing-args -minvalid-symbols @gol
907 -matomic-model=@var{atomic-model} @gol
908 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch -mcbranchdi -mcmpeqdi @gol
909 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
910 -mpretend-cmove -mtas}
912 @emph{Solaris 2 Options}
913 @gccoptlist{-mimpure-text  -mno-impure-text @gol
914 -pthreads -pthread}
916 @emph{SPARC Options}
917 @gccoptlist{-mcpu=@var{cpu-type} @gol
918 -mtune=@var{cpu-type} @gol
919 -mcmodel=@var{code-model} @gol
920 -mmemory-model=@var{mem-model} @gol
921 -m32  -m64  -mapp-regs  -mno-app-regs @gol
922 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
923 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
924 -mhard-quad-float  -msoft-quad-float @gol
925 -mlittle-endian @gol
926 -mstack-bias  -mno-stack-bias @gol
927 -munaligned-doubles  -mno-unaligned-doubles @gol
928 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
929 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
930 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
931 -mfix-at697f}
933 @emph{SPU Options}
934 @gccoptlist{-mwarn-reloc -merror-reloc @gol
935 -msafe-dma -munsafe-dma @gol
936 -mbranch-hints @gol
937 -msmall-mem -mlarge-mem -mstdmain @gol
938 -mfixed-range=@var{register-range} @gol
939 -mea32 -mea64 @gol
940 -maddress-space-conversion -mno-address-space-conversion @gol
941 -mcache-size=@var{cache-size} @gol
942 -matomic-updates -mno-atomic-updates}
944 @emph{System V Options}
945 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
947 @emph{TILE-Gx Options}
948 @gccoptlist{-mcpu=@var{cpu} -m32 -m64 -mcmodel=@var{code-model}}
950 @emph{TILEPro Options}
951 @gccoptlist{-mcpu=@var{cpu} -m32}
953 @emph{V850 Options}
954 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
955 -mprolog-function  -mno-prolog-function  -mspace @gol
956 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
957 -mapp-regs  -mno-app-regs @gol
958 -mdisable-callt  -mno-disable-callt @gol
959 -mv850e2v3 @gol
960 -mv850e2 @gol
961 -mv850e1 -mv850es @gol
962 -mv850e @gol
963 -mv850  -mbig-switch}
965 @emph{VAX Options}
966 @gccoptlist{-mg  -mgnu  -munix}
968 @emph{VMS Options}
969 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
970 -mpointer-size=@var{size}}
972 @emph{VxWorks Options}
973 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
974 -Xbind-lazy  -Xbind-now}
976 @emph{x86-64 Options}
977 See i386 and x86-64 Options.
979 @emph{Xstormy16 Options}
980 @gccoptlist{-msim}
982 @emph{Xtensa Options}
983 @gccoptlist{-mconst16 -mno-const16 @gol
984 -mfused-madd  -mno-fused-madd @gol
985 -mforce-no-pic @gol
986 -mserialize-volatile  -mno-serialize-volatile @gol
987 -mtext-section-literals  -mno-text-section-literals @gol
988 -mtarget-align  -mno-target-align @gol
989 -mlongcalls  -mno-longcalls}
991 @emph{zSeries Options}
992 See S/390 and zSeries Options.
994 @item Code Generation Options
995 @xref{Code Gen Options,,Options for Code Generation Conventions}.
996 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
997 -ffixed-@var{reg}  -fexceptions @gol
998 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
999 -fasynchronous-unwind-tables @gol
1000 -finhibit-size-directive  -finstrument-functions @gol
1001 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1002 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1003 -fno-common  -fno-ident @gol
1004 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1005 -fno-jump-tables @gol
1006 -frecord-gcc-switches @gol
1007 -freg-struct-return  -fshort-enums @gol
1008 -fshort-double  -fshort-wchar @gol
1009 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1010 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1011 -fno-stack-limit -fsplit-stack @gol
1012 -fleading-underscore  -ftls-model=@var{model} @gol
1013 -fstack-reuse=@var{reuse_level} @gol
1014 -ftrapv  -fwrapv  -fbounds-check @gol
1015 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1016 @end table
1018 @menu
1019 * Overall Options::     Controlling the kind of output:
1020                         an executable, object files, assembler files,
1021                         or preprocessed source.
1022 * C Dialect Options::   Controlling the variant of C language compiled.
1023 * C++ Dialect Options:: Variations on C++.
1024 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
1025                         and Objective-C++.
1026 * Language Independent Options:: Controlling how diagnostics should be
1027                         formatted.
1028 * Warning Options::     How picky should the compiler be?
1029 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
1030 * Optimize Options::    How much optimization?
1031 * Preprocessor Options:: Controlling header files and macro definitions.
1032                          Also, getting dependency information for Make.
1033 * Assembler Options::   Passing options to the assembler.
1034 * Link Options::        Specifying libraries and so on.
1035 * Directory Options::   Where to find header files and libraries.
1036                         Where to find the compiler executable files.
1037 * Spec Files::          How to pass switches to sub-processes.
1038 * Target Options::      Running a cross-compiler, or an old version of GCC.
1039 @end menu
1041 @node Overall Options
1042 @section Options Controlling the Kind of Output
1044 Compilation can involve up to four stages: preprocessing, compilation
1045 proper, assembly and linking, always in that order.  GCC is capable of
1046 preprocessing and compiling several files either into several
1047 assembler input files, or into one assembler input file; then each
1048 assembler input file produces an object file, and linking combines all
1049 the object files (those newly compiled, and those specified as input)
1050 into an executable file.
1052 @cindex file name suffix
1053 For any given input file, the file name suffix determines what kind of
1054 compilation is done:
1056 @table @gcctabopt
1057 @item @var{file}.c
1058 C source code that must be preprocessed.
1060 @item @var{file}.i
1061 C source code that should not be preprocessed.
1063 @item @var{file}.ii
1064 C++ source code that should not be preprocessed.
1066 @item @var{file}.m
1067 Objective-C source code.  Note that you must link with the @file{libobjc}
1068 library to make an Objective-C program work.
1070 @item @var{file}.mi
1071 Objective-C source code that should not be preprocessed.
1073 @item @var{file}.mm
1074 @itemx @var{file}.M
1075 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1076 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1077 to a literal capital M@.
1079 @item @var{file}.mii
1080 Objective-C++ source code that should not be preprocessed.
1082 @item @var{file}.h
1083 C, C++, Objective-C or Objective-C++ header file to be turned into a
1084 precompiled header (default), or C, C++ header file to be turned into an
1085 Ada spec (via the @option{-fdump-ada-spec} switch).
1087 @item @var{file}.cc
1088 @itemx @var{file}.cp
1089 @itemx @var{file}.cxx
1090 @itemx @var{file}.cpp
1091 @itemx @var{file}.CPP
1092 @itemx @var{file}.c++
1093 @itemx @var{file}.C
1094 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1095 the last two letters must both be literally @samp{x}.  Likewise,
1096 @samp{.C} refers to a literal capital C@.
1098 @item @var{file}.mm
1099 @itemx @var{file}.M
1100 Objective-C++ source code that must be preprocessed.
1102 @item @var{file}.mii
1103 Objective-C++ source code that should not be preprocessed.
1105 @item @var{file}.hh
1106 @itemx @var{file}.H
1107 @itemx @var{file}.hp
1108 @itemx @var{file}.hxx
1109 @itemx @var{file}.hpp
1110 @itemx @var{file}.HPP
1111 @itemx @var{file}.h++
1112 @itemx @var{file}.tcc
1113 C++ header file to be turned into a precompiled header or Ada spec.
1115 @item @var{file}.f
1116 @itemx @var{file}.for
1117 @itemx @var{file}.ftn
1118 Fixed form Fortran source code that should not be preprocessed.
1120 @item @var{file}.F
1121 @itemx @var{file}.FOR
1122 @itemx @var{file}.fpp
1123 @itemx @var{file}.FPP
1124 @itemx @var{file}.FTN
1125 Fixed form Fortran source code that must be preprocessed (with the traditional
1126 preprocessor).
1128 @item @var{file}.f90
1129 @itemx @var{file}.f95
1130 @itemx @var{file}.f03
1131 @itemx @var{file}.f08
1132 Free form Fortran source code that should not be preprocessed.
1134 @item @var{file}.F90
1135 @itemx @var{file}.F95
1136 @itemx @var{file}.F03
1137 @itemx @var{file}.F08
1138 Free form Fortran source code that must be preprocessed (with the
1139 traditional preprocessor).
1141 @item @var{file}.go
1142 Go source code.
1144 @c FIXME: Descriptions of Java file types.
1145 @c @var{file}.java
1146 @c @var{file}.class
1147 @c @var{file}.zip
1148 @c @var{file}.jar
1150 @item @var{file}.ads
1151 Ada source code file that contains a library unit declaration (a
1152 declaration of a package, subprogram, or generic, or a generic
1153 instantiation), or a library unit renaming declaration (a package,
1154 generic, or subprogram renaming declaration).  Such files are also
1155 called @dfn{specs}.
1157 @item @var{file}.adb
1158 Ada source code file containing a library unit body (a subprogram or
1159 package body).  Such files are also called @dfn{bodies}.
1161 @c GCC also knows about some suffixes for languages not yet included:
1162 @c Pascal:
1163 @c @var{file}.p
1164 @c @var{file}.pas
1165 @c Ratfor:
1166 @c @var{file}.r
1168 @item @var{file}.s
1169 Assembler code.
1171 @item @var{file}.S
1172 @itemx @var{file}.sx
1173 Assembler code that must be preprocessed.
1175 @item @var{other}
1176 An object file to be fed straight into linking.
1177 Any file name with no recognized suffix is treated this way.
1178 @end table
1180 @opindex x
1181 You can specify the input language explicitly with the @option{-x} option:
1183 @table @gcctabopt
1184 @item -x @var{language}
1185 Specify explicitly the @var{language} for the following input files
1186 (rather than letting the compiler choose a default based on the file
1187 name suffix).  This option applies to all following input files until
1188 the next @option{-x} option.  Possible values for @var{language} are:
1189 @smallexample
1190 c  c-header  cpp-output
1191 c++  c++-header  c++-cpp-output
1192 objective-c  objective-c-header  objective-c-cpp-output
1193 objective-c++ objective-c++-header objective-c++-cpp-output
1194 assembler  assembler-with-cpp
1196 f77  f77-cpp-input f95  f95-cpp-input
1198 java
1199 @end smallexample
1201 @item -x none
1202 Turn off any specification of a language, so that subsequent files are
1203 handled according to their file name suffixes (as they are if @option{-x}
1204 has not been used at all).
1206 @item -pass-exit-codes
1207 @opindex pass-exit-codes
1208 Normally the @command{gcc} program exits with the code of 1 if any
1209 phase of the compiler returns a non-success return code.  If you specify
1210 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1211 the numerically highest error produced by any phase returning an error
1212 indication.  The C, C++, and Fortran front ends return 4 if an internal
1213 compiler error is encountered.
1214 @end table
1216 If you only want some of the stages of compilation, you can use
1217 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1218 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1219 @command{gcc} is to stop.  Note that some combinations (for example,
1220 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1222 @table @gcctabopt
1223 @item -c
1224 @opindex c
1225 Compile or assemble the source files, but do not link.  The linking
1226 stage simply is not done.  The ultimate output is in the form of an
1227 object file for each source file.
1229 By default, the object file name for a source file is made by replacing
1230 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1232 Unrecognized input files, not requiring compilation or assembly, are
1233 ignored.
1235 @item -S
1236 @opindex S
1237 Stop after the stage of compilation proper; do not assemble.  The output
1238 is in the form of an assembler code file for each non-assembler input
1239 file specified.
1241 By default, the assembler file name for a source file is made by
1242 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1244 Input files that don't require compilation are ignored.
1246 @item -E
1247 @opindex E
1248 Stop after the preprocessing stage; do not run the compiler proper.  The
1249 output is in the form of preprocessed source code, which is sent to the
1250 standard output.
1252 Input files that don't require preprocessing are ignored.
1254 @cindex output file option
1255 @item -o @var{file}
1256 @opindex o
1257 Place output in file @var{file}.  This applies to whatever
1258 sort of output is being produced, whether it be an executable file,
1259 an object file, an assembler file or preprocessed C code.
1261 If @option{-o} is not specified, the default is to put an executable
1262 file in @file{a.out}, the object file for
1263 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1264 assembler file in @file{@var{source}.s}, a precompiled header file in
1265 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1266 standard output.
1268 @item -v
1269 @opindex v
1270 Print (on standard error output) the commands executed to run the stages
1271 of compilation.  Also print the version number of the compiler driver
1272 program and of the preprocessor and the compiler proper.
1274 @item -###
1275 @opindex ###
1276 Like @option{-v} except the commands are not executed and arguments
1277 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1278 This is useful for shell scripts to capture the driver-generated command lines.
1280 @item -pipe
1281 @opindex pipe
1282 Use pipes rather than temporary files for communication between the
1283 various stages of compilation.  This fails to work on some systems where
1284 the assembler is unable to read from a pipe; but the GNU assembler has
1285 no trouble.
1287 @item --help
1288 @opindex help
1289 Print (on the standard output) a description of the command-line options
1290 understood by @command{gcc}.  If the @option{-v} option is also specified
1291 then @option{--help} is also passed on to the various processes
1292 invoked by @command{gcc}, so that they can display the command-line options
1293 they accept.  If the @option{-Wextra} option has also been specified
1294 (prior to the @option{--help} option), then command-line options that
1295 have no documentation associated with them are also displayed.
1297 @item --target-help
1298 @opindex target-help
1299 Print (on the standard output) a description of target-specific command-line
1300 options for each tool.  For some targets extra target-specific
1301 information may also be printed.
1303 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1304 Print (on the standard output) a description of the command-line
1305 options understood by the compiler that fit into all specified classes
1306 and qualifiers.  These are the supported classes:
1308 @table @asis
1309 @item @samp{optimizers}
1310 Display all of the optimization options supported by the
1311 compiler.
1313 @item @samp{warnings}
1314 Display all of the options controlling warning messages
1315 produced by the compiler.
1317 @item @samp{target}
1318 Display target-specific options.  Unlike the
1319 @option{--target-help} option however, target-specific options of the
1320 linker and assembler are not displayed.  This is because those
1321 tools do not currently support the extended @option{--help=} syntax.
1323 @item @samp{params}
1324 Display the values recognized by the @option{--param}
1325 option.
1327 @item @var{language}
1328 Display the options supported for @var{language}, where
1329 @var{language} is the name of one of the languages supported in this
1330 version of GCC@.
1332 @item @samp{common}
1333 Display the options that are common to all languages.
1334 @end table
1336 These are the supported qualifiers:
1338 @table @asis
1339 @item @samp{undocumented}
1340 Display only those options that are undocumented.
1342 @item @samp{joined}
1343 Display options taking an argument that appears after an equal
1344 sign in the same continuous piece of text, such as:
1345 @samp{--help=target}.
1347 @item @samp{separate}
1348 Display options taking an argument that appears as a separate word
1349 following the original option, such as: @samp{-o output-file}.
1350 @end table
1352 Thus for example to display all the undocumented target-specific
1353 switches supported by the compiler, use:
1355 @smallexample
1356 --help=target,undocumented
1357 @end smallexample
1359 The sense of a qualifier can be inverted by prefixing it with the
1360 @samp{^} character, so for example to display all binary warning
1361 options (i.e., ones that are either on or off and that do not take an
1362 argument) that have a description, use:
1364 @smallexample
1365 --help=warnings,^joined,^undocumented
1366 @end smallexample
1368 The argument to @option{--help=} should not consist solely of inverted
1369 qualifiers.
1371 Combining several classes is possible, although this usually
1372 restricts the output so much that there is nothing to display.  One
1373 case where it does work, however, is when one of the classes is
1374 @var{target}.  For example, to display all the target-specific
1375 optimization options, use:
1377 @smallexample
1378 --help=target,optimizers
1379 @end smallexample
1381 The @option{--help=} option can be repeated on the command line.  Each
1382 successive use displays its requested class of options, skipping
1383 those that have already been displayed.
1385 If the @option{-Q} option appears on the command line before the
1386 @option{--help=} option, then the descriptive text displayed by
1387 @option{--help=} is changed.  Instead of describing the displayed
1388 options, an indication is given as to whether the option is enabled,
1389 disabled or set to a specific value (assuming that the compiler
1390 knows this at the point where the @option{--help=} option is used).
1392 Here is a truncated example from the ARM port of @command{gcc}:
1394 @smallexample
1395   % gcc -Q -mabi=2 --help=target -c
1396   The following options are target specific:
1397   -mabi=                                2
1398   -mabort-on-noreturn                   [disabled]
1399   -mapcs                                [disabled]
1400 @end smallexample
1402 The output is sensitive to the effects of previous command-line
1403 options, so for example it is possible to find out which optimizations
1404 are enabled at @option{-O2} by using:
1406 @smallexample
1407 -Q -O2 --help=optimizers
1408 @end smallexample
1410 Alternatively you can discover which binary optimizations are enabled
1411 by @option{-O3} by using:
1413 @smallexample
1414 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1415 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1416 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1417 @end smallexample
1419 @item -no-canonical-prefixes
1420 @opindex no-canonical-prefixes
1421 Do not expand any symbolic links, resolve references to @samp{/../}
1422 or @samp{/./}, or make the path absolute when generating a relative
1423 prefix.
1425 @item --version
1426 @opindex version
1427 Display the version number and copyrights of the invoked GCC@.
1429 @item -wrapper
1430 @opindex wrapper
1431 Invoke all subcommands under a wrapper program.  The name of the
1432 wrapper program and its parameters are passed as a comma separated
1433 list.
1435 @smallexample
1436 gcc -c t.c -wrapper gdb,--args
1437 @end smallexample
1439 @noindent
1440 This invokes all subprograms of @command{gcc} under
1441 @samp{gdb --args}, thus the invocation of @command{cc1} is
1442 @samp{gdb --args cc1 @dots{}}.
1444 @item -fplugin=@var{name}.so
1445 Load the plugin code in file @var{name}.so, assumed to be a
1446 shared object to be dlopen'd by the compiler.  The base name of
1447 the shared object file is used to identify the plugin for the
1448 purposes of argument parsing (See
1449 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1450 Each plugin should define the callback functions specified in the
1451 Plugins API.
1453 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1454 Define an argument called @var{key} with a value of @var{value}
1455 for the plugin called @var{name}.
1457 @item -fdump-ada-spec@r{[}-slim@r{]}
1458 For C and C++ source and include files, generate corresponding Ada
1459 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1460 GNAT User's Guide}, which provides detailed documentation on this feature.
1462 @item -fdump-go-spec=@var{file}
1463 For input files in any language, generate corresponding Go
1464 declarations in @var{file}.  This generates Go @code{const},
1465 @code{type}, @code{var}, and @code{func} declarations which may be a
1466 useful way to start writing a Go interface to code written in some
1467 other language.
1469 @include @value{srcdir}/../libiberty/at-file.texi
1470 @end table
1472 @node Invoking G++
1473 @section Compiling C++ Programs
1475 @cindex suffixes for C++ source
1476 @cindex C++ source file suffixes
1477 C++ source files conventionally use one of the suffixes @samp{.C},
1478 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1479 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1480 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1481 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1482 files with these names and compiles them as C++ programs even if you
1483 call the compiler the same way as for compiling C programs (usually
1484 with the name @command{gcc}).
1486 @findex g++
1487 @findex c++
1488 However, the use of @command{gcc} does not add the C++ library.
1489 @command{g++} is a program that calls GCC and automatically specifies linking
1490 against the C++ library.  It treats @samp{.c},
1491 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1492 files unless @option{-x} is used.  This program is also useful when
1493 precompiling a C header file with a @samp{.h} extension for use in C++
1494 compilations.  On many systems, @command{g++} is also installed with
1495 the name @command{c++}.
1497 @cindex invoking @command{g++}
1498 When you compile C++ programs, you may specify many of the same
1499 command-line options that you use for compiling programs in any
1500 language; or command-line options meaningful for C and related
1501 languages; or options that are meaningful only for C++ programs.
1502 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1503 explanations of options for languages related to C@.
1504 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1505 explanations of options that are meaningful only for C++ programs.
1507 @node C Dialect Options
1508 @section Options Controlling C Dialect
1509 @cindex dialect options
1510 @cindex language dialect options
1511 @cindex options, dialect
1513 The following options control the dialect of C (or languages derived
1514 from C, such as C++, Objective-C and Objective-C++) that the compiler
1515 accepts:
1517 @table @gcctabopt
1518 @cindex ANSI support
1519 @cindex ISO support
1520 @item -ansi
1521 @opindex ansi
1522 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1523 equivalent to @option{-std=c++98}.
1525 This turns off certain features of GCC that are incompatible with ISO
1526 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1527 such as the @code{asm} and @code{typeof} keywords, and
1528 predefined macros such as @code{unix} and @code{vax} that identify the
1529 type of system you are using.  It also enables the undesirable and
1530 rarely used ISO trigraph feature.  For the C compiler,
1531 it disables recognition of C++ style @samp{//} comments as well as
1532 the @code{inline} keyword.
1534 The alternate keywords @code{__asm__}, @code{__extension__},
1535 @code{__inline__} and @code{__typeof__} continue to work despite
1536 @option{-ansi}.  You would not want to use them in an ISO C program, of
1537 course, but it is useful to put them in header files that might be included
1538 in compilations done with @option{-ansi}.  Alternate predefined macros
1539 such as @code{__unix__} and @code{__vax__} are also available, with or
1540 without @option{-ansi}.
1542 The @option{-ansi} option does not cause non-ISO programs to be
1543 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1544 addition to @option{-ansi}.  @xref{Warning Options}.
1546 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1547 option is used.  Some header files may notice this macro and refrain
1548 from declaring certain functions or defining certain macros that the
1549 ISO standard doesn't call for; this is to avoid interfering with any
1550 programs that might use these names for other things.
1552 Functions that are normally built in but do not have semantics
1553 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1554 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1555 built-in functions provided by GCC}, for details of the functions
1556 affected.
1558 @item -std=
1559 @opindex std
1560 Determine the language standard. @xref{Standards,,Language Standards
1561 Supported by GCC}, for details of these standard versions.  This option
1562 is currently only supported when compiling C or C++.
1564 The compiler can accept several base standards, such as @samp{c90} or
1565 @samp{c++98}, and GNU dialects of those standards, such as
1566 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1567 compiler accepts all programs following that standard plus those
1568 using GNU extensions that do not contradict it.  For example,
1569 @option{-std=c90} turns off certain features of GCC that are
1570 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1571 keywords, but not other GNU extensions that do not have a meaning in
1572 ISO C90, such as omitting the middle term of a @code{?:}
1573 expression. On the other hand, when a GNU dialect of a standard is
1574 specified, all features supported by the compiler are enabled, even when
1575 those features change the meaning of the base standard.  As a result, some
1576 strict-conforming programs may be rejected.  The particular standard
1577 is used by @option{-Wpedantic} to identify which features are GNU
1578 extensions given that version of the standard. For example
1579 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1580 comments, while @option{-std=gnu99 -Wpedantic} does not.
1582 A value for this option must be provided; possible values are
1584 @table @samp
1585 @item c90
1586 @itemx c89
1587 @itemx iso9899:1990
1588 Support all ISO C90 programs (certain GNU extensions that conflict
1589 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1591 @item iso9899:199409
1592 ISO C90 as modified in amendment 1.
1594 @item c99
1595 @itemx c9x
1596 @itemx iso9899:1999
1597 @itemx iso9899:199x
1598 ISO C99.  Note that this standard is not yet fully supported; see
1599 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1600 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1602 @item c11
1603 @itemx c1x
1604 @itemx iso9899:2011
1605 ISO C11, the 2011 revision of the ISO C standard.
1606 Support is incomplete and experimental.  The name @samp{c1x} is
1607 deprecated.
1609 @item gnu90
1610 @itemx gnu89
1611 GNU dialect of ISO C90 (including some C99 features). This
1612 is the default for C code.
1614 @item gnu99
1615 @itemx gnu9x
1616 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1617 this will become the default.  The name @samp{gnu9x} is deprecated.
1619 @item gnu11
1620 @itemx gnu1x
1621 GNU dialect of ISO C11.  Support is incomplete and experimental.  The
1622 name @samp{gnu1x} is deprecated.
1624 @item c++98
1625 @itemx c++03
1626 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1627 additional defect reports. Same as @option{-ansi} for C++ code.
1629 @item gnu++98
1630 @itemx gnu++03
1631 GNU dialect of @option{-std=c++98}.  This is the default for
1632 C++ code.
1634 @item c++11
1635 @itemx c++0x
1636 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1637 experimental, and may change in incompatible ways in future releases.
1638 The name @samp{c++0x} is deprecated.
1640 @item gnu++11
1641 @itemx gnu++0x
1642 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1643 experimental, and may change in incompatible ways in future releases.
1644 The name @samp{gnu++0x} is deprecated.
1646 @item c++1y
1647 The next revision of the ISO C++ standard, tentatively planned for
1648 2017.  Support is highly experimental, and will almost certainly
1649 change in incompatible ways in future releases.
1651 @item gnu++1y
1652 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1653 and will almost certainly change in incompatible ways in future
1654 releases.
1655 @end table
1657 @item -fgnu89-inline
1658 @opindex fgnu89-inline
1659 The option @option{-fgnu89-inline} tells GCC to use the traditional
1660 GNU semantics for @code{inline} functions when in C99 mode.
1661 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1662 is accepted and ignored by GCC versions 4.1.3 up to but not including
1663 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1664 C99 mode.  Using this option is roughly equivalent to adding the
1665 @code{gnu_inline} function attribute to all inline functions
1666 (@pxref{Function Attributes}).
1668 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1669 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1670 specifies the default behavior).  This option was first supported in
1671 GCC 4.3.  This option is not supported in @option{-std=c90} or
1672 @option{-std=gnu90} mode.
1674 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1675 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1676 in effect for @code{inline} functions.  @xref{Common Predefined
1677 Macros,,,cpp,The C Preprocessor}.
1679 @item -aux-info @var{filename}
1680 @opindex aux-info
1681 Output to the given filename prototyped declarations for all functions
1682 declared and/or defined in a translation unit, including those in header
1683 files.  This option is silently ignored in any language other than C@.
1685 Besides declarations, the file indicates, in comments, the origin of
1686 each declaration (source file and line), whether the declaration was
1687 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1688 @samp{O} for old, respectively, in the first character after the line
1689 number and the colon), and whether it came from a declaration or a
1690 definition (@samp{C} or @samp{F}, respectively, in the following
1691 character).  In the case of function definitions, a K&R-style list of
1692 arguments followed by their declarations is also provided, inside
1693 comments, after the declaration.
1695 @item -fallow-parameterless-variadic-functions
1696 Accept variadic functions without named parameters.
1698 Although it is possible to define such a function, this is not very
1699 useful as it is not possible to read the arguments.  This is only
1700 supported for C as this construct is allowed by C++.
1702 @item -fno-asm
1703 @opindex fno-asm
1704 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1705 keyword, so that code can use these words as identifiers.  You can use
1706 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1707 instead.  @option{-ansi} implies @option{-fno-asm}.
1709 In C++, this switch only affects the @code{typeof} keyword, since
1710 @code{asm} and @code{inline} are standard keywords.  You may want to
1711 use the @option{-fno-gnu-keywords} flag instead, which has the same
1712 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1713 switch only affects the @code{asm} and @code{typeof} keywords, since
1714 @code{inline} is a standard keyword in ISO C99.
1716 @item -fno-builtin
1717 @itemx -fno-builtin-@var{function}
1718 @opindex fno-builtin
1719 @cindex built-in functions
1720 Don't recognize built-in functions that do not begin with
1721 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1722 functions provided by GCC}, for details of the functions affected,
1723 including those which are not built-in functions when @option{-ansi} or
1724 @option{-std} options for strict ISO C conformance are used because they
1725 do not have an ISO standard meaning.
1727 GCC normally generates special code to handle certain built-in functions
1728 more efficiently; for instance, calls to @code{alloca} may become single
1729 instructions which adjust the stack directly, and calls to @code{memcpy}
1730 may become inline copy loops.  The resulting code is often both smaller
1731 and faster, but since the function calls no longer appear as such, you
1732 cannot set a breakpoint on those calls, nor can you change the behavior
1733 of the functions by linking with a different library.  In addition,
1734 when a function is recognized as a built-in function, GCC may use
1735 information about that function to warn about problems with calls to
1736 that function, or to generate more efficient code, even if the
1737 resulting code still contains calls to that function.  For example,
1738 warnings are given with @option{-Wformat} for bad calls to
1739 @code{printf} when @code{printf} is built in and @code{strlen} is
1740 known not to modify global memory.
1742 With the @option{-fno-builtin-@var{function}} option
1743 only the built-in function @var{function} is
1744 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1745 function is named that is not built-in in this version of GCC, this
1746 option is ignored.  There is no corresponding
1747 @option{-fbuiltin-@var{function}} option; if you wish to enable
1748 built-in functions selectively when using @option{-fno-builtin} or
1749 @option{-ffreestanding}, you may define macros such as:
1751 @smallexample
1752 #define abs(n)          __builtin_abs ((n))
1753 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1754 @end smallexample
1756 @item -fhosted
1757 @opindex fhosted
1758 @cindex hosted environment
1760 Assert that compilation targets a hosted environment.  This implies
1761 @option{-fbuiltin}.  A hosted environment is one in which the
1762 entire standard library is available, and in which @code{main} has a return
1763 type of @code{int}.  Examples are nearly everything except a kernel.
1764 This is equivalent to @option{-fno-freestanding}.
1766 @item -ffreestanding
1767 @opindex ffreestanding
1768 @cindex hosted environment
1770 Assert that compilation targets a freestanding environment.  This
1771 implies @option{-fno-builtin}.  A freestanding environment
1772 is one in which the standard library may not exist, and program startup may
1773 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1774 This is equivalent to @option{-fno-hosted}.
1776 @xref{Standards,,Language Standards Supported by GCC}, for details of
1777 freestanding and hosted environments.
1779 @item -fopenmp
1780 @opindex fopenmp
1781 @cindex OpenMP parallel
1782 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1783 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1784 compiler generates parallel code according to the OpenMP Application
1785 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1786 implies @option{-pthread}, and thus is only supported on targets that
1787 have support for @option{-pthread}.
1789 @item -fgnu-tm
1790 @opindex fgnu-tm
1791 When the option @option{-fgnu-tm} is specified, the compiler
1792 generates code for the Linux variant of Intel's current Transactional
1793 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1794 an experimental feature whose interface may change in future versions
1795 of GCC, as the official specification changes.  Please note that not
1796 all architectures are supported for this feature.
1798 For more information on GCC's support for transactional memory,
1799 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1800 Transactional Memory Library}.
1802 Note that the transactional memory feature is not supported with
1803 non-call exceptions (@option{-fnon-call-exceptions}).
1805 @item -fms-extensions
1806 @opindex fms-extensions
1807 Accept some non-standard constructs used in Microsoft header files.
1809 In C++ code, this allows member names in structures to be similar
1810 to previous types declarations.
1812 @smallexample
1813 typedef int UOW;
1814 struct ABC @{
1815   UOW UOW;
1817 @end smallexample
1819 Some cases of unnamed fields in structures and unions are only
1820 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1821 fields within structs/unions}, for details.
1823 @item -fplan9-extensions
1824 Accept some non-standard constructs used in Plan 9 code.
1826 This enables @option{-fms-extensions}, permits passing pointers to
1827 structures with anonymous fields to functions that expect pointers to
1828 elements of the type of the field, and permits referring to anonymous
1829 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1830 struct/union fields within structs/unions}, for details.  This is only
1831 supported for C, not C++.
1833 @item -trigraphs
1834 @opindex trigraphs
1835 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1836 options for strict ISO C conformance) implies @option{-trigraphs}.
1838 @cindex traditional C language
1839 @cindex C language, traditional
1840 @item -traditional
1841 @itemx -traditional-cpp
1842 @opindex traditional-cpp
1843 @opindex traditional
1844 Formerly, these options caused GCC to attempt to emulate a pre-standard
1845 C compiler.  They are now only supported with the @option{-E} switch.
1846 The preprocessor continues to support a pre-standard mode.  See the GNU
1847 CPP manual for details.
1849 @item -fcond-mismatch
1850 @opindex fcond-mismatch
1851 Allow conditional expressions with mismatched types in the second and
1852 third arguments.  The value of such an expression is void.  This option
1853 is not supported for C++.
1855 @item -flax-vector-conversions
1856 @opindex flax-vector-conversions
1857 Allow implicit conversions between vectors with differing numbers of
1858 elements and/or incompatible element types.  This option should not be
1859 used for new code.
1861 @item -funsigned-char
1862 @opindex funsigned-char
1863 Let the type @code{char} be unsigned, like @code{unsigned char}.
1865 Each kind of machine has a default for what @code{char} should
1866 be.  It is either like @code{unsigned char} by default or like
1867 @code{signed char} by default.
1869 Ideally, a portable program should always use @code{signed char} or
1870 @code{unsigned char} when it depends on the signedness of an object.
1871 But many programs have been written to use plain @code{char} and
1872 expect it to be signed, or expect it to be unsigned, depending on the
1873 machines they were written for.  This option, and its inverse, let you
1874 make such a program work with the opposite default.
1876 The type @code{char} is always a distinct type from each of
1877 @code{signed char} or @code{unsigned char}, even though its behavior
1878 is always just like one of those two.
1880 @item -fsigned-char
1881 @opindex fsigned-char
1882 Let the type @code{char} be signed, like @code{signed char}.
1884 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1885 the negative form of @option{-funsigned-char}.  Likewise, the option
1886 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1888 @item -fsigned-bitfields
1889 @itemx -funsigned-bitfields
1890 @itemx -fno-signed-bitfields
1891 @itemx -fno-unsigned-bitfields
1892 @opindex fsigned-bitfields
1893 @opindex funsigned-bitfields
1894 @opindex fno-signed-bitfields
1895 @opindex fno-unsigned-bitfields
1896 These options control whether a bit-field is signed or unsigned, when the
1897 declaration does not use either @code{signed} or @code{unsigned}.  By
1898 default, such a bit-field is signed, because this is consistent: the
1899 basic integer types such as @code{int} are signed types.
1900 @end table
1902 @node C++ Dialect Options
1903 @section Options Controlling C++ Dialect
1905 @cindex compiler options, C++
1906 @cindex C++ options, command-line
1907 @cindex options, C++
1908 This section describes the command-line options that are only meaningful
1909 for C++ programs.  You can also use most of the GNU compiler options
1910 regardless of what language your program is in.  For example, you
1911 might compile a file @code{firstClass.C} like this:
1913 @smallexample
1914 g++ -g -frepo -O -c firstClass.C
1915 @end smallexample
1917 @noindent
1918 In this example, only @option{-frepo} is an option meant
1919 only for C++ programs; you can use the other options with any
1920 language supported by GCC@.
1922 Here is a list of options that are @emph{only} for compiling C++ programs:
1924 @table @gcctabopt
1926 @item -fabi-version=@var{n}
1927 @opindex fabi-version
1928 Use version @var{n} of the C++ ABI@.  The default is version 2.
1930 Version 0 refers to the version conforming most closely to
1931 the C++ ABI specification.  Therefore, the ABI obtained using version 0
1932 will change in different versions of G++ as ABI bugs are fixed.
1934 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
1936 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.  
1938 Version 3 corrects an error in mangling a constant address as a
1939 template argument.
1941 Version 4, which first appeared in G++ 4.5, implements a standard
1942 mangling for vector types.
1944 Version 5, which first appeared in G++ 4.6, corrects the mangling of
1945 attribute const/volatile on function pointer types, decltype of a
1946 plain decl, and use of a function parameter in the declaration of
1947 another parameter.
1949 Version 6, which first appeared in G++ 4.7, corrects the promotion
1950 behavior of C++11 scoped enums and the mangling of template argument
1951 packs, const/static_cast, prefix ++ and --, and a class scope function
1952 used as a template argument.
1954 See also @option{-Wabi}.
1956 @item -fno-access-control
1957 @opindex fno-access-control
1958 Turn off all access checking.  This switch is mainly useful for working
1959 around bugs in the access control code.
1961 @item -fcheck-new
1962 @opindex fcheck-new
1963 Check that the pointer returned by @code{operator new} is non-null
1964 before attempting to modify the storage allocated.  This check is
1965 normally unnecessary because the C++ standard specifies that
1966 @code{operator new} only returns @code{0} if it is declared
1967 @samp{throw()}, in which case the compiler always checks the
1968 return value even without this option.  In all other cases, when
1969 @code{operator new} has a non-empty exception specification, memory
1970 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1971 @samp{new (nothrow)}.
1973 @item -fconstexpr-depth=@var{n}
1974 @opindex fconstexpr-depth
1975 Set the maximum nested evaluation depth for C++11 constexpr functions
1976 to @var{n}.  A limit is needed to detect endless recursion during
1977 constant expression evaluation.  The minimum specified by the standard
1978 is 512.
1980 @item -fdeduce-init-list
1981 @opindex fdeduce-init-list
1982 Enable deduction of a template type parameter as
1983 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
1985 @smallexample
1986 template <class T> auto forward(T t) -> decltype (realfn (t))
1988   return realfn (t);
1991 void f()
1993   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1995 @end smallexample
1997 This deduction was implemented as a possible extension to the
1998 originally proposed semantics for the C++11 standard, but was not part
1999 of the final standard, so it is disabled by default.  This option is
2000 deprecated, and may be removed in a future version of G++.
2002 @item -ffriend-injection
2003 @opindex ffriend-injection
2004 Inject friend functions into the enclosing namespace, so that they are
2005 visible outside the scope of the class in which they are declared.
2006 Friend functions were documented to work this way in the old Annotated
2007 C++ Reference Manual, and versions of G++ before 4.1 always worked
2008 that way.  However, in ISO C++ a friend function that is not declared
2009 in an enclosing scope can only be found using argument dependent
2010 lookup.  This option causes friends to be injected as they were in
2011 earlier releases.
2013 This option is for compatibility, and may be removed in a future
2014 release of G++.
2016 @item -fno-elide-constructors
2017 @opindex fno-elide-constructors
2018 The C++ standard allows an implementation to omit creating a temporary
2019 that is only used to initialize another object of the same type.
2020 Specifying this option disables that optimization, and forces G++ to
2021 call the copy constructor in all cases.
2023 @item -fno-enforce-eh-specs
2024 @opindex fno-enforce-eh-specs
2025 Don't generate code to check for violation of exception specifications
2026 at run time.  This option violates the C++ standard, but may be useful
2027 for reducing code size in production builds, much like defining
2028 @samp{NDEBUG}.  This does not give user code permission to throw
2029 exceptions in violation of the exception specifications; the compiler
2030 still optimizes based on the specifications, so throwing an
2031 unexpected exception results in undefined behavior at run time.
2033 @item -ffor-scope
2034 @itemx -fno-for-scope
2035 @opindex ffor-scope
2036 @opindex fno-for-scope
2037 If @option{-ffor-scope} is specified, the scope of variables declared in
2038 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2039 as specified by the C++ standard.
2040 If @option{-fno-for-scope} is specified, the scope of variables declared in
2041 a @i{for-init-statement} extends to the end of the enclosing scope,
2042 as was the case in old versions of G++, and other (traditional)
2043 implementations of C++.
2045 If neither flag is given, the default is to follow the standard,
2046 but to allow and give a warning for old-style code that would
2047 otherwise be invalid, or have different behavior.
2049 @item -fno-gnu-keywords
2050 @opindex fno-gnu-keywords
2051 Do not recognize @code{typeof} as a keyword, so that code can use this
2052 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2053 @option{-ansi} implies @option{-fno-gnu-keywords}.
2055 @item -fno-implicit-templates
2056 @opindex fno-implicit-templates
2057 Never emit code for non-inline templates that are instantiated
2058 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2059 @xref{Template Instantiation}, for more information.
2061 @item -fno-implicit-inline-templates
2062 @opindex fno-implicit-inline-templates
2063 Don't emit code for implicit instantiations of inline templates, either.
2064 The default is to handle inlines differently so that compiles with and
2065 without optimization need the same set of explicit instantiations.
2067 @item -fno-implement-inlines
2068 @opindex fno-implement-inlines
2069 To save space, do not emit out-of-line copies of inline functions
2070 controlled by @samp{#pragma implementation}.  This causes linker
2071 errors if these functions are not inlined everywhere they are called.
2073 @item -fms-extensions
2074 @opindex fms-extensions
2075 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2076 int and getting a pointer to member function via non-standard syntax.
2078 @item -fno-nonansi-builtins
2079 @opindex fno-nonansi-builtins
2080 Disable built-in declarations of functions that are not mandated by
2081 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2082 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2084 @item -fnothrow-opt
2085 @opindex fnothrow-opt
2086 Treat a @code{throw()} exception specification as if it were a
2087 @code{noexcept} specification to reduce or eliminate the text size
2088 overhead relative to a function with no exception specification.  If
2089 the function has local variables of types with non-trivial
2090 destructors, the exception specification actually makes the
2091 function smaller because the EH cleanups for those variables can be
2092 optimized away.  The semantic effect is that an exception thrown out of
2093 a function with such an exception specification results in a call
2094 to @code{terminate} rather than @code{unexpected}.
2096 @item -fno-operator-names
2097 @opindex fno-operator-names
2098 Do not treat the operator name keywords @code{and}, @code{bitand},
2099 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2100 synonyms as keywords.
2102 @item -fno-optional-diags
2103 @opindex fno-optional-diags
2104 Disable diagnostics that the standard says a compiler does not need to
2105 issue.  Currently, the only such diagnostic issued by G++ is the one for
2106 a name having multiple meanings within a class.
2108 @item -fpermissive
2109 @opindex fpermissive
2110 Downgrade some diagnostics about nonconformant code from errors to
2111 warnings.  Thus, using @option{-fpermissive} allows some
2112 nonconforming code to compile.
2114 @item -fno-pretty-templates
2115 @opindex fno-pretty-templates
2116 When an error message refers to a specialization of a function
2117 template, the compiler normally prints the signature of the
2118 template followed by the template arguments and any typedefs or
2119 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2120 rather than @code{void f(int)}) so that it's clear which template is
2121 involved.  When an error message refers to a specialization of a class
2122 template, the compiler omits any template arguments that match
2123 the default template arguments for that template.  If either of these
2124 behaviors make it harder to understand the error message rather than
2125 easier, you can use @option{-fno-pretty-templates} to disable them.
2127 @item -frepo
2128 @opindex frepo
2129 Enable automatic template instantiation at link time.  This option also
2130 implies @option{-fno-implicit-templates}.  @xref{Template
2131 Instantiation}, for more information.
2133 @item -fno-rtti
2134 @opindex fno-rtti
2135 Disable generation of information about every class with virtual
2136 functions for use by the C++ run-time type identification features
2137 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2138 of the language, you can save some space by using this flag.  Note that
2139 exception handling uses the same information, but G++ generates it as
2140 needed. The @samp{dynamic_cast} operator can still be used for casts that
2141 do not require run-time type information, i.e.@: casts to @code{void *} or to
2142 unambiguous base classes.
2144 @item -fstats
2145 @opindex fstats
2146 Emit statistics about front-end processing at the end of the compilation.
2147 This information is generally only useful to the G++ development team.
2149 @item -fstrict-enums
2150 @opindex fstrict-enums
2151 Allow the compiler to optimize using the assumption that a value of
2152 enumerated type can only be one of the values of the enumeration (as
2153 defined in the C++ standard; basically, a value that can be
2154 represented in the minimum number of bits needed to represent all the
2155 enumerators).  This assumption may not be valid if the program uses a
2156 cast to convert an arbitrary integer value to the enumerated type.
2158 @item -ftemplate-backtrace-limit=@var{n}
2159 @opindex ftemplate-backtrace-limit
2160 Set the maximum number of template instantiation notes for a single
2161 warning or error to @var{n}.  The default value is 10.
2163 @item -ftemplate-depth=@var{n}
2164 @opindex ftemplate-depth
2165 Set the maximum instantiation depth for template classes to @var{n}.
2166 A limit on the template instantiation depth is needed to detect
2167 endless recursions during template class instantiation.  ANSI/ISO C++
2168 conforming programs must not rely on a maximum depth greater than 17
2169 (changed to 1024 in C++11).  The default value is 900, as the compiler
2170 can run out of stack space before hitting 1024 in some situations.
2172 @item -fno-threadsafe-statics
2173 @opindex fno-threadsafe-statics
2174 Do not emit the extra code to use the routines specified in the C++
2175 ABI for thread-safe initialization of local statics.  You can use this
2176 option to reduce code size slightly in code that doesn't need to be
2177 thread-safe.
2179 @item -fuse-cxa-atexit
2180 @opindex fuse-cxa-atexit
2181 Register destructors for objects with static storage duration with the
2182 @code{__cxa_atexit} function rather than the @code{atexit} function.
2183 This option is required for fully standards-compliant handling of static
2184 destructors, but only works if your C library supports
2185 @code{__cxa_atexit}.
2187 @item -fno-use-cxa-get-exception-ptr
2188 @opindex fno-use-cxa-get-exception-ptr
2189 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2190 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2191 if the runtime routine is not available.
2193 @item -fvisibility-inlines-hidden
2194 @opindex fvisibility-inlines-hidden
2195 This switch declares that the user does not attempt to compare
2196 pointers to inline functions or methods where the addresses of the two functions
2197 are taken in different shared objects.
2199 The effect of this is that GCC may, effectively, mark inline methods with
2200 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2201 appear in the export table of a DSO and do not require a PLT indirection
2202 when used within the DSO@.  Enabling this option can have a dramatic effect
2203 on load and link times of a DSO as it massively reduces the size of the
2204 dynamic export table when the library makes heavy use of templates.
2206 The behavior of this switch is not quite the same as marking the
2207 methods as hidden directly, because it does not affect static variables
2208 local to the function or cause the compiler to deduce that
2209 the function is defined in only one shared object.
2211 You may mark a method as having a visibility explicitly to negate the
2212 effect of the switch for that method.  For example, if you do want to
2213 compare pointers to a particular inline method, you might mark it as
2214 having default visibility.  Marking the enclosing class with explicit
2215 visibility has no effect.
2217 Explicitly instantiated inline methods are unaffected by this option
2218 as their linkage might otherwise cross a shared library boundary.
2219 @xref{Template Instantiation}.
2221 @item -fvisibility-ms-compat
2222 @opindex fvisibility-ms-compat
2223 This flag attempts to use visibility settings to make GCC's C++
2224 linkage model compatible with that of Microsoft Visual Studio.
2226 The flag makes these changes to GCC's linkage model:
2228 @enumerate
2229 @item
2230 It sets the default visibility to @code{hidden}, like
2231 @option{-fvisibility=hidden}.
2233 @item
2234 Types, but not their members, are not hidden by default.
2236 @item
2237 The One Definition Rule is relaxed for types without explicit
2238 visibility specifications that are defined in more than one
2239 shared object: those declarations are permitted if they are
2240 permitted when this option is not used.
2241 @end enumerate
2243 In new code it is better to use @option{-fvisibility=hidden} and
2244 export those classes that are intended to be externally visible.
2245 Unfortunately it is possible for code to rely, perhaps accidentally,
2246 on the Visual Studio behavior.
2248 Among the consequences of these changes are that static data members
2249 of the same type with the same name but defined in different shared
2250 objects are different, so changing one does not change the other;
2251 and that pointers to function members defined in different shared
2252 objects may not compare equal.  When this flag is given, it is a
2253 violation of the ODR to define types with the same name differently.
2255 @item -fno-weak
2256 @opindex fno-weak
2257 Do not use weak symbol support, even if it is provided by the linker.
2258 By default, G++ uses weak symbols if they are available.  This
2259 option exists only for testing, and should not be used by end-users;
2260 it results in inferior code and has no benefits.  This option may
2261 be removed in a future release of G++.
2263 @item -nostdinc++
2264 @opindex nostdinc++
2265 Do not search for header files in the standard directories specific to
2266 C++, but do still search the other standard directories.  (This option
2267 is used when building the C++ library.)
2268 @end table
2270 In addition, these optimization, warning, and code generation options
2271 have meanings only for C++ programs:
2273 @table @gcctabopt
2274 @item -fno-default-inline
2275 @opindex fno-default-inline
2276 Do not assume @samp{inline} for functions defined inside a class scope.
2277 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2278 functions have linkage like inline functions; they just aren't
2279 inlined by default.
2281 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2282 @opindex Wabi
2283 @opindex Wno-abi
2284 Warn when G++ generates code that is probably not compatible with the
2285 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2286 all such cases, there are probably some cases that are not warned about,
2287 even though G++ is generating incompatible code.  There may also be
2288 cases where warnings are emitted even though the code that is generated
2289 is compatible.
2291 You should rewrite your code to avoid these warnings if you are
2292 concerned about the fact that code generated by G++ may not be binary
2293 compatible with code generated by other compilers.
2295 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2297 @itemize @bullet
2299 @item
2300 A template with a non-type template parameter of reference type is
2301 mangled incorrectly:
2302 @smallexample
2303 extern int N;
2304 template <int &> struct S @{@};
2305 void n (S<N>) @{2@}
2306 @end smallexample
2308 This is fixed in @option{-fabi-version=3}.
2310 @item
2311 SIMD vector types declared using @code{__attribute ((vector_size))} are
2312 mangled in a non-standard way that does not allow for overloading of
2313 functions taking vectors of different sizes.
2315 The mangling is changed in @option{-fabi-version=4}.
2316 @end itemize
2318 The known incompatibilities in @option{-fabi-version=1} include:
2320 @itemize @bullet
2322 @item
2323 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2324 pack data into the same byte as a base class.  For example:
2326 @smallexample
2327 struct A @{ virtual void f(); int f1 : 1; @};
2328 struct B : public A @{ int f2 : 1; @};
2329 @end smallexample
2331 @noindent
2332 In this case, G++ places @code{B::f2} into the same byte
2333 as @code{A::f1}; other compilers do not.  You can avoid this problem
2334 by explicitly padding @code{A} so that its size is a multiple of the
2335 byte size on your platform; that causes G++ and other compilers to
2336 lay out @code{B} identically.
2338 @item
2339 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2340 tail padding when laying out virtual bases.  For example:
2342 @smallexample
2343 struct A @{ virtual void f(); char c1; @};
2344 struct B @{ B(); char c2; @};
2345 struct C : public A, public virtual B @{@};
2346 @end smallexample
2348 @noindent
2349 In this case, G++ does not place @code{B} into the tail-padding for
2350 @code{A}; other compilers do.  You can avoid this problem by
2351 explicitly padding @code{A} so that its size is a multiple of its
2352 alignment (ignoring virtual base classes); that causes G++ and other
2353 compilers to lay out @code{C} identically.
2355 @item
2356 Incorrect handling of bit-fields with declared widths greater than that
2357 of their underlying types, when the bit-fields appear in a union.  For
2358 example:
2360 @smallexample
2361 union U @{ int i : 4096; @};
2362 @end smallexample
2364 @noindent
2365 Assuming that an @code{int} does not have 4096 bits, G++ makes the
2366 union too small by the number of bits in an @code{int}.
2368 @item
2369 Empty classes can be placed at incorrect offsets.  For example:
2371 @smallexample
2372 struct A @{@};
2374 struct B @{
2375   A a;
2376   virtual void f ();
2379 struct C : public B, public A @{@};
2380 @end smallexample
2382 @noindent
2383 G++ places the @code{A} base class of @code{C} at a nonzero offset;
2384 it should be placed at offset zero.  G++ mistakenly believes that the
2385 @code{A} data member of @code{B} is already at offset zero.
2387 @item
2388 Names of template functions whose types involve @code{typename} or
2389 template template parameters can be mangled incorrectly.
2391 @smallexample
2392 template <typename Q>
2393 void f(typename Q::X) @{@}
2395 template <template <typename> class Q>
2396 void f(typename Q<int>::X) @{@}
2397 @end smallexample
2399 @noindent
2400 Instantiations of these templates may be mangled incorrectly.
2402 @end itemize
2404 It also warns about psABI-related changes.  The known psABI changes at this
2405 point include:
2407 @itemize @bullet
2409 @item
2410 For SysV/x86-64, unions with @code{long double} members are 
2411 passed in memory as specified in psABI.  For example:
2413 @smallexample
2414 union U @{
2415   long double ld;
2416   int i;
2418 @end smallexample
2420 @noindent
2421 @code{union U} is always passed in memory.
2423 @end itemize
2425 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2426 @opindex Wctor-dtor-privacy
2427 @opindex Wno-ctor-dtor-privacy
2428 Warn when a class seems unusable because all the constructors or
2429 destructors in that class are private, and it has neither friends nor
2430 public static member functions.
2432 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2433 @opindex Wdelete-non-virtual-dtor
2434 @opindex Wno-delete-non-virtual-dtor
2435 Warn when @samp{delete} is used to destroy an instance of a class that
2436 has virtual functions and non-virtual destructor. It is unsafe to delete
2437 an instance of a derived class through a pointer to a base class if the
2438 base class does not have a virtual destructor.  This warning is enabled
2439 by @option{-Wall}.
2441 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2442 @opindex Wliteral-suffix
2443 @opindex Wno-literal-suffix
2444 Warn when a string or character literal is followed by a ud-suffix which does
2445 not begin with an underscore.  As a conforming extension, GCC treats such
2446 suffixes as separate preprocessing tokens in order to maintain backwards
2447 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2448 For example:
2450 @smallexample
2451 #define __STDC_FORMAT_MACROS
2452 #include <inttypes.h>
2453 #include <stdio.h>
2455 int main() @{
2456   int64_t i64 = 123;
2457   printf("My int64: %"PRId64"\n", i64);
2459 @end smallexample
2461 In this case, @code{PRId64} is treated as a separate preprocessing token.
2463 This warning is enabled by default.
2465 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2466 @opindex Wnarrowing
2467 @opindex Wno-narrowing
2468 Warn when a narrowing conversion prohibited by C++11 occurs within
2469 @samp{@{ @}}, e.g.
2471 @smallexample
2472 int i = @{ 2.2 @}; // error: narrowing from double to int
2473 @end smallexample
2475 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2477 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2478 required by the standard.  Note that this does not affect the meaning
2479 of well-formed code; narrowing conversions are still considered
2480 ill-formed in SFINAE context.
2482 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2483 @opindex Wnoexcept
2484 @opindex Wno-noexcept
2485 Warn when a noexcept-expression evaluates to false because of a call
2486 to a function that does not have a non-throwing exception
2487 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2488 the compiler to never throw an exception.
2490 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2491 @opindex Wnon-virtual-dtor
2492 @opindex Wno-non-virtual-dtor
2493 Warn when a class has virtual functions and an accessible non-virtual
2494 destructor, in which case it is possible but unsafe to delete
2495 an instance of a derived class through a pointer to the base class.
2496 This warning is also enabled if @option{-Weffc++} is specified.
2498 @item -Wreorder @r{(C++ and Objective-C++ only)}
2499 @opindex Wreorder
2500 @opindex Wno-reorder
2501 @cindex reordering, warning
2502 @cindex warning for reordering of member initializers
2503 Warn when the order of member initializers given in the code does not
2504 match the order in which they must be executed.  For instance:
2506 @smallexample
2507 struct A @{
2508   int i;
2509   int j;
2510   A(): j (0), i (1) @{ @}
2512 @end smallexample
2514 @noindent
2515 The compiler rearranges the member initializers for @samp{i}
2516 and @samp{j} to match the declaration order of the members, emitting
2517 a warning to that effect.  This warning is enabled by @option{-Wall}.
2518 @end table
2520 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2522 @table @gcctabopt
2523 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2524 @opindex Weffc++
2525 @opindex Wno-effc++
2526 Warn about violations of the following style guidelines from Scott Meyers'
2527 @cite{Effective C++, Second Edition} book:
2529 @itemize @bullet
2530 @item
2531 Item 11:  Define a copy constructor and an assignment operator for classes
2532 with dynamically-allocated memory.
2534 @item
2535 Item 12:  Prefer initialization to assignment in constructors.
2537 @item
2538 Item 14:  Make destructors virtual in base classes.
2540 @item
2541 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2543 @item
2544 Item 23:  Don't try to return a reference when you must return an object.
2546 @end itemize
2548 Also warn about violations of the following style guidelines from
2549 Scott Meyers' @cite{More Effective C++} book:
2551 @itemize @bullet
2552 @item
2553 Item 6:  Distinguish between prefix and postfix forms of increment and
2554 decrement operators.
2556 @item
2557 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2559 @end itemize
2561 When selecting this option, be aware that the standard library
2562 headers do not obey all of these guidelines; use @samp{grep -v}
2563 to filter out those warnings.
2565 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2566 @opindex Wstrict-null-sentinel
2567 @opindex Wno-strict-null-sentinel
2568 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2569 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2570 to @code{__null}.  Although it is a null pointer constant rather than a
2571 null pointer, it is guaranteed to be of the same size as a pointer.
2572 But this use is not portable across different compilers.
2574 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2575 @opindex Wno-non-template-friend
2576 @opindex Wnon-template-friend
2577 Disable warnings when non-templatized friend functions are declared
2578 within a template.  Since the advent of explicit template specification
2579 support in G++, if the name of the friend is an unqualified-id (i.e.,
2580 @samp{friend foo(int)}), the C++ language specification demands that the
2581 friend declare or define an ordinary, nontemplate function.  (Section
2582 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2583 could be interpreted as a particular specialization of a templatized
2584 function.  Because this non-conforming behavior is no longer the default
2585 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2586 check existing code for potential trouble spots and is on by default.
2587 This new compiler behavior can be turned off with
2588 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2589 but disables the helpful warning.
2591 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2592 @opindex Wold-style-cast
2593 @opindex Wno-old-style-cast
2594 Warn if an old-style (C-style) cast to a non-void type is used within
2595 a C++ program.  The new-style casts (@samp{dynamic_cast},
2596 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2597 less vulnerable to unintended effects and much easier to search for.
2599 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2600 @opindex Woverloaded-virtual
2601 @opindex Wno-overloaded-virtual
2602 @cindex overloaded virtual function, warning
2603 @cindex warning for overloaded virtual function
2604 Warn when a function declaration hides virtual functions from a
2605 base class.  For example, in:
2607 @smallexample
2608 struct A @{
2609   virtual void f();
2612 struct B: public A @{
2613   void f(int);
2615 @end smallexample
2617 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2618 like:
2620 @smallexample
2621 B* b;
2622 b->f();
2623 @end smallexample
2625 @noindent
2626 fails to compile.
2628 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2629 @opindex Wno-pmf-conversions
2630 @opindex Wpmf-conversions
2631 Disable the diagnostic for converting a bound pointer to member function
2632 to a plain pointer.
2634 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2635 @opindex Wsign-promo
2636 @opindex Wno-sign-promo
2637 Warn when overload resolution chooses a promotion from unsigned or
2638 enumerated type to a signed type, over a conversion to an unsigned type of
2639 the same size.  Previous versions of G++ tried to preserve
2640 unsignedness, but the standard mandates the current behavior.
2642 @smallexample
2643 struct A @{
2644   operator int ();
2645   A& operator = (int);
2648 main ()
2650   A a,b;
2651   a = b;
2653 @end smallexample
2655 @noindent
2656 In this example, G++ synthesizes a default @samp{A& operator =
2657 (const A&);}, while cfront uses the user-defined @samp{operator =}.
2658 @end table
2660 @node Objective-C and Objective-C++ Dialect Options
2661 @section Options Controlling Objective-C and Objective-C++ Dialects
2663 @cindex compiler options, Objective-C and Objective-C++
2664 @cindex Objective-C and Objective-C++ options, command-line
2665 @cindex options, Objective-C and Objective-C++
2666 (NOTE: This manual does not describe the Objective-C and Objective-C++
2667 languages themselves.  @xref{Standards,,Language Standards
2668 Supported by GCC}, for references.)
2670 This section describes the command-line options that are only meaningful
2671 for Objective-C and Objective-C++ programs.  You can also use most of
2672 the language-independent GNU compiler options.
2673 For example, you might compile a file @code{some_class.m} like this:
2675 @smallexample
2676 gcc -g -fgnu-runtime -O -c some_class.m
2677 @end smallexample
2679 @noindent
2680 In this example, @option{-fgnu-runtime} is an option meant only for
2681 Objective-C and Objective-C++ programs; you can use the other options with
2682 any language supported by GCC@.
2684 Note that since Objective-C is an extension of the C language, Objective-C
2685 compilations may also use options specific to the C front-end (e.g.,
2686 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2687 C++-specific options (e.g., @option{-Wabi}).
2689 Here is a list of options that are @emph{only} for compiling Objective-C
2690 and Objective-C++ programs:
2692 @table @gcctabopt
2693 @item -fconstant-string-class=@var{class-name}
2694 @opindex fconstant-string-class
2695 Use @var{class-name} as the name of the class to instantiate for each
2696 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2697 class name is @code{NXConstantString} if the GNU runtime is being used, and
2698 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2699 @option{-fconstant-cfstrings} option, if also present, overrides the
2700 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2701 to be laid out as constant CoreFoundation strings.
2703 @item -fgnu-runtime
2704 @opindex fgnu-runtime
2705 Generate object code compatible with the standard GNU Objective-C
2706 runtime.  This is the default for most types of systems.
2708 @item -fnext-runtime
2709 @opindex fnext-runtime
2710 Generate output compatible with the NeXT runtime.  This is the default
2711 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2712 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2713 used.
2715 @item -fno-nil-receivers
2716 @opindex fno-nil-receivers
2717 Assume that all Objective-C message dispatches (@code{[receiver
2718 message:arg]}) in this translation unit ensure that the receiver is
2719 not @code{nil}.  This allows for more efficient entry points in the
2720 runtime to be used.  This option is only available in conjunction with
2721 the NeXT runtime and ABI version 0 or 1.
2723 @item -fobjc-abi-version=@var{n}
2724 @opindex fobjc-abi-version
2725 Use version @var{n} of the Objective-C ABI for the selected runtime.
2726 This option is currently supported only for the NeXT runtime.  In that
2727 case, Version 0 is the traditional (32-bit) ABI without support for
2728 properties and other Objective-C 2.0 additions.  Version 1 is the
2729 traditional (32-bit) ABI with support for properties and other
2730 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2731 nothing is specified, the default is Version 0 on 32-bit target
2732 machines, and Version 2 on 64-bit target machines.
2734 @item -fobjc-call-cxx-cdtors
2735 @opindex fobjc-call-cxx-cdtors
2736 For each Objective-C class, check if any of its instance variables is a
2737 C++ object with a non-trivial default constructor.  If so, synthesize a
2738 special @code{- (id) .cxx_construct} instance method which runs
2739 non-trivial default constructors on any such instance variables, in order,
2740 and then return @code{self}.  Similarly, check if any instance variable
2741 is a C++ object with a non-trivial destructor, and if so, synthesize a
2742 special @code{- (void) .cxx_destruct} method which runs
2743 all such default destructors, in reverse order.
2745 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2746 methods thusly generated only operate on instance variables
2747 declared in the current Objective-C class, and not those inherited
2748 from superclasses.  It is the responsibility of the Objective-C
2749 runtime to invoke all such methods in an object's inheritance
2750 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2751 by the runtime immediately after a new object instance is allocated;
2752 the @code{- (void) .cxx_destruct} methods are invoked immediately
2753 before the runtime deallocates an object instance.
2755 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2756 support for invoking the @code{- (id) .cxx_construct} and
2757 @code{- (void) .cxx_destruct} methods.
2759 @item -fobjc-direct-dispatch
2760 @opindex fobjc-direct-dispatch
2761 Allow fast jumps to the message dispatcher.  On Darwin this is
2762 accomplished via the comm page.
2764 @item -fobjc-exceptions
2765 @opindex fobjc-exceptions
2766 Enable syntactic support for structured exception handling in
2767 Objective-C, similar to what is offered by C++ and Java.  This option
2768 is required to use the Objective-C keywords @code{@@try},
2769 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2770 @code{@@synchronized}.  This option is available with both the GNU
2771 runtime and the NeXT runtime (but not available in conjunction with
2772 the NeXT runtime on Mac OS X 10.2 and earlier).
2774 @item -fobjc-gc
2775 @opindex fobjc-gc
2776 Enable garbage collection (GC) in Objective-C and Objective-C++
2777 programs.  This option is only available with the NeXT runtime; the
2778 GNU runtime has a different garbage collection implementation that
2779 does not require special compiler flags.
2781 @item -fobjc-nilcheck
2782 @opindex fobjc-nilcheck
2783 For the NeXT runtime with version 2 of the ABI, check for a nil
2784 receiver in method invocations before doing the actual method call.
2785 This is the default and can be disabled using
2786 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2787 checked for nil in this way no matter what this flag is set to.
2788 Currently this flag does nothing when the GNU runtime, or an older
2789 version of the NeXT runtime ABI, is used.
2791 @item -fobjc-std=objc1
2792 @opindex fobjc-std
2793 Conform to the language syntax of Objective-C 1.0, the language
2794 recognized by GCC 4.0.  This only affects the Objective-C additions to
2795 the C/C++ language; it does not affect conformance to C/C++ standards,
2796 which is controlled by the separate C/C++ dialect option flags.  When
2797 this option is used with the Objective-C or Objective-C++ compiler,
2798 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2799 This is useful if you need to make sure that your Objective-C code can
2800 be compiled with older versions of GCC@.
2802 @item -freplace-objc-classes
2803 @opindex freplace-objc-classes
2804 Emit a special marker instructing @command{ld(1)} not to statically link in
2805 the resulting object file, and allow @command{dyld(1)} to load it in at
2806 run time instead.  This is used in conjunction with the Fix-and-Continue
2807 debugging mode, where the object file in question may be recompiled and
2808 dynamically reloaded in the course of program execution, without the need
2809 to restart the program itself.  Currently, Fix-and-Continue functionality
2810 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2811 and later.
2813 @item -fzero-link
2814 @opindex fzero-link
2815 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2816 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2817 compile time) with static class references that get initialized at load time,
2818 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2819 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2820 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2821 for individual class implementations to be modified during program execution.
2822 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2823 regardless of command-line options.
2825 @item -gen-decls
2826 @opindex gen-decls
2827 Dump interface declarations for all classes seen in the source file to a
2828 file named @file{@var{sourcename}.decl}.
2830 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2831 @opindex Wassign-intercept
2832 @opindex Wno-assign-intercept
2833 Warn whenever an Objective-C assignment is being intercepted by the
2834 garbage collector.
2836 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2837 @opindex Wno-protocol
2838 @opindex Wprotocol
2839 If a class is declared to implement a protocol, a warning is issued for
2840 every method in the protocol that is not implemented by the class.  The
2841 default behavior is to issue a warning for every method not explicitly
2842 implemented in the class, even if a method implementation is inherited
2843 from the superclass.  If you use the @option{-Wno-protocol} option, then
2844 methods inherited from the superclass are considered to be implemented,
2845 and no warning is issued for them.
2847 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2848 @opindex Wselector
2849 @opindex Wno-selector
2850 Warn if multiple methods of different types for the same selector are
2851 found during compilation.  The check is performed on the list of methods
2852 in the final stage of compilation.  Additionally, a check is performed
2853 for each selector appearing in a @code{@@selector(@dots{})}
2854 expression, and a corresponding method for that selector has been found
2855 during compilation.  Because these checks scan the method table only at
2856 the end of compilation, these warnings are not produced if the final
2857 stage of compilation is not reached, for example because an error is
2858 found during compilation, or because the @option{-fsyntax-only} option is
2859 being used.
2861 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2862 @opindex Wstrict-selector-match
2863 @opindex Wno-strict-selector-match
2864 Warn if multiple methods with differing argument and/or return types are
2865 found for a given selector when attempting to send a message using this
2866 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2867 is off (which is the default behavior), the compiler omits such warnings
2868 if any differences found are confined to types that share the same size
2869 and alignment.
2871 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2872 @opindex Wundeclared-selector
2873 @opindex Wno-undeclared-selector
2874 Warn if a @code{@@selector(@dots{})} expression referring to an
2875 undeclared selector is found.  A selector is considered undeclared if no
2876 method with that name has been declared before the
2877 @code{@@selector(@dots{})} expression, either explicitly in an
2878 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2879 an @code{@@implementation} section.  This option always performs its
2880 checks as soon as a @code{@@selector(@dots{})} expression is found,
2881 while @option{-Wselector} only performs its checks in the final stage of
2882 compilation.  This also enforces the coding style convention
2883 that methods and selectors must be declared before being used.
2885 @item -print-objc-runtime-info
2886 @opindex print-objc-runtime-info
2887 Generate C header describing the largest structure that is passed by
2888 value, if any.
2890 @end table
2892 @node Language Independent Options
2893 @section Options to Control Diagnostic Messages Formatting
2894 @cindex options to control diagnostics formatting
2895 @cindex diagnostic messages
2896 @cindex message formatting
2898 Traditionally, diagnostic messages have been formatted irrespective of
2899 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
2900 options described below
2901 to control the formatting algorithm for diagnostic messages, 
2902 e.g.@: how many characters per line, how often source location
2903 information should be reported.  Note that some language front ends may not
2904 honor these options.
2906 @table @gcctabopt
2907 @item -fmessage-length=@var{n}
2908 @opindex fmessage-length
2909 Try to format error messages so that they fit on lines of about @var{n}
2910 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2911 the front ends supported by GCC@.  If @var{n} is zero, then no
2912 line-wrapping is done; each error message appears on a single
2913 line.
2915 @item -fdiagnostics-show-location=once
2916 @opindex fdiagnostics-show-location
2917 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2918 reporter to emit source location information @emph{once}; that is, in
2919 case the message is too long to fit on a single physical line and has to
2920 be wrapped, the source location won't be emitted (as prefix) again,
2921 over and over, in subsequent continuation lines.  This is the default
2922 behavior.
2924 @item -fdiagnostics-show-location=every-line
2925 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2926 messages reporter to emit the same source location information (as
2927 prefix) for physical lines that result from the process of breaking
2928 a message which is too long to fit on a single line.
2930 @item -fno-diagnostics-show-option
2931 @opindex fno-diagnostics-show-option
2932 @opindex fdiagnostics-show-option
2933 By default, each diagnostic emitted includes text indicating the
2934 command-line option that directly controls the diagnostic (if such an
2935 option is known to the diagnostic machinery).  Specifying the
2936 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
2938 @item -fno-diagnostics-show-caret
2939 @opindex fno-diagnostics-show-caret
2940 @opindex fdiagnostics-show-caret
2941 By default, each diagnostic emitted includes the original source line
2942 and a caret '^' indicating the column.  This option suppresses this
2943 information.
2945 @end table
2947 @node Warning Options
2948 @section Options to Request or Suppress Warnings
2949 @cindex options to control warnings
2950 @cindex warning messages
2951 @cindex messages, warning
2952 @cindex suppressing warnings
2954 Warnings are diagnostic messages that report constructions that
2955 are not inherently erroneous but that are risky or suggest there
2956 may have been an error.
2958 The following language-independent options do not enable specific
2959 warnings but control the kinds of diagnostics produced by GCC@.
2961 @table @gcctabopt
2962 @cindex syntax checking
2963 @item -fsyntax-only
2964 @opindex fsyntax-only
2965 Check the code for syntax errors, but don't do anything beyond that.
2967 @item -fmax-errors=@var{n}
2968 @opindex fmax-errors
2969 Limits the maximum number of error messages to @var{n}, at which point
2970 GCC bails out rather than attempting to continue processing the source
2971 code.  If @var{n} is 0 (the default), there is no limit on the number
2972 of error messages produced.  If @option{-Wfatal-errors} is also
2973 specified, then @option{-Wfatal-errors} takes precedence over this
2974 option.
2976 @item -w
2977 @opindex w
2978 Inhibit all warning messages.
2980 @item -Werror
2981 @opindex Werror
2982 @opindex Wno-error
2983 Make all warnings into errors.
2985 @item -Werror=
2986 @opindex Werror=
2987 @opindex Wno-error=
2988 Make the specified warning into an error.  The specifier for a warning
2989 is appended; for example @option{-Werror=switch} turns the warnings
2990 controlled by @option{-Wswitch} into errors.  This switch takes a
2991 negative form, to be used to negate @option{-Werror} for specific
2992 warnings; for example @option{-Wno-error=switch} makes
2993 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2994 is in effect.
2996 The warning message for each controllable warning includes the
2997 option that controls the warning.  That option can then be used with
2998 @option{-Werror=} and @option{-Wno-error=} as described above.
2999 (Printing of the option in the warning message can be disabled using the
3000 @option{-fno-diagnostics-show-option} flag.)
3002 Note that specifying @option{-Werror=}@var{foo} automatically implies
3003 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3004 imply anything.
3006 @item -Wfatal-errors
3007 @opindex Wfatal-errors
3008 @opindex Wno-fatal-errors
3009 This option causes the compiler to abort compilation on the first error
3010 occurred rather than trying to keep going and printing further error
3011 messages.
3013 @end table
3015 You can request many specific warnings with options beginning with
3016 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3017 implicit declarations.  Each of these specific warning options also
3018 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3019 example, @option{-Wno-implicit}.  This manual lists only one of the
3020 two forms, whichever is not the default.  For further
3021 language-specific options also refer to @ref{C++ Dialect Options} and
3022 @ref{Objective-C and Objective-C++ Dialect Options}.
3024 When an unrecognized warning option is requested (e.g.,
3025 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3026 that the option is not recognized.  However, if the @option{-Wno-} form
3027 is used, the behavior is slightly different: no diagnostic is
3028 produced for @option{-Wno-unknown-warning} unless other diagnostics
3029 are being produced.  This allows the use of new @option{-Wno-} options
3030 with old compilers, but if something goes wrong, the compiler
3031 warns that an unrecognized option is present.
3033 @table @gcctabopt
3034 @item -Wpedantic
3035 @itemx -pedantic
3036 @opindex pedantic
3037 @opindex Wpedantic
3038 Issue all the warnings demanded by strict ISO C and ISO C++;
3039 reject all programs that use forbidden extensions, and some other
3040 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3041 version of the ISO C standard specified by any @option{-std} option used.
3043 Valid ISO C and ISO C++ programs should compile properly with or without
3044 this option (though a rare few require @option{-ansi} or a
3045 @option{-std} option specifying the required version of ISO C)@.  However,
3046 without this option, certain GNU extensions and traditional C and C++
3047 features are supported as well.  With this option, they are rejected.
3049 @option{-Wpedantic} does not cause warning messages for use of the
3050 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3051 warnings are also disabled in the expression that follows
3052 @code{__extension__}.  However, only system header files should use
3053 these escape routes; application programs should avoid them.
3054 @xref{Alternate Keywords}.
3056 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3057 C conformance.  They soon find that it does not do quite what they want:
3058 it finds some non-ISO practices, but not all---only those for which
3059 ISO C @emph{requires} a diagnostic, and some others for which
3060 diagnostics have been added.
3062 A feature to report any failure to conform to ISO C might be useful in
3063 some instances, but would require considerable additional work and would
3064 be quite different from @option{-Wpedantic}.  We don't have plans to
3065 support such a feature in the near future.
3067 Where the standard specified with @option{-std} represents a GNU
3068 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3069 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3070 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3071 where they are required by the base standard.  (It does not make sense
3072 for such warnings to be given only for features not in the specified GNU
3073 C dialect, since by definition the GNU dialects of C include all
3074 features the compiler supports with the given option, and there would be
3075 nothing to warn about.)
3077 @item -pedantic-errors
3078 @opindex pedantic-errors
3079 Like @option{-Wpedantic}, except that errors are produced rather than
3080 warnings.
3082 @item -Wall
3083 @opindex Wall
3084 @opindex Wno-all
3085 This enables all the warnings about constructions that some users
3086 consider questionable, and that are easy to avoid (or modify to
3087 prevent the warning), even in conjunction with macros.  This also
3088 enables some language-specific warnings described in @ref{C++ Dialect
3089 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3091 @option{-Wall} turns on the following warning flags:
3093 @gccoptlist{-Waddress   @gol
3094 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3095 -Wc++11-compat  @gol
3096 -Wchar-subscripts  @gol
3097 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3098 -Wimplicit-int @r{(C and Objective-C only)} @gol
3099 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3100 -Wcomment  @gol
3101 -Wformat   @gol
3102 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3103 -Wmaybe-uninitialized @gol
3104 -Wmissing-braces @r{(only for C/ObjC)} @gol
3105 -Wnonnull  @gol
3106 -Wparentheses  @gol
3107 -Wpointer-sign  @gol
3108 -Wreorder   @gol
3109 -Wreturn-type  @gol
3110 -Wsequence-point  @gol
3111 -Wsign-compare @r{(only in C++)}  @gol
3112 -Wstrict-aliasing  @gol
3113 -Wstrict-overflow=1  @gol
3114 -Wswitch  @gol
3115 -Wtrigraphs  @gol
3116 -Wuninitialized  @gol
3117 -Wunknown-pragmas  @gol
3118 -Wunused-function  @gol
3119 -Wunused-label     @gol
3120 -Wunused-value     @gol
3121 -Wunused-variable  @gol
3122 -Wvolatile-register-var @gol
3125 Note that some warning flags are not implied by @option{-Wall}.  Some of
3126 them warn about constructions that users generally do not consider
3127 questionable, but which occasionally you might wish to check for;
3128 others warn about constructions that are necessary or hard to avoid in
3129 some cases, and there is no simple way to modify the code to suppress
3130 the warning. Some of them are enabled by @option{-Wextra} but many of
3131 them must be enabled individually.
3133 @item -Wextra
3134 @opindex W
3135 @opindex Wextra
3136 @opindex Wno-extra
3137 This enables some extra warning flags that are not enabled by
3138 @option{-Wall}. (This option used to be called @option{-W}.  The older
3139 name is still supported, but the newer name is more descriptive.)
3141 @gccoptlist{-Wclobbered  @gol
3142 -Wempty-body  @gol
3143 -Wignored-qualifiers @gol
3144 -Wmissing-field-initializers  @gol
3145 -Wmissing-parameter-type @r{(C only)}  @gol
3146 -Wold-style-declaration @r{(C only)}  @gol
3147 -Woverride-init  @gol
3148 -Wsign-compare  @gol
3149 -Wtype-limits  @gol
3150 -Wuninitialized  @gol
3151 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3152 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3155 The option @option{-Wextra} also prints warning messages for the
3156 following cases:
3158 @itemize @bullet
3160 @item
3161 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3162 @samp{>}, or @samp{>=}.
3164 @item
3165 (C++ only) An enumerator and a non-enumerator both appear in a
3166 conditional expression.
3168 @item
3169 (C++ only) Ambiguous virtual bases.
3171 @item
3172 (C++ only) Subscripting an array that has been declared @samp{register}.
3174 @item
3175 (C++ only) Taking the address of a variable that has been declared
3176 @samp{register}.
3178 @item
3179 (C++ only) A base class is not initialized in a derived class's copy
3180 constructor.
3182 @end itemize
3184 @item -Wchar-subscripts
3185 @opindex Wchar-subscripts
3186 @opindex Wno-char-subscripts
3187 Warn if an array subscript has type @code{char}.  This is a common cause
3188 of error, as programmers often forget that this type is signed on some
3189 machines.
3190 This warning is enabled by @option{-Wall}.
3192 @item -Wcomment
3193 @opindex Wcomment
3194 @opindex Wno-comment
3195 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3196 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3197 This warning is enabled by @option{-Wall}.
3199 @item -Wno-coverage-mismatch
3200 @opindex Wno-coverage-mismatch
3201 Warn if feedback profiles do not match when using the
3202 @option{-fprofile-use} option.
3203 If a source file is changed between compiling with @option{-fprofile-gen} and
3204 with @option{-fprofile-use}, the files with the profile feedback can fail
3205 to match the source file and GCC cannot use the profile feedback
3206 information.  By default, this warning is enabled and is treated as an
3207 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3208 warning or @option{-Wno-error=coverage-mismatch} can be used to
3209 disable the error.  Disabling the error for this warning can result in
3210 poorly optimized code and is useful only in the
3211 case of very minor changes such as bug fixes to an existing code-base.
3212 Completely disabling the warning is not recommended.
3214 @item -Wno-cpp
3215 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3217 Suppress warning messages emitted by @code{#warning} directives.
3219 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3220 @opindex Wdouble-promotion
3221 @opindex Wno-double-promotion
3222 Give a warning when a value of type @code{float} is implicitly
3223 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3224 floating-point unit implement @code{float} in hardware, but emulate
3225 @code{double} in software.  On such a machine, doing computations
3226 using @code{double} values is much more expensive because of the
3227 overhead required for software emulation.
3229 It is easy to accidentally do computations with @code{double} because
3230 floating-point literals are implicitly of type @code{double}.  For
3231 example, in:
3232 @smallexample
3233 @group
3234 float area(float radius)
3236    return 3.14159 * radius * radius;
3238 @end group
3239 @end smallexample
3240 the compiler performs the entire computation with @code{double}
3241 because the floating-point literal is a @code{double}.
3243 @item -Wformat
3244 @itemx -Wformat=@var{n}
3245 @opindex Wformat
3246 @opindex Wno-format
3247 @opindex ffreestanding
3248 @opindex fno-builtin
3249 @opindex Wformat=
3250 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3251 the arguments supplied have types appropriate to the format string
3252 specified, and that the conversions specified in the format string make
3253 sense.  This includes standard functions, and others specified by format
3254 attributes (@pxref{Function Attributes}), in the @code{printf},
3255 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3256 not in the C standard) families (or other target-specific families).
3257 Which functions are checked without format attributes having been
3258 specified depends on the standard version selected, and such checks of
3259 functions without the attribute specified are disabled by
3260 @option{-ffreestanding} or @option{-fno-builtin}.
3262 The formats are checked against the format features supported by GNU
3263 libc version 2.2.  These include all ISO C90 and C99 features, as well
3264 as features from the Single Unix Specification and some BSD and GNU
3265 extensions.  Other library implementations may not support all these
3266 features; GCC does not support warning about features that go beyond a
3267 particular library's limitations.  However, if @option{-Wpedantic} is used
3268 with @option{-Wformat}, warnings are given about format features not
3269 in the selected standard version (but not for @code{strfmon} formats,
3270 since those are not in any version of the C standard).  @xref{C Dialect
3271 Options,,Options Controlling C Dialect}.
3273 @table @gcctabopt
3274 @item -Wformat=1
3275 @itemx -Wformat
3276 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3277 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3278 @option{-Wformat} also checks for null format arguments for several
3279 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3280 aspects of this level of format checking can be disabled by the
3281 options: @option{-Wno-format-contains-nul},
3282 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3283 @option{-Wformat} is enabled by @option{-Wall}.
3285 @item -Wno-format-contains-nul
3286 @opindex Wno-format-contains-nul
3287 @opindex Wformat-contains-nul
3288 If @option{-Wformat} is specified, do not warn about format strings that
3289 contain NUL bytes.
3291 @item -Wno-format-extra-args
3292 @opindex Wno-format-extra-args
3293 @opindex Wformat-extra-args
3294 If @option{-Wformat} is specified, do not warn about excess arguments to a
3295 @code{printf} or @code{scanf} format function.  The C standard specifies
3296 that such arguments are ignored.
3298 Where the unused arguments lie between used arguments that are
3299 specified with @samp{$} operand number specifications, normally
3300 warnings are still given, since the implementation could not know what
3301 type to pass to @code{va_arg} to skip the unused arguments.  However,
3302 in the case of @code{scanf} formats, this option suppresses the
3303 warning if the unused arguments are all pointers, since the Single
3304 Unix Specification says that such unused arguments are allowed.
3306 @item -Wno-format-zero-length
3307 @opindex Wno-format-zero-length
3308 @opindex Wformat-zero-length
3309 If @option{-Wformat} is specified, do not warn about zero-length formats.
3310 The C standard specifies that zero-length formats are allowed.
3313 @item -Wformat=2
3314 Enable @option{-Wformat} plus additional format checks.  Currently
3315 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3316 -Wformat-y2k}.
3318 @item -Wformat-nonliteral
3319 @opindex Wformat-nonliteral
3320 @opindex Wno-format-nonliteral
3321 If @option{-Wformat} is specified, also warn if the format string is not a
3322 string literal and so cannot be checked, unless the format function
3323 takes its format arguments as a @code{va_list}.
3325 @item -Wformat-security
3326 @opindex Wformat-security
3327 @opindex Wno-format-security
3328 If @option{-Wformat} is specified, also warn about uses of format
3329 functions that represent possible security problems.  At present, this
3330 warns about calls to @code{printf} and @code{scanf} functions where the
3331 format string is not a string literal and there are no format arguments,
3332 as in @code{printf (foo);}.  This may be a security hole if the format
3333 string came from untrusted input and contains @samp{%n}.  (This is
3334 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3335 in future warnings may be added to @option{-Wformat-security} that are not
3336 included in @option{-Wformat-nonliteral}.)
3338 @item -Wformat-y2k
3339 @opindex Wformat-y2k
3340 @opindex Wno-format-y2k
3341 If @option{-Wformat} is specified, also warn about @code{strftime}
3342 formats that may yield only a two-digit year.
3343 @end table
3345 @item -Wnonnull
3346 @opindex Wnonnull
3347 @opindex Wno-nonnull
3348 Warn about passing a null pointer for arguments marked as
3349 requiring a non-null value by the @code{nonnull} function attribute.
3351 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3352 can be disabled with the @option{-Wno-nonnull} option.
3354 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3355 @opindex Winit-self
3356 @opindex Wno-init-self
3357 Warn about uninitialized variables that are initialized with themselves.
3358 Note this option can only be used with the @option{-Wuninitialized} option.
3360 For example, GCC warns about @code{i} being uninitialized in the
3361 following snippet only when @option{-Winit-self} has been specified:
3362 @smallexample
3363 @group
3364 int f()
3366   int i = i;
3367   return i;
3369 @end group
3370 @end smallexample
3372 This warning is enabled by @option{-Wall} in C++.
3374 @item -Wimplicit-int @r{(C and Objective-C only)}
3375 @opindex Wimplicit-int
3376 @opindex Wno-implicit-int
3377 Warn when a declaration does not specify a type.
3378 This warning is enabled by @option{-Wall}.
3380 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3381 @opindex Wimplicit-function-declaration
3382 @opindex Wno-implicit-function-declaration
3383 Give a warning whenever a function is used before being declared. In
3384 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3385 enabled by default and it is made into an error by
3386 @option{-pedantic-errors}. This warning is also enabled by
3387 @option{-Wall}.
3389 @item -Wimplicit @r{(C and Objective-C only)}
3390 @opindex Wimplicit
3391 @opindex Wno-implicit
3392 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3393 This warning is enabled by @option{-Wall}.
3395 @item -Wignored-qualifiers @r{(C and C++ only)}
3396 @opindex Wignored-qualifiers
3397 @opindex Wno-ignored-qualifiers
3398 Warn if the return type of a function has a type qualifier
3399 such as @code{const}.  For ISO C such a type qualifier has no effect,
3400 since the value returned by a function is not an lvalue.
3401 For C++, the warning is only emitted for scalar types or @code{void}.
3402 ISO C prohibits qualified @code{void} return types on function
3403 definitions, so such return types always receive a warning
3404 even without this option.
3406 This warning is also enabled by @option{-Wextra}.
3408 @item -Wmain
3409 @opindex Wmain
3410 @opindex Wno-main
3411 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3412 a function with external linkage, returning int, taking either zero
3413 arguments, two, or three arguments of appropriate types.  This warning
3414 is enabled by default in C++ and is enabled by either @option{-Wall}
3415 or @option{-Wpedantic}.
3417 @item -Wmissing-braces
3418 @opindex Wmissing-braces
3419 @opindex Wno-missing-braces
3420 Warn if an aggregate or union initializer is not fully bracketed.  In
3421 the following example, the initializer for @samp{a} is not fully
3422 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3423 enabled by @option{-Wall} in C.
3425 @smallexample
3426 int a[2][2] = @{ 0, 1, 2, 3 @};
3427 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3428 @end smallexample
3430 This warning is enabled by @option{-Wall}.
3432 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3433 @opindex Wmissing-include-dirs
3434 @opindex Wno-missing-include-dirs
3435 Warn if a user-supplied include directory does not exist.
3437 @item -Wparentheses
3438 @opindex Wparentheses
3439 @opindex Wno-parentheses
3440 Warn if parentheses are omitted in certain contexts, such
3441 as when there is an assignment in a context where a truth value
3442 is expected, or when operators are nested whose precedence people
3443 often get confused about.
3445 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3446 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3447 interpretation from that of ordinary mathematical notation.
3449 Also warn about constructions where there may be confusion to which
3450 @code{if} statement an @code{else} branch belongs.  Here is an example of
3451 such a case:
3453 @smallexample
3454 @group
3456   if (a)
3457     if (b)
3458       foo ();
3459   else
3460     bar ();
3462 @end group
3463 @end smallexample
3465 In C/C++, every @code{else} branch belongs to the innermost possible
3466 @code{if} statement, which in this example is @code{if (b)}.  This is
3467 often not what the programmer expected, as illustrated in the above
3468 example by indentation the programmer chose.  When there is the
3469 potential for this confusion, GCC issues a warning when this flag
3470 is specified.  To eliminate the warning, add explicit braces around
3471 the innermost @code{if} statement so there is no way the @code{else}
3472 can belong to the enclosing @code{if}.  The resulting code
3473 looks like this:
3475 @smallexample
3476 @group
3478   if (a)
3479     @{
3480       if (b)
3481         foo ();
3482       else
3483         bar ();
3484     @}
3486 @end group
3487 @end smallexample
3489 Also warn for dangerous uses of the GNU extension to
3490 @code{?:} with omitted middle operand. When the condition
3491 in the @code{?}: operator is a boolean expression, the omitted value is
3492 always 1.  Often programmers expect it to be a value computed
3493 inside the conditional expression instead.
3495 This warning is enabled by @option{-Wall}.
3497 @item -Wsequence-point
3498 @opindex Wsequence-point
3499 @opindex Wno-sequence-point
3500 Warn about code that may have undefined semantics because of violations
3501 of sequence point rules in the C and C++ standards.
3503 The C and C++ standards define the order in which expressions in a C/C++
3504 program are evaluated in terms of @dfn{sequence points}, which represent
3505 a partial ordering between the execution of parts of the program: those
3506 executed before the sequence point, and those executed after it.  These
3507 occur after the evaluation of a full expression (one which is not part
3508 of a larger expression), after the evaluation of the first operand of a
3509 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3510 function is called (but after the evaluation of its arguments and the
3511 expression denoting the called function), and in certain other places.
3512 Other than as expressed by the sequence point rules, the order of
3513 evaluation of subexpressions of an expression is not specified.  All
3514 these rules describe only a partial order rather than a total order,
3515 since, for example, if two functions are called within one expression
3516 with no sequence point between them, the order in which the functions
3517 are called is not specified.  However, the standards committee have
3518 ruled that function calls do not overlap.
3520 It is not specified when between sequence points modifications to the
3521 values of objects take effect.  Programs whose behavior depends on this
3522 have undefined behavior; the C and C++ standards specify that ``Between
3523 the previous and next sequence point an object shall have its stored
3524 value modified at most once by the evaluation of an expression.
3525 Furthermore, the prior value shall be read only to determine the value
3526 to be stored.''.  If a program breaks these rules, the results on any
3527 particular implementation are entirely unpredictable.
3529 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3530 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3531 diagnosed by this option, and it may give an occasional false positive
3532 result, but in general it has been found fairly effective at detecting
3533 this sort of problem in programs.
3535 The standard is worded confusingly, therefore there is some debate
3536 over the precise meaning of the sequence point rules in subtle cases.
3537 Links to discussions of the problem, including proposed formal
3538 definitions, may be found on the GCC readings page, at
3539 @uref{http://gcc.gnu.org/@/readings.html}.
3541 This warning is enabled by @option{-Wall} for C and C++.
3543 @item -Wno-return-local-addr
3544 @opindex Wno-return-local-addr
3545 @opindex Wreturn-local-addr
3546 Do not warn about returning a pointer (or in C++, a reference) to a
3547 variable that goes out of scope after the function returns.
3549 @item -Wreturn-type
3550 @opindex Wreturn-type
3551 @opindex Wno-return-type
3552 Warn whenever a function is defined with a return type that defaults
3553 to @code{int}.  Also warn about any @code{return} statement with no
3554 return value in a function whose return type is not @code{void}
3555 (falling off the end of the function body is considered returning
3556 without a value), and about a @code{return} statement with an
3557 expression in a function whose return type is @code{void}.
3559 For C++, a function without return type always produces a diagnostic
3560 message, even when @option{-Wno-return-type} is specified.  The only
3561 exceptions are @samp{main} and functions defined in system headers.
3563 This warning is enabled by @option{-Wall}.
3565 @item -Wswitch
3566 @opindex Wswitch
3567 @opindex Wno-switch
3568 Warn whenever a @code{switch} statement has an index of enumerated type
3569 and lacks a @code{case} for one or more of the named codes of that
3570 enumeration.  (The presence of a @code{default} label prevents this
3571 warning.)  @code{case} labels outside the enumeration range also
3572 provoke warnings when this option is used (even if there is a
3573 @code{default} label).
3574 This warning is enabled by @option{-Wall}.
3576 @item -Wswitch-default
3577 @opindex Wswitch-default
3578 @opindex Wno-switch-default
3579 Warn whenever a @code{switch} statement does not have a @code{default}
3580 case.
3582 @item -Wswitch-enum
3583 @opindex Wswitch-enum
3584 @opindex Wno-switch-enum
3585 Warn whenever a @code{switch} statement has an index of enumerated type
3586 and lacks a @code{case} for one or more of the named codes of that
3587 enumeration.  @code{case} labels outside the enumeration range also
3588 provoke warnings when this option is used.  The only difference
3589 between @option{-Wswitch} and this option is that this option gives a
3590 warning about an omitted enumeration code even if there is a
3591 @code{default} label.
3593 @item -Wsync-nand @r{(C and C++ only)}
3594 @opindex Wsync-nand
3595 @opindex Wno-sync-nand
3596 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3597 built-in functions are used.  These functions changed semantics in GCC 4.4.
3599 @item -Wtrigraphs
3600 @opindex Wtrigraphs
3601 @opindex Wno-trigraphs
3602 Warn if any trigraphs are encountered that might change the meaning of
3603 the program (trigraphs within comments are not warned about).
3604 This warning is enabled by @option{-Wall}.
3606 @item -Wunused-but-set-parameter
3607 @opindex Wunused-but-set-parameter
3608 @opindex Wno-unused-but-set-parameter
3609 Warn whenever a function parameter is assigned to, but otherwise unused
3610 (aside from its declaration).
3612 To suppress this warning use the @samp{unused} attribute
3613 (@pxref{Variable Attributes}).
3615 This warning is also enabled by @option{-Wunused} together with
3616 @option{-Wextra}.
3618 @item -Wunused-but-set-variable
3619 @opindex Wunused-but-set-variable
3620 @opindex Wno-unused-but-set-variable
3621 Warn whenever a local variable is assigned to, but otherwise unused
3622 (aside from its declaration).
3623 This warning is enabled by @option{-Wall}.
3625 To suppress this warning use the @samp{unused} attribute
3626 (@pxref{Variable Attributes}).
3628 This warning is also enabled by @option{-Wunused}, which is enabled
3629 by @option{-Wall}.
3631 @item -Wunused-function
3632 @opindex Wunused-function
3633 @opindex Wno-unused-function
3634 Warn whenever a static function is declared but not defined or a
3635 non-inline static function is unused.
3636 This warning is enabled by @option{-Wall}.
3638 @item -Wunused-label
3639 @opindex Wunused-label
3640 @opindex Wno-unused-label
3641 Warn whenever a label is declared but not used.
3642 This warning is enabled by @option{-Wall}.
3644 To suppress this warning use the @samp{unused} attribute
3645 (@pxref{Variable Attributes}).
3647 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3648 @opindex Wunused-local-typedefs
3649 Warn when a typedef locally defined in a function is not used.
3650 This warning is enabled by @option{-Wall}.
3652 @item -Wunused-parameter
3653 @opindex Wunused-parameter
3654 @opindex Wno-unused-parameter
3655 Warn whenever a function parameter is unused aside from its declaration.
3657 To suppress this warning use the @samp{unused} attribute
3658 (@pxref{Variable Attributes}).
3660 @item -Wno-unused-result
3661 @opindex Wunused-result
3662 @opindex Wno-unused-result
3663 Do not warn if a caller of a function marked with attribute
3664 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3665 its return value. The default is @option{-Wunused-result}.
3667 @item -Wunused-variable
3668 @opindex Wunused-variable
3669 @opindex Wno-unused-variable
3670 Warn whenever a local variable or non-constant static variable is unused
3671 aside from its declaration.
3672 This warning is enabled by @option{-Wall}.
3674 To suppress this warning use the @samp{unused} attribute
3675 (@pxref{Variable Attributes}).
3677 @item -Wunused-value
3678 @opindex Wunused-value
3679 @opindex Wno-unused-value
3680 Warn whenever a statement computes a result that is explicitly not
3681 used. To suppress this warning cast the unused expression to
3682 @samp{void}. This includes an expression-statement or the left-hand
3683 side of a comma expression that contains no side effects. For example,
3684 an expression such as @samp{x[i,j]} causes a warning, while
3685 @samp{x[(void)i,j]} does not.
3687 This warning is enabled by @option{-Wall}.
3689 @item -Wunused
3690 @opindex Wunused
3691 @opindex Wno-unused
3692 All the above @option{-Wunused} options combined.
3694 In order to get a warning about an unused function parameter, you must
3695 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3696 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3698 @item -Wuninitialized
3699 @opindex Wuninitialized
3700 @opindex Wno-uninitialized
3701 Warn if an automatic variable is used without first being initialized
3702 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3703 warn if a non-static reference or non-static @samp{const} member
3704 appears in a class without constructors.
3706 If you want to warn about code that uses the uninitialized value of the
3707 variable in its own initializer, use the @option{-Winit-self} option.
3709 These warnings occur for individual uninitialized or clobbered
3710 elements of structure, union or array variables as well as for
3711 variables that are uninitialized or clobbered as a whole.  They do
3712 not occur for variables or elements declared @code{volatile}.  Because
3713 these warnings depend on optimization, the exact variables or elements
3714 for which there are warnings depends on the precise optimization
3715 options and version of GCC used.
3717 Note that there may be no warning about a variable that is used only
3718 to compute a value that itself is never used, because such
3719 computations may be deleted by data flow analysis before the warnings
3720 are printed.
3722 @item -Wmaybe-uninitialized
3723 @opindex Wmaybe-uninitialized
3724 @opindex Wno-maybe-uninitialized
3725 For an automatic variable, if there exists a path from the function
3726 entry to a use of the variable that is initialized, but there exist
3727 some other paths for which the variable is not initialized, the compiler
3728 emits a warning if it cannot prove the uninitialized paths are not
3729 executed at run time. These warnings are made optional because GCC is
3730 not smart enough to see all the reasons why the code might be correct
3731 in spite of appearing to have an error.  Here is one example of how
3732 this can happen:
3734 @smallexample
3735 @group
3737   int x;
3738   switch (y)
3739     @{
3740     case 1: x = 1;
3741       break;
3742     case 2: x = 4;
3743       break;
3744     case 3: x = 5;
3745     @}
3746   foo (x);
3748 @end group
3749 @end smallexample
3751 @noindent
3752 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3753 always initialized, but GCC doesn't know this. To suppress the
3754 warning, you need to provide a default case with assert(0) or
3755 similar code.
3757 @cindex @code{longjmp} warnings
3758 This option also warns when a non-volatile automatic variable might be
3759 changed by a call to @code{longjmp}.  These warnings as well are possible
3760 only in optimizing compilation.
3762 The compiler sees only the calls to @code{setjmp}.  It cannot know
3763 where @code{longjmp} will be called; in fact, a signal handler could
3764 call it at any point in the code.  As a result, you may get a warning
3765 even when there is in fact no problem because @code{longjmp} cannot
3766 in fact be called at the place that would cause a problem.
3768 Some spurious warnings can be avoided if you declare all the functions
3769 you use that never return as @code{noreturn}.  @xref{Function
3770 Attributes}.
3772 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3774 @item -Wunknown-pragmas
3775 @opindex Wunknown-pragmas
3776 @opindex Wno-unknown-pragmas
3777 @cindex warning for unknown pragmas
3778 @cindex unknown pragmas, warning
3779 @cindex pragmas, warning of unknown
3780 Warn when a @code{#pragma} directive is encountered that is not understood by 
3781 GCC@.  If this command-line option is used, warnings are even issued
3782 for unknown pragmas in system header files.  This is not the case if
3783 the warnings are only enabled by the @option{-Wall} command-line option.
3785 @item -Wno-pragmas
3786 @opindex Wno-pragmas
3787 @opindex Wpragmas
3788 Do not warn about misuses of pragmas, such as incorrect parameters,
3789 invalid syntax, or conflicts between pragmas.  See also
3790 @option{-Wunknown-pragmas}.
3792 @item -Wstrict-aliasing
3793 @opindex Wstrict-aliasing
3794 @opindex Wno-strict-aliasing
3795 This option is only active when @option{-fstrict-aliasing} is active.
3796 It warns about code that might break the strict aliasing rules that the
3797 compiler is using for optimization.  The warning does not catch all
3798 cases, but does attempt to catch the more common pitfalls.  It is
3799 included in @option{-Wall}.
3800 It is equivalent to @option{-Wstrict-aliasing=3}
3802 @item -Wstrict-aliasing=n
3803 @opindex Wstrict-aliasing=n
3804 This option is only active when @option{-fstrict-aliasing} is active.
3805 It warns about code that might break the strict aliasing rules that the
3806 compiler is using for optimization.
3807 Higher levels correspond to higher accuracy (fewer false positives).
3808 Higher levels also correspond to more effort, similar to the way @option{-O} 
3809 works.
3810 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
3812 Level 1: Most aggressive, quick, least accurate.
3813 Possibly useful when higher levels
3814 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
3815 false negatives.  However, it has many false positives.
3816 Warns for all pointer conversions between possibly incompatible types,
3817 even if never dereferenced.  Runs in the front end only.
3819 Level 2: Aggressive, quick, not too precise.
3820 May still have many false positives (not as many as level 1 though),
3821 and few false negatives (but possibly more than level 1).
3822 Unlike level 1, it only warns when an address is taken.  Warns about
3823 incomplete types.  Runs in the front end only.
3825 Level 3 (default for @option{-Wstrict-aliasing}):
3826 Should have very few false positives and few false
3827 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3828 Takes care of the common pun+dereference pattern in the front end:
3829 @code{*(int*)&some_float}.
3830 If optimization is enabled, it also runs in the back end, where it deals
3831 with multiple statement cases using flow-sensitive points-to information.
3832 Only warns when the converted pointer is dereferenced.
3833 Does not warn about incomplete types.
3835 @item -Wstrict-overflow
3836 @itemx -Wstrict-overflow=@var{n}
3837 @opindex Wstrict-overflow
3838 @opindex Wno-strict-overflow
3839 This option is only active when @option{-fstrict-overflow} is active.
3840 It warns about cases where the compiler optimizes based on the
3841 assumption that signed overflow does not occur.  Note that it does not
3842 warn about all cases where the code might overflow: it only warns
3843 about cases where the compiler implements some optimization.  Thus
3844 this warning depends on the optimization level.
3846 An optimization that assumes that signed overflow does not occur is
3847 perfectly safe if the values of the variables involved are such that
3848 overflow never does, in fact, occur.  Therefore this warning can
3849 easily give a false positive: a warning about code that is not
3850 actually a problem.  To help focus on important issues, several
3851 warning levels are defined.  No warnings are issued for the use of
3852 undefined signed overflow when estimating how many iterations a loop
3853 requires, in particular when determining whether a loop will be
3854 executed at all.
3856 @table @gcctabopt
3857 @item -Wstrict-overflow=1
3858 Warn about cases that are both questionable and easy to avoid.  For
3859 example,  with @option{-fstrict-overflow}, the compiler simplifies
3860 @code{x + 1 > x} to @code{1}.  This level of
3861 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3862 are not, and must be explicitly requested.
3864 @item -Wstrict-overflow=2
3865 Also warn about other cases where a comparison is simplified to a
3866 constant.  For example: @code{abs (x) >= 0}.  This can only be
3867 simplified when @option{-fstrict-overflow} is in effect, because
3868 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3869 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3870 @option{-Wstrict-overflow=2}.
3872 @item -Wstrict-overflow=3
3873 Also warn about other cases where a comparison is simplified.  For
3874 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
3876 @item -Wstrict-overflow=4
3877 Also warn about other simplifications not covered by the above cases.
3878 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
3880 @item -Wstrict-overflow=5
3881 Also warn about cases where the compiler reduces the magnitude of a
3882 constant involved in a comparison.  For example: @code{x + 2 > y} is
3883 simplified to @code{x + 1 >= y}.  This is reported only at the
3884 highest warning level because this simplification applies to many
3885 comparisons, so this warning level gives a very large number of
3886 false positives.
3887 @end table
3889 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
3890 @opindex Wsuggest-attribute=
3891 @opindex Wno-suggest-attribute=
3892 Warn for cases where adding an attribute may be beneficial. The
3893 attributes currently supported are listed below.
3895 @table @gcctabopt
3896 @item -Wsuggest-attribute=pure
3897 @itemx -Wsuggest-attribute=const
3898 @itemx -Wsuggest-attribute=noreturn
3899 @opindex Wsuggest-attribute=pure
3900 @opindex Wno-suggest-attribute=pure
3901 @opindex Wsuggest-attribute=const
3902 @opindex Wno-suggest-attribute=const
3903 @opindex Wsuggest-attribute=noreturn
3904 @opindex Wno-suggest-attribute=noreturn
3906 Warn about functions that might be candidates for attributes
3907 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3908 functions visible in other compilation units or (in the case of @code{pure} and
3909 @code{const}) if it cannot prove that the function returns normally. A function
3910 returns normally if it doesn't contain an infinite loop or return abnormally
3911 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3912 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3913 higher.  Higher optimization levels improve the accuracy of the analysis.
3915 @item -Wsuggest-attribute=format
3916 @itemx -Wmissing-format-attribute
3917 @opindex Wsuggest-attribute=format
3918 @opindex Wmissing-format-attribute
3919 @opindex Wno-suggest-attribute=format
3920 @opindex Wno-missing-format-attribute
3921 @opindex Wformat
3922 @opindex Wno-format
3924 Warn about function pointers that might be candidates for @code{format}
3925 attributes.  Note these are only possible candidates, not absolute ones.
3926 GCC guesses that function pointers with @code{format} attributes that
3927 are used in assignment, initialization, parameter passing or return
3928 statements should have a corresponding @code{format} attribute in the
3929 resulting type.  I.e.@: the left-hand side of the assignment or
3930 initialization, the type of the parameter variable, or the return type
3931 of the containing function respectively should also have a @code{format}
3932 attribute to avoid the warning.
3934 GCC also warns about function definitions that might be
3935 candidates for @code{format} attributes.  Again, these are only
3936 possible candidates.  GCC guesses that @code{format} attributes
3937 might be appropriate for any function that calls a function like
3938 @code{vprintf} or @code{vscanf}, but this might not always be the
3939 case, and some functions for which @code{format} attributes are
3940 appropriate may not be detected.
3941 @end table
3943 @item -Warray-bounds
3944 @opindex Wno-array-bounds
3945 @opindex Warray-bounds
3946 This option is only active when @option{-ftree-vrp} is active
3947 (default for @option{-O2} and above). It warns about subscripts to arrays
3948 that are always out of bounds. This warning is enabled by @option{-Wall}.
3950 @item -Wno-div-by-zero
3951 @opindex Wno-div-by-zero
3952 @opindex Wdiv-by-zero
3953 Do not warn about compile-time integer division by zero.  Floating-point
3954 division by zero is not warned about, as it can be a legitimate way of
3955 obtaining infinities and NaNs.
3957 @item -Wsystem-headers
3958 @opindex Wsystem-headers
3959 @opindex Wno-system-headers
3960 @cindex warnings from system headers
3961 @cindex system headers, warnings from
3962 Print warning messages for constructs found in system header files.
3963 Warnings from system headers are normally suppressed, on the assumption
3964 that they usually do not indicate real problems and would only make the
3965 compiler output harder to read.  Using this command-line option tells
3966 GCC to emit warnings from system headers as if they occurred in user
3967 code.  However, note that using @option{-Wall} in conjunction with this
3968 option does @emph{not} warn about unknown pragmas in system
3969 headers---for that, @option{-Wunknown-pragmas} must also be used.
3971 @item -Wtrampolines
3972 @opindex Wtrampolines
3973 @opindex Wno-trampolines
3974  Warn about trampolines generated for pointers to nested functions.
3976  A trampoline is a small piece of data or code that is created at run
3977  time on the stack when the address of a nested function is taken, and
3978  is used to call the nested function indirectly.  For some targets, it
3979  is made up of data only and thus requires no special treatment.  But,
3980  for most targets, it is made up of code and thus requires the stack
3981  to be made executable in order for the program to work properly.
3983 @item -Wfloat-equal
3984 @opindex Wfloat-equal
3985 @opindex Wno-float-equal
3986 Warn if floating-point values are used in equality comparisons.
3988 The idea behind this is that sometimes it is convenient (for the
3989 programmer) to consider floating-point values as approximations to
3990 infinitely precise real numbers.  If you are doing this, then you need
3991 to compute (by analyzing the code, or in some other way) the maximum or
3992 likely maximum error that the computation introduces, and allow for it
3993 when performing comparisons (and when producing output, but that's a
3994 different problem).  In particular, instead of testing for equality, you
3995 should check to see whether the two values have ranges that overlap; and
3996 this is done with the relational operators, so equality comparisons are
3997 probably mistaken.
3999 @item -Wtraditional @r{(C and Objective-C only)}
4000 @opindex Wtraditional
4001 @opindex Wno-traditional
4002 Warn about certain constructs that behave differently in traditional and
4003 ISO C@.  Also warn about ISO C constructs that have no traditional C
4004 equivalent, and/or problematic constructs that should be avoided.
4006 @itemize @bullet
4007 @item
4008 Macro parameters that appear within string literals in the macro body.
4009 In traditional C macro replacement takes place within string literals,
4010 but in ISO C it does not.
4012 @item
4013 In traditional C, some preprocessor directives did not exist.
4014 Traditional preprocessors only considered a line to be a directive
4015 if the @samp{#} appeared in column 1 on the line.  Therefore
4016 @option{-Wtraditional} warns about directives that traditional C
4017 understands but ignores because the @samp{#} does not appear as the
4018 first character on the line.  It also suggests you hide directives like
4019 @samp{#pragma} not understood by traditional C by indenting them.  Some
4020 traditional implementations do not recognize @samp{#elif}, so this option
4021 suggests avoiding it altogether.
4023 @item
4024 A function-like macro that appears without arguments.
4026 @item
4027 The unary plus operator.
4029 @item
4030 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4031 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4032 constants.)  Note, these suffixes appear in macros defined in the system
4033 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4034 Use of these macros in user code might normally lead to spurious
4035 warnings, however GCC's integrated preprocessor has enough context to
4036 avoid warning in these cases.
4038 @item
4039 A function declared external in one block and then used after the end of
4040 the block.
4042 @item
4043 A @code{switch} statement has an operand of type @code{long}.
4045 @item
4046 A non-@code{static} function declaration follows a @code{static} one.
4047 This construct is not accepted by some traditional C compilers.
4049 @item
4050 The ISO type of an integer constant has a different width or
4051 signedness from its traditional type.  This warning is only issued if
4052 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4053 typically represent bit patterns, are not warned about.
4055 @item
4056 Usage of ISO string concatenation is detected.
4058 @item
4059 Initialization of automatic aggregates.
4061 @item
4062 Identifier conflicts with labels.  Traditional C lacks a separate
4063 namespace for labels.
4065 @item
4066 Initialization of unions.  If the initializer is zero, the warning is
4067 omitted.  This is done under the assumption that the zero initializer in
4068 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4069 initializer warnings and relies on default initialization to zero in the
4070 traditional C case.
4072 @item
4073 Conversions by prototypes between fixed/floating-point values and vice
4074 versa.  The absence of these prototypes when compiling with traditional
4075 C causes serious problems.  This is a subset of the possible
4076 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4078 @item
4079 Use of ISO C style function definitions.  This warning intentionally is
4080 @emph{not} issued for prototype declarations or variadic functions
4081 because these ISO C features appear in your code when using
4082 libiberty's traditional C compatibility macros, @code{PARAMS} and
4083 @code{VPARAMS}.  This warning is also bypassed for nested functions
4084 because that feature is already a GCC extension and thus not relevant to
4085 traditional C compatibility.
4086 @end itemize
4088 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4089 @opindex Wtraditional-conversion
4090 @opindex Wno-traditional-conversion
4091 Warn if a prototype causes a type conversion that is different from what
4092 would happen to the same argument in the absence of a prototype.  This
4093 includes conversions of fixed point to floating and vice versa, and
4094 conversions changing the width or signedness of a fixed-point argument
4095 except when the same as the default promotion.
4097 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4098 @opindex Wdeclaration-after-statement
4099 @opindex Wno-declaration-after-statement
4100 Warn when a declaration is found after a statement in a block.  This
4101 construct, known from C++, was introduced with ISO C99 and is by default
4102 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4103 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4105 @item -Wundef
4106 @opindex Wundef
4107 @opindex Wno-undef
4108 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4110 @item -Wno-endif-labels
4111 @opindex Wno-endif-labels
4112 @opindex Wendif-labels
4113 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4115 @item -Wshadow
4116 @opindex Wshadow
4117 @opindex Wno-shadow
4118 Warn whenever a local variable or type declaration shadows another variable,
4119 parameter, type, or class member (in C++), or whenever a built-in function
4120 is shadowed. Note that in C++, the compiler warns if a local variable
4121 shadows an explicit typedef, but not if it shadows a struct/class/enum.
4123 @item -Wlarger-than=@var{len}
4124 @opindex Wlarger-than=@var{len}
4125 @opindex Wlarger-than-@var{len}
4126 Warn whenever an object of larger than @var{len} bytes is defined.
4128 @item -Wframe-larger-than=@var{len}
4129 @opindex Wframe-larger-than
4130 Warn if the size of a function frame is larger than @var{len} bytes.
4131 The computation done to determine the stack frame size is approximate
4132 and not conservative.
4133 The actual requirements may be somewhat greater than @var{len}
4134 even if you do not get a warning.  In addition, any space allocated
4135 via @code{alloca}, variable-length arrays, or related constructs
4136 is not included by the compiler when determining
4137 whether or not to issue a warning.
4139 @item -Wno-free-nonheap-object
4140 @opindex Wno-free-nonheap-object
4141 @opindex Wfree-nonheap-object
4142 Do not warn when attempting to free an object that was not allocated
4143 on the heap.
4145 @item -Wstack-usage=@var{len}
4146 @opindex Wstack-usage
4147 Warn if the stack usage of a function might be larger than @var{len} bytes.
4148 The computation done to determine the stack usage is conservative.
4149 Any space allocated via @code{alloca}, variable-length arrays, or related
4150 constructs is included by the compiler when determining whether or not to
4151 issue a warning.
4153 The message is in keeping with the output of @option{-fstack-usage}.
4155 @itemize
4156 @item
4157 If the stack usage is fully static but exceeds the specified amount, it's:
4159 @smallexample
4160   warning: stack usage is 1120 bytes
4161 @end smallexample
4162 @item
4163 If the stack usage is (partly) dynamic but bounded, it's:
4165 @smallexample
4166   warning: stack usage might be 1648 bytes
4167 @end smallexample
4168 @item
4169 If the stack usage is (partly) dynamic and not bounded, it's:
4171 @smallexample
4172   warning: stack usage might be unbounded
4173 @end smallexample
4174 @end itemize
4176 @item -Wunsafe-loop-optimizations
4177 @opindex Wunsafe-loop-optimizations
4178 @opindex Wno-unsafe-loop-optimizations
4179 Warn if the loop cannot be optimized because the compiler cannot
4180 assume anything on the bounds of the loop indices.  With
4181 @option{-funsafe-loop-optimizations} warn if the compiler makes
4182 such assumptions.
4184 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4185 @opindex Wno-pedantic-ms-format
4186 @opindex Wpedantic-ms-format
4187 When used in combination with @option{-Wformat}
4188 and @option{-pedantic} without GNU extensions, this option
4189 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4190 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4191 which depend on the MS runtime.
4193 @item -Wpointer-arith
4194 @opindex Wpointer-arith
4195 @opindex Wno-pointer-arith
4196 Warn about anything that depends on the ``size of'' a function type or
4197 of @code{void}.  GNU C assigns these types a size of 1, for
4198 convenience in calculations with @code{void *} pointers and pointers
4199 to functions.  In C++, warn also when an arithmetic operation involves
4200 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4202 @item -Wtype-limits
4203 @opindex Wtype-limits
4204 @opindex Wno-type-limits
4205 Warn if a comparison is always true or always false due to the limited
4206 range of the data type, but do not warn for constant expressions.  For
4207 example, warn if an unsigned variable is compared against zero with
4208 @samp{<} or @samp{>=}.  This warning is also enabled by
4209 @option{-Wextra}.
4211 @item -Wbad-function-cast @r{(C and Objective-C only)}
4212 @opindex Wbad-function-cast
4213 @opindex Wno-bad-function-cast
4214 Warn whenever a function call is cast to a non-matching type.
4215 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4217 @item -Wc++-compat @r{(C and Objective-C only)}
4218 Warn about ISO C constructs that are outside of the common subset of
4219 ISO C and ISO C++, e.g.@: request for implicit conversion from
4220 @code{void *} to a pointer to non-@code{void} type.
4222 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4223 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4224 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4225 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4226 enabled by @option{-Wall}.
4228 @item -Wcast-qual
4229 @opindex Wcast-qual
4230 @opindex Wno-cast-qual
4231 Warn whenever a pointer is cast so as to remove a type qualifier from
4232 the target type.  For example, warn if a @code{const char *} is cast
4233 to an ordinary @code{char *}.
4235 Also warn when making a cast that introduces a type qualifier in an
4236 unsafe way.  For example, casting @code{char **} to @code{const char **}
4237 is unsafe, as in this example:
4239 @smallexample
4240   /* p is char ** value.  */
4241   const char **q = (const char **) p;
4242   /* Assignment of readonly string to const char * is OK.  */
4243   *q = "string";
4244   /* Now char** pointer points to read-only memory.  */
4245   **p = 'b';
4246 @end smallexample
4248 @item -Wcast-align
4249 @opindex Wcast-align
4250 @opindex Wno-cast-align
4251 Warn whenever a pointer is cast such that the required alignment of the
4252 target is increased.  For example, warn if a @code{char *} is cast to
4253 an @code{int *} on machines where integers can only be accessed at
4254 two- or four-byte boundaries.
4256 @item -Wwrite-strings
4257 @opindex Wwrite-strings
4258 @opindex Wno-write-strings
4259 When compiling C, give string constants the type @code{const
4260 char[@var{length}]} so that copying the address of one into a
4261 non-@code{const} @code{char *} pointer produces a warning.  These
4262 warnings help you find at compile time code that can try to write
4263 into a string constant, but only if you have been very careful about
4264 using @code{const} in declarations and prototypes.  Otherwise, it is
4265 just a nuisance. This is why we did not make @option{-Wall} request
4266 these warnings.
4268 When compiling C++, warn about the deprecated conversion from string
4269 literals to @code{char *}.  This warning is enabled by default for C++
4270 programs.
4272 @item -Wclobbered
4273 @opindex Wclobbered
4274 @opindex Wno-clobbered
4275 Warn for variables that might be changed by @samp{longjmp} or
4276 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4278 @item -Wconversion
4279 @opindex Wconversion
4280 @opindex Wno-conversion
4281 Warn for implicit conversions that may alter a value. This includes
4282 conversions between real and integer, like @code{abs (x)} when
4283 @code{x} is @code{double}; conversions between signed and unsigned,
4284 like @code{unsigned ui = -1}; and conversions to smaller types, like
4285 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4286 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4287 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4288 conversions between signed and unsigned integers can be disabled by
4289 using @option{-Wno-sign-conversion}.
4291 For C++, also warn for confusing overload resolution for user-defined
4292 conversions; and conversions that never use a type conversion
4293 operator: conversions to @code{void}, the same type, a base class or a
4294 reference to them. Warnings about conversions between signed and
4295 unsigned integers are disabled by default in C++ unless
4296 @option{-Wsign-conversion} is explicitly enabled.
4298 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4299 @opindex Wconversion-null
4300 @opindex Wno-conversion-null
4301 Do not warn for conversions between @code{NULL} and non-pointer
4302 types. @option{-Wconversion-null} is enabled by default.
4304 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4305 @opindex Wzero-as-null-pointer-constant
4306 @opindex Wno-zero-as-null-pointer-constant
4307 Warn when a literal '0' is used as null pointer constant.  This can
4308 be useful to facilitate the conversion to @code{nullptr} in C++11.
4310 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4311 @opindex Wuseless-cast
4312 @opindex Wno-useless-cast
4313 Warn when an expression is casted to its own type.
4315 @item -Wempty-body
4316 @opindex Wempty-body
4317 @opindex Wno-empty-body
4318 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4319 while} statement.  This warning is also enabled by @option{-Wextra}.
4321 @item -Wenum-compare
4322 @opindex Wenum-compare
4323 @opindex Wno-enum-compare
4324 Warn about a comparison between values of different enumerated types.
4325 In C++ enumeral mismatches in conditional expressions are also
4326 diagnosed and the warning is enabled by default.  In C this warning is 
4327 enabled by @option{-Wall}.
4329 @item -Wjump-misses-init @r{(C, Objective-C only)}
4330 @opindex Wjump-misses-init
4331 @opindex Wno-jump-misses-init
4332 Warn if a @code{goto} statement or a @code{switch} statement jumps
4333 forward across the initialization of a variable, or jumps backward to a
4334 label after the variable has been initialized.  This only warns about
4335 variables that are initialized when they are declared.  This warning is
4336 only supported for C and Objective-C; in C++ this sort of branch is an
4337 error in any case.
4339 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4340 can be disabled with the @option{-Wno-jump-misses-init} option.
4342 @item -Wsign-compare
4343 @opindex Wsign-compare
4344 @opindex Wno-sign-compare
4345 @cindex warning for comparison of signed and unsigned values
4346 @cindex comparison of signed and unsigned values, warning
4347 @cindex signed and unsigned values, comparison warning
4348 Warn when a comparison between signed and unsigned values could produce
4349 an incorrect result when the signed value is converted to unsigned.
4350 This warning is also enabled by @option{-Wextra}; to get the other warnings
4351 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4353 @item -Wsign-conversion
4354 @opindex Wsign-conversion
4355 @opindex Wno-sign-conversion
4356 Warn for implicit conversions that may change the sign of an integer
4357 value, like assigning a signed integer expression to an unsigned
4358 integer variable. An explicit cast silences the warning. In C, this
4359 option is enabled also by @option{-Wconversion}.
4361 @item -Wsizeof-pointer-memaccess
4362 @opindex Wsizeof-pointer-memaccess
4363 @opindex Wno-sizeof-pointer-memaccess
4364 Warn for suspicious length parameters to certain string and memory built-in
4365 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4366 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4367 but a pointer, and suggests a possible fix, or about
4368 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4369 @option{-Wall}.
4371 @item -Waddress
4372 @opindex Waddress
4373 @opindex Wno-address
4374 Warn about suspicious uses of memory addresses. These include using
4375 the address of a function in a conditional expression, such as
4376 @code{void func(void); if (func)}, and comparisons against the memory
4377 address of a string literal, such as @code{if (x == "abc")}.  Such
4378 uses typically indicate a programmer error: the address of a function
4379 always evaluates to true, so their use in a conditional usually
4380 indicate that the programmer forgot the parentheses in a function
4381 call; and comparisons against string literals result in unspecified
4382 behavior and are not portable in C, so they usually indicate that the
4383 programmer intended to use @code{strcmp}.  This warning is enabled by
4384 @option{-Wall}.
4386 @item -Wlogical-op
4387 @opindex Wlogical-op
4388 @opindex Wno-logical-op
4389 Warn about suspicious uses of logical operators in expressions.
4390 This includes using logical operators in contexts where a
4391 bit-wise operator is likely to be expected.
4393 @item -Waggregate-return
4394 @opindex Waggregate-return
4395 @opindex Wno-aggregate-return
4396 Warn if any functions that return structures or unions are defined or
4397 called.  (In languages where you can return an array, this also elicits
4398 a warning.)
4400 @item -Wno-attributes
4401 @opindex Wno-attributes
4402 @opindex Wattributes
4403 Do not warn if an unexpected @code{__attribute__} is used, such as
4404 unrecognized attributes, function attributes applied to variables,
4405 etc.  This does not stop errors for incorrect use of supported
4406 attributes.
4408 @item -Wno-builtin-macro-redefined
4409 @opindex Wno-builtin-macro-redefined
4410 @opindex Wbuiltin-macro-redefined
4411 Do not warn if certain built-in macros are redefined.  This suppresses
4412 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4413 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4415 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4416 @opindex Wstrict-prototypes
4417 @opindex Wno-strict-prototypes
4418 Warn if a function is declared or defined without specifying the
4419 argument types.  (An old-style function definition is permitted without
4420 a warning if preceded by a declaration that specifies the argument
4421 types.)
4423 @item -Wold-style-declaration @r{(C and Objective-C only)}
4424 @opindex Wold-style-declaration
4425 @opindex Wno-old-style-declaration
4426 Warn for obsolescent usages, according to the C Standard, in a
4427 declaration. For example, warn if storage-class specifiers like
4428 @code{static} are not the first things in a declaration.  This warning
4429 is also enabled by @option{-Wextra}.
4431 @item -Wold-style-definition @r{(C and Objective-C only)}
4432 @opindex Wold-style-definition
4433 @opindex Wno-old-style-definition
4434 Warn if an old-style function definition is used.  A warning is given
4435 even if there is a previous prototype.
4437 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4438 @opindex Wmissing-parameter-type
4439 @opindex Wno-missing-parameter-type
4440 A function parameter is declared without a type specifier in K&R-style
4441 functions:
4443 @smallexample
4444 void foo(bar) @{ @}
4445 @end smallexample
4447 This warning is also enabled by @option{-Wextra}.
4449 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4450 @opindex Wmissing-prototypes
4451 @opindex Wno-missing-prototypes
4452 Warn if a global function is defined without a previous prototype
4453 declaration.  This warning is issued even if the definition itself
4454 provides a prototype.  Use this option to detect global functions
4455 that do not have a matching prototype declaration in a header file.
4456 This option is not valid for C++ because all function declarations
4457 provide prototypes and a non-matching declaration will declare an
4458 overload rather than conflict with an earlier declaration.
4459 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4461 @item -Wmissing-declarations
4462 @opindex Wmissing-declarations
4463 @opindex Wno-missing-declarations
4464 Warn if a global function is defined without a previous declaration.
4465 Do so even if the definition itself provides a prototype.
4466 Use this option to detect global functions that are not declared in
4467 header files.  In C, no warnings are issued for functions with previous
4468 non-prototype declarations; use @option{-Wmissing-prototype} to detect
4469 missing prototypes.  In C++, no warnings are issued for function templates,
4470 or for inline functions, or for functions in anonymous namespaces.
4472 @item -Wmissing-field-initializers
4473 @opindex Wmissing-field-initializers
4474 @opindex Wno-missing-field-initializers
4475 @opindex W
4476 @opindex Wextra
4477 @opindex Wno-extra
4478 Warn if a structure's initializer has some fields missing.  For
4479 example, the following code causes such a warning, because
4480 @code{x.h} is implicitly zero:
4482 @smallexample
4483 struct s @{ int f, g, h; @};
4484 struct s x = @{ 3, 4 @};
4485 @end smallexample
4487 This option does not warn about designated initializers, so the following
4488 modification does not trigger a warning:
4490 @smallexample
4491 struct s @{ int f, g, h; @};
4492 struct s x = @{ .f = 3, .g = 4 @};
4493 @end smallexample
4495 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4496 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4498 @item -Wno-multichar
4499 @opindex Wno-multichar
4500 @opindex Wmultichar
4501 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4502 Usually they indicate a typo in the user's code, as they have
4503 implementation-defined values, and should not be used in portable code.
4505 @item -Wnormalized=<none|id|nfc|nfkc>
4506 @opindex Wnormalized=
4507 @cindex NFC
4508 @cindex NFKC
4509 @cindex character set, input normalization
4510 In ISO C and ISO C++, two identifiers are different if they are
4511 different sequences of characters.  However, sometimes when characters
4512 outside the basic ASCII character set are used, you can have two
4513 different character sequences that look the same.  To avoid confusion,
4514 the ISO 10646 standard sets out some @dfn{normalization rules} which
4515 when applied ensure that two sequences that look the same are turned into
4516 the same sequence.  GCC can warn you if you are using identifiers that
4517 have not been normalized; this option controls that warning.
4519 There are four levels of warning supported by GCC@.  The default is
4520 @option{-Wnormalized=nfc}, which warns about any identifier that is
4521 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4522 recommended form for most uses.
4524 Unfortunately, there are some characters allowed in identifiers by
4525 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4526 identifiers.  That is, there's no way to use these symbols in portable
4527 ISO C or C++ and have all your identifiers in NFC@.
4528 @option{-Wnormalized=id} suppresses the warning for these characters.
4529 It is hoped that future versions of the standards involved will correct
4530 this, which is why this option is not the default.
4532 You can switch the warning off for all characters by writing
4533 @option{-Wnormalized=none}.  You should only do this if you
4534 are using some other normalization scheme (like ``D''), because
4535 otherwise you can easily create bugs that are literally impossible to see.
4537 Some characters in ISO 10646 have distinct meanings but look identical
4538 in some fonts or display methodologies, especially once formatting has
4539 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4540 LETTER N'', displays just like a regular @code{n} that has been
4541 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4542 normalization scheme to convert all these into a standard form as
4543 well, and GCC warns if your code is not in NFKC if you use
4544 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4545 about every identifier that contains the letter O because it might be
4546 confused with the digit 0, and so is not the default, but may be
4547 useful as a local coding convention if the programming environment 
4548 cannot be fixed to display these characters distinctly.
4550 @item -Wno-deprecated
4551 @opindex Wno-deprecated
4552 @opindex Wdeprecated
4553 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4555 @item -Wno-deprecated-declarations
4556 @opindex Wno-deprecated-declarations
4557 @opindex Wdeprecated-declarations
4558 Do not warn about uses of functions (@pxref{Function Attributes}),
4559 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4560 Attributes}) marked as deprecated by using the @code{deprecated}
4561 attribute.
4563 @item -Wno-overflow
4564 @opindex Wno-overflow
4565 @opindex Woverflow
4566 Do not warn about compile-time overflow in constant expressions.
4568 @item -Woverride-init @r{(C and Objective-C only)}
4569 @opindex Woverride-init
4570 @opindex Wno-override-init
4571 @opindex W
4572 @opindex Wextra
4573 @opindex Wno-extra
4574 Warn if an initialized field without side effects is overridden when
4575 using designated initializers (@pxref{Designated Inits, , Designated
4576 Initializers}).
4578 This warning is included in @option{-Wextra}.  To get other
4579 @option{-Wextra} warnings without this one, use @option{-Wextra
4580 -Wno-override-init}.
4582 @item -Wpacked
4583 @opindex Wpacked
4584 @opindex Wno-packed
4585 Warn if a structure is given the packed attribute, but the packed
4586 attribute has no effect on the layout or size of the structure.
4587 Such structures may be mis-aligned for little benefit.  For
4588 instance, in this code, the variable @code{f.x} in @code{struct bar}
4589 is misaligned even though @code{struct bar} does not itself
4590 have the packed attribute:
4592 @smallexample
4593 @group
4594 struct foo @{
4595   int x;
4596   char a, b, c, d;
4597 @} __attribute__((packed));
4598 struct bar @{
4599   char z;
4600   struct foo f;
4602 @end group
4603 @end smallexample
4605 @item -Wpacked-bitfield-compat
4606 @opindex Wpacked-bitfield-compat
4607 @opindex Wno-packed-bitfield-compat
4608 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4609 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4610 the change can lead to differences in the structure layout.  GCC
4611 informs you when the offset of such a field has changed in GCC 4.4.
4612 For example there is no longer a 4-bit padding between field @code{a}
4613 and @code{b} in this structure:
4615 @smallexample
4616 struct foo
4618   char a:4;
4619   char b:8;
4620 @} __attribute__ ((packed));
4621 @end smallexample
4623 This warning is enabled by default.  Use
4624 @option{-Wno-packed-bitfield-compat} to disable this warning.
4626 @item -Wpadded
4627 @opindex Wpadded
4628 @opindex Wno-padded
4629 Warn if padding is included in a structure, either to align an element
4630 of the structure or to align the whole structure.  Sometimes when this
4631 happens it is possible to rearrange the fields of the structure to
4632 reduce the padding and so make the structure smaller.
4634 @item -Wredundant-decls
4635 @opindex Wredundant-decls
4636 @opindex Wno-redundant-decls
4637 Warn if anything is declared more than once in the same scope, even in
4638 cases where multiple declaration is valid and changes nothing.
4640 @item -Wnested-externs @r{(C and Objective-C only)}
4641 @opindex Wnested-externs
4642 @opindex Wno-nested-externs
4643 Warn if an @code{extern} declaration is encountered within a function.
4645 @item -Wno-inherited-variadic-ctor
4646 @opindex Winherited-variadic-ctor
4647 @opindex Wno-inherited-variadic-ctor
4648 Suppress warnings about use of C++11 inheriting constructors when the
4649 base class inherited from has a C variadic constructor; the warning is
4650 on by default because the ellipsis is not inherited.
4652 @item -Winline
4653 @opindex Winline
4654 @opindex Wno-inline
4655 Warn if a function that is declared as inline cannot be inlined.
4656 Even with this option, the compiler does not warn about failures to
4657 inline functions declared in system headers.
4659 The compiler uses a variety of heuristics to determine whether or not
4660 to inline a function.  For example, the compiler takes into account
4661 the size of the function being inlined and the amount of inlining
4662 that has already been done in the current function.  Therefore,
4663 seemingly insignificant changes in the source program can cause the
4664 warnings produced by @option{-Winline} to appear or disappear.
4666 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4667 @opindex Wno-invalid-offsetof
4668 @opindex Winvalid-offsetof
4669 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4670 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4671 to a non-POD type is undefined.  In existing C++ implementations,
4672 however, @samp{offsetof} typically gives meaningful results even when
4673 applied to certain kinds of non-POD types (such as a simple
4674 @samp{struct} that fails to be a POD type only by virtue of having a
4675 constructor).  This flag is for users who are aware that they are
4676 writing nonportable code and who have deliberately chosen to ignore the
4677 warning about it.
4679 The restrictions on @samp{offsetof} may be relaxed in a future version
4680 of the C++ standard.
4682 @item -Wno-int-to-pointer-cast
4683 @opindex Wno-int-to-pointer-cast
4684 @opindex Wint-to-pointer-cast
4685 Suppress warnings from casts to pointer type of an integer of a
4686 different size. In C++, casting to a pointer type of smaller size is
4687 an error. @option{Wint-to-pointer-cast} is enabled by default.
4690 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4691 @opindex Wno-pointer-to-int-cast
4692 @opindex Wpointer-to-int-cast
4693 Suppress warnings from casts from a pointer to an integer type of a
4694 different size.
4696 @item -Winvalid-pch
4697 @opindex Winvalid-pch
4698 @opindex Wno-invalid-pch
4699 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4700 the search path but can't be used.
4702 @item -Wlong-long
4703 @opindex Wlong-long
4704 @opindex Wno-long-long
4705 Warn if @samp{long long} type is used.  This is enabled by either
4706 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
4707 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4709 @item -Wvariadic-macros
4710 @opindex Wvariadic-macros
4711 @opindex Wno-variadic-macros
4712 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4713 alternate syntax when in pedantic ISO C99 mode.  This is default.
4714 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4716 @item -Wvarargs
4717 @opindex Wvarargs
4718 @opindex Wno-varargs
4719 Warn upon questionable usage of the macros used to handle variable
4720 arguments like @samp{va_start}.  This is default.  To inhibit the
4721 warning messages, use @option{-Wno-varargs}.
4723 @item -Wvector-operation-performance
4724 @opindex Wvector-operation-performance
4725 @opindex Wno-vector-operation-performance
4726 Warn if vector operation is not implemented via SIMD capabilities of the
4727 architecture.  Mainly useful for the performance tuning.
4728 Vector operation can be implemented @code{piecewise}, which means that the
4729 scalar operation is performed on every vector element; 
4730 @code{in parallel}, which means that the vector operation is implemented
4731 using scalars of wider type, which normally is more performance efficient;
4732 and @code{as a single scalar}, which means that vector fits into a
4733 scalar type.
4735 @item -Wno-virtual-move-assign
4736 @opindex Wvirtual-move-assign
4737 @opindex Wno-virtual-move-assign
4738 Suppress warnings about inheriting from a virtual base with a
4739 non-trivial C++11 move assignment operator.  This is dangerous because
4740 if the virtual base is reachable along more than one path, it will be
4741 moved multiple times, which can mean both objects end up in the
4742 moved-from state.  If the move assignment operator is written to avoid
4743 moving from a moved-from object, this warning can be disabled.
4745 @item -Wvla
4746 @opindex Wvla
4747 @opindex Wno-vla
4748 Warn if variable length array is used in the code.
4749 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
4750 the variable length array.
4752 @item -Wvolatile-register-var
4753 @opindex Wvolatile-register-var
4754 @opindex Wno-volatile-register-var
4755 Warn if a register variable is declared volatile.  The volatile
4756 modifier does not inhibit all optimizations that may eliminate reads
4757 and/or writes to register variables.  This warning is enabled by
4758 @option{-Wall}.
4760 @item -Wdisabled-optimization
4761 @opindex Wdisabled-optimization
4762 @opindex Wno-disabled-optimization
4763 Warn if a requested optimization pass is disabled.  This warning does
4764 not generally indicate that there is anything wrong with your code; it
4765 merely indicates that GCC's optimizers are unable to handle the code
4766 effectively.  Often, the problem is that your code is too big or too
4767 complex; GCC refuses to optimize programs when the optimization
4768 itself is likely to take inordinate amounts of time.
4770 @item -Wpointer-sign @r{(C and Objective-C only)}
4771 @opindex Wpointer-sign
4772 @opindex Wno-pointer-sign
4773 Warn for pointer argument passing or assignment with different signedness.
4774 This option is only supported for C and Objective-C@.  It is implied by
4775 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
4776 @option{-Wno-pointer-sign}.
4778 @item -Wstack-protector
4779 @opindex Wstack-protector
4780 @opindex Wno-stack-protector
4781 This option is only active when @option{-fstack-protector} is active.  It
4782 warns about functions that are not protected against stack smashing.
4784 @item -Wno-mudflap
4785 @opindex Wno-mudflap
4786 Suppress warnings about constructs that cannot be instrumented by
4787 @option{-fmudflap}.
4789 @item -Woverlength-strings
4790 @opindex Woverlength-strings
4791 @opindex Wno-overlength-strings
4792 Warn about string constants that are longer than the ``minimum
4793 maximum'' length specified in the C standard.  Modern compilers
4794 generally allow string constants that are much longer than the
4795 standard's minimum limit, but very portable programs should avoid
4796 using longer strings.
4798 The limit applies @emph{after} string constant concatenation, and does
4799 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4800 C99, it was raised to 4095.  C++98 does not specify a normative
4801 minimum maximum, so we do not diagnose overlength strings in C++@.
4803 This option is implied by @option{-Wpedantic}, and can be disabled with
4804 @option{-Wno-overlength-strings}.
4806 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4807 @opindex Wunsuffixed-float-constants
4809 Issue a warning for any floating constant that does not have
4810 a suffix.  When used together with @option{-Wsystem-headers} it
4811 warns about such constants in system header files.  This can be useful
4812 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4813 from the decimal floating-point extension to C99.
4814 @end table
4816 @node Debugging Options
4817 @section Options for Debugging Your Program or GCC
4818 @cindex options, debugging
4819 @cindex debugging information options
4821 GCC has various special options that are used for debugging
4822 either your program or GCC:
4824 @table @gcctabopt
4825 @item -g
4826 @opindex g
4827 Produce debugging information in the operating system's native format
4828 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4829 information.
4831 On most systems that use stabs format, @option{-g} enables use of extra
4832 debugging information that only GDB can use; this extra information
4833 makes debugging work better in GDB but probably makes other debuggers
4834 crash or
4835 refuse to read the program.  If you want to control for certain whether
4836 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4837 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4839 GCC allows you to use @option{-g} with
4840 @option{-O}.  The shortcuts taken by optimized code may occasionally
4841 produce surprising results: some variables you declared may not exist
4842 at all; flow of control may briefly move where you did not expect it;
4843 some statements may not be executed because they compute constant
4844 results or their values are already at hand; some statements may
4845 execute in different places because they have been moved out of loops.
4847 Nevertheless it proves possible to debug optimized output.  This makes
4848 it reasonable to use the optimizer for programs that might have bugs.
4850 The following options are useful when GCC is generated with the
4851 capability for more than one debugging format.
4853 @item -gsplit-dwarf
4854 @opindex gsplit-dwarf
4855 Separate as much dwarf debugging information as possible into a
4856 separate output file with the extension .dwo.  This option allows
4857 the build system to avoid linking files with debug information.  To
4858 be useful, this option requires a debugger capable of reading .dwo
4859 files.
4861 @item -ggdb
4862 @opindex ggdb
4863 Produce debugging information for use by GDB@.  This means to use the
4864 most expressive format available (DWARF 2, stabs, or the native format
4865 if neither of those are supported), including GDB extensions if at all
4866 possible.
4868 @item -gpubnames
4869 @opindex gpubnames
4870 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
4872 @item -gstabs
4873 @opindex gstabs
4874 Produce debugging information in stabs format (if that is supported),
4875 without GDB extensions.  This is the format used by DBX on most BSD
4876 systems.  On MIPS, Alpha and System V Release 4 systems this option
4877 produces stabs debugging output that is not understood by DBX or SDB@.
4878 On System V Release 4 systems this option requires the GNU assembler.
4880 @item -feliminate-unused-debug-symbols
4881 @opindex feliminate-unused-debug-symbols
4882 Produce debugging information in stabs format (if that is supported),
4883 for only symbols that are actually used.
4885 @item -femit-class-debug-always
4886 Instead of emitting debugging information for a C++ class in only one
4887 object file, emit it in all object files using the class.  This option
4888 should be used only with debuggers that are unable to handle the way GCC
4889 normally emits debugging information for classes because using this
4890 option increases the size of debugging information by as much as a
4891 factor of two.
4893 @item -fdebug-types-section
4894 @opindex fdebug-types-section
4895 @opindex fno-debug-types-section
4896 When using DWARF Version 4 or higher, type DIEs can be put into
4897 their own @code{.debug_types} section instead of making them part of the
4898 @code{.debug_info} section.  It is more efficient to put them in a separate
4899 comdat sections since the linker can then remove duplicates.
4900 But not all DWARF consumers support @code{.debug_types} sections yet
4901 and on some objects @code{.debug_types} produces larger instead of smaller
4902 debugging information.
4904 @item -gstabs+
4905 @opindex gstabs+
4906 Produce debugging information in stabs format (if that is supported),
4907 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4908 use of these extensions is likely to make other debuggers crash or
4909 refuse to read the program.
4911 @item -gcoff
4912 @opindex gcoff
4913 Produce debugging information in COFF format (if that is supported).
4914 This is the format used by SDB on most System V systems prior to
4915 System V Release 4.
4917 @item -gxcoff
4918 @opindex gxcoff
4919 Produce debugging information in XCOFF format (if that is supported).
4920 This is the format used by the DBX debugger on IBM RS/6000 systems.
4922 @item -gxcoff+
4923 @opindex gxcoff+
4924 Produce debugging information in XCOFF format (if that is supported),
4925 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4926 use of these extensions is likely to make other debuggers crash or
4927 refuse to read the program, and may cause assemblers other than the GNU
4928 assembler (GAS) to fail with an error.
4930 @item -gdwarf-@var{version}
4931 @opindex gdwarf-@var{version}
4932 Produce debugging information in DWARF format (if that is supported).
4933 The value of @var{version} may be either 2, 3 or 4; the default version
4934 for most targets is 4.
4936 Note that with DWARF Version 2, some ports require and always
4937 use some non-conflicting DWARF 3 extensions in the unwind tables.
4939 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4940 for maximum benefit.
4942 @item -grecord-gcc-switches
4943 @opindex grecord-gcc-switches
4944 This switch causes the command-line options used to invoke the
4945 compiler that may affect code generation to be appended to the
4946 DW_AT_producer attribute in DWARF debugging information.  The options
4947 are concatenated with spaces separating them from each other and from
4948 the compiler version.  See also @option{-frecord-gcc-switches} for another
4949 way of storing compiler options into the object file.  This is the default.
4951 @item -gno-record-gcc-switches
4952 @opindex gno-record-gcc-switches
4953 Disallow appending command-line options to the DW_AT_producer attribute
4954 in DWARF debugging information.
4956 @item -gstrict-dwarf
4957 @opindex gstrict-dwarf
4958 Disallow using extensions of later DWARF standard version than selected
4959 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4960 DWARF extensions from later standard versions is allowed.
4962 @item -gno-strict-dwarf
4963 @opindex gno-strict-dwarf
4964 Allow using extensions of later DWARF standard version than selected with
4965 @option{-gdwarf-@var{version}}.
4967 @item -gvms
4968 @opindex gvms
4969 Produce debugging information in Alpha/VMS debug format (if that is
4970 supported).  This is the format used by DEBUG on Alpha/VMS systems.
4972 @item -g@var{level}
4973 @itemx -ggdb@var{level}
4974 @itemx -gstabs@var{level}
4975 @itemx -gcoff@var{level}
4976 @itemx -gxcoff@var{level}
4977 @itemx -gvms@var{level}
4978 Request debugging information and also use @var{level} to specify how
4979 much information.  The default level is 2.
4981 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4982 @option{-g}.
4984 Level 1 produces minimal information, enough for making backtraces in
4985 parts of the program that you don't plan to debug.  This includes
4986 descriptions of functions and external variables, but no information
4987 about local variables and no line numbers.
4989 Level 3 includes extra information, such as all the macro definitions
4990 present in the program.  Some debuggers support macro expansion when
4991 you use @option{-g3}.
4993 @option{-gdwarf-2} does not accept a concatenated debug level, because
4994 GCC used to support an option @option{-gdwarf} that meant to generate
4995 debug information in version 1 of the DWARF format (which is very
4996 different from version 2), and it would have been too confusing.  That
4997 debug format is long obsolete, but the option cannot be changed now.
4998 Instead use an additional @option{-g@var{level}} option to change the
4999 debug level for DWARF.
5001 @item -gtoggle
5002 @opindex gtoggle
5003 Turn off generation of debug info, if leaving out this option
5004 generates it, or turn it on at level 2 otherwise.  The position of this
5005 argument in the command line does not matter; it takes effect after all
5006 other options are processed, and it does so only once, no matter how
5007 many times it is given.  This is mainly intended to be used with
5008 @option{-fcompare-debug}.
5010 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5011 @opindex fdump-final-insns
5012 Dump the final internal representation (RTL) to @var{file}.  If the
5013 optional argument is omitted (or if @var{file} is @code{.}), the name
5014 of the dump file is determined by appending @code{.gkd} to the
5015 compilation output file name.
5017 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5018 @opindex fcompare-debug
5019 @opindex fno-compare-debug
5020 If no error occurs during compilation, run the compiler a second time,
5021 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5022 passed to the second compilation.  Dump the final internal
5023 representation in both compilations, and print an error if they differ.
5025 If the equal sign is omitted, the default @option{-gtoggle} is used.
5027 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5028 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5029 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5030 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5031 is used.
5033 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5034 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5035 of the final representation and the second compilation, preventing even
5036 @env{GCC_COMPARE_DEBUG} from taking effect.
5038 To verify full coverage during @option{-fcompare-debug} testing, set
5039 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5040 which GCC rejects as an invalid option in any actual compilation
5041 (rather than preprocessing, assembly or linking).  To get just a
5042 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5043 not overridden} will do.
5045 @item -fcompare-debug-second
5046 @opindex fcompare-debug-second
5047 This option is implicitly passed to the compiler for the second
5048 compilation requested by @option{-fcompare-debug}, along with options to
5049 silence warnings, and omitting other options that would cause
5050 side-effect compiler outputs to files or to the standard output.  Dump
5051 files and preserved temporary files are renamed so as to contain the
5052 @code{.gk} additional extension during the second compilation, to avoid
5053 overwriting those generated by the first.
5055 When this option is passed to the compiler driver, it causes the
5056 @emph{first} compilation to be skipped, which makes it useful for little
5057 other than debugging the compiler proper.
5059 @item -feliminate-dwarf2-dups
5060 @opindex feliminate-dwarf2-dups
5061 Compress DWARF 2 debugging information by eliminating duplicated
5062 information about each symbol.  This option only makes sense when
5063 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5065 @item -femit-struct-debug-baseonly
5066 Emit debug information for struct-like types
5067 only when the base name of the compilation source file
5068 matches the base name of file in which the struct is defined.
5070 This option substantially reduces the size of debugging information,
5071 but at significant potential loss in type information to the debugger.
5072 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5073 See @option{-femit-struct-debug-detailed} for more detailed control.
5075 This option works only with DWARF 2.
5077 @item -femit-struct-debug-reduced
5078 Emit debug information for struct-like types
5079 only when the base name of the compilation source file
5080 matches the base name of file in which the type is defined,
5081 unless the struct is a template or defined in a system header.
5083 This option significantly reduces the size of debugging information,
5084 with some potential loss in type information to the debugger.
5085 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5086 See @option{-femit-struct-debug-detailed} for more detailed control.
5088 This option works only with DWARF 2.
5090 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5091 Specify the struct-like types
5092 for which the compiler generates debug information.
5093 The intent is to reduce duplicate struct debug information
5094 between different object files within the same program.
5096 This option is a detailed version of
5097 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5098 which serves for most needs.
5100 A specification has the syntax@*
5101 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5103 The optional first word limits the specification to
5104 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5105 A struct type is used directly when it is the type of a variable, member.
5106 Indirect uses arise through pointers to structs.
5107 That is, when use of an incomplete struct is valid, the use is indirect.
5108 An example is
5109 @samp{struct one direct; struct two * indirect;}.
5111 The optional second word limits the specification to
5112 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5113 Generic structs are a bit complicated to explain.
5114 For C++, these are non-explicit specializations of template classes,
5115 or non-template classes within the above.
5116 Other programming languages have generics,
5117 but @option{-femit-struct-debug-detailed} does not yet implement them.
5119 The third word specifies the source files for those
5120 structs for which the compiler should emit debug information.
5121 The values @samp{none} and @samp{any} have the normal meaning.
5122 The value @samp{base} means that
5123 the base of name of the file in which the type declaration appears
5124 must match the base of the name of the main compilation file.
5125 In practice, this means that when compiling @file{foo.c}, debug information
5126 is generated for types declared in that file and @file{foo.h},
5127 but not other header files.
5128 The value @samp{sys} means those types satisfying @samp{base}
5129 or declared in system or compiler headers.
5131 You may need to experiment to determine the best settings for your application.
5133 The default is @option{-femit-struct-debug-detailed=all}.
5135 This option works only with DWARF 2.
5137 @item -fno-merge-debug-strings
5138 @opindex fmerge-debug-strings
5139 @opindex fno-merge-debug-strings
5140 Direct the linker to not merge together strings in the debugging
5141 information that are identical in different object files.  Merging is
5142 not supported by all assemblers or linkers.  Merging decreases the size
5143 of the debug information in the output file at the cost of increasing
5144 link processing time.  Merging is enabled by default.
5146 @item -fdebug-prefix-map=@var{old}=@var{new}
5147 @opindex fdebug-prefix-map
5148 When compiling files in directory @file{@var{old}}, record debugging
5149 information describing them as in @file{@var{new}} instead.
5151 @item -fno-dwarf2-cfi-asm
5152 @opindex fdwarf2-cfi-asm
5153 @opindex fno-dwarf2-cfi-asm
5154 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5155 instead of using GAS @code{.cfi_*} directives.
5157 @cindex @command{prof}
5158 @item -p
5159 @opindex p
5160 Generate extra code to write profile information suitable for the
5161 analysis program @command{prof}.  You must use this option when compiling
5162 the source files you want data about, and you must also use it when
5163 linking.
5165 @cindex @command{gprof}
5166 @item -pg
5167 @opindex pg
5168 Generate extra code to write profile information suitable for the
5169 analysis program @command{gprof}.  You must use this option when compiling
5170 the source files you want data about, and you must also use it when
5171 linking.
5173 @item -Q
5174 @opindex Q
5175 Makes the compiler print out each function name as it is compiled, and
5176 print some statistics about each pass when it finishes.
5178 @item -ftime-report
5179 @opindex ftime-report
5180 Makes the compiler print some statistics about the time consumed by each
5181 pass when it finishes.
5183 @item -fmem-report
5184 @opindex fmem-report
5185 Makes the compiler print some statistics about permanent memory
5186 allocation when it finishes.
5188 @item -fmem-report-wpa
5189 @opindex fmem-report-wpa
5190 Makes the compiler print some statistics about permanent memory
5191 allocation for the WPA phase only.
5193 @item -fpre-ipa-mem-report
5194 @opindex fpre-ipa-mem-report
5195 @item -fpost-ipa-mem-report
5196 @opindex fpost-ipa-mem-report
5197 Makes the compiler print some statistics about permanent memory
5198 allocation before or after interprocedural optimization.
5200 @item -fprofile-report
5201 @opindex fprofile-report
5202 Makes the compiler print some statistics about consistency of the
5203 (estimated) profile and effect of individual passes.
5205 @item -fstack-usage
5206 @opindex fstack-usage
5207 Makes the compiler output stack usage information for the program, on a
5208 per-function basis.  The filename for the dump is made by appending
5209 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5210 the output file, if explicitly specified and it is not an executable,
5211 otherwise it is the basename of the source file.  An entry is made up
5212 of three fields:
5214 @itemize
5215 @item
5216 The name of the function.
5217 @item
5218 A number of bytes.
5219 @item
5220 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5221 @end itemize
5223 The qualifier @code{static} means that the function manipulates the stack
5224 statically: a fixed number of bytes are allocated for the frame on function
5225 entry and released on function exit; no stack adjustments are otherwise made
5226 in the function.  The second field is this fixed number of bytes.
5228 The qualifier @code{dynamic} means that the function manipulates the stack
5229 dynamically: in addition to the static allocation described above, stack
5230 adjustments are made in the body of the function, for example to push/pop
5231 arguments around function calls.  If the qualifier @code{bounded} is also
5232 present, the amount of these adjustments is bounded at compile time and
5233 the second field is an upper bound of the total amount of stack used by
5234 the function.  If it is not present, the amount of these adjustments is
5235 not bounded at compile time and the second field only represents the
5236 bounded part.
5238 @item -fprofile-arcs
5239 @opindex fprofile-arcs
5240 Add code so that program flow @dfn{arcs} are instrumented.  During
5241 execution the program records how many times each branch and call is
5242 executed and how many times it is taken or returns.  When the compiled
5243 program exits it saves this data to a file called
5244 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5245 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5246 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5247 @var{auxname} is generated from the name of the output file, if
5248 explicitly specified and it is not the final executable, otherwise it is
5249 the basename of the source file.  In both cases any suffix is removed
5250 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5251 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5252 @xref{Cross-profiling}.
5254 @cindex @command{gcov}
5255 @item --coverage
5256 @opindex coverage
5258 This option is used to compile and link code instrumented for coverage
5259 analysis.  The option is a synonym for @option{-fprofile-arcs}
5260 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5261 linking).  See the documentation for those options for more details.
5263 @itemize
5265 @item
5266 Compile the source files with @option{-fprofile-arcs} plus optimization
5267 and code generation options.  For test coverage analysis, use the
5268 additional @option{-ftest-coverage} option.  You do not need to profile
5269 every source file in a program.
5271 @item
5272 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5273 (the latter implies the former).
5275 @item
5276 Run the program on a representative workload to generate the arc profile
5277 information.  This may be repeated any number of times.  You can run
5278 concurrent instances of your program, and provided that the file system
5279 supports locking, the data files will be correctly updated.  Also
5280 @code{fork} calls are detected and correctly handled (double counting
5281 will not happen).
5283 @item
5284 For profile-directed optimizations, compile the source files again with
5285 the same optimization and code generation options plus
5286 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5287 Control Optimization}).
5289 @item
5290 For test coverage analysis, use @command{gcov} to produce human readable
5291 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5292 @command{gcov} documentation for further information.
5294 @end itemize
5296 With @option{-fprofile-arcs}, for each function of your program GCC
5297 creates a program flow graph, then finds a spanning tree for the graph.
5298 Only arcs that are not on the spanning tree have to be instrumented: the
5299 compiler adds code to count the number of times that these arcs are
5300 executed.  When an arc is the only exit or only entrance to a block, the
5301 instrumentation code can be added to the block; otherwise, a new basic
5302 block must be created to hold the instrumentation code.
5304 @need 2000
5305 @item -ftest-coverage
5306 @opindex ftest-coverage
5307 Produce a notes file that the @command{gcov} code-coverage utility
5308 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5309 show program coverage.  Each source file's note file is called
5310 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5311 above for a description of @var{auxname} and instructions on how to
5312 generate test coverage data.  Coverage data matches the source files
5313 more closely if you do not optimize.
5315 @item -fdbg-cnt-list
5316 @opindex fdbg-cnt-list
5317 Print the name and the counter upper bound for all debug counters.
5320 @item -fdbg-cnt=@var{counter-value-list}
5321 @opindex fdbg-cnt
5322 Set the internal debug counter upper bound.  @var{counter-value-list}
5323 is a comma-separated list of @var{name}:@var{value} pairs
5324 which sets the upper bound of each debug counter @var{name} to @var{value}.
5325 All debug counters have the initial upper bound of @code{UINT_MAX};
5326 thus @code{dbg_cnt()} returns true always unless the upper bound
5327 is set by this option.
5328 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5329 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5331 @item -fenable-@var{kind}-@var{pass}
5332 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5333 @opindex fdisable-
5334 @opindex fenable-
5336 This is a set of options that are used to explicitly disable/enable
5337 optimization passes.  These options are intended for use for debugging GCC.
5338 Compiler users should use regular options for enabling/disabling
5339 passes instead.
5341 @table @gcctabopt
5343 @item -fdisable-ipa-@var{pass}
5344 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5345 statically invoked in the compiler multiple times, the pass name should be
5346 appended with a sequential number starting from 1.
5348 @item -fdisable-rtl-@var{pass}
5349 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5350 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5351 statically invoked in the compiler multiple times, the pass name should be
5352 appended with a sequential number starting from 1.  @var{range-list} is a 
5353 comma-separated list of function ranges or assembler names.  Each range is a number
5354 pair separated by a colon.  The range is inclusive in both ends.  If the range
5355 is trivial, the number pair can be simplified as a single number.  If the
5356 function's cgraph node's @var{uid} falls within one of the specified ranges,
5357 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5358 function header of a dump file, and the pass names can be dumped by using
5359 option @option{-fdump-passes}.
5361 @item -fdisable-tree-@var{pass}
5362 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5363 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5364 option arguments.
5366 @item -fenable-ipa-@var{pass}
5367 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5368 statically invoked in the compiler multiple times, the pass name should be
5369 appended with a sequential number starting from 1.
5371 @item -fenable-rtl-@var{pass}
5372 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5373 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5374 description and examples.
5376 @item -fenable-tree-@var{pass}
5377 @itemx -fenable-tree-@var{pass}=@var{range-list}
5378 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5379 of option arguments.
5381 @end table
5383 Here are some examples showing uses of these options.
5385 @smallexample
5387 # disable ccp1 for all functions
5388    -fdisable-tree-ccp1
5389 # disable complete unroll for function whose cgraph node uid is 1
5390    -fenable-tree-cunroll=1
5391 # disable gcse2 for functions at the following ranges [1,1],
5392 # [300,400], and [400,1000]
5393 # disable gcse2 for functions foo and foo2
5394    -fdisable-rtl-gcse2=foo,foo2
5395 # disable early inlining
5396    -fdisable-tree-einline
5397 # disable ipa inlining
5398    -fdisable-ipa-inline
5399 # enable tree full unroll
5400    -fenable-tree-unroll
5402 @end smallexample
5404 @item -d@var{letters}
5405 @itemx -fdump-rtl-@var{pass}
5406 @itemx -fdump-rtl-@var{pass}=@var{filename}
5407 @opindex d
5408 Says to make debugging dumps during compilation at times specified by
5409 @var{letters}.  This is used for debugging the RTL-based passes of the
5410 compiler.  The file names for most of the dumps are made by appending
5411 a pass number and a word to the @var{dumpname}, and the files are
5412 created in the directory of the output file. In case of
5413 @option{=@var{filename}} option, the dump is output on the given file
5414 instead of the pass numbered dump files. Note that the pass number is
5415 computed statically as passes get registered into the pass manager.
5416 Thus the numbering is not related to the dynamic order of execution of
5417 passes.  In particular, a pass installed by a plugin could have a
5418 number over 200 even if it executed quite early.  @var{dumpname} is
5419 generated from the name of the output file, if explicitly specified
5420 and it is not an executable, otherwise it is the basename of the
5421 source file. These switches may have different effects when
5422 @option{-E} is used for preprocessing.
5424 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5425 @option{-d} option @var{letters}.  Here are the possible
5426 letters for use in @var{pass} and @var{letters}, and their meanings:
5428 @table @gcctabopt
5430 @item -fdump-rtl-alignments
5431 @opindex fdump-rtl-alignments
5432 Dump after branch alignments have been computed.
5434 @item -fdump-rtl-asmcons
5435 @opindex fdump-rtl-asmcons
5436 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5438 @item -fdump-rtl-auto_inc_dec
5439 @opindex fdump-rtl-auto_inc_dec
5440 Dump after auto-inc-dec discovery.  This pass is only run on
5441 architectures that have auto inc or auto dec instructions.
5443 @item -fdump-rtl-barriers
5444 @opindex fdump-rtl-barriers
5445 Dump after cleaning up the barrier instructions.
5447 @item -fdump-rtl-bbpart
5448 @opindex fdump-rtl-bbpart
5449 Dump after partitioning hot and cold basic blocks.
5451 @item -fdump-rtl-bbro
5452 @opindex fdump-rtl-bbro
5453 Dump after block reordering.
5455 @item -fdump-rtl-btl1
5456 @itemx -fdump-rtl-btl2
5457 @opindex fdump-rtl-btl2
5458 @opindex fdump-rtl-btl2
5459 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5460 after the two branch
5461 target load optimization passes.
5463 @item -fdump-rtl-bypass
5464 @opindex fdump-rtl-bypass
5465 Dump after jump bypassing and control flow optimizations.
5467 @item -fdump-rtl-combine
5468 @opindex fdump-rtl-combine
5469 Dump after the RTL instruction combination pass.
5471 @item -fdump-rtl-compgotos
5472 @opindex fdump-rtl-compgotos
5473 Dump after duplicating the computed gotos.
5475 @item -fdump-rtl-ce1
5476 @itemx -fdump-rtl-ce2
5477 @itemx -fdump-rtl-ce3
5478 @opindex fdump-rtl-ce1
5479 @opindex fdump-rtl-ce2
5480 @opindex fdump-rtl-ce3
5481 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5482 @option{-fdump-rtl-ce3} enable dumping after the three
5483 if conversion passes.
5485 @item -fdump-rtl-cprop_hardreg
5486 @opindex fdump-rtl-cprop_hardreg
5487 Dump after hard register copy propagation.
5489 @item -fdump-rtl-csa
5490 @opindex fdump-rtl-csa
5491 Dump after combining stack adjustments.
5493 @item -fdump-rtl-cse1
5494 @itemx -fdump-rtl-cse2
5495 @opindex fdump-rtl-cse1
5496 @opindex fdump-rtl-cse2
5497 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5498 the two common subexpression elimination passes.
5500 @item -fdump-rtl-dce
5501 @opindex fdump-rtl-dce
5502 Dump after the standalone dead code elimination passes.
5504 @item -fdump-rtl-dbr
5505 @opindex fdump-rtl-dbr
5506 Dump after delayed branch scheduling.
5508 @item -fdump-rtl-dce1
5509 @itemx -fdump-rtl-dce2
5510 @opindex fdump-rtl-dce1
5511 @opindex fdump-rtl-dce2
5512 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5513 the two dead store elimination passes.
5515 @item -fdump-rtl-eh
5516 @opindex fdump-rtl-eh
5517 Dump after finalization of EH handling code.
5519 @item -fdump-rtl-eh_ranges
5520 @opindex fdump-rtl-eh_ranges
5521 Dump after conversion of EH handling range regions.
5523 @item -fdump-rtl-expand
5524 @opindex fdump-rtl-expand
5525 Dump after RTL generation.
5527 @item -fdump-rtl-fwprop1
5528 @itemx -fdump-rtl-fwprop2
5529 @opindex fdump-rtl-fwprop1
5530 @opindex fdump-rtl-fwprop2
5531 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5532 dumping after the two forward propagation passes.
5534 @item -fdump-rtl-gcse1
5535 @itemx -fdump-rtl-gcse2
5536 @opindex fdump-rtl-gcse1
5537 @opindex fdump-rtl-gcse2
5538 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5539 after global common subexpression elimination.
5541 @item -fdump-rtl-init-regs
5542 @opindex fdump-rtl-init-regs
5543 Dump after the initialization of the registers.
5545 @item -fdump-rtl-initvals
5546 @opindex fdump-rtl-initvals
5547 Dump after the computation of the initial value sets.
5549 @item -fdump-rtl-into_cfglayout
5550 @opindex fdump-rtl-into_cfglayout
5551 Dump after converting to cfglayout mode.
5553 @item -fdump-rtl-ira
5554 @opindex fdump-rtl-ira
5555 Dump after iterated register allocation.
5557 @item -fdump-rtl-jump
5558 @opindex fdump-rtl-jump
5559 Dump after the second jump optimization.
5561 @item -fdump-rtl-loop2
5562 @opindex fdump-rtl-loop2
5563 @option{-fdump-rtl-loop2} enables dumping after the rtl
5564 loop optimization passes.
5566 @item -fdump-rtl-mach
5567 @opindex fdump-rtl-mach
5568 Dump after performing the machine dependent reorganization pass, if that
5569 pass exists.
5571 @item -fdump-rtl-mode_sw
5572 @opindex fdump-rtl-mode_sw
5573 Dump after removing redundant mode switches.
5575 @item -fdump-rtl-rnreg
5576 @opindex fdump-rtl-rnreg
5577 Dump after register renumbering.
5579 @item -fdump-rtl-outof_cfglayout
5580 @opindex fdump-rtl-outof_cfglayout
5581 Dump after converting from cfglayout mode.
5583 @item -fdump-rtl-peephole2
5584 @opindex fdump-rtl-peephole2
5585 Dump after the peephole pass.
5587 @item -fdump-rtl-postreload
5588 @opindex fdump-rtl-postreload
5589 Dump after post-reload optimizations.
5591 @itemx -fdump-rtl-pro_and_epilogue
5592 @opindex fdump-rtl-pro_and_epilogue
5593 Dump after generating the function prologues and epilogues.
5595 @item -fdump-rtl-regmove
5596 @opindex fdump-rtl-regmove
5597 Dump after the register move pass.
5599 @item -fdump-rtl-sched1
5600 @itemx -fdump-rtl-sched2
5601 @opindex fdump-rtl-sched1
5602 @opindex fdump-rtl-sched2
5603 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5604 after the basic block scheduling passes.
5606 @item -fdump-rtl-see
5607 @opindex fdump-rtl-see
5608 Dump after sign extension elimination.
5610 @item -fdump-rtl-seqabstr
5611 @opindex fdump-rtl-seqabstr
5612 Dump after common sequence discovery.
5614 @item -fdump-rtl-shorten
5615 @opindex fdump-rtl-shorten
5616 Dump after shortening branches.
5618 @item -fdump-rtl-sibling
5619 @opindex fdump-rtl-sibling
5620 Dump after sibling call optimizations.
5622 @item -fdump-rtl-split1
5623 @itemx -fdump-rtl-split2
5624 @itemx -fdump-rtl-split3
5625 @itemx -fdump-rtl-split4
5626 @itemx -fdump-rtl-split5
5627 @opindex fdump-rtl-split1
5628 @opindex fdump-rtl-split2
5629 @opindex fdump-rtl-split3
5630 @opindex fdump-rtl-split4
5631 @opindex fdump-rtl-split5
5632 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5633 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5634 @option{-fdump-rtl-split5} enable dumping after five rounds of
5635 instruction splitting.
5637 @item -fdump-rtl-sms
5638 @opindex fdump-rtl-sms
5639 Dump after modulo scheduling.  This pass is only run on some
5640 architectures.
5642 @item -fdump-rtl-stack
5643 @opindex fdump-rtl-stack
5644 Dump after conversion from GCC's ``flat register file'' registers to the
5645 x87's stack-like registers.  This pass is only run on x86 variants.
5647 @item -fdump-rtl-subreg1
5648 @itemx -fdump-rtl-subreg2
5649 @opindex fdump-rtl-subreg1
5650 @opindex fdump-rtl-subreg2
5651 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5652 the two subreg expansion passes.
5654 @item -fdump-rtl-unshare
5655 @opindex fdump-rtl-unshare
5656 Dump after all rtl has been unshared.
5658 @item -fdump-rtl-vartrack
5659 @opindex fdump-rtl-vartrack
5660 Dump after variable tracking.
5662 @item -fdump-rtl-vregs
5663 @opindex fdump-rtl-vregs
5664 Dump after converting virtual registers to hard registers.
5666 @item -fdump-rtl-web
5667 @opindex fdump-rtl-web
5668 Dump after live range splitting.
5670 @item -fdump-rtl-regclass
5671 @itemx -fdump-rtl-subregs_of_mode_init
5672 @itemx -fdump-rtl-subregs_of_mode_finish
5673 @itemx -fdump-rtl-dfinit
5674 @itemx -fdump-rtl-dfinish
5675 @opindex fdump-rtl-regclass
5676 @opindex fdump-rtl-subregs_of_mode_init
5677 @opindex fdump-rtl-subregs_of_mode_finish
5678 @opindex fdump-rtl-dfinit
5679 @opindex fdump-rtl-dfinish
5680 These dumps are defined but always produce empty files.
5682 @item -da
5683 @itemx -fdump-rtl-all
5684 @opindex da
5685 @opindex fdump-rtl-all
5686 Produce all the dumps listed above.
5688 @item -dA
5689 @opindex dA
5690 Annotate the assembler output with miscellaneous debugging information.
5692 @item -dD
5693 @opindex dD
5694 Dump all macro definitions, at the end of preprocessing, in addition to
5695 normal output.
5697 @item -dH
5698 @opindex dH
5699 Produce a core dump whenever an error occurs.
5701 @item -dp
5702 @opindex dp
5703 Annotate the assembler output with a comment indicating which
5704 pattern and alternative is used.  The length of each instruction is
5705 also printed.
5707 @item -dP
5708 @opindex dP
5709 Dump the RTL in the assembler output as a comment before each instruction.
5710 Also turns on @option{-dp} annotation.
5712 @item -dv
5713 @opindex dv
5714 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5715 dump a representation of the control flow graph suitable for viewing with VCG
5716 to @file{@var{file}.@var{pass}.vcg}.
5718 @item -dx
5719 @opindex dx
5720 Just generate RTL for a function instead of compiling it.  Usually used
5721 with @option{-fdump-rtl-expand}.
5722 @end table
5724 @item -fdump-noaddr
5725 @opindex fdump-noaddr
5726 When doing debugging dumps, suppress address output.  This makes it more
5727 feasible to use diff on debugging dumps for compiler invocations with
5728 different compiler binaries and/or different
5729 text / bss / data / heap / stack / dso start locations.
5731 @item -fdump-unnumbered
5732 @opindex fdump-unnumbered
5733 When doing debugging dumps, suppress instruction numbers and address output.
5734 This makes it more feasible to use diff on debugging dumps for compiler
5735 invocations with different options, in particular with and without
5736 @option{-g}.
5738 @item -fdump-unnumbered-links
5739 @opindex fdump-unnumbered-links
5740 When doing debugging dumps (see @option{-d} option above), suppress
5741 instruction numbers for the links to the previous and next instructions
5742 in a sequence.
5744 @item -fdump-translation-unit @r{(C++ only)}
5745 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5746 @opindex fdump-translation-unit
5747 Dump a representation of the tree structure for the entire translation
5748 unit to a file.  The file name is made by appending @file{.tu} to the
5749 source file name, and the file is created in the same directory as the
5750 output file.  If the @samp{-@var{options}} form is used, @var{options}
5751 controls the details of the dump as described for the
5752 @option{-fdump-tree} options.
5754 @item -fdump-class-hierarchy @r{(C++ only)}
5755 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5756 @opindex fdump-class-hierarchy
5757 Dump a representation of each class's hierarchy and virtual function
5758 table layout to a file.  The file name is made by appending
5759 @file{.class} to the source file name, and the file is created in the
5760 same directory as the output file.  If the @samp{-@var{options}} form
5761 is used, @var{options} controls the details of the dump as described
5762 for the @option{-fdump-tree} options.
5764 @item -fdump-ipa-@var{switch}
5765 @opindex fdump-ipa
5766 Control the dumping at various stages of inter-procedural analysis
5767 language tree to a file.  The file name is generated by appending a
5768 switch specific suffix to the source file name, and the file is created
5769 in the same directory as the output file.  The following dumps are
5770 possible:
5772 @table @samp
5773 @item all
5774 Enables all inter-procedural analysis dumps.
5776 @item cgraph
5777 Dumps information about call-graph optimization, unused function removal,
5778 and inlining decisions.
5780 @item inline
5781 Dump after function inlining.
5783 @end table
5785 @item -fdump-passes
5786 @opindex fdump-passes
5787 Dump the list of optimization passes that are turned on and off by
5788 the current command-line options.
5790 @item -fdump-statistics-@var{option}
5791 @opindex fdump-statistics
5792 Enable and control dumping of pass statistics in a separate file.  The
5793 file name is generated by appending a suffix ending in
5794 @samp{.statistics} to the source file name, and the file is created in
5795 the same directory as the output file.  If the @samp{-@var{option}}
5796 form is used, @samp{-stats} causes counters to be summed over the
5797 whole compilation unit while @samp{-details} dumps every event as
5798 the passes generate them.  The default with no option is to sum
5799 counters for each function compiled.
5801 @item -fdump-tree-@var{switch}
5802 @itemx -fdump-tree-@var{switch}-@var{options}
5803 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
5804 @opindex fdump-tree
5805 Control the dumping at various stages of processing the intermediate
5806 language tree to a file.  The file name is generated by appending a
5807 switch-specific suffix to the source file name, and the file is
5808 created in the same directory as the output file. In case of
5809 @option{=@var{filename}} option, the dump is output on the given file
5810 instead of the auto named dump files.  If the @samp{-@var{options}}
5811 form is used, @var{options} is a list of @samp{-} separated options
5812 which control the details of the dump.  Not all options are applicable
5813 to all dumps; those that are not meaningful are ignored.  The
5814 following options are available
5816 @table @samp
5817 @item address
5818 Print the address of each node.  Usually this is not meaningful as it
5819 changes according to the environment and source file.  Its primary use
5820 is for tying up a dump file with a debug environment.
5821 @item asmname
5822 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5823 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5824 use working backward from mangled names in the assembly file.
5825 @item slim
5826 Inhibit dumping of members of a scope or body of a function merely
5827 because that scope has been reached.  Only dump such items when they
5828 are directly reachable by some other path.  When dumping pretty-printed
5829 trees, this option inhibits dumping the bodies of control structures.
5830 @item raw
5831 Print a raw representation of the tree.  By default, trees are
5832 pretty-printed into a C-like representation.
5833 @item details
5834 Enable more detailed dumps (not honored by every dump option). Also
5835 include information from the optimization passes.
5836 @item stats
5837 Enable dumping various statistics about the pass (not honored by every dump
5838 option).
5839 @item blocks
5840 Enable showing basic block boundaries (disabled in raw dumps).
5841 @item vops
5842 Enable showing virtual operands for every statement.
5843 @item lineno
5844 Enable showing line numbers for statements.
5845 @item uid
5846 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5847 @item verbose
5848 Enable showing the tree dump for each statement.
5849 @item eh
5850 Enable showing the EH region number holding each statement.
5851 @item scev
5852 Enable showing scalar evolution analysis details.
5853 @item optimized
5854 Enable showing optimization information (only available in certain
5855 passes).
5856 @item missed
5857 Enable showing missed optimization information (only available in certain
5858 passes).
5859 @item notes
5860 Enable other detailed optimization information (only available in
5861 certain passes).
5862 @item =@var{filename}
5863 Instead of an auto named dump file, output into the given file
5864 name. The file names @file{stdout} and @file{stderr} are treated
5865 specially and are considered already open standard streams. For
5866 example,
5868 @smallexample
5869 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
5870      -fdump-tree-pre=stderr file.c
5871 @end smallexample
5873 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
5874 output on to @file{stderr}. If two conflicting dump filenames are
5875 given for the same pass, then the latter option overrides the earlier
5876 one.
5878 @item all
5879 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5880 and @option{lineno}.
5882 @item optall
5883 Turn on all optimization options, i.e., @option{optimized},
5884 @option{missed}, and @option{note}.
5885 @end table
5887 The following tree dumps are possible:
5888 @table @samp
5890 @item original
5891 @opindex fdump-tree-original
5892 Dump before any tree based optimization, to @file{@var{file}.original}.
5894 @item optimized
5895 @opindex fdump-tree-optimized
5896 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5898 @item gimple
5899 @opindex fdump-tree-gimple
5900 Dump each function before and after the gimplification pass to a file.  The
5901 file name is made by appending @file{.gimple} to the source file name.
5903 @item cfg
5904 @opindex fdump-tree-cfg
5905 Dump the control flow graph of each function to a file.  The file name is
5906 made by appending @file{.cfg} to the source file name.
5908 @item vcg
5909 @opindex fdump-tree-vcg
5910 Dump the control flow graph of each function to a file in VCG format.  The
5911 file name is made by appending @file{.vcg} to the source file name.  Note
5912 that if the file contains more than one function, the generated file cannot
5913 be used directly by VCG@.  You must cut and paste each function's
5914 graph into its own separate file first.
5916 @item ch
5917 @opindex fdump-tree-ch
5918 Dump each function after copying loop headers.  The file name is made by
5919 appending @file{.ch} to the source file name.
5921 @item ssa
5922 @opindex fdump-tree-ssa
5923 Dump SSA related information to a file.  The file name is made by appending
5924 @file{.ssa} to the source file name.
5926 @item alias
5927 @opindex fdump-tree-alias
5928 Dump aliasing information for each function.  The file name is made by
5929 appending @file{.alias} to the source file name.
5931 @item ccp
5932 @opindex fdump-tree-ccp
5933 Dump each function after CCP@.  The file name is made by appending
5934 @file{.ccp} to the source file name.
5936 @item storeccp
5937 @opindex fdump-tree-storeccp
5938 Dump each function after STORE-CCP@.  The file name is made by appending
5939 @file{.storeccp} to the source file name.
5941 @item pre
5942 @opindex fdump-tree-pre
5943 Dump trees after partial redundancy elimination.  The file name is made
5944 by appending @file{.pre} to the source file name.
5946 @item fre
5947 @opindex fdump-tree-fre
5948 Dump trees after full redundancy elimination.  The file name is made
5949 by appending @file{.fre} to the source file name.
5951 @item copyprop
5952 @opindex fdump-tree-copyprop
5953 Dump trees after copy propagation.  The file name is made
5954 by appending @file{.copyprop} to the source file name.
5956 @item store_copyprop
5957 @opindex fdump-tree-store_copyprop
5958 Dump trees after store copy-propagation.  The file name is made
5959 by appending @file{.store_copyprop} to the source file name.
5961 @item dce
5962 @opindex fdump-tree-dce
5963 Dump each function after dead code elimination.  The file name is made by
5964 appending @file{.dce} to the source file name.
5966 @item mudflap
5967 @opindex fdump-tree-mudflap
5968 Dump each function after adding mudflap instrumentation.  The file name is
5969 made by appending @file{.mudflap} to the source file name.
5971 @item sra
5972 @opindex fdump-tree-sra
5973 Dump each function after performing scalar replacement of aggregates.  The
5974 file name is made by appending @file{.sra} to the source file name.
5976 @item sink
5977 @opindex fdump-tree-sink
5978 Dump each function after performing code sinking.  The file name is made
5979 by appending @file{.sink} to the source file name.
5981 @item dom
5982 @opindex fdump-tree-dom
5983 Dump each function after applying dominator tree optimizations.  The file
5984 name is made by appending @file{.dom} to the source file name.
5986 @item dse
5987 @opindex fdump-tree-dse
5988 Dump each function after applying dead store elimination.  The file
5989 name is made by appending @file{.dse} to the source file name.
5991 @item phiopt
5992 @opindex fdump-tree-phiopt
5993 Dump each function after optimizing PHI nodes into straightline code.  The file
5994 name is made by appending @file{.phiopt} to the source file name.
5996 @item forwprop
5997 @opindex fdump-tree-forwprop
5998 Dump each function after forward propagating single use variables.  The file
5999 name is made by appending @file{.forwprop} to the source file name.
6001 @item copyrename
6002 @opindex fdump-tree-copyrename
6003 Dump each function after applying the copy rename optimization.  The file
6004 name is made by appending @file{.copyrename} to the source file name.
6006 @item nrv
6007 @opindex fdump-tree-nrv
6008 Dump each function after applying the named return value optimization on
6009 generic trees.  The file name is made by appending @file{.nrv} to the source
6010 file name.
6012 @item vect
6013 @opindex fdump-tree-vect
6014 Dump each function after applying vectorization of loops.  The file name is
6015 made by appending @file{.vect} to the source file name.
6017 @item slp
6018 @opindex fdump-tree-slp
6019 Dump each function after applying vectorization of basic blocks.  The file name
6020 is made by appending @file{.slp} to the source file name.
6022 @item vrp
6023 @opindex fdump-tree-vrp
6024 Dump each function after Value Range Propagation (VRP).  The file name
6025 is made by appending @file{.vrp} to the source file name.
6027 @item all
6028 @opindex fdump-tree-all
6029 Enable all the available tree dumps with the flags provided in this option.
6030 @end table
6032 @item -fopt-info
6033 @itemx -fopt-info-@var{options}
6034 @itemx -fopt-info-@var{options}=@var{filename}
6035 @opindex fopt-info
6036 Controls optimization dumps from various optimization passes. If the
6037 @samp{-@var{options}} form is used, @var{options} is a list of
6038 @samp{-} separated options to select the dump details and
6039 optimizations.  If @var{options} is not specified, it defaults to
6040 @option{all} for details and @option{optall} for optimization
6041 groups. If the @var{filename} is not specified, it defaults to
6042 @file{stderr}. Note that the output @var{filename} will be overwritten
6043 in case of multiple translation units. If a combined output from
6044 multiple translation units is desired, @file{stderr} should be used
6045 instead.
6047 The options can be divided into two groups, 1) options describing the
6048 verbosity of the dump, and 2) options describing which optimizations
6049 should be included. The options from both the groups can be freely
6050 mixed as they are non-overlapping. However, in case of any conflicts,
6051 the latter options override the earlier options on the command
6052 line. Though multiple -fopt-info options are accepted, only one of
6053 them can have @option{=filename}. If other filenames are provided then
6054 all but the first one are ignored.
6056 The dump verbosity has the following options
6058 @table @samp
6059 @item optimized
6060 Print information when an optimization is successfully applied. It is
6061 up to a pass to decide which information is relevant. For example, the
6062 vectorizer passes print the source location of loops which got
6063 successfully vectorized.
6064 @item missed
6065 Print information about missed optimizations. Individual passes
6066 control which informations to include in the output. For example,
6068 @smallexample
6069 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6070 @end smallexample
6072 will print information about missed optimization opportunities from
6073 vectorization passes on stderr.
6074 @item note
6075 Print verbose information about optimizations, such as certain
6076 transformations, more detailed messages about decisions etc.
6077 @item all
6078 Print detailed optimization information. This includes
6079 @var{optimized}, @var{missed}, and @var{note}.
6080 @end table
6082 The second set of options describes a group of optimizations and may
6083 include one or more of the following.
6085 @table @samp
6086 @item ipa
6087 Enable dumps from all interprocedural optimizations.
6088 @item loop
6089 Enable dumps from all loop optimizations.
6090 @item inline
6091 Enable dumps from all inlining optimizations.
6092 @item vec
6093 Enable dumps from all vectorization optimizations.
6094 @end table
6096 For example,
6097 @smallexample
6098 gcc -O3 -fopt-info-missed=missed.all
6099 @end smallexample
6101 outputs missed optimization report from all the passes into
6102 @file{missed.all}.
6104 As another example,
6105 @smallexample
6106 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6107 @end smallexample
6109 will output information about missed optimizations as well as
6110 optimized locations from all the inlining passes into
6111 @file{inline.txt}.
6113 If the @var{filename} is provided, then the dumps from all the
6114 applicable optimizations are concatenated into the @file{filename}.
6115 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6116 omitted, it defaults to @option{all-optall}, which means dump all
6117 available optimization info from all the passes. In the following
6118 example, all optimization info is output on to @file{stderr}.
6120 @smallexample
6121 gcc -O3 -fopt-info
6122 @end smallexample
6124 Note that @option{-fopt-info-vec-missed} behaves the same as
6125 @option{-fopt-info-missed-vec}.
6127 As another example, consider
6129 @smallexample
6130 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6131 @end smallexample
6133 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6134 in conflict since only one output file is allowed. In this case, only
6135 the first option takes effect and the subsequent options are
6136 ignored. Thus only the @file{vec.miss} is produced which cotaints
6137 dumps from the vectorizer about missed opportunities.
6139 @item -ftree-vectorizer-verbose=@var{n}
6140 @opindex ftree-vectorizer-verbose
6141 This option is deprecated and is implemented in terms of
6142 @option{-fopt-info}. Please use @option{-fopt-info-@var{kind}} form
6143 instead, where @var{kind} is one of the valid opt-info options. It
6144 prints additional optimization information.  For @var{n}=0 no
6145 diagnostic information is reported.  If @var{n}=1 the vectorizer
6146 reports each loop that got vectorized, and the total number of loops
6147 that got vectorized.  If @var{n}=2 the vectorizer reports locations
6148 which could not be vectorized and the reasons for those. For any
6149 higher verbosity levels all the analysis and transformation
6150 information from the vectorizer is reported.
6152 Note that the information output by @option{-ftree-vectorizer-verbose}
6153 option is sent to @file{stderr}. If the equivalent form
6154 @option{-fopt-info-@var{options}=@var{filename}} is used then the
6155 output is sent into @var{filename} instead.
6157 @item -frandom-seed=@var{string}
6158 @opindex frandom-seed
6159 This option provides a seed that GCC uses in place of
6160 random numbers in generating certain symbol names
6161 that have to be different in every compiled file.  It is also used to
6162 place unique stamps in coverage data files and the object files that
6163 produce them.  You can use the @option{-frandom-seed} option to produce
6164 reproducibly identical object files.
6166 The @var{string} should be different for every file you compile.
6168 @item -fsched-verbose=@var{n}
6169 @opindex fsched-verbose
6170 On targets that use instruction scheduling, this option controls the
6171 amount of debugging output the scheduler prints.  This information is
6172 written to standard error, unless @option{-fdump-rtl-sched1} or
6173 @option{-fdump-rtl-sched2} is specified, in which case it is output
6174 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6175 respectively.  However for @var{n} greater than nine, the output is
6176 always printed to standard error.
6178 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6179 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6180 For @var{n} greater than one, it also output basic block probabilities,
6181 detailed ready list information and unit/insn info.  For @var{n} greater
6182 than two, it includes RTL at abort point, control-flow and regions info.
6183 And for @var{n} over four, @option{-fsched-verbose} also includes
6184 dependence info.
6186 @item -save-temps
6187 @itemx -save-temps=cwd
6188 @opindex save-temps
6189 Store the usual ``temporary'' intermediate files permanently; place them
6190 in the current directory and name them based on the source file.  Thus,
6191 compiling @file{foo.c} with @option{-c -save-temps} produces files
6192 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6193 preprocessed @file{foo.i} output file even though the compiler now
6194 normally uses an integrated preprocessor.
6196 When used in combination with the @option{-x} command-line option,
6197 @option{-save-temps} is sensible enough to avoid over writing an
6198 input source file with the same extension as an intermediate file.
6199 The corresponding intermediate file may be obtained by renaming the
6200 source file before using @option{-save-temps}.
6202 If you invoke GCC in parallel, compiling several different source
6203 files that share a common base name in different subdirectories or the
6204 same source file compiled for multiple output destinations, it is
6205 likely that the different parallel compilers will interfere with each
6206 other, and overwrite the temporary files.  For instance:
6208 @smallexample
6209 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6210 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6211 @end smallexample
6213 may result in @file{foo.i} and @file{foo.o} being written to
6214 simultaneously by both compilers.
6216 @item -save-temps=obj
6217 @opindex save-temps=obj
6218 Store the usual ``temporary'' intermediate files permanently.  If the
6219 @option{-o} option is used, the temporary files are based on the
6220 object file.  If the @option{-o} option is not used, the
6221 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6223 For example:
6225 @smallexample
6226 gcc -save-temps=obj -c foo.c
6227 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6228 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6229 @end smallexample
6231 @noindent
6232 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6233 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6234 @file{dir2/yfoobar.o}.
6236 @item -time@r{[}=@var{file}@r{]}
6237 @opindex time
6238 Report the CPU time taken by each subprocess in the compilation
6239 sequence.  For C source files, this is the compiler proper and assembler
6240 (plus the linker if linking is done).
6242 Without the specification of an output file, the output looks like this:
6244 @smallexample
6245 # cc1 0.12 0.01
6246 # as 0.00 0.01
6247 @end smallexample
6249 The first number on each line is the ``user time'', that is time spent
6250 executing the program itself.  The second number is ``system time'',
6251 time spent executing operating system routines on behalf of the program.
6252 Both numbers are in seconds.
6254 With the specification of an output file, the output is appended to the
6255 named file, and it looks like this:
6257 @smallexample
6258 0.12 0.01 cc1 @var{options}
6259 0.00 0.01 as @var{options}
6260 @end smallexample
6262 The ``user time'' and the ``system time'' are moved before the program
6263 name, and the options passed to the program are displayed, so that one
6264 can later tell what file was being compiled, and with which options.
6266 @item -fvar-tracking
6267 @opindex fvar-tracking
6268 Run variable tracking pass.  It computes where variables are stored at each
6269 position in code.  Better debugging information is then generated
6270 (if the debugging information format supports this information).
6272 It is enabled by default when compiling with optimization (@option{-Os},
6273 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6274 the debug info format supports it.
6276 @item -fvar-tracking-assignments
6277 @opindex fvar-tracking-assignments
6278 @opindex fno-var-tracking-assignments
6279 Annotate assignments to user variables early in the compilation and
6280 attempt to carry the annotations over throughout the compilation all the
6281 way to the end, in an attempt to improve debug information while
6282 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6284 It can be enabled even if var-tracking is disabled, in which case
6285 annotations are created and maintained, but discarded at the end.
6287 @item -fvar-tracking-assignments-toggle
6288 @opindex fvar-tracking-assignments-toggle
6289 @opindex fno-var-tracking-assignments-toggle
6290 Toggle @option{-fvar-tracking-assignments}, in the same way that
6291 @option{-gtoggle} toggles @option{-g}.
6293 @item -print-file-name=@var{library}
6294 @opindex print-file-name
6295 Print the full absolute name of the library file @var{library} that
6296 would be used when linking---and don't do anything else.  With this
6297 option, GCC does not compile or link anything; it just prints the
6298 file name.
6300 @item -print-multi-directory
6301 @opindex print-multi-directory
6302 Print the directory name corresponding to the multilib selected by any
6303 other switches present in the command line.  This directory is supposed
6304 to exist in @env{GCC_EXEC_PREFIX}.
6306 @item -print-multi-lib
6307 @opindex print-multi-lib
6308 Print the mapping from multilib directory names to compiler switches
6309 that enable them.  The directory name is separated from the switches by
6310 @samp{;}, and each switch starts with an @samp{@@} instead of the
6311 @samp{-}, without spaces between multiple switches.  This is supposed to
6312 ease shell processing.
6314 @item -print-multi-os-directory
6315 @opindex print-multi-os-directory
6316 Print the path to OS libraries for the selected
6317 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6318 present in the @file{lib} subdirectory and no multilibs are used, this is
6319 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6320 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6321 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6322 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6324 @item -print-prog-name=@var{program}
6325 @opindex print-prog-name
6326 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6328 @item -print-libgcc-file-name
6329 @opindex print-libgcc-file-name
6330 Same as @option{-print-file-name=libgcc.a}.
6332 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6333 but you do want to link with @file{libgcc.a}.  You can do:
6335 @smallexample
6336 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6337 @end smallexample
6339 @item -print-search-dirs
6340 @opindex print-search-dirs
6341 Print the name of the configured installation directory and a list of
6342 program and library directories @command{gcc} searches---and don't do anything else.
6344 This is useful when @command{gcc} prints the error message
6345 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6346 To resolve this you either need to put @file{cpp0} and the other compiler
6347 components where @command{gcc} expects to find them, or you can set the environment
6348 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6349 Don't forget the trailing @samp{/}.
6350 @xref{Environment Variables}.
6352 @item -print-sysroot
6353 @opindex print-sysroot
6354 Print the target sysroot directory that is used during
6355 compilation.  This is the target sysroot specified either at configure
6356 time or using the @option{--sysroot} option, possibly with an extra
6357 suffix that depends on compilation options.  If no target sysroot is
6358 specified, the option prints nothing.
6360 @item -print-sysroot-headers-suffix
6361 @opindex print-sysroot-headers-suffix
6362 Print the suffix added to the target sysroot when searching for
6363 headers, or give an error if the compiler is not configured with such
6364 a suffix---and don't do anything else.
6366 @item -dumpmachine
6367 @opindex dumpmachine
6368 Print the compiler's target machine (for example,
6369 @samp{i686-pc-linux-gnu})---and don't do anything else.
6371 @item -dumpversion
6372 @opindex dumpversion
6373 Print the compiler version (for example, @samp{3.0})---and don't do
6374 anything else.
6376 @item -dumpspecs
6377 @opindex dumpspecs
6378 Print the compiler's built-in specs---and don't do anything else.  (This
6379 is used when GCC itself is being built.)  @xref{Spec Files}.
6381 @item -fno-eliminate-unused-debug-types
6382 @opindex feliminate-unused-debug-types
6383 @opindex fno-eliminate-unused-debug-types
6384 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
6385 output for types that are nowhere used in the source file being compiled.
6386 Sometimes it is useful to have GCC emit debugging
6387 information for all types declared in a compilation
6388 unit, regardless of whether or not they are actually used
6389 in that compilation unit, for example 
6390 if, in the debugger, you want to cast a value to a type that is
6391 not actually used in your program (but is declared).  More often,
6392 however, this results in a significant amount of wasted space.
6393 @end table
6395 @node Optimize Options
6396 @section Options That Control Optimization
6397 @cindex optimize options
6398 @cindex options, optimization
6400 These options control various sorts of optimizations.
6402 Without any optimization option, the compiler's goal is to reduce the
6403 cost of compilation and to make debugging produce the expected
6404 results.  Statements are independent: if you stop the program with a
6405 breakpoint between statements, you can then assign a new value to any
6406 variable or change the program counter to any other statement in the
6407 function and get exactly the results you expect from the source
6408 code.
6410 Turning on optimization flags makes the compiler attempt to improve
6411 the performance and/or code size at the expense of compilation time
6412 and possibly the ability to debug the program.
6414 The compiler performs optimization based on the knowledge it has of the
6415 program.  Compiling multiple files at once to a single output file mode allows
6416 the compiler to use information gained from all of the files when compiling
6417 each of them.
6419 Not all optimizations are controlled directly by a flag.  Only
6420 optimizations that have a flag are listed in this section.
6422 Most optimizations are only enabled if an @option{-O} level is set on
6423 the command line.  Otherwise they are disabled, even if individual
6424 optimization flags are specified.
6426 Depending on the target and how GCC was configured, a slightly different
6427 set of optimizations may be enabled at each @option{-O} level than
6428 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6429 to find out the exact set of optimizations that are enabled at each level.
6430 @xref{Overall Options}, for examples.
6432 @table @gcctabopt
6433 @item -O
6434 @itemx -O1
6435 @opindex O
6436 @opindex O1
6437 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6438 more memory for a large function.
6440 With @option{-O}, the compiler tries to reduce code size and execution
6441 time, without performing any optimizations that take a great deal of
6442 compilation time.
6444 @option{-O} turns on the following optimization flags:
6445 @gccoptlist{
6446 -fauto-inc-dec @gol
6447 -fcompare-elim @gol
6448 -fcprop-registers @gol
6449 -fdce @gol
6450 -fdefer-pop @gol
6451 -fdelayed-branch @gol
6452 -fdse @gol
6453 -fguess-branch-probability @gol
6454 -fif-conversion2 @gol
6455 -fif-conversion @gol
6456 -fipa-pure-const @gol
6457 -fipa-profile @gol
6458 -fipa-reference @gol
6459 -fmerge-constants
6460 -fsplit-wide-types @gol
6461 -ftree-bit-ccp @gol
6462 -ftree-builtin-call-dce @gol
6463 -ftree-ccp @gol
6464 -ftree-ch @gol
6465 -ftree-copyrename @gol
6466 -ftree-dce @gol
6467 -ftree-dominator-opts @gol
6468 -ftree-dse @gol
6469 -ftree-forwprop @gol
6470 -ftree-fre @gol
6471 -ftree-phiprop @gol
6472 -ftree-slsr @gol
6473 -ftree-sra @gol
6474 -ftree-pta @gol
6475 -ftree-ter @gol
6476 -funit-at-a-time}
6478 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6479 where doing so does not interfere with debugging.
6481 @item -O2
6482 @opindex O2
6483 Optimize even more.  GCC performs nearly all supported optimizations
6484 that do not involve a space-speed tradeoff.
6485 As compared to @option{-O}, this option increases both compilation time
6486 and the performance of the generated code.
6488 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6489 also turns on the following optimization flags:
6490 @gccoptlist{-fthread-jumps @gol
6491 -falign-functions  -falign-jumps @gol
6492 -falign-loops  -falign-labels @gol
6493 -fcaller-saves @gol
6494 -fcrossjumping @gol
6495 -fcse-follow-jumps  -fcse-skip-blocks @gol
6496 -fdelete-null-pointer-checks @gol
6497 -fdevirtualize @gol
6498 -fexpensive-optimizations @gol
6499 -fgcse  -fgcse-lm  @gol
6500 -fhoist-adjacent-loads @gol
6501 -finline-small-functions @gol
6502 -findirect-inlining @gol
6503 -fipa-sra @gol
6504 -foptimize-sibling-calls @gol
6505 -fpartial-inlining @gol
6506 -fpeephole2 @gol
6507 -fregmove @gol
6508 -freorder-blocks  -freorder-functions @gol
6509 -frerun-cse-after-loop  @gol
6510 -fsched-interblock  -fsched-spec @gol
6511 -fschedule-insns  -fschedule-insns2 @gol
6512 -fstrict-aliasing -fstrict-overflow @gol
6513 -ftree-switch-conversion -ftree-tail-merge @gol
6514 -ftree-pre @gol
6515 -ftree-vrp}
6517 Please note the warning under @option{-fgcse} about
6518 invoking @option{-O2} on programs that use computed gotos.
6520 @item -O3
6521 @opindex O3
6522 Optimize yet more.  @option{-O3} turns on all optimizations specified
6523 by @option{-O2} and also turns on the @option{-finline-functions},
6524 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6525 @option{-fgcse-after-reload}, @option{-ftree-vectorize},
6526 @option{-fvect-cost-model},
6527 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
6529 @item -O0
6530 @opindex O0
6531 Reduce compilation time and make debugging produce the expected
6532 results.  This is the default.
6534 @item -Os
6535 @opindex Os
6536 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6537 do not typically increase code size.  It also performs further
6538 optimizations designed to reduce code size.
6540 @option{-Os} disables the following optimization flags:
6541 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6542 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6543 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6545 @item -Ofast
6546 @opindex Ofast
6547 Disregard strict standards compliance.  @option{-Ofast} enables all
6548 @option{-O3} optimizations.  It also enables optimizations that are not
6549 valid for all standard-compliant programs.
6550 It turns on @option{-ffast-math} and the Fortran-specific
6551 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6553 @item -Og
6554 @opindex Og
6555 Optimize debugging experience.  @option{-Og} enables optimizations
6556 that do not interfere with debugging. It should be the optimization
6557 level of choice for the standard edit-compile-debug cycle, offering
6558 a reasonable level of optimization while maintaining fast compilation
6559 and a good debugging experience.
6561 If you use multiple @option{-O} options, with or without level numbers,
6562 the last such option is the one that is effective.
6563 @end table
6565 Options of the form @option{-f@var{flag}} specify machine-independent
6566 flags.  Most flags have both positive and negative forms; the negative
6567 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6568 below, only one of the forms is listed---the one you typically 
6569 use.  You can figure out the other form by either removing @samp{no-}
6570 or adding it.
6572 The following options control specific optimizations.  They are either
6573 activated by @option{-O} options or are related to ones that are.  You
6574 can use the following flags in the rare cases when ``fine-tuning'' of
6575 optimizations to be performed is desired.
6577 @table @gcctabopt
6578 @item -fno-default-inline
6579 @opindex fno-default-inline
6580 Do not make member functions inline by default merely because they are
6581 defined inside the class scope (C++ only).  Otherwise, when you specify
6582 @w{@option{-O}}, member functions defined inside class scope are compiled
6583 inline by default; i.e., you don't need to add @samp{inline} in front of
6584 the member function name.
6586 @item -fno-defer-pop
6587 @opindex fno-defer-pop
6588 Always pop the arguments to each function call as soon as that function
6589 returns.  For machines that must pop arguments after a function call,
6590 the compiler normally lets arguments accumulate on the stack for several
6591 function calls and pops them all at once.
6593 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6595 @item -fforward-propagate
6596 @opindex fforward-propagate
6597 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6598 instructions and checks if the result can be simplified.  If loop unrolling
6599 is active, two passes are performed and the second is scheduled after
6600 loop unrolling.
6602 This option is enabled by default at optimization levels @option{-O},
6603 @option{-O2}, @option{-O3}, @option{-Os}.
6605 @item -ffp-contract=@var{style}
6606 @opindex ffp-contract
6607 @option{-ffp-contract=off} disables floating-point expression contraction.
6608 @option{-ffp-contract=fast} enables floating-point expression contraction
6609 such as forming of fused multiply-add operations if the target has
6610 native support for them.
6611 @option{-ffp-contract=on} enables floating-point expression contraction
6612 if allowed by the language standard.  This is currently not implemented
6613 and treated equal to @option{-ffp-contract=off}.
6615 The default is @option{-ffp-contract=fast}.
6617 @item -fomit-frame-pointer
6618 @opindex fomit-frame-pointer
6619 Don't keep the frame pointer in a register for functions that
6620 don't need one.  This avoids the instructions to save, set up and
6621 restore frame pointers; it also makes an extra register available
6622 in many functions.  @strong{It also makes debugging impossible on
6623 some machines.}
6625 On some machines, such as the VAX, this flag has no effect, because
6626 the standard calling sequence automatically handles the frame pointer
6627 and nothing is saved by pretending it doesn't exist.  The
6628 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6629 whether a target machine supports this flag.  @xref{Registers,,Register
6630 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6632 Starting with GCC version 4.6, the default setting (when not optimizing for
6633 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
6634 @option{-fomit-frame-pointer}.  The default can be reverted to
6635 @option{-fno-omit-frame-pointer} by configuring GCC with the
6636 @option{--enable-frame-pointer} configure option.
6638 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6640 @item -foptimize-sibling-calls
6641 @opindex foptimize-sibling-calls
6642 Optimize sibling and tail recursive calls.
6644 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6646 @item -fno-inline
6647 @opindex fno-inline
6648 Do not expand any functions inline apart from those marked with
6649 the @code{always_inline} attribute.  This is the default when not
6650 optimizing.
6652 Single functions can be exempted from inlining by marking them
6653 with the @code{noinline} attribute.
6655 @item -finline-small-functions
6656 @opindex finline-small-functions
6657 Integrate functions into their callers when their body is smaller than expected
6658 function call code (so overall size of program gets smaller).  The compiler
6659 heuristically decides which functions are simple enough to be worth integrating
6660 in this way.  This inlining applies to all functions, even those not declared
6661 inline.
6663 Enabled at level @option{-O2}.
6665 @item -findirect-inlining
6666 @opindex findirect-inlining
6667 Inline also indirect calls that are discovered to be known at compile
6668 time thanks to previous inlining.  This option has any effect only
6669 when inlining itself is turned on by the @option{-finline-functions}
6670 or @option{-finline-small-functions} options.
6672 Enabled at level @option{-O2}.
6674 @item -finline-functions
6675 @opindex finline-functions
6676 Consider all functions for inlining, even if they are not declared inline.
6677 The compiler heuristically decides which functions are worth integrating
6678 in this way.
6680 If all calls to a given function are integrated, and the function is
6681 declared @code{static}, then the function is normally not output as
6682 assembler code in its own right.
6684 Enabled at level @option{-O3}.
6686 @item -finline-functions-called-once
6687 @opindex finline-functions-called-once
6688 Consider all @code{static} functions called once for inlining into their
6689 caller even if they are not marked @code{inline}.  If a call to a given
6690 function is integrated, then the function is not output as assembler code
6691 in its own right.
6693 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6695 @item -fearly-inlining
6696 @opindex fearly-inlining
6697 Inline functions marked by @code{always_inline} and functions whose body seems
6698 smaller than the function call overhead early before doing
6699 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6700 makes profiling significantly cheaper and usually inlining faster on programs
6701 having large chains of nested wrapper functions.
6703 Enabled by default.
6705 @item -fipa-sra
6706 @opindex fipa-sra
6707 Perform interprocedural scalar replacement of aggregates, removal of
6708 unused parameters and replacement of parameters passed by reference
6709 by parameters passed by value.
6711 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6713 @item -finline-limit=@var{n}
6714 @opindex finline-limit
6715 By default, GCC limits the size of functions that can be inlined.  This flag
6716 allows coarse control of this limit.  @var{n} is the size of functions that
6717 can be inlined in number of pseudo instructions.
6719 Inlining is actually controlled by a number of parameters, which may be
6720 specified individually by using @option{--param @var{name}=@var{value}}.
6721 The @option{-finline-limit=@var{n}} option sets some of these parameters
6722 as follows:
6724 @table @gcctabopt
6725 @item max-inline-insns-single
6726 is set to @var{n}/2.
6727 @item max-inline-insns-auto
6728 is set to @var{n}/2.
6729 @end table
6731 See below for a documentation of the individual
6732 parameters controlling inlining and for the defaults of these parameters.
6734 @emph{Note:} there may be no value to @option{-finline-limit} that results
6735 in default behavior.
6737 @emph{Note:} pseudo instruction represents, in this particular context, an
6738 abstract measurement of function's size.  In no way does it represent a count
6739 of assembly instructions and as such its exact meaning might change from one
6740 release to an another.
6742 @item -fno-keep-inline-dllexport
6743 @opindex -fno-keep-inline-dllexport
6744 This is a more fine-grained version of @option{-fkeep-inline-functions},
6745 which applies only to functions that are declared using the @code{dllexport}
6746 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6747 Functions}.)
6749 @item -fkeep-inline-functions
6750 @opindex fkeep-inline-functions
6751 In C, emit @code{static} functions that are declared @code{inline}
6752 into the object file, even if the function has been inlined into all
6753 of its callers.  This switch does not affect functions using the
6754 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6755 inline functions into the object file.
6757 @item -fkeep-static-consts
6758 @opindex fkeep-static-consts
6759 Emit variables declared @code{static const} when optimization isn't turned
6760 on, even if the variables aren't referenced.
6762 GCC enables this option by default.  If you want to force the compiler to
6763 check if a variable is referenced, regardless of whether or not
6764 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6766 @item -fmerge-constants
6767 @opindex fmerge-constants
6768 Attempt to merge identical constants (string constants and floating-point
6769 constants) across compilation units.
6771 This option is the default for optimized compilation if the assembler and
6772 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6773 behavior.
6775 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6777 @item -fmerge-all-constants
6778 @opindex fmerge-all-constants
6779 Attempt to merge identical constants and identical variables.
6781 This option implies @option{-fmerge-constants}.  In addition to
6782 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6783 arrays or initialized constant variables with integral or floating-point
6784 types.  Languages like C or C++ require each variable, including multiple
6785 instances of the same variable in recursive calls, to have distinct locations,
6786 so using this option results in non-conforming
6787 behavior.
6789 @item -fmodulo-sched
6790 @opindex fmodulo-sched
6791 Perform swing modulo scheduling immediately before the first scheduling
6792 pass.  This pass looks at innermost loops and reorders their
6793 instructions by overlapping different iterations.
6795 @item -fmodulo-sched-allow-regmoves
6796 @opindex fmodulo-sched-allow-regmoves
6797 Perform more aggressive SMS-based modulo scheduling with register moves
6798 allowed.  By setting this flag certain anti-dependences edges are
6799 deleted, which triggers the generation of reg-moves based on the
6800 life-range analysis.  This option is effective only with
6801 @option{-fmodulo-sched} enabled.
6803 @item -fno-branch-count-reg
6804 @opindex fno-branch-count-reg
6805 Do not use ``decrement and branch'' instructions on a count register,
6806 but instead generate a sequence of instructions that decrement a
6807 register, compare it against zero, then branch based upon the result.
6808 This option is only meaningful on architectures that support such
6809 instructions, which include x86, PowerPC, IA-64 and S/390.
6811 The default is @option{-fbranch-count-reg}.
6813 @item -fno-function-cse
6814 @opindex fno-function-cse
6815 Do not put function addresses in registers; make each instruction that
6816 calls a constant function contain the function's address explicitly.
6818 This option results in less efficient code, but some strange hacks
6819 that alter the assembler output may be confused by the optimizations
6820 performed when this option is not used.
6822 The default is @option{-ffunction-cse}
6824 @item -fno-zero-initialized-in-bss
6825 @opindex fno-zero-initialized-in-bss
6826 If the target supports a BSS section, GCC by default puts variables that
6827 are initialized to zero into BSS@.  This can save space in the resulting
6828 code.
6830 This option turns off this behavior because some programs explicitly
6831 rely on variables going to the data section---e.g., so that the
6832 resulting executable can find the beginning of that section and/or make
6833 assumptions based on that.
6835 The default is @option{-fzero-initialized-in-bss}.
6837 @item -fmudflap -fmudflapth -fmudflapir
6838 @opindex fmudflap
6839 @opindex fmudflapth
6840 @opindex fmudflapir
6841 @cindex bounds checking
6842 @cindex mudflap
6843 For front-ends that support it (C and C++), instrument all risky
6844 pointer/array dereferencing operations, some standard library
6845 string/heap functions, and some other associated constructs with
6846 range/validity tests.  Modules so instrumented should be immune to
6847 buffer overflows, invalid heap use, and some other classes of C/C++
6848 programming errors.  The instrumentation relies on a separate runtime
6849 library (@file{libmudflap}), which is linked into a program if
6850 @option{-fmudflap} is given at link time.  Run-time behavior of the
6851 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6852 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6853 for its options.
6855 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6856 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6857 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6858 instrumentation should ignore pointer reads.  This produces less
6859 instrumentation (and therefore faster execution) and still provides
6860 some protection against outright memory corrupting writes, but allows
6861 erroneously read data to propagate within a program.
6863 @item -fthread-jumps
6864 @opindex fthread-jumps
6865 Perform optimizations that check to see if a jump branches to a
6866 location where another comparison subsumed by the first is found.  If
6867 so, the first branch is redirected to either the destination of the
6868 second branch or a point immediately following it, depending on whether
6869 the condition is known to be true or false.
6871 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6873 @item -fsplit-wide-types
6874 @opindex fsplit-wide-types
6875 When using a type that occupies multiple registers, such as @code{long
6876 long} on a 32-bit system, split the registers apart and allocate them
6877 independently.  This normally generates better code for those types,
6878 but may make debugging more difficult.
6880 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6881 @option{-Os}.
6883 @item -fcse-follow-jumps
6884 @opindex fcse-follow-jumps
6885 In common subexpression elimination (CSE), scan through jump instructions
6886 when the target of the jump is not reached by any other path.  For
6887 example, when CSE encounters an @code{if} statement with an
6888 @code{else} clause, CSE follows the jump when the condition
6889 tested is false.
6891 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6893 @item -fcse-skip-blocks
6894 @opindex fcse-skip-blocks
6895 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6896 follow jumps that conditionally skip over blocks.  When CSE
6897 encounters a simple @code{if} statement with no else clause,
6898 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6899 body of the @code{if}.
6901 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6903 @item -frerun-cse-after-loop
6904 @opindex frerun-cse-after-loop
6905 Re-run common subexpression elimination after loop optimizations are
6906 performed.
6908 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6910 @item -fgcse
6911 @opindex fgcse
6912 Perform a global common subexpression elimination pass.
6913 This pass also performs global constant and copy propagation.
6915 @emph{Note:} When compiling a program using computed gotos, a GCC
6916 extension, you may get better run-time performance if you disable
6917 the global common subexpression elimination pass by adding
6918 @option{-fno-gcse} to the command line.
6920 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6922 @item -fgcse-lm
6923 @opindex fgcse-lm
6924 When @option{-fgcse-lm} is enabled, global common subexpression elimination
6925 attempts to move loads that are only killed by stores into themselves.  This
6926 allows a loop containing a load/store sequence to be changed to a load outside
6927 the loop, and a copy/store within the loop.
6929 Enabled by default when @option{-fgcse} is enabled.
6931 @item -fgcse-sm
6932 @opindex fgcse-sm
6933 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6934 global common subexpression elimination.  This pass attempts to move
6935 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6936 loops containing a load/store sequence can be changed to a load before
6937 the loop and a store after the loop.
6939 Not enabled at any optimization level.
6941 @item -fgcse-las
6942 @opindex fgcse-las
6943 When @option{-fgcse-las} is enabled, the global common subexpression
6944 elimination pass eliminates redundant loads that come after stores to the
6945 same memory location (both partial and full redundancies).
6947 Not enabled at any optimization level.
6949 @item -fgcse-after-reload
6950 @opindex fgcse-after-reload
6951 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6952 pass is performed after reload.  The purpose of this pass is to clean up
6953 redundant spilling.
6955 @item -funsafe-loop-optimizations
6956 @opindex funsafe-loop-optimizations
6957 This option tells the loop optimizer to assume that loop indices do not
6958 overflow, and that loops with nontrivial exit condition are not
6959 infinite.  This enables a wider range of loop optimizations even if
6960 the loop optimizer itself cannot prove that these assumptions are valid.
6961 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
6962 if it finds this kind of loop.
6964 @item -fcrossjumping
6965 @opindex fcrossjumping
6966 Perform cross-jumping transformation.
6967 This transformation unifies equivalent code and saves code size.  The
6968 resulting code may or may not perform better than without cross-jumping.
6970 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6972 @item -fauto-inc-dec
6973 @opindex fauto-inc-dec
6974 Combine increments or decrements of addresses with memory accesses.
6975 This pass is always skipped on architectures that do not have
6976 instructions to support this.  Enabled by default at @option{-O} and
6977 higher on architectures that support this.
6979 @item -fdce
6980 @opindex fdce
6981 Perform dead code elimination (DCE) on RTL@.
6982 Enabled by default at @option{-O} and higher.
6984 @item -fdse
6985 @opindex fdse
6986 Perform dead store elimination (DSE) on RTL@.
6987 Enabled by default at @option{-O} and higher.
6989 @item -fif-conversion
6990 @opindex fif-conversion
6991 Attempt to transform conditional jumps into branch-less equivalents.  This
6992 includes use of conditional moves, min, max, set flags and abs instructions, and
6993 some tricks doable by standard arithmetics.  The use of conditional execution
6994 on chips where it is available is controlled by @code{if-conversion2}.
6996 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6998 @item -fif-conversion2
6999 @opindex fif-conversion2
7000 Use conditional execution (where available) to transform conditional jumps into
7001 branch-less equivalents.
7003 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7005 @item -fdelete-null-pointer-checks
7006 @opindex fdelete-null-pointer-checks
7007 Assume that programs cannot safely dereference null pointers, and that
7008 no code or data element resides there.  This enables simple constant
7009 folding optimizations at all optimization levels.  In addition, other
7010 optimization passes in GCC use this flag to control global dataflow
7011 analyses that eliminate useless checks for null pointers; these assume
7012 that if a pointer is checked after it has already been dereferenced,
7013 it cannot be null.
7015 Note however that in some environments this assumption is not true.
7016 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7017 for programs that depend on that behavior.
7019 Some targets, especially embedded ones, disable this option at all levels.
7020 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7021 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7022 are enabled independently at different optimization levels.
7024 @item -fdevirtualize
7025 @opindex fdevirtualize
7026 Attempt to convert calls to virtual functions to direct calls.  This
7027 is done both within a procedure and interprocedurally as part of
7028 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7029 propagation (@option{-fipa-cp}).
7030 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7032 @item -fexpensive-optimizations
7033 @opindex fexpensive-optimizations
7034 Perform a number of minor optimizations that are relatively expensive.
7036 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7038 @item -free
7039 @opindex free
7040 Attempt to remove redundant extension instructions.  This is especially
7041 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7042 registers after writing to their lower 32-bit half.
7044 Enabled for x86 at levels @option{-O2}, @option{-O3}.
7046 @item -foptimize-register-move
7047 @itemx -fregmove
7048 @opindex foptimize-register-move
7049 @opindex fregmove
7050 Attempt to reassign register numbers in move instructions and as
7051 operands of other simple instructions in order to maximize the amount of
7052 register tying.  This is especially helpful on machines with two-operand
7053 instructions.
7055 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
7056 optimization.
7058 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7060 @item -fira-algorithm=@var{algorithm}
7061 Use the specified coloring algorithm for the integrated register
7062 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7063 specifies Chow's priority coloring, or @samp{CB}, which specifies
7064 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7065 for all architectures, but for those targets that do support it, it is
7066 the default because it generates better code.
7068 @item -fira-region=@var{region}
7069 Use specified regions for the integrated register allocator.  The
7070 @var{region} argument should be one of the following:
7072 @table @samp
7074 @item all
7075 Use all loops as register allocation regions.
7076 This can give the best results for machines with a small and/or
7077 irregular register set.
7079 @item mixed
7080 Use all loops except for loops with small register pressure 
7081 as the regions.  This value usually gives
7082 the best results in most cases and for most architectures,
7083 and is enabled by default when compiling with optimization for speed
7084 (@option{-O}, @option{-O2}, @dots{}).
7086 @item one
7087 Use all functions as a single region.  
7088 This typically results in the smallest code size, and is enabled by default for
7089 @option{-Os} or @option{-O0}.
7091 @end table
7093 @item -fira-hoist-pressure
7094 @opindex fira-hoist-pressure
7095 Use IRA to evaluate register pressure in the code hoisting pass for
7096 decisions to hoist expressions.  This option usually results in smaller
7097 code, but it can slow the compiler down.
7099 This option is enabled at level @option{-Os} for all targets.
7101 @item -fira-loop-pressure
7102 @opindex fira-loop-pressure
7103 Use IRA to evaluate register pressure in loops for decisions to move
7104 loop invariants.  This option usually results in generation
7105 of faster and smaller code on machines with large register files (>= 32
7106 registers), but it can slow the compiler down.
7108 This option is enabled at level @option{-O3} for some targets.
7110 @item -fno-ira-share-save-slots
7111 @opindex fno-ira-share-save-slots
7112 Disable sharing of stack slots used for saving call-used hard
7113 registers living through a call.  Each hard register gets a
7114 separate stack slot, and as a result function stack frames are
7115 larger.
7117 @item -fno-ira-share-spill-slots
7118 @opindex fno-ira-share-spill-slots
7119 Disable sharing of stack slots allocated for pseudo-registers.  Each
7120 pseudo-register that does not get a hard register gets a separate
7121 stack slot, and as a result function stack frames are larger.
7123 @item -fira-verbose=@var{n}
7124 @opindex fira-verbose
7125 Control the verbosity of the dump file for the integrated register allocator.
7126 The default value is 5.  If the value @var{n} is greater or equal to 10,
7127 the dump output is sent to stderr using the same format as @var{n} minus 10.
7129 @item -fdelayed-branch
7130 @opindex fdelayed-branch
7131 If supported for the target machine, attempt to reorder instructions
7132 to exploit instruction slots available after delayed branch
7133 instructions.
7135 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7137 @item -fschedule-insns
7138 @opindex fschedule-insns
7139 If supported for the target machine, attempt to reorder instructions to
7140 eliminate execution stalls due to required data being unavailable.  This
7141 helps machines that have slow floating point or memory load instructions
7142 by allowing other instructions to be issued until the result of the load
7143 or floating-point instruction is required.
7145 Enabled at levels @option{-O2}, @option{-O3}.
7147 @item -fschedule-insns2
7148 @opindex fschedule-insns2
7149 Similar to @option{-fschedule-insns}, but requests an additional pass of
7150 instruction scheduling after register allocation has been done.  This is
7151 especially useful on machines with a relatively small number of
7152 registers and where memory load instructions take more than one cycle.
7154 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7156 @item -fno-sched-interblock
7157 @opindex fno-sched-interblock
7158 Don't schedule instructions across basic blocks.  This is normally
7159 enabled by default when scheduling before register allocation, i.e.@:
7160 with @option{-fschedule-insns} or at @option{-O2} or higher.
7162 @item -fno-sched-spec
7163 @opindex fno-sched-spec
7164 Don't allow speculative motion of non-load instructions.  This is normally
7165 enabled by default when scheduling before register allocation, i.e.@:
7166 with @option{-fschedule-insns} or at @option{-O2} or higher.
7168 @item -fsched-pressure
7169 @opindex fsched-pressure
7170 Enable register pressure sensitive insn scheduling before register
7171 allocation.  This only makes sense when scheduling before register
7172 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7173 @option{-O2} or higher.  Usage of this option can improve the
7174 generated code and decrease its size by preventing register pressure
7175 increase above the number of available hard registers and subsequent
7176 spills in register allocation.
7178 @item -fsched-spec-load
7179 @opindex fsched-spec-load
7180 Allow speculative motion of some load instructions.  This only makes
7181 sense when scheduling before register allocation, i.e.@: with
7182 @option{-fschedule-insns} or at @option{-O2} or higher.
7184 @item -fsched-spec-load-dangerous
7185 @opindex fsched-spec-load-dangerous
7186 Allow speculative motion of more load instructions.  This only makes
7187 sense when scheduling before register allocation, i.e.@: with
7188 @option{-fschedule-insns} or at @option{-O2} or higher.
7190 @item -fsched-stalled-insns
7191 @itemx -fsched-stalled-insns=@var{n}
7192 @opindex fsched-stalled-insns
7193 Define how many insns (if any) can be moved prematurely from the queue
7194 of stalled insns into the ready list during the second scheduling pass.
7195 @option{-fno-sched-stalled-insns} means that no insns are moved
7196 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7197 on how many queued insns can be moved prematurely.
7198 @option{-fsched-stalled-insns} without a value is equivalent to
7199 @option{-fsched-stalled-insns=1}.
7201 @item -fsched-stalled-insns-dep
7202 @itemx -fsched-stalled-insns-dep=@var{n}
7203 @opindex fsched-stalled-insns-dep
7204 Define how many insn groups (cycles) are examined for a dependency
7205 on a stalled insn that is a candidate for premature removal from the queue
7206 of stalled insns.  This has an effect only during the second scheduling pass,
7207 and only if @option{-fsched-stalled-insns} is used.
7208 @option{-fno-sched-stalled-insns-dep} is equivalent to
7209 @option{-fsched-stalled-insns-dep=0}.
7210 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7211 @option{-fsched-stalled-insns-dep=1}.
7213 @item -fsched2-use-superblocks
7214 @opindex fsched2-use-superblocks
7215 When scheduling after register allocation, use superblock scheduling.
7216 This allows motion across basic block boundaries,
7217 resulting in faster schedules.  This option is experimental, as not all machine
7218 descriptions used by GCC model the CPU closely enough to avoid unreliable
7219 results from the algorithm.
7221 This only makes sense when scheduling after register allocation, i.e.@: with
7222 @option{-fschedule-insns2} or at @option{-O2} or higher.
7224 @item -fsched-group-heuristic
7225 @opindex fsched-group-heuristic
7226 Enable the group heuristic in the scheduler.  This heuristic favors
7227 the instruction that belongs to a schedule group.  This is enabled
7228 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7229 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7231 @item -fsched-critical-path-heuristic
7232 @opindex fsched-critical-path-heuristic
7233 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7234 instructions on the critical path.  This is enabled by default when
7235 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7236 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7238 @item -fsched-spec-insn-heuristic
7239 @opindex fsched-spec-insn-heuristic
7240 Enable the speculative instruction heuristic in the scheduler.  This
7241 heuristic favors speculative instructions with greater dependency weakness.
7242 This is enabled by default when scheduling is enabled, i.e.@:
7243 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7244 or at @option{-O2} or higher.
7246 @item -fsched-rank-heuristic
7247 @opindex fsched-rank-heuristic
7248 Enable the rank heuristic in the scheduler.  This heuristic favors
7249 the instruction belonging to a basic block with greater size or frequency.
7250 This is enabled by default when scheduling is enabled, i.e.@:
7251 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7252 at @option{-O2} or higher.
7254 @item -fsched-last-insn-heuristic
7255 @opindex fsched-last-insn-heuristic
7256 Enable the last-instruction heuristic in the scheduler.  This heuristic
7257 favors the instruction that is less dependent on the last instruction
7258 scheduled.  This is enabled by default when scheduling is enabled,
7259 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7260 at @option{-O2} or higher.
7262 @item -fsched-dep-count-heuristic
7263 @opindex fsched-dep-count-heuristic
7264 Enable the dependent-count heuristic in the scheduler.  This heuristic
7265 favors the instruction that has more instructions depending on it.
7266 This is enabled by default when scheduling is enabled, i.e.@:
7267 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7268 at @option{-O2} or higher.
7270 @item -freschedule-modulo-scheduled-loops
7271 @opindex freschedule-modulo-scheduled-loops
7272 Modulo scheduling is performed before traditional scheduling.  If a loop
7273 is modulo scheduled, later scheduling passes may change its schedule.  
7274 Use this option to control that behavior.
7276 @item -fselective-scheduling
7277 @opindex fselective-scheduling
7278 Schedule instructions using selective scheduling algorithm.  Selective
7279 scheduling runs instead of the first scheduler pass.
7281 @item -fselective-scheduling2
7282 @opindex fselective-scheduling2
7283 Schedule instructions using selective scheduling algorithm.  Selective
7284 scheduling runs instead of the second scheduler pass.
7286 @item -fsel-sched-pipelining
7287 @opindex fsel-sched-pipelining
7288 Enable software pipelining of innermost loops during selective scheduling.
7289 This option has no effect unless one of @option{-fselective-scheduling} or
7290 @option{-fselective-scheduling2} is turned on.
7292 @item -fsel-sched-pipelining-outer-loops
7293 @opindex fsel-sched-pipelining-outer-loops
7294 When pipelining loops during selective scheduling, also pipeline outer loops.
7295 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7297 @item -fshrink-wrap
7298 @opindex fshrink-wrap
7299 Emit function prologues only before parts of the function that need it,
7300 rather than at the top of the function.  This flag is enabled by default at
7301 @option{-O} and higher.
7303 @item -fcaller-saves
7304 @opindex fcaller-saves
7305 Enable allocation of values to registers that are clobbered by
7306 function calls, by emitting extra instructions to save and restore the
7307 registers around such calls.  Such allocation is done only when it
7308 seems to result in better code.
7310 This option is always enabled by default on certain machines, usually
7311 those which have no call-preserved registers to use instead.
7313 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7315 @item -fcombine-stack-adjustments
7316 @opindex fcombine-stack-adjustments
7317 Tracks stack adjustments (pushes and pops) and stack memory references
7318 and then tries to find ways to combine them.
7320 Enabled by default at @option{-O1} and higher.
7322 @item -fconserve-stack
7323 @opindex fconserve-stack
7324 Attempt to minimize stack usage.  The compiler attempts to use less
7325 stack space, even if that makes the program slower.  This option
7326 implies setting the @option{large-stack-frame} parameter to 100
7327 and the @option{large-stack-frame-growth} parameter to 400.
7329 @item -ftree-reassoc
7330 @opindex ftree-reassoc
7331 Perform reassociation on trees.  This flag is enabled by default
7332 at @option{-O} and higher.
7334 @item -ftree-pre
7335 @opindex ftree-pre
7336 Perform partial redundancy elimination (PRE) on trees.  This flag is
7337 enabled by default at @option{-O2} and @option{-O3}.
7339 @item -ftree-partial-pre
7340 @opindex ftree-partial-pre
7341 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7342 enabled by default at @option{-O3}.
7344 @item -ftree-forwprop
7345 @opindex ftree-forwprop
7346 Perform forward propagation on trees.  This flag is enabled by default
7347 at @option{-O} and higher.
7349 @item -ftree-fre
7350 @opindex ftree-fre
7351 Perform full redundancy elimination (FRE) on trees.  The difference
7352 between FRE and PRE is that FRE only considers expressions
7353 that are computed on all paths leading to the redundant computation.
7354 This analysis is faster than PRE, though it exposes fewer redundancies.
7355 This flag is enabled by default at @option{-O} and higher.
7357 @item -ftree-phiprop
7358 @opindex ftree-phiprop
7359 Perform hoisting of loads from conditional pointers on trees.  This
7360 pass is enabled by default at @option{-O} and higher.
7362 @item -fhoist-adjacent-loads
7363 @opindex hoist-adjacent-loads
7364 Speculatively hoist loads from both branches of an if-then-else if the
7365 loads are from adjacent locations in the same structure and the target
7366 architecture has a conditional move instruction.  This flag is enabled
7367 by default at @option{-O2} and higher.
7369 @item -ftree-copy-prop
7370 @opindex ftree-copy-prop
7371 Perform copy propagation on trees.  This pass eliminates unnecessary
7372 copy operations.  This flag is enabled by default at @option{-O} and
7373 higher.
7375 @item -fipa-pure-const
7376 @opindex fipa-pure-const
7377 Discover which functions are pure or constant.
7378 Enabled by default at @option{-O} and higher.
7380 @item -fipa-reference
7381 @opindex fipa-reference
7382 Discover which static variables do not escape the
7383 compilation unit.
7384 Enabled by default at @option{-O} and higher.
7386 @item -fipa-pta
7387 @opindex fipa-pta
7388 Perform interprocedural pointer analysis and interprocedural modification
7389 and reference analysis.  This option can cause excessive memory and
7390 compile-time usage on large compilation units.  It is not enabled by
7391 default at any optimization level.
7393 @item -fipa-profile
7394 @opindex fipa-profile
7395 Perform interprocedural profile propagation.  The functions called only from
7396 cold functions are marked as cold. Also functions executed once (such as
7397 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7398 functions and loop less parts of functions executed once are then optimized for
7399 size.
7400 Enabled by default at @option{-O} and higher.
7402 @item -fipa-cp
7403 @opindex fipa-cp
7404 Perform interprocedural constant propagation.
7405 This optimization analyzes the program to determine when values passed
7406 to functions are constants and then optimizes accordingly.
7407 This optimization can substantially increase performance
7408 if the application has constants passed to functions.
7409 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7411 @item -fipa-cp-clone
7412 @opindex fipa-cp-clone
7413 Perform function cloning to make interprocedural constant propagation stronger.
7414 When enabled, interprocedural constant propagation performs function cloning
7415 when externally visible function can be called with constant arguments.
7416 Because this optimization can create multiple copies of functions,
7417 it may significantly increase code size
7418 (see @option{--param ipcp-unit-growth=@var{value}}).
7419 This flag is enabled by default at @option{-O3}.
7421 @item -ftree-sink
7422 @opindex ftree-sink
7423 Perform forward store motion  on trees.  This flag is
7424 enabled by default at @option{-O} and higher.
7426 @item -ftree-bit-ccp
7427 @opindex ftree-bit-ccp
7428 Perform sparse conditional bit constant propagation on trees and propagate
7429 pointer alignment information.
7430 This pass only operates on local scalar variables and is enabled by default
7431 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7433 @item -ftree-ccp
7434 @opindex ftree-ccp
7435 Perform sparse conditional constant propagation (CCP) on trees.  This
7436 pass only operates on local scalar variables and is enabled by default
7437 at @option{-O} and higher.
7439 @item -ftree-switch-conversion
7440 Perform conversion of simple initializations in a switch to
7441 initializations from a scalar array.  This flag is enabled by default
7442 at @option{-O2} and higher.
7444 @item -ftree-tail-merge
7445 Look for identical code sequences.  When found, replace one with a jump to the
7446 other.  This optimization is known as tail merging or cross jumping.  This flag
7447 is enabled by default at @option{-O2} and higher.  The compilation time
7448 in this pass can
7449 be limited using @option{max-tail-merge-comparisons} parameter and
7450 @option{max-tail-merge-iterations} parameter.
7452 @item -ftree-dce
7453 @opindex ftree-dce
7454 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7455 default at @option{-O} and higher.
7457 @item -ftree-builtin-call-dce
7458 @opindex ftree-builtin-call-dce
7459 Perform conditional dead code elimination (DCE) for calls to built-in functions
7460 that may set @code{errno} but are otherwise side-effect free.  This flag is
7461 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7462 specified.
7464 @item -ftree-dominator-opts
7465 @opindex ftree-dominator-opts
7466 Perform a variety of simple scalar cleanups (constant/copy
7467 propagation, redundancy elimination, range propagation and expression
7468 simplification) based on a dominator tree traversal.  This also
7469 performs jump threading (to reduce jumps to jumps). This flag is
7470 enabled by default at @option{-O} and higher.
7472 @item -ftree-dse
7473 @opindex ftree-dse
7474 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7475 a memory location that is later overwritten by another store without
7476 any intervening loads.  In this case the earlier store can be deleted.  This
7477 flag is enabled by default at @option{-O} and higher.
7479 @item -ftree-ch
7480 @opindex ftree-ch
7481 Perform loop header copying on trees.  This is beneficial since it increases
7482 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7483 is enabled by default at @option{-O} and higher.  It is not enabled
7484 for @option{-Os}, since it usually increases code size.
7486 @item -ftree-loop-optimize
7487 @opindex ftree-loop-optimize
7488 Perform loop optimizations on trees.  This flag is enabled by default
7489 at @option{-O} and higher.
7491 @item -ftree-loop-linear
7492 @opindex ftree-loop-linear
7493 Perform loop interchange transformations on tree.  Same as
7494 @option{-floop-interchange}.  To use this code transformation, GCC has
7495 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7496 enable the Graphite loop transformation infrastructure.
7498 @item -floop-interchange
7499 @opindex floop-interchange
7500 Perform loop interchange transformations on loops.  Interchanging two
7501 nested loops switches the inner and outer loops.  For example, given a
7502 loop like:
7503 @smallexample
7504 DO J = 1, M
7505   DO I = 1, N
7506     A(J, I) = A(J, I) * C
7507   ENDDO
7508 ENDDO
7509 @end smallexample
7510 loop interchange transforms the loop as if it were written:
7511 @smallexample
7512 DO I = 1, N
7513   DO J = 1, M
7514     A(J, I) = A(J, I) * C
7515   ENDDO
7516 ENDDO
7517 @end smallexample
7518 which can be beneficial when @code{N} is larger than the caches,
7519 because in Fortran, the elements of an array are stored in memory
7520 contiguously by column, and the original loop iterates over rows,
7521 potentially creating at each access a cache miss.  This optimization
7522 applies to all the languages supported by GCC and is not limited to
7523 Fortran.  To use this code transformation, GCC has to be configured
7524 with @option{--with-ppl} and @option{--with-cloog} to enable the
7525 Graphite loop transformation infrastructure.
7527 @item -floop-strip-mine
7528 @opindex floop-strip-mine
7529 Perform loop strip mining transformations on loops.  Strip mining
7530 splits a loop into two nested loops.  The outer loop has strides
7531 equal to the strip size and the inner loop has strides of the
7532 original loop within a strip.  The strip length can be changed
7533 using the @option{loop-block-tile-size} parameter.  For example,
7534 given a loop like:
7535 @smallexample
7536 DO I = 1, N
7537   A(I) = A(I) + C
7538 ENDDO
7539 @end smallexample
7540 loop strip mining transforms the loop as if it were written:
7541 @smallexample
7542 DO II = 1, N, 51
7543   DO I = II, min (II + 50, N)
7544     A(I) = A(I) + C
7545   ENDDO
7546 ENDDO
7547 @end smallexample
7548 This optimization applies to all the languages supported by GCC and is
7549 not limited to Fortran.  To use this code transformation, GCC has to
7550 be configured with @option{--with-ppl} and @option{--with-cloog} to
7551 enable the Graphite loop transformation infrastructure.
7553 @item -floop-block
7554 @opindex floop-block
7555 Perform loop blocking transformations on loops.  Blocking strip mines
7556 each loop in the loop nest such that the memory accesses of the
7557 element loops fit inside caches.  The strip length can be changed
7558 using the @option{loop-block-tile-size} parameter.  For example, given
7559 a loop like:
7560 @smallexample
7561 DO I = 1, N
7562   DO J = 1, M
7563     A(J, I) = B(I) + C(J)
7564   ENDDO
7565 ENDDO
7566 @end smallexample
7567 loop blocking transforms the loop as if it were written:
7568 @smallexample
7569 DO II = 1, N, 51
7570   DO JJ = 1, M, 51
7571     DO I = II, min (II + 50, N)
7572       DO J = JJ, min (JJ + 50, M)
7573         A(J, I) = B(I) + C(J)
7574       ENDDO
7575     ENDDO
7576   ENDDO
7577 ENDDO
7578 @end smallexample
7579 which can be beneficial when @code{M} is larger than the caches,
7580 because the innermost loop iterates over a smaller amount of data
7581 which can be kept in the caches.  This optimization applies to all the
7582 languages supported by GCC and is not limited to Fortran.  To use this
7583 code transformation, GCC has to be configured with @option{--with-ppl}
7584 and @option{--with-cloog} to enable the Graphite loop transformation
7585 infrastructure.
7587 @item -fgraphite-identity
7588 @opindex fgraphite-identity
7589 Enable the identity transformation for graphite.  For every SCoP we generate
7590 the polyhedral representation and transform it back to gimple.  Using
7591 @option{-fgraphite-identity} we can check the costs or benefits of the
7592 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7593 are also performed by the code generator CLooG, like index splitting and
7594 dead code elimination in loops.
7596 @item -floop-nest-optimize
7597 @opindex floop-nest-optimize
7598 Enable the ISL based loop nest optimizer.  This is a generic loop nest
7599 optimizer based on the Pluto optimization algorithms.  It calculates a loop
7600 structure optimized for data-locality and parallelism.  This option
7601 is experimental.
7603 @item -floop-parallelize-all
7604 @opindex floop-parallelize-all
7605 Use the Graphite data dependence analysis to identify loops that can
7606 be parallelized.  Parallelize all the loops that can be analyzed to
7607 not contain loop carried dependences without checking that it is
7608 profitable to parallelize the loops.
7610 @item -fcheck-data-deps
7611 @opindex fcheck-data-deps
7612 Compare the results of several data dependence analyzers.  This option
7613 is used for debugging the data dependence analyzers.
7615 @item -ftree-loop-if-convert
7616 Attempt to transform conditional jumps in the innermost loops to
7617 branch-less equivalents.  The intent is to remove control-flow from
7618 the innermost loops in order to improve the ability of the
7619 vectorization pass to handle these loops.  This is enabled by default
7620 if vectorization is enabled.
7622 @item -ftree-loop-if-convert-stores
7623 Attempt to also if-convert conditional jumps containing memory writes.
7624 This transformation can be unsafe for multi-threaded programs as it
7625 transforms conditional memory writes into unconditional memory writes.
7626 For example,
7627 @smallexample
7628 for (i = 0; i < N; i++)
7629   if (cond)
7630     A[i] = expr;
7631 @end smallexample
7632 is transformed to
7633 @smallexample
7634 for (i = 0; i < N; i++)
7635   A[i] = cond ? expr : A[i];
7636 @end smallexample
7637 potentially producing data races.
7639 @item -ftree-loop-distribution
7640 Perform loop distribution.  This flag can improve cache performance on
7641 big loop bodies and allow further loop optimizations, like
7642 parallelization or vectorization, to take place.  For example, the loop
7643 @smallexample
7644 DO I = 1, N
7645   A(I) = B(I) + C
7646   D(I) = E(I) * F
7647 ENDDO
7648 @end smallexample
7649 is transformed to
7650 @smallexample
7651 DO I = 1, N
7652    A(I) = B(I) + C
7653 ENDDO
7654 DO I = 1, N
7655    D(I) = E(I) * F
7656 ENDDO
7657 @end smallexample
7659 @item -ftree-loop-distribute-patterns
7660 Perform loop distribution of patterns that can be code generated with
7661 calls to a library.  This flag is enabled by default at @option{-O3}.
7663 This pass distributes the initialization loops and generates a call to
7664 memset zero.  For example, the loop
7665 @smallexample
7666 DO I = 1, N
7667   A(I) = 0
7668   B(I) = A(I) + I
7669 ENDDO
7670 @end smallexample
7671 is transformed to
7672 @smallexample
7673 DO I = 1, N
7674    A(I) = 0
7675 ENDDO
7676 DO I = 1, N
7677    B(I) = A(I) + I
7678 ENDDO
7679 @end smallexample
7680 and the initialization loop is transformed into a call to memset zero.
7682 @item -ftree-loop-im
7683 @opindex ftree-loop-im
7684 Perform loop invariant motion on trees.  This pass moves only invariants that
7685 are hard to handle at RTL level (function calls, operations that expand to
7686 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7687 operands of conditions that are invariant out of the loop, so that we can use
7688 just trivial invariantness analysis in loop unswitching.  The pass also includes
7689 store motion.
7691 @item -ftree-loop-ivcanon
7692 @opindex ftree-loop-ivcanon
7693 Create a canonical counter for number of iterations in loops for which
7694 determining number of iterations requires complicated analysis.  Later
7695 optimizations then may determine the number easily.  Useful especially
7696 in connection with unrolling.
7698 @item -fivopts
7699 @opindex fivopts
7700 Perform induction variable optimizations (strength reduction, induction
7701 variable merging and induction variable elimination) on trees.
7703 @item -ftree-parallelize-loops=n
7704 @opindex ftree-parallelize-loops
7705 Parallelize loops, i.e., split their iteration space to run in n threads.
7706 This is only possible for loops whose iterations are independent
7707 and can be arbitrarily reordered.  The optimization is only
7708 profitable on multiprocessor machines, for loops that are CPU-intensive,
7709 rather than constrained e.g.@: by memory bandwidth.  This option
7710 implies @option{-pthread}, and thus is only supported on targets
7711 that have support for @option{-pthread}.
7713 @item -ftree-pta
7714 @opindex ftree-pta
7715 Perform function-local points-to analysis on trees.  This flag is
7716 enabled by default at @option{-O} and higher.
7718 @item -ftree-sra
7719 @opindex ftree-sra
7720 Perform scalar replacement of aggregates.  This pass replaces structure
7721 references with scalars to prevent committing structures to memory too
7722 early.  This flag is enabled by default at @option{-O} and higher.
7724 @item -ftree-copyrename
7725 @opindex ftree-copyrename
7726 Perform copy renaming on trees.  This pass attempts to rename compiler
7727 temporaries to other variables at copy locations, usually resulting in
7728 variable names which more closely resemble the original variables.  This flag
7729 is enabled by default at @option{-O} and higher.
7731 @item -ftree-coalesce-inlined-vars
7732 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7733 combine small user-defined variables too, but only if they were inlined
7734 from other functions.  It is a more limited form of
7735 @option{-ftree-coalesce-vars}.  This may harm debug information of such
7736 inlined variables, but it will keep variables of the inlined-into
7737 function apart from each other, such that they are more likely to
7738 contain the expected values in a debugging session.  This was the
7739 default in GCC versions older than 4.7.
7741 @item -ftree-coalesce-vars
7742 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7743 combine small user-defined variables too, instead of just compiler
7744 temporaries.  This may severely limit the ability to debug an optimized
7745 program compiled with @option{-fno-var-tracking-assignments}.  In the
7746 negated form, this flag prevents SSA coalescing of user variables,
7747 including inlined ones.  This option is enabled by default.
7749 @item -ftree-ter
7750 @opindex ftree-ter
7751 Perform temporary expression replacement during the SSA->normal phase.  Single
7752 use/single def temporaries are replaced at their use location with their
7753 defining expression.  This results in non-GIMPLE code, but gives the expanders
7754 much more complex trees to work on resulting in better RTL generation.  This is
7755 enabled by default at @option{-O} and higher.
7757 @item -ftree-slsr
7758 @opindex ftree-slsr
7759 Perform straight-line strength reduction on trees.  This recognizes related
7760 expressions involving multiplications and replaces them by less expensive
7761 calculations when possible.  This is enabled by default at @option{-O} and
7762 higher.
7764 @item -ftree-vectorize
7765 @opindex ftree-vectorize
7766 Perform loop vectorization on trees. This flag is enabled by default at
7767 @option{-O3}.
7769 @item -ftree-slp-vectorize
7770 @opindex ftree-slp-vectorize
7771 Perform basic block vectorization on trees. This flag is enabled by default at
7772 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7774 @item -ftree-vect-loop-version
7775 @opindex ftree-vect-loop-version
7776 Perform loop versioning when doing loop vectorization on trees.  When a loop
7777 appears to be vectorizable except that data alignment or data dependence cannot
7778 be determined at compile time, then vectorized and non-vectorized versions of
7779 the loop are generated along with run-time checks for alignment or dependence
7780 to control which version is executed.  This option is enabled by default
7781 except at level @option{-Os} where it is disabled.
7783 @item -fvect-cost-model
7784 @opindex fvect-cost-model
7785 Enable cost model for vectorization.  This option is enabled by default at
7786 @option{-O3}.
7788 @item -ftree-vrp
7789 @opindex ftree-vrp
7790 Perform Value Range Propagation on trees.  This is similar to the
7791 constant propagation pass, but instead of values, ranges of values are
7792 propagated.  This allows the optimizers to remove unnecessary range
7793 checks like array bound checks and null pointer checks.  This is
7794 enabled by default at @option{-O2} and higher.  Null pointer check
7795 elimination is only done if @option{-fdelete-null-pointer-checks} is
7796 enabled.
7798 @item -ftracer
7799 @opindex ftracer
7800 Perform tail duplication to enlarge superblock size.  This transformation
7801 simplifies the control flow of the function allowing other optimizations to do
7802 a better job.
7804 @item -funroll-loops
7805 @opindex funroll-loops
7806 Unroll loops whose number of iterations can be determined at compile
7807 time or upon entry to the loop.  @option{-funroll-loops} implies
7808 @option{-frerun-cse-after-loop}.  This option makes code larger,
7809 and may or may not make it run faster.
7811 @item -funroll-all-loops
7812 @opindex funroll-all-loops
7813 Unroll all loops, even if their number of iterations is uncertain when
7814 the loop is entered.  This usually makes programs run more slowly.
7815 @option{-funroll-all-loops} implies the same options as
7816 @option{-funroll-loops},
7818 @item -fsplit-ivs-in-unroller
7819 @opindex fsplit-ivs-in-unroller
7820 Enables expression of values of induction variables in later iterations
7821 of the unrolled loop using the value in the first iteration.  This breaks
7822 long dependency chains, thus improving efficiency of the scheduling passes.
7824 A combination of @option{-fweb} and CSE is often sufficient to obtain the
7825 same effect.  However, that is not reliable in cases where the loop body
7826 is more complicated than a single basic block.  It also does not work at all
7827 on some architectures due to restrictions in the CSE pass.
7829 This optimization is enabled by default.
7831 @item -fvariable-expansion-in-unroller
7832 @opindex fvariable-expansion-in-unroller
7833 With this option, the compiler creates multiple copies of some
7834 local variables when unrolling a loop, which can result in superior code.
7836 @item -fpartial-inlining
7837 @opindex fpartial-inlining
7838 Inline parts of functions.  This option has any effect only
7839 when inlining itself is turned on by the @option{-finline-functions}
7840 or @option{-finline-small-functions} options.
7842 Enabled at level @option{-O2}.
7844 @item -fpredictive-commoning
7845 @opindex fpredictive-commoning
7846 Perform predictive commoning optimization, i.e., reusing computations
7847 (especially memory loads and stores) performed in previous
7848 iterations of loops.
7850 This option is enabled at level @option{-O3}.
7852 @item -fprefetch-loop-arrays
7853 @opindex fprefetch-loop-arrays
7854 If supported by the target machine, generate instructions to prefetch
7855 memory to improve the performance of loops that access large arrays.
7857 This option may generate better or worse code; results are highly
7858 dependent on the structure of loops within the source code.
7860 Disabled at level @option{-Os}.
7862 @item -fno-peephole
7863 @itemx -fno-peephole2
7864 @opindex fno-peephole
7865 @opindex fno-peephole2
7866 Disable any machine-specific peephole optimizations.  The difference
7867 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7868 are implemented in the compiler; some targets use one, some use the
7869 other, a few use both.
7871 @option{-fpeephole} is enabled by default.
7872 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7874 @item -fno-guess-branch-probability
7875 @opindex fno-guess-branch-probability
7876 Do not guess branch probabilities using heuristics.
7878 GCC uses heuristics to guess branch probabilities if they are
7879 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7880 heuristics are based on the control flow graph.  If some branch probabilities
7881 are specified by @samp{__builtin_expect}, then the heuristics are
7882 used to guess branch probabilities for the rest of the control flow graph,
7883 taking the @samp{__builtin_expect} info into account.  The interactions
7884 between the heuristics and @samp{__builtin_expect} can be complex, and in
7885 some cases, it may be useful to disable the heuristics so that the effects
7886 of @samp{__builtin_expect} are easier to understand.
7888 The default is @option{-fguess-branch-probability} at levels
7889 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7891 @item -freorder-blocks
7892 @opindex freorder-blocks
7893 Reorder basic blocks in the compiled function in order to reduce number of
7894 taken branches and improve code locality.
7896 Enabled at levels @option{-O2}, @option{-O3}.
7898 @item -freorder-blocks-and-partition
7899 @opindex freorder-blocks-and-partition
7900 In addition to reordering basic blocks in the compiled function, in order
7901 to reduce number of taken branches, partitions hot and cold basic blocks
7902 into separate sections of the assembly and .o files, to improve
7903 paging and cache locality performance.
7905 This optimization is automatically turned off in the presence of
7906 exception handling, for linkonce sections, for functions with a user-defined
7907 section attribute and on any architecture that does not support named
7908 sections.
7910 @item -freorder-functions
7911 @opindex freorder-functions
7912 Reorder functions in the object file in order to
7913 improve code locality.  This is implemented by using special
7914 subsections @code{.text.hot} for most frequently executed functions and
7915 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7916 the linker so object file format must support named sections and linker must
7917 place them in a reasonable way.
7919 Also profile feedback must be available to make this option effective.  See
7920 @option{-fprofile-arcs} for details.
7922 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7924 @item -fstrict-aliasing
7925 @opindex fstrict-aliasing
7926 Allow the compiler to assume the strictest aliasing rules applicable to
7927 the language being compiled.  For C (and C++), this activates
7928 optimizations based on the type of expressions.  In particular, an
7929 object of one type is assumed never to reside at the same address as an
7930 object of a different type, unless the types are almost the same.  For
7931 example, an @code{unsigned int} can alias an @code{int}, but not a
7932 @code{void*} or a @code{double}.  A character type may alias any other
7933 type.
7935 @anchor{Type-punning}Pay special attention to code like this:
7936 @smallexample
7937 union a_union @{
7938   int i;
7939   double d;
7942 int f() @{
7943   union a_union t;
7944   t.d = 3.0;
7945   return t.i;
7947 @end smallexample
7948 The practice of reading from a different union member than the one most
7949 recently written to (called ``type-punning'') is common.  Even with
7950 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7951 is accessed through the union type.  So, the code above works as
7952 expected.  @xref{Structures unions enumerations and bit-fields
7953 implementation}.  However, this code might not:
7954 @smallexample
7955 int f() @{
7956   union a_union t;
7957   int* ip;
7958   t.d = 3.0;
7959   ip = &t.i;
7960   return *ip;
7962 @end smallexample
7964 Similarly, access by taking the address, casting the resulting pointer
7965 and dereferencing the result has undefined behavior, even if the cast
7966 uses a union type, e.g.:
7967 @smallexample
7968 int f() @{
7969   double d = 3.0;
7970   return ((union a_union *) &d)->i;
7972 @end smallexample
7974 The @option{-fstrict-aliasing} option is enabled at levels
7975 @option{-O2}, @option{-O3}, @option{-Os}.
7977 @item -fstrict-overflow
7978 @opindex fstrict-overflow
7979 Allow the compiler to assume strict signed overflow rules, depending
7980 on the language being compiled.  For C (and C++) this means that
7981 overflow when doing arithmetic with signed numbers is undefined, which
7982 means that the compiler may assume that it does not happen.  This
7983 permits various optimizations.  For example, the compiler assumes
7984 that an expression like @code{i + 10 > i} is always true for
7985 signed @code{i}.  This assumption is only valid if signed overflow is
7986 undefined, as the expression is false if @code{i + 10} overflows when
7987 using twos complement arithmetic.  When this option is in effect any
7988 attempt to determine whether an operation on signed numbers 
7989 overflows must be written carefully to not actually involve overflow.
7991 This option also allows the compiler to assume strict pointer
7992 semantics: given a pointer to an object, if adding an offset to that
7993 pointer does not produce a pointer to the same object, the addition is
7994 undefined.  This permits the compiler to conclude that @code{p + u >
7995 p} is always true for a pointer @code{p} and unsigned integer
7996 @code{u}.  This assumption is only valid because pointer wraparound is
7997 undefined, as the expression is false if @code{p + u} overflows using
7998 twos complement arithmetic.
8000 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8001 that integer signed overflow is fully defined: it wraps.  When
8002 @option{-fwrapv} is used, there is no difference between
8003 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8004 integers.  With @option{-fwrapv} certain types of overflow are
8005 permitted.  For example, if the compiler gets an overflow when doing
8006 arithmetic on constants, the overflowed value can still be used with
8007 @option{-fwrapv}, but not otherwise.
8009 The @option{-fstrict-overflow} option is enabled at levels
8010 @option{-O2}, @option{-O3}, @option{-Os}.
8012 @item -falign-functions
8013 @itemx -falign-functions=@var{n}
8014 @opindex falign-functions
8015 Align the start of functions to the next power-of-two greater than
8016 @var{n}, skipping up to @var{n} bytes.  For instance,
8017 @option{-falign-functions=32} aligns functions to the next 32-byte
8018 boundary, but @option{-falign-functions=24} aligns to the next
8019 32-byte boundary only if this can be done by skipping 23 bytes or less.
8021 @option{-fno-align-functions} and @option{-falign-functions=1} are
8022 equivalent and mean that functions are not aligned.
8024 Some assemblers only support this flag when @var{n} is a power of two;
8025 in that case, it is rounded up.
8027 If @var{n} is not specified or is zero, use a machine-dependent default.
8029 Enabled at levels @option{-O2}, @option{-O3}.
8031 @item -falign-labels
8032 @itemx -falign-labels=@var{n}
8033 @opindex falign-labels
8034 Align all branch targets to a power-of-two boundary, skipping up to
8035 @var{n} bytes like @option{-falign-functions}.  This option can easily
8036 make code slower, because it must insert dummy operations for when the
8037 branch target is reached in the usual flow of the code.
8039 @option{-fno-align-labels} and @option{-falign-labels=1} are
8040 equivalent and mean that labels are not aligned.
8042 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8043 are greater than this value, then their values are used instead.
8045 If @var{n} is not specified or is zero, use a machine-dependent default
8046 which is very likely to be @samp{1}, meaning no alignment.
8048 Enabled at levels @option{-O2}, @option{-O3}.
8050 @item -falign-loops
8051 @itemx -falign-loops=@var{n}
8052 @opindex falign-loops
8053 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8054 like @option{-falign-functions}.  If the loops are
8055 executed many times, this makes up for any execution of the dummy
8056 operations.
8058 @option{-fno-align-loops} and @option{-falign-loops=1} are
8059 equivalent and mean that loops are not aligned.
8061 If @var{n} is not specified or is zero, use a machine-dependent default.
8063 Enabled at levels @option{-O2}, @option{-O3}.
8065 @item -falign-jumps
8066 @itemx -falign-jumps=@var{n}
8067 @opindex falign-jumps
8068 Align branch targets to a power-of-two boundary, for branch targets
8069 where the targets can only be reached by jumping, skipping up to @var{n}
8070 bytes like @option{-falign-functions}.  In this case, no dummy operations
8071 need be executed.
8073 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8074 equivalent and mean that loops are not aligned.
8076 If @var{n} is not specified or is zero, use a machine-dependent default.
8078 Enabled at levels @option{-O2}, @option{-O3}.
8080 @item -funit-at-a-time
8081 @opindex funit-at-a-time
8082 This option is left for compatibility reasons. @option{-funit-at-a-time}
8083 has no effect, while @option{-fno-unit-at-a-time} implies
8084 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8086 Enabled by default.
8088 @item -fno-toplevel-reorder
8089 @opindex fno-toplevel-reorder
8090 Do not reorder top-level functions, variables, and @code{asm}
8091 statements.  Output them in the same order that they appear in the
8092 input file.  When this option is used, unreferenced static variables
8093 are not removed.  This option is intended to support existing code
8094 that relies on a particular ordering.  For new code, it is better to
8095 use attributes.
8097 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8098 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8099 targets.
8101 @item -fweb
8102 @opindex fweb
8103 Constructs webs as commonly used for register allocation purposes and assign
8104 each web individual pseudo register.  This allows the register allocation pass
8105 to operate on pseudos directly, but also strengthens several other optimization
8106 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8107 however, make debugging impossible, since variables no longer stay in a
8108 ``home register''.
8110 Enabled by default with @option{-funroll-loops}.
8112 @item -fwhole-program
8113 @opindex fwhole-program
8114 Assume that the current compilation unit represents the whole program being
8115 compiled.  All public functions and variables with the exception of @code{main}
8116 and those merged by attribute @code{externally_visible} become static functions
8117 and in effect are optimized more aggressively by interprocedural optimizers. If @command{gold} is used as the linker plugin, @code{externally_visible} attributes are automatically added to functions (not variable yet due to a current @command{gold} issue) that are accessed outside of LTO objects according to resolution file produced by @command{gold}.  For other linkers that cannot generate resolution file, explicit @code{externally_visible} attributes are still necessary.
8118 While this option is equivalent to proper use of the @code{static} keyword for
8119 programs consisting of a single file, in combination with option
8120 @option{-flto} this flag can be used to
8121 compile many smaller scale programs since the functions and variables become
8122 local for the whole combined compilation unit, not for the single source file
8123 itself.
8125 This option implies @option{-fwhole-file} for Fortran programs.
8127 @item -flto[=@var{n}]
8128 @opindex flto
8129 This option runs the standard link-time optimizer.  When invoked
8130 with source code, it generates GIMPLE (one of GCC's internal
8131 representations) and writes it to special ELF sections in the object
8132 file.  When the object files are linked together, all the function
8133 bodies are read from these ELF sections and instantiated as if they
8134 had been part of the same translation unit.
8136 To use the link-time optimizer, @option{-flto} needs to be specified at
8137 compile time and during the final link.  For example:
8139 @smallexample
8140 gcc -c -O2 -flto foo.c
8141 gcc -c -O2 -flto bar.c
8142 gcc -o myprog -flto -O2 foo.o bar.o
8143 @end smallexample
8145 The first two invocations to GCC save a bytecode representation
8146 of GIMPLE into special ELF sections inside @file{foo.o} and
8147 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8148 @file{foo.o} and @file{bar.o}, merges the two files into a single
8149 internal image, and compiles the result as usual.  Since both
8150 @file{foo.o} and @file{bar.o} are merged into a single image, this
8151 causes all the interprocedural analyses and optimizations in GCC to
8152 work across the two files as if they were a single one.  This means,
8153 for example, that the inliner is able to inline functions in
8154 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8156 Another (simpler) way to enable link-time optimization is:
8158 @smallexample
8159 gcc -o myprog -flto -O2 foo.c bar.c
8160 @end smallexample
8162 The above generates bytecode for @file{foo.c} and @file{bar.c},
8163 merges them together into a single GIMPLE representation and optimizes
8164 them as usual to produce @file{myprog}.
8166 The only important thing to keep in mind is that to enable link-time
8167 optimizations the @option{-flto} flag needs to be passed to both the
8168 compile and the link commands.
8170 To make whole program optimization effective, it is necessary to make
8171 certain whole program assumptions.  The compiler needs to know
8172 what functions and variables can be accessed by libraries and runtime
8173 outside of the link-time optimized unit.  When supported by the linker,
8174 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8175 to the compiler about used and externally visible symbols.  When
8176 the linker plugin is not available, @option{-fwhole-program} should be
8177 used to allow the compiler to make these assumptions, which leads
8178 to more aggressive optimization decisions.
8180 Note that when a file is compiled with @option{-flto}, the generated
8181 object file is larger than a regular object file because it 
8182 contains GIMPLE bytecodes and the usual final code.  This means that
8183 object files with LTO information can be linked as normal object
8184 files; if @option{-flto} is not passed to the linker, no
8185 interprocedural optimizations are applied.
8187 Additionally, the optimization flags used to compile individual files
8188 are not necessarily related to those used at link time.  For instance,
8190 @smallexample
8191 gcc -c -O0 -flto foo.c
8192 gcc -c -O0 -flto bar.c
8193 gcc -o myprog -flto -O3 foo.o bar.o
8194 @end smallexample
8196 This produces individual object files with unoptimized assembler
8197 code, but the resulting binary @file{myprog} is optimized at
8198 @option{-O3}.  If, instead, the final binary is generated without
8199 @option{-flto}, then @file{myprog} is not optimized.
8201 When producing the final binary with @option{-flto}, GCC only
8202 applies link-time optimizations to those files that contain bytecode.
8203 Therefore, you can mix and match object files and libraries with
8204 GIMPLE bytecodes and final object code.  GCC automatically selects
8205 which files to optimize in LTO mode and which files to link without
8206 further processing.
8208 There are some code generation flags preserved by GCC when
8209 generating bytecodes, as they need to be used during the final link
8210 stage.  Currently, the following options are saved into the GIMPLE
8211 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
8212 @option{-m} target flags.
8214 At link time, these options are read in and reapplied.  Note that the
8215 current implementation makes no attempt to recognize conflicting
8216 values for these options.  If different files have conflicting option
8217 values (e.g., one file is compiled with @option{-fPIC} and another
8218 isn't), the compiler simply uses the last value read from the
8219 bytecode files.  It is recommended, then, that you compile all the files
8220 participating in the same link with the same options.
8222 If LTO encounters objects with C linkage declared with incompatible
8223 types in separate translation units to be linked together (undefined
8224 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8225 issued.  The behavior is still undefined at run time.
8227 Another feature of LTO is that it is possible to apply interprocedural
8228 optimizations on files written in different languages.  This requires
8229 support in the language front end.  Currently, the C, C++ and
8230 Fortran front ends are capable of emitting GIMPLE bytecodes, so
8231 something like this should work:
8233 @smallexample
8234 gcc -c -flto foo.c
8235 g++ -c -flto bar.cc
8236 gfortran -c -flto baz.f90
8237 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8238 @end smallexample
8240 Notice that the final link is done with @command{g++} to get the C++
8241 runtime libraries and @option{-lgfortran} is added to get the Fortran
8242 runtime libraries.  In general, when mixing languages in LTO mode, you
8243 should use the same link command options as when mixing languages in a
8244 regular (non-LTO) compilation; all you need to add is @option{-flto} to
8245 all the compile and link commands.
8247 If object files containing GIMPLE bytecode are stored in a library archive, say
8248 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8249 are using a linker with plugin support.  To enable this feature, use
8250 the flag @option{-fuse-linker-plugin} at link time:
8252 @smallexample
8253 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8254 @end smallexample
8256 With the linker plugin enabled, the linker extracts the needed
8257 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8258 to make them part of the aggregated GIMPLE image to be optimized.
8260 If you are not using a linker with plugin support and/or do not
8261 enable the linker plugin, then the objects inside @file{libfoo.a}
8262 are extracted and linked as usual, but they do not participate
8263 in the LTO optimization process.
8265 Link-time optimizations do not require the presence of the whole program to
8266 operate.  If the program does not require any symbols to be exported, it is
8267 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8268 the interprocedural optimizers to use more aggressive assumptions which may
8269 lead to improved optimization opportunities.
8270 Use of @option{-fwhole-program} is not needed when linker plugin is
8271 active (see @option{-fuse-linker-plugin}).
8273 The current implementation of LTO makes no
8274 attempt to generate bytecode that is portable between different
8275 types of hosts.  The bytecode files are versioned and there is a
8276 strict version check, so bytecode files generated in one version of
8277 GCC will not work with an older/newer version of GCC@.
8279 Link-time optimization does not work well with generation of debugging
8280 information.  Combining @option{-flto} with
8281 @option{-g} is currently experimental and expected to produce wrong
8282 results.
8284 If you specify the optional @var{n}, the optimization and code
8285 generation done at link time is executed in parallel using @var{n}
8286 parallel jobs by utilizing an installed @command{make} program.  The
8287 environment variable @env{MAKE} may be used to override the program
8288 used.  The default value for @var{n} is 1.
8290 You can also specify @option{-flto=jobserver} to use GNU make's
8291 job server mode to determine the number of parallel jobs. This
8292 is useful when the Makefile calling GCC is already executing in parallel.
8293 You must prepend a @samp{+} to the command recipe in the parent Makefile
8294 for this to work.  This option likely only works if @env{MAKE} is
8295 GNU make.
8297 This option is disabled by default.
8299 @item -flto-partition=@var{alg}
8300 @opindex flto-partition
8301 Specify the partitioning algorithm used by the link-time optimizer.
8302 The value is either @code{1to1} to specify a partitioning mirroring
8303 the original source files or @code{balanced} to specify partitioning
8304 into equally sized chunks (whenever possible) or @code{max} to create
8305 new partition for every symbol where possible.  Specifying @code{none}
8306 as an algorithm disables partitioning and streaming completely. 
8307 The default value is @code{balanced}. While @code{1to1} can be used
8308 as an workaround for various code ordering issues, the @code{max}
8309 partitioning is intended for internal testing only.
8311 @item -flto-compression-level=@var{n}
8312 This option specifies the level of compression used for intermediate
8313 language written to LTO object files, and is only meaningful in
8314 conjunction with LTO mode (@option{-flto}).  Valid
8315 values are 0 (no compression) to 9 (maximum compression).  Values
8316 outside this range are clamped to either 0 or 9.  If the option is not
8317 given, a default balanced compression setting is used.
8319 @item -flto-report
8320 Prints a report with internal details on the workings of the link-time
8321 optimizer.  The contents of this report vary from version to version.
8322 It is meant to be useful to GCC developers when processing object
8323 files in LTO mode (via @option{-flto}).
8325 Disabled by default.
8327 @item -fuse-linker-plugin
8328 Enables the use of a linker plugin during link-time optimization.  This
8329 option relies on plugin support in the linker, which is available in gold
8330 or in GNU ld 2.21 or newer.
8332 This option enables the extraction of object files with GIMPLE bytecode out
8333 of library archives. This improves the quality of optimization by exposing
8334 more code to the link-time optimizer.  This information specifies what
8335 symbols can be accessed externally (by non-LTO object or during dynamic
8336 linking).  Resulting code quality improvements on binaries (and shared
8337 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8338 See @option{-flto} for a description of the effect of this flag and how to
8339 use it.
8341 This option is enabled by default when LTO support in GCC is enabled
8342 and GCC was configured for use with
8343 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8345 @item -ffat-lto-objects
8346 @opindex ffat-lto-objects
8347 Fat LTO objects are object files that contain both the intermediate language
8348 and the object code. This makes them usable for both LTO linking and normal
8349 linking. This option is effective only when compiling with @option{-flto}
8350 and is ignored at link time.
8352 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8353 requires the complete toolchain to be aware of LTO. It requires a linker with
8354 linker plugin support for basic functionality.  Additionally,
8355 @command{nm}, @command{ar} and @command{ranlib}
8356 need to support linker plugins to allow a full-featured build environment
8357 (capable of building static libraries etc). gcc provides the @command{gcc-ar},
8358 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8359 to these tools. With non fat LTO makefiles need to be modified to use them.
8361 The default is @option{-ffat-lto-objects} but this default is intended to
8362 change in future releases when linker plugin enabled environments become more
8363 common.
8365 @item -fcompare-elim
8366 @opindex fcompare-elim
8367 After register allocation and post-register allocation instruction splitting,
8368 identify arithmetic instructions that compute processor flags similar to a
8369 comparison operation based on that arithmetic.  If possible, eliminate the
8370 explicit comparison operation.
8372 This pass only applies to certain targets that cannot explicitly represent
8373 the comparison operation before register allocation is complete.
8375 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8377 @item -fcprop-registers
8378 @opindex fcprop-registers
8379 After register allocation and post-register allocation instruction splitting,
8380 perform a copy-propagation pass to try to reduce scheduling dependencies
8381 and occasionally eliminate the copy.
8383 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8385 @item -fprofile-correction
8386 @opindex fprofile-correction
8387 Profiles collected using an instrumented binary for multi-threaded programs may
8388 be inconsistent due to missed counter updates. When this option is specified,
8389 GCC uses heuristics to correct or smooth out such inconsistencies. By
8390 default, GCC emits an error message when an inconsistent profile is detected.
8392 @item -fprofile-dir=@var{path}
8393 @opindex fprofile-dir
8395 Set the directory to search for the profile data files in to @var{path}.
8396 This option affects only the profile data generated by
8397 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8398 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8399 and its related options.  Both absolute and relative paths can be used.
8400 By default, GCC uses the current directory as @var{path}, thus the
8401 profile data file appears in the same directory as the object file.
8403 @item -fprofile-generate
8404 @itemx -fprofile-generate=@var{path}
8405 @opindex fprofile-generate
8407 Enable options usually used for instrumenting application to produce
8408 profile useful for later recompilation with profile feedback based
8409 optimization.  You must use @option{-fprofile-generate} both when
8410 compiling and when linking your program.
8412 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8414 If @var{path} is specified, GCC looks at the @var{path} to find
8415 the profile feedback data files. See @option{-fprofile-dir}.
8417 @item -fprofile-use
8418 @itemx -fprofile-use=@var{path}
8419 @opindex fprofile-use
8420 Enable profile feedback directed optimizations, and optimizations
8421 generally profitable only with profile feedback available.
8423 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8424 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
8425 @code{ftree-loop-distribute-patterns}
8427 By default, GCC emits an error message if the feedback profiles do not
8428 match the source code.  This error can be turned into a warning by using
8429 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8430 code.
8432 If @var{path} is specified, GCC looks at the @var{path} to find
8433 the profile feedback data files. See @option{-fprofile-dir}.
8434 @end table
8436 The following options control compiler behavior regarding floating-point 
8437 arithmetic.  These options trade off between speed and
8438 correctness.  All must be specifically enabled.
8440 @table @gcctabopt
8441 @item -ffloat-store
8442 @opindex ffloat-store
8443 Do not store floating-point variables in registers, and inhibit other
8444 options that might change whether a floating-point value is taken from a
8445 register or memory.
8447 @cindex floating-point precision
8448 This option prevents undesirable excess precision on machines such as
8449 the 68000 where the floating registers (of the 68881) keep more
8450 precision than a @code{double} is supposed to have.  Similarly for the
8451 x86 architecture.  For most programs, the excess precision does only
8452 good, but a few programs rely on the precise definition of IEEE floating
8453 point.  Use @option{-ffloat-store} for such programs, after modifying
8454 them to store all pertinent intermediate computations into variables.
8456 @item -fexcess-precision=@var{style}
8457 @opindex fexcess-precision
8458 This option allows further control over excess precision on machines
8459 where floating-point registers have more precision than the IEEE
8460 @code{float} and @code{double} types and the processor does not
8461 support operations rounding to those types.  By default,
8462 @option{-fexcess-precision=fast} is in effect; this means that
8463 operations are carried out in the precision of the registers and that
8464 it is unpredictable when rounding to the types specified in the source
8465 code takes place.  When compiling C, if
8466 @option{-fexcess-precision=standard} is specified then excess
8467 precision follows the rules specified in ISO C99; in particular,
8468 both casts and assignments cause values to be rounded to their
8469 semantic types (whereas @option{-ffloat-store} only affects
8470 assignments).  This option is enabled by default for C if a strict
8471 conformance option such as @option{-std=c99} is used.
8473 @opindex mfpmath
8474 @option{-fexcess-precision=standard} is not implemented for languages
8475 other than C, and has no effect if
8476 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8477 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8478 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8479 semantics apply without excess precision, and in the latter, rounding
8480 is unpredictable.
8482 @item -ffast-math
8483 @opindex ffast-math
8484 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8485 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8486 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8488 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8490 This option is not turned on by any @option{-O} option besides
8491 @option{-Ofast} since it can result in incorrect output for programs
8492 that depend on an exact implementation of IEEE or ISO rules/specifications
8493 for math functions. It may, however, yield faster code for programs
8494 that do not require the guarantees of these specifications.
8496 @item -fno-math-errno
8497 @opindex fno-math-errno
8498 Do not set @code{errno} after calling math functions that are executed
8499 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8500 IEEE exceptions for math error handling may want to use this flag
8501 for speed while maintaining IEEE arithmetic compatibility.
8503 This option is not turned on by any @option{-O} option since
8504 it can result in incorrect output for programs that depend on
8505 an exact implementation of IEEE or ISO rules/specifications for
8506 math functions. It may, however, yield faster code for programs
8507 that do not require the guarantees of these specifications.
8509 The default is @option{-fmath-errno}.
8511 On Darwin systems, the math library never sets @code{errno}.  There is
8512 therefore no reason for the compiler to consider the possibility that
8513 it might, and @option{-fno-math-errno} is the default.
8515 @item -funsafe-math-optimizations
8516 @opindex funsafe-math-optimizations
8518 Allow optimizations for floating-point arithmetic that (a) assume
8519 that arguments and results are valid and (b) may violate IEEE or
8520 ANSI standards.  When used at link-time, it may include libraries
8521 or startup files that change the default FPU control word or other
8522 similar optimizations.
8524 This option is not turned on by any @option{-O} option since
8525 it can result in incorrect output for programs that depend on
8526 an exact implementation of IEEE or ISO rules/specifications for
8527 math functions. It may, however, yield faster code for programs
8528 that do not require the guarantees of these specifications.
8529 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8530 @option{-fassociative-math} and @option{-freciprocal-math}.
8532 The default is @option{-fno-unsafe-math-optimizations}.
8534 @item -fassociative-math
8535 @opindex fassociative-math
8537 Allow re-association of operands in series of floating-point operations.
8538 This violates the ISO C and C++ language standard by possibly changing
8539 computation result.  NOTE: re-ordering may change the sign of zero as
8540 well as ignore NaNs and inhibit or create underflow or overflow (and
8541 thus cannot be used on code that relies on rounding behavior like
8542 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8543 and thus may not be used when ordered comparisons are required.
8544 This option requires that both @option{-fno-signed-zeros} and
8545 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8546 much sense with @option{-frounding-math}. For Fortran the option
8547 is automatically enabled when both @option{-fno-signed-zeros} and
8548 @option{-fno-trapping-math} are in effect.
8550 The default is @option{-fno-associative-math}.
8552 @item -freciprocal-math
8553 @opindex freciprocal-math
8555 Allow the reciprocal of a value to be used instead of dividing by
8556 the value if this enables optimizations.  For example @code{x / y}
8557 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8558 is subject to common subexpression elimination.  Note that this loses
8559 precision and increases the number of flops operating on the value.
8561 The default is @option{-fno-reciprocal-math}.
8563 @item -ffinite-math-only
8564 @opindex ffinite-math-only
8565 Allow optimizations for floating-point arithmetic that assume
8566 that arguments and results are not NaNs or +-Infs.
8568 This option is not turned on by any @option{-O} option since
8569 it can result in incorrect output for programs that depend on
8570 an exact implementation of IEEE or ISO rules/specifications for
8571 math functions. It may, however, yield faster code for programs
8572 that do not require the guarantees of these specifications.
8574 The default is @option{-fno-finite-math-only}.
8576 @item -fno-signed-zeros
8577 @opindex fno-signed-zeros
8578 Allow optimizations for floating-point arithmetic that ignore the
8579 signedness of zero.  IEEE arithmetic specifies the behavior of
8580 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8581 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8582 This option implies that the sign of a zero result isn't significant.
8584 The default is @option{-fsigned-zeros}.
8586 @item -fno-trapping-math
8587 @opindex fno-trapping-math
8588 Compile code assuming that floating-point operations cannot generate
8589 user-visible traps.  These traps include division by zero, overflow,
8590 underflow, inexact result and invalid operation.  This option requires
8591 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8592 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8594 This option should never be turned on by any @option{-O} option since
8595 it can result in incorrect output for programs that depend on
8596 an exact implementation of IEEE or ISO rules/specifications for
8597 math functions.
8599 The default is @option{-ftrapping-math}.
8601 @item -frounding-math
8602 @opindex frounding-math
8603 Disable transformations and optimizations that assume default floating-point
8604 rounding behavior.  This is round-to-zero for all floating point
8605 to integer conversions, and round-to-nearest for all other arithmetic
8606 truncations.  This option should be specified for programs that change
8607 the FP rounding mode dynamically, or that may be executed with a
8608 non-default rounding mode.  This option disables constant folding of
8609 floating-point expressions at compile time (which may be affected by
8610 rounding mode) and arithmetic transformations that are unsafe in the
8611 presence of sign-dependent rounding modes.
8613 The default is @option{-fno-rounding-math}.
8615 This option is experimental and does not currently guarantee to
8616 disable all GCC optimizations that are affected by rounding mode.
8617 Future versions of GCC may provide finer control of this setting
8618 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8619 will be used to specify the default state for @code{FENV_ACCESS}.
8621 @item -fsignaling-nans
8622 @opindex fsignaling-nans
8623 Compile code assuming that IEEE signaling NaNs may generate user-visible
8624 traps during floating-point operations.  Setting this option disables
8625 optimizations that may change the number of exceptions visible with
8626 signaling NaNs.  This option implies @option{-ftrapping-math}.
8628 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8629 be defined.
8631 The default is @option{-fno-signaling-nans}.
8633 This option is experimental and does not currently guarantee to
8634 disable all GCC optimizations that affect signaling NaN behavior.
8636 @item -fsingle-precision-constant
8637 @opindex fsingle-precision-constant
8638 Treat floating-point constants as single precision instead of
8639 implicitly converting them to double-precision constants.
8641 @item -fcx-limited-range
8642 @opindex fcx-limited-range
8643 When enabled, this option states that a range reduction step is not
8644 needed when performing complex division.  Also, there is no checking
8645 whether the result of a complex multiplication or division is @code{NaN
8646 + I*NaN}, with an attempt to rescue the situation in that case.  The
8647 default is @option{-fno-cx-limited-range}, but is enabled by
8648 @option{-ffast-math}.
8650 This option controls the default setting of the ISO C99
8651 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8652 all languages.
8654 @item -fcx-fortran-rules
8655 @opindex fcx-fortran-rules
8656 Complex multiplication and division follow Fortran rules.  Range
8657 reduction is done as part of complex division, but there is no checking
8658 whether the result of a complex multiplication or division is @code{NaN
8659 + I*NaN}, with an attempt to rescue the situation in that case.
8661 The default is @option{-fno-cx-fortran-rules}.
8663 @end table
8665 The following options control optimizations that may improve
8666 performance, but are not enabled by any @option{-O} options.  This
8667 section includes experimental options that may produce broken code.
8669 @table @gcctabopt
8670 @item -fbranch-probabilities
8671 @opindex fbranch-probabilities
8672 After running a program compiled with @option{-fprofile-arcs}
8673 (@pxref{Debugging Options,, Options for Debugging Your Program or
8674 @command{gcc}}), you can compile it a second time using
8675 @option{-fbranch-probabilities}, to improve optimizations based on
8676 the number of times each branch was taken.  When a program
8677 compiled with @option{-fprofile-arcs} exits, it saves arc execution
8678 counts to a file called @file{@var{sourcename}.gcda} for each source
8679 file.  The information in this data file is very dependent on the
8680 structure of the generated code, so you must use the same source code
8681 and the same optimization options for both compilations.
8683 With @option{-fbranch-probabilities}, GCC puts a
8684 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8685 These can be used to improve optimization.  Currently, they are only
8686 used in one place: in @file{reorg.c}, instead of guessing which path a
8687 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8688 exactly determine which path is taken more often.
8690 @item -fprofile-values
8691 @opindex fprofile-values
8692 If combined with @option{-fprofile-arcs}, it adds code so that some
8693 data about values of expressions in the program is gathered.
8695 With @option{-fbranch-probabilities}, it reads back the data gathered
8696 from profiling values of expressions for usage in optimizations.
8698 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8700 @item -fvpt
8701 @opindex fvpt
8702 If combined with @option{-fprofile-arcs}, this option instructs the compiler
8703 to add code to gather information about values of expressions.
8705 With @option{-fbranch-probabilities}, it reads back the data gathered
8706 and actually performs the optimizations based on them.
8707 Currently the optimizations include specialization of division operations
8708 using the knowledge about the value of the denominator.
8710 @item -frename-registers
8711 @opindex frename-registers
8712 Attempt to avoid false dependencies in scheduled code by making use
8713 of registers left over after register allocation.  This optimization
8714 most benefits processors with lots of registers.  Depending on the
8715 debug information format adopted by the target, however, it can
8716 make debugging impossible, since variables no longer stay in
8717 a ``home register''.
8719 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8721 @item -ftracer
8722 @opindex ftracer
8723 Perform tail duplication to enlarge superblock size.  This transformation
8724 simplifies the control flow of the function allowing other optimizations to do
8725 a better job.
8727 Enabled with @option{-fprofile-use}.
8729 @item -funroll-loops
8730 @opindex funroll-loops
8731 Unroll loops whose number of iterations can be determined at compile time or
8732 upon entry to the loop.  @option{-funroll-loops} implies
8733 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8734 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8735 a small constant number of iterations).  This option makes code larger, and may
8736 or may not make it run faster.
8738 Enabled with @option{-fprofile-use}.
8740 @item -funroll-all-loops
8741 @opindex funroll-all-loops
8742 Unroll all loops, even if their number of iterations is uncertain when
8743 the loop is entered.  This usually makes programs run more slowly.
8744 @option{-funroll-all-loops} implies the same options as
8745 @option{-funroll-loops}.
8747 @item -fpeel-loops
8748 @opindex fpeel-loops
8749 Peels loops for which there is enough information that they do not
8750 roll much (from profile feedback).  It also turns on complete loop peeling
8751 (i.e.@: complete removal of loops with small constant number of iterations).
8753 Enabled with @option{-fprofile-use}.
8755 @item -fmove-loop-invariants
8756 @opindex fmove-loop-invariants
8757 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8758 at level @option{-O1}
8760 @item -funswitch-loops
8761 @opindex funswitch-loops
8762 Move branches with loop invariant conditions out of the loop, with duplicates
8763 of the loop on both branches (modified according to result of the condition).
8765 @item -ffunction-sections
8766 @itemx -fdata-sections
8767 @opindex ffunction-sections
8768 @opindex fdata-sections
8769 Place each function or data item into its own section in the output
8770 file if the target supports arbitrary sections.  The name of the
8771 function or the name of the data item determines the section's name
8772 in the output file.
8774 Use these options on systems where the linker can perform optimizations
8775 to improve locality of reference in the instruction space.  Most systems
8776 using the ELF object format and SPARC processors running Solaris 2 have
8777 linkers with such optimizations.  AIX may have these optimizations in
8778 the future.
8780 Only use these options when there are significant benefits from doing
8781 so.  When you specify these options, the assembler and linker
8782 create larger object and executable files and are also slower.
8783 You cannot use @code{gprof} on all systems if you
8784 specify this option, and you may have problems with debugging if
8785 you specify both this option and @option{-g}.
8787 @item -fbranch-target-load-optimize
8788 @opindex fbranch-target-load-optimize
8789 Perform branch target register load optimization before prologue / epilogue
8790 threading.
8791 The use of target registers can typically be exposed only during reload,
8792 thus hoisting loads out of loops and doing inter-block scheduling needs
8793 a separate optimization pass.
8795 @item -fbranch-target-load-optimize2
8796 @opindex fbranch-target-load-optimize2
8797 Perform branch target register load optimization after prologue / epilogue
8798 threading.
8800 @item -fbtr-bb-exclusive
8801 @opindex fbtr-bb-exclusive
8802 When performing branch target register load optimization, don't reuse
8803 branch target registers within any basic block.
8805 @item -fstack-protector
8806 @opindex fstack-protector
8807 Emit extra code to check for buffer overflows, such as stack smashing
8808 attacks.  This is done by adding a guard variable to functions with
8809 vulnerable objects.  This includes functions that call @code{alloca}, and
8810 functions with buffers larger than 8 bytes.  The guards are initialized
8811 when a function is entered and then checked when the function exits.
8812 If a guard check fails, an error message is printed and the program exits.
8814 @item -fstack-protector-all
8815 @opindex fstack-protector-all
8816 Like @option{-fstack-protector} except that all functions are protected.
8818 @item -fsection-anchors
8819 @opindex fsection-anchors
8820 Try to reduce the number of symbolic address calculations by using
8821 shared ``anchor'' symbols to address nearby objects.  This transformation
8822 can help to reduce the number of GOT entries and GOT accesses on some
8823 targets.
8825 For example, the implementation of the following function @code{foo}:
8827 @smallexample
8828 static int a, b, c;
8829 int foo (void) @{ return a + b + c; @}
8830 @end smallexample
8832 @noindent
8833 usually calculates the addresses of all three variables, but if you
8834 compile it with @option{-fsection-anchors}, it accesses the variables
8835 from a common anchor point instead.  The effect is similar to the
8836 following pseudocode (which isn't valid C):
8838 @smallexample
8839 int foo (void)
8841   register int *xr = &x;
8842   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8844 @end smallexample
8846 Not all targets support this option.
8848 @item --param @var{name}=@var{value}
8849 @opindex param
8850 In some places, GCC uses various constants to control the amount of
8851 optimization that is done.  For example, GCC does not inline functions
8852 that contain more than a certain number of instructions.  You can
8853 control some of these constants on the command line using the
8854 @option{--param} option.
8856 The names of specific parameters, and the meaning of the values, are
8857 tied to the internals of the compiler, and are subject to change
8858 without notice in future releases.
8860 In each case, the @var{value} is an integer.  The allowable choices for
8861 @var{name} are:
8863 @table @gcctabopt
8864 @item predictable-branch-outcome
8865 When branch is predicted to be taken with probability lower than this threshold
8866 (in percent), then it is considered well predictable. The default is 10.
8868 @item max-crossjump-edges
8869 The maximum number of incoming edges to consider for cross-jumping.
8870 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8871 the number of edges incoming to each block.  Increasing values mean
8872 more aggressive optimization, making the compilation time increase with
8873 probably small improvement in executable size.
8875 @item min-crossjump-insns
8876 The minimum number of instructions that must be matched at the end
8877 of two blocks before cross-jumping is performed on them.  This
8878 value is ignored in the case where all instructions in the block being
8879 cross-jumped from are matched.  The default value is 5.
8881 @item max-grow-copy-bb-insns
8882 The maximum code size expansion factor when copying basic blocks
8883 instead of jumping.  The expansion is relative to a jump instruction.
8884 The default value is 8.
8886 @item max-goto-duplication-insns
8887 The maximum number of instructions to duplicate to a block that jumps
8888 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8889 passes, GCC factors computed gotos early in the compilation process,
8890 and unfactors them as late as possible.  Only computed jumps at the
8891 end of a basic blocks with no more than max-goto-duplication-insns are
8892 unfactored.  The default value is 8.
8894 @item max-delay-slot-insn-search
8895 The maximum number of instructions to consider when looking for an
8896 instruction to fill a delay slot.  If more than this arbitrary number of
8897 instructions are searched, the time savings from filling the delay slot
8898 are minimal, so stop searching.  Increasing values mean more
8899 aggressive optimization, making the compilation time increase with probably
8900 small improvement in execution time.
8902 @item max-delay-slot-live-search
8903 When trying to fill delay slots, the maximum number of instructions to
8904 consider when searching for a block with valid live register
8905 information.  Increasing this arbitrarily chosen value means more
8906 aggressive optimization, increasing the compilation time.  This parameter
8907 should be removed when the delay slot code is rewritten to maintain the
8908 control-flow graph.
8910 @item max-gcse-memory
8911 The approximate maximum amount of memory that can be allocated in
8912 order to perform the global common subexpression elimination
8913 optimization.  If more memory than specified is required, the
8914 optimization is not done.
8916 @item max-gcse-insertion-ratio
8917 If the ratio of expression insertions to deletions is larger than this value
8918 for any expression, then RTL PRE inserts or removes the expression and thus
8919 leaves partially redundant computations in the instruction stream.  The default value is 20.
8921 @item max-pending-list-length
8922 The maximum number of pending dependencies scheduling allows
8923 before flushing the current state and starting over.  Large functions
8924 with few branches or calls can create excessively large lists which
8925 needlessly consume memory and resources.
8927 @item max-modulo-backtrack-attempts
8928 The maximum number of backtrack attempts the scheduler should make
8929 when modulo scheduling a loop.  Larger values can exponentially increase
8930 compilation time.
8932 @item max-inline-insns-single
8933 Several parameters control the tree inliner used in GCC@.
8934 This number sets the maximum number of instructions (counted in GCC's
8935 internal representation) in a single function that the tree inliner
8936 considers for inlining.  This only affects functions declared
8937 inline and methods implemented in a class declaration (C++).
8938 The default value is 400.
8940 @item max-inline-insns-auto
8941 When you use @option{-finline-functions} (included in @option{-O3}),
8942 a lot of functions that would otherwise not be considered for inlining
8943 by the compiler are investigated.  To those functions, a different
8944 (more restrictive) limit compared to functions declared inline can
8945 be applied.
8946 The default value is 40.
8948 @item large-function-insns
8949 The limit specifying really large functions.  For functions larger than this
8950 limit after inlining, inlining is constrained by
8951 @option{--param large-function-growth}.  This parameter is useful primarily
8952 to avoid extreme compilation time caused by non-linear algorithms used by the
8953 back end.
8954 The default value is 2700.
8956 @item large-function-growth
8957 Specifies maximal growth of large function caused by inlining in percents.
8958 The default value is 100 which limits large function growth to 2.0 times
8959 the original size.
8961 @item large-unit-insns
8962 The limit specifying large translation unit.  Growth caused by inlining of
8963 units larger than this limit is limited by @option{--param inline-unit-growth}.
8964 For small units this might be too tight.
8965 For example, consider a unit consisting of function A
8966 that is inline and B that just calls A three times.  If B is small relative to
8967 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8968 large units consisting of small inlineable functions, however, the overall unit
8969 growth limit is needed to avoid exponential explosion of code size.  Thus for
8970 smaller units, the size is increased to @option{--param large-unit-insns}
8971 before applying @option{--param inline-unit-growth}.  The default is 10000.
8973 @item inline-unit-growth
8974 Specifies maximal overall growth of the compilation unit caused by inlining.
8975 The default value is 30 which limits unit growth to 1.3 times the original
8976 size.
8978 @item ipcp-unit-growth
8979 Specifies maximal overall growth of the compilation unit caused by
8980 interprocedural constant propagation.  The default value is 10 which limits
8981 unit growth to 1.1 times the original size.
8983 @item large-stack-frame
8984 The limit specifying large stack frames.  While inlining the algorithm is trying
8985 to not grow past this limit too much.  The default value is 256 bytes.
8987 @item large-stack-frame-growth
8988 Specifies maximal growth of large stack frames caused by inlining in percents.
8989 The default value is 1000 which limits large stack frame growth to 11 times
8990 the original size.
8992 @item max-inline-insns-recursive
8993 @itemx max-inline-insns-recursive-auto
8994 Specifies the maximum number of instructions an out-of-line copy of a
8995 self-recursive inline
8996 function can grow into by performing recursive inlining.
8998 For functions declared inline, @option{--param max-inline-insns-recursive} is
8999 taken into account.  For functions not declared inline, recursive inlining
9000 happens only when @option{-finline-functions} (included in @option{-O3}) is
9001 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
9002 default value is 450.
9004 @item max-inline-recursive-depth
9005 @itemx max-inline-recursive-depth-auto
9006 Specifies the maximum recursion depth used for recursive inlining.
9008 For functions declared inline, @option{--param max-inline-recursive-depth} is
9009 taken into account.  For functions not declared inline, recursive inlining
9010 happens only when @option{-finline-functions} (included in @option{-O3}) is
9011 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9012 default value is 8.
9014 @item min-inline-recursive-probability
9015 Recursive inlining is profitable only for function having deep recursion
9016 in average and can hurt for function having little recursion depth by
9017 increasing the prologue size or complexity of function body to other
9018 optimizers.
9020 When profile feedback is available (see @option{-fprofile-generate}) the actual
9021 recursion depth can be guessed from probability that function recurses via a
9022 given call expression.  This parameter limits inlining only to call expressions
9023 whose probability exceeds the given threshold (in percents).
9024 The default value is 10.
9026 @item early-inlining-insns
9027 Specify growth that the early inliner can make.  In effect it increases
9028 the amount of inlining for code having a large abstraction penalty.
9029 The default value is 10.
9031 @item max-early-inliner-iterations
9032 @itemx max-early-inliner-iterations
9033 Limit of iterations of the early inliner.  This basically bounds
9034 the number of nested indirect calls the early inliner can resolve.
9035 Deeper chains are still handled by late inlining.
9037 @item comdat-sharing-probability
9038 @itemx comdat-sharing-probability
9039 Probability (in percent) that C++ inline function with comdat visibility
9040 are shared across multiple compilation units.  The default value is 20.
9042 @item min-vect-loop-bound
9043 The minimum number of iterations under which loops are not vectorized
9044 when @option{-ftree-vectorize} is used.  The number of iterations after
9045 vectorization needs to be greater than the value specified by this option
9046 to allow vectorization.  The default value is 0.
9048 @item gcse-cost-distance-ratio
9049 Scaling factor in calculation of maximum distance an expression
9050 can be moved by GCSE optimizations.  This is currently supported only in the
9051 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9052 is with simple expressions, i.e., the expressions that have cost
9053 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9054 hoisting of simple expressions.  The default value is 10.
9056 @item gcse-unrestricted-cost
9057 Cost, roughly measured as the cost of a single typical machine
9058 instruction, at which GCSE optimizations do not constrain
9059 the distance an expression can travel.  This is currently
9060 supported only in the code hoisting pass.  The lesser the cost,
9061 the more aggressive code hoisting is.  Specifying 0 
9062 allows all expressions to travel unrestricted distances.
9063 The default value is 3.
9065 @item max-hoist-depth
9066 The depth of search in the dominator tree for expressions to hoist.
9067 This is used to avoid quadratic behavior in hoisting algorithm.
9068 The value of 0 does not limit on the search, but may slow down compilation
9069 of huge functions.  The default value is 30.
9071 @item max-tail-merge-comparisons
9072 The maximum amount of similar bbs to compare a bb with.  This is used to
9073 avoid quadratic behavior in tree tail merging.  The default value is 10.
9075 @item max-tail-merge-iterations
9076 The maximum amount of iterations of the pass over the function.  This is used to
9077 limit compilation time in tree tail merging.  The default value is 2.
9079 @item max-unrolled-insns
9080 The maximum number of instructions that a loop may have to be unrolled.
9081 If a loop is unrolled, this parameter also determines how many times
9082 the loop code is unrolled.
9084 @item max-average-unrolled-insns
9085 The maximum number of instructions biased by probabilities of their execution
9086 that a loop may have to be unrolled.  If a loop is unrolled,
9087 this parameter also determines how many times the loop code is unrolled.
9089 @item max-unroll-times
9090 The maximum number of unrollings of a single loop.
9092 @item max-peeled-insns
9093 The maximum number of instructions that a loop may have to be peeled.
9094 If a loop is peeled, this parameter also determines how many times
9095 the loop code is peeled.
9097 @item max-peel-times
9098 The maximum number of peelings of a single loop.
9100 @item max-peel-branches
9101 The maximum number of branches on the hot path through the peeled sequence.
9103 @item max-completely-peeled-insns
9104 The maximum number of insns of a completely peeled loop.
9106 @item max-completely-peel-times
9107 The maximum number of iterations of a loop to be suitable for complete peeling.
9109 @item max-completely-peel-loop-nest-depth
9110 The maximum depth of a loop nest suitable for complete peeling.
9112 @item max-unswitch-insns
9113 The maximum number of insns of an unswitched loop.
9115 @item max-unswitch-level
9116 The maximum number of branches unswitched in a single loop.
9118 @item lim-expensive
9119 The minimum cost of an expensive expression in the loop invariant motion.
9121 @item iv-consider-all-candidates-bound
9122 Bound on number of candidates for induction variables, below which
9123 all candidates are considered for each use in induction variable
9124 optimizations.  If there are more candidates than this,
9125 only the most relevant ones are considered to avoid quadratic time complexity.
9127 @item iv-max-considered-uses
9128 The induction variable optimizations give up on loops that contain more
9129 induction variable uses.
9131 @item iv-always-prune-cand-set-bound
9132 If the number of candidates in the set is smaller than this value,
9133 always try to remove unnecessary ivs from the set
9134 when adding a new one.
9136 @item scev-max-expr-size
9137 Bound on size of expressions used in the scalar evolutions analyzer.
9138 Large expressions slow the analyzer.
9140 @item scev-max-expr-complexity
9141 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9142 Complex expressions slow the analyzer.
9144 @item omega-max-vars
9145 The maximum number of variables in an Omega constraint system.
9146 The default value is 128.
9148 @item omega-max-geqs
9149 The maximum number of inequalities in an Omega constraint system.
9150 The default value is 256.
9152 @item omega-max-eqs
9153 The maximum number of equalities in an Omega constraint system.
9154 The default value is 128.
9156 @item omega-max-wild-cards
9157 The maximum number of wildcard variables that the Omega solver is
9158 able to insert.  The default value is 18.
9160 @item omega-hash-table-size
9161 The size of the hash table in the Omega solver.  The default value is
9162 550.
9164 @item omega-max-keys
9165 The maximal number of keys used by the Omega solver.  The default
9166 value is 500.
9168 @item omega-eliminate-redundant-constraints
9169 When set to 1, use expensive methods to eliminate all redundant
9170 constraints.  The default value is 0.
9172 @item vect-max-version-for-alignment-checks
9173 The maximum number of run-time checks that can be performed when
9174 doing loop versioning for alignment in the vectorizer.  See option
9175 @option{-ftree-vect-loop-version} for more information.
9177 @item vect-max-version-for-alias-checks
9178 The maximum number of run-time checks that can be performed when
9179 doing loop versioning for alias in the vectorizer.  See option
9180 @option{-ftree-vect-loop-version} for more information.
9182 @item max-iterations-to-track
9183 The maximum number of iterations of a loop the brute-force algorithm
9184 for analysis of the number of iterations of the loop tries to evaluate.
9186 @item hot-bb-count-fraction
9187 Select fraction of the maximal count of repetitions of basic block in program
9188 given basic block needs to have to be considered hot.
9190 @item hot-bb-frequency-fraction
9191 Select fraction of the entry block frequency of executions of basic block in
9192 function given basic block needs to have to be considered hot.
9194 @item max-predicted-iterations
9195 The maximum number of loop iterations we predict statically.  This is useful
9196 in cases where a function contains a single loop with known bound and
9197 another loop with unknown bound.
9198 The known number of iterations is predicted correctly, while
9199 the unknown number of iterations average to roughly 10.  This means that the
9200 loop without bounds appears artificially cold relative to the other one.
9202 @item align-threshold
9204 Select fraction of the maximal frequency of executions of a basic block in
9205 a function to align the basic block.
9207 @item align-loop-iterations
9209 A loop expected to iterate at least the selected number of iterations is
9210 aligned.
9212 @item tracer-dynamic-coverage
9213 @itemx tracer-dynamic-coverage-feedback
9215 This value is used to limit superblock formation once the given percentage of
9216 executed instructions is covered.  This limits unnecessary code size
9217 expansion.
9219 The @option{tracer-dynamic-coverage-feedback} is used only when profile
9220 feedback is available.  The real profiles (as opposed to statically estimated
9221 ones) are much less balanced allowing the threshold to be larger value.
9223 @item tracer-max-code-growth
9224 Stop tail duplication once code growth has reached given percentage.  This is
9225 a rather artificial limit, as most of the duplicates are eliminated later in
9226 cross jumping, so it may be set to much higher values than is the desired code
9227 growth.
9229 @item tracer-min-branch-ratio
9231 Stop reverse growth when the reverse probability of best edge is less than this
9232 threshold (in percent).
9234 @item tracer-min-branch-ratio
9235 @itemx tracer-min-branch-ratio-feedback
9237 Stop forward growth if the best edge has probability lower than this
9238 threshold.
9240 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
9241 compilation for profile feedback and one for compilation without.  The value
9242 for compilation with profile feedback needs to be more conservative (higher) in
9243 order to make tracer effective.
9245 @item max-cse-path-length
9247 The maximum number of basic blocks on path that CSE considers.
9248 The default is 10.
9250 @item max-cse-insns
9251 The maximum number of instructions CSE processes before flushing.
9252 The default is 1000.
9254 @item ggc-min-expand
9256 GCC uses a garbage collector to manage its own memory allocation.  This
9257 parameter specifies the minimum percentage by which the garbage
9258 collector's heap should be allowed to expand between collections.
9259 Tuning this may improve compilation speed; it has no effect on code
9260 generation.
9262 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9263 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9264 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9265 GCC is not able to calculate RAM on a particular platform, the lower
9266 bound of 30% is used.  Setting this parameter and
9267 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9268 every opportunity.  This is extremely slow, but can be useful for
9269 debugging.
9271 @item ggc-min-heapsize
9273 Minimum size of the garbage collector's heap before it begins bothering
9274 to collect garbage.  The first collection occurs after the heap expands
9275 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9276 tuning this may improve compilation speed, and has no effect on code
9277 generation.
9279 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9280 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9281 with a lower bound of 4096 (four megabytes) and an upper bound of
9282 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9283 particular platform, the lower bound is used.  Setting this parameter
9284 very large effectively disables garbage collection.  Setting this
9285 parameter and @option{ggc-min-expand} to zero causes a full collection
9286 to occur at every opportunity.
9288 @item max-reload-search-insns
9289 The maximum number of instruction reload should look backward for equivalent
9290 register.  Increasing values mean more aggressive optimization, making the
9291 compilation time increase with probably slightly better performance.
9292 The default value is 100.
9294 @item max-cselib-memory-locations
9295 The maximum number of memory locations cselib should take into account.
9296 Increasing values mean more aggressive optimization, making the compilation time
9297 increase with probably slightly better performance.  The default value is 500.
9299 @item reorder-blocks-duplicate
9300 @itemx reorder-blocks-duplicate-feedback
9302 Used by the basic block reordering pass to decide whether to use unconditional
9303 branch or duplicate the code on its destination.  Code is duplicated when its
9304 estimated size is smaller than this value multiplied by the estimated size of
9305 unconditional jump in the hot spots of the program.
9307 The @option{reorder-block-duplicate-feedback} is used only when profile
9308 feedback is available.  It may be set to higher values than
9309 @option{reorder-block-duplicate} since information about the hot spots is more
9310 accurate.
9312 @item max-sched-ready-insns
9313 The maximum number of instructions ready to be issued the scheduler should
9314 consider at any given time during the first scheduling pass.  Increasing
9315 values mean more thorough searches, making the compilation time increase
9316 with probably little benefit.  The default value is 100.
9318 @item max-sched-region-blocks
9319 The maximum number of blocks in a region to be considered for
9320 interblock scheduling.  The default value is 10.
9322 @item max-pipeline-region-blocks
9323 The maximum number of blocks in a region to be considered for
9324 pipelining in the selective scheduler.  The default value is 15.
9326 @item max-sched-region-insns
9327 The maximum number of insns in a region to be considered for
9328 interblock scheduling.  The default value is 100.
9330 @item max-pipeline-region-insns
9331 The maximum number of insns in a region to be considered for
9332 pipelining in the selective scheduler.  The default value is 200.
9334 @item min-spec-prob
9335 The minimum probability (in percents) of reaching a source block
9336 for interblock speculative scheduling.  The default value is 40.
9338 @item max-sched-extend-regions-iters
9339 The maximum number of iterations through CFG to extend regions.
9340 A value of 0 (the default) disables region extensions.
9342 @item max-sched-insn-conflict-delay
9343 The maximum conflict delay for an insn to be considered for speculative motion.
9344 The default value is 3.
9346 @item sched-spec-prob-cutoff
9347 The minimal probability of speculation success (in percents), so that
9348 speculative insns are scheduled.
9349 The default value is 40.
9351 @item sched-spec-state-edge-prob-cutoff
9352 The minimum probability an edge must have for the scheduler to save its
9353 state across it.
9354 The default value is 10.
9356 @item sched-mem-true-dep-cost
9357 Minimal distance (in CPU cycles) between store and load targeting same
9358 memory locations.  The default value is 1.
9360 @item selsched-max-lookahead
9361 The maximum size of the lookahead window of selective scheduling.  It is a
9362 depth of search for available instructions.
9363 The default value is 50.
9365 @item selsched-max-sched-times
9366 The maximum number of times that an instruction is scheduled during
9367 selective scheduling.  This is the limit on the number of iterations
9368 through which the instruction may be pipelined.  The default value is 2.
9370 @item selsched-max-insns-to-rename
9371 The maximum number of best instructions in the ready list that are considered
9372 for renaming in the selective scheduler.  The default value is 2.
9374 @item sms-min-sc
9375 The minimum value of stage count that swing modulo scheduler
9376 generates.  The default value is 2.
9378 @item max-last-value-rtl
9379 The maximum size measured as number of RTLs that can be recorded in an expression
9380 in combiner for a pseudo register as last known value of that register.  The default
9381 is 10000.
9383 @item integer-share-limit
9384 Small integer constants can use a shared data structure, reducing the
9385 compiler's memory usage and increasing its speed.  This sets the maximum
9386 value of a shared integer constant.  The default value is 256.
9388 @item ssp-buffer-size
9389 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9390 protection when @option{-fstack-protection} is used.
9392 @item max-jump-thread-duplication-stmts
9393 Maximum number of statements allowed in a block that needs to be
9394 duplicated when threading jumps.
9396 @item max-fields-for-field-sensitive
9397 Maximum number of fields in a structure treated in
9398 a field sensitive manner during pointer analysis.  The default is zero
9399 for @option{-O0} and @option{-O1},
9400 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9402 @item prefetch-latency
9403 Estimate on average number of instructions that are executed before
9404 prefetch finishes.  The distance prefetched ahead is proportional
9405 to this constant.  Increasing this number may also lead to less
9406 streams being prefetched (see @option{simultaneous-prefetches}).
9408 @item simultaneous-prefetches
9409 Maximum number of prefetches that can run at the same time.
9411 @item l1-cache-line-size
9412 The size of cache line in L1 cache, in bytes.
9414 @item l1-cache-size
9415 The size of L1 cache, in kilobytes.
9417 @item l2-cache-size
9418 The size of L2 cache, in kilobytes.
9420 @item min-insn-to-prefetch-ratio
9421 The minimum ratio between the number of instructions and the
9422 number of prefetches to enable prefetching in a loop.
9424 @item prefetch-min-insn-to-mem-ratio
9425 The minimum ratio between the number of instructions and the
9426 number of memory references to enable prefetching in a loop.
9428 @item use-canonical-types
9429 Whether the compiler should use the ``canonical'' type system.  By
9430 default, this should always be 1, which uses a more efficient internal
9431 mechanism for comparing types in C++ and Objective-C++.  However, if
9432 bugs in the canonical type system are causing compilation failures,
9433 set this value to 0 to disable canonical types.
9435 @item switch-conversion-max-branch-ratio
9436 Switch initialization conversion refuses to create arrays that are
9437 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9438 branches in the switch.
9440 @item max-partial-antic-length
9441 Maximum length of the partial antic set computed during the tree
9442 partial redundancy elimination optimization (@option{-ftree-pre}) when
9443 optimizing at @option{-O3} and above.  For some sorts of source code
9444 the enhanced partial redundancy elimination optimization can run away,
9445 consuming all of the memory available on the host machine.  This
9446 parameter sets a limit on the length of the sets that are computed,
9447 which prevents the runaway behavior.  Setting a value of 0 for
9448 this parameter allows an unlimited set length.
9450 @item sccvn-max-scc-size
9451 Maximum size of a strongly connected component (SCC) during SCCVN
9452 processing.  If this limit is hit, SCCVN processing for the whole
9453 function is not done and optimizations depending on it are
9454 disabled.  The default maximum SCC size is 10000.
9456 @item sccvn-max-alias-queries-per-access
9457 Maximum number of alias-oracle queries we perform when looking for
9458 redundancies for loads and stores.  If this limit is hit the search
9459 is aborted and the load or store is not considered redundant.  The
9460 number of queries is algorithmically limited to the number of
9461 stores on all paths from the load to the function entry.
9462 The default maxmimum number of queries is 1000.
9464 @item ira-max-loops-num
9465 IRA uses regional register allocation by default.  If a function
9466 contains more loops than the number given by this parameter, only at most
9467 the given number of the most frequently-executed loops form regions
9468 for regional register allocation.  The default value of the
9469 parameter is 100.
9471 @item ira-max-conflict-table-size 
9472 Although IRA uses a sophisticated algorithm to compress the conflict
9473 table, the table can still require excessive amounts of memory for
9474 huge functions.  If the conflict table for a function could be more
9475 than the size in MB given by this parameter, the register allocator
9476 instead uses a faster, simpler, and lower-quality
9477 algorithm that does not require building a pseudo-register conflict table.  
9478 The default value of the parameter is 2000.
9480 @item ira-loop-reserved-regs
9481 IRA can be used to evaluate more accurate register pressure in loops
9482 for decisions to move loop invariants (see @option{-O3}).  The number
9483 of available registers reserved for some other purposes is given
9484 by this parameter.  The default value of the parameter is 2, which is
9485 the minimal number of registers needed by typical instructions.
9486 This value is the best found from numerous experiments.
9488 @item loop-invariant-max-bbs-in-loop
9489 Loop invariant motion can be very expensive, both in compilation time and
9490 in amount of needed compile-time memory, with very large loops.  Loops
9491 with more basic blocks than this parameter won't have loop invariant
9492 motion optimization performed on them.  The default value of the
9493 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9495 @item loop-max-datarefs-for-datadeps
9496 Building data dapendencies is expensive for very large loops.  This
9497 parameter limits the number of data references in loops that are
9498 considered for data dependence analysis.  These large loops are no
9499 handled by the optimizations using loop data dependencies.
9500 The default value is 1000.
9502 @item max-vartrack-size
9503 Sets a maximum number of hash table slots to use during variable
9504 tracking dataflow analysis of any function.  If this limit is exceeded
9505 with variable tracking at assignments enabled, analysis for that
9506 function is retried without it, after removing all debug insns from
9507 the function.  If the limit is exceeded even without debug insns, var
9508 tracking analysis is completely disabled for the function.  Setting
9509 the parameter to zero makes it unlimited.
9511 @item max-vartrack-expr-depth
9512 Sets a maximum number of recursion levels when attempting to map
9513 variable names or debug temporaries to value expressions.  This trades
9514 compilation time for more complete debug information.  If this is set too
9515 low, value expressions that are available and could be represented in
9516 debug information may end up not being used; setting this higher may
9517 enable the compiler to find more complex debug expressions, but compile
9518 time and memory use may grow.  The default is 12.
9520 @item min-nondebug-insn-uid
9521 Use uids starting at this parameter for nondebug insns.  The range below
9522 the parameter is reserved exclusively for debug insns created by
9523 @option{-fvar-tracking-assignments}, but debug insns may get
9524 (non-overlapping) uids above it if the reserved range is exhausted.
9526 @item ipa-sra-ptr-growth-factor
9527 IPA-SRA replaces a pointer to an aggregate with one or more new
9528 parameters only when their cumulative size is less or equal to
9529 @option{ipa-sra-ptr-growth-factor} times the size of the original
9530 pointer parameter.
9532 @item tm-max-aggregate-size
9533 When making copies of thread-local variables in a transaction, this
9534 parameter specifies the size in bytes after which variables are
9535 saved with the logging functions as opposed to save/restore code
9536 sequence pairs.  This option only applies when using
9537 @option{-fgnu-tm}.
9539 @item graphite-max-nb-scop-params
9540 To avoid exponential effects in the Graphite loop transforms, the
9541 number of parameters in a Static Control Part (SCoP) is bounded.  The
9542 default value is 10 parameters.  A variable whose value is unknown at
9543 compilation time and defined outside a SCoP is a parameter of the SCoP.
9545 @item graphite-max-bbs-per-function
9546 To avoid exponential effects in the detection of SCoPs, the size of
9547 the functions analyzed by Graphite is bounded.  The default value is
9548 100 basic blocks.
9550 @item loop-block-tile-size
9551 Loop blocking or strip mining transforms, enabled with
9552 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9553 loop in the loop nest by a given number of iterations.  The strip
9554 length can be changed using the @option{loop-block-tile-size}
9555 parameter.  The default value is 51 iterations.
9557 @item ipa-cp-value-list-size
9558 IPA-CP attempts to track all possible values and types passed to a function's
9559 parameter in order to propagate them and perform devirtualization.
9560 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9561 stores per one formal parameter of a function.
9563 @item lto-partitions
9564 Specify desired number of partitions produced during WHOPR compilation.
9565 The number of partitions should exceed the number of CPUs used for compilation.
9566 The default value is 32.
9568 @item lto-minpartition
9569 Size of minimal partition for WHOPR (in estimated instructions).
9570 This prevents expenses of splitting very small programs into too many
9571 partitions.
9573 @item cxx-max-namespaces-for-diagnostic-help
9574 The maximum number of namespaces to consult for suggestions when C++
9575 name lookup fails for an identifier.  The default is 1000.
9577 @item sink-frequency-threshold
9578 The maximum relative execution frequency (in percents) of the target block
9579 relative to a statement's original block to allow statement sinking of a
9580 statement.  Larger numbers result in more aggressive statement sinking.
9581 The default value is 75.  A small positive adjustment is applied for
9582 statements with memory operands as those are even more profitable so sink.
9584 @item max-stores-to-sink
9585 The maximum number of conditional stores paires that can be sunk.  Set to 0
9586 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9587 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9589 @item allow-load-data-races
9590 Allow optimizers to introduce new data races on loads.
9591 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9592 unless implicitly set by the @option{-fmemory-model=} option.
9594 @item allow-store-data-races
9595 Allow optimizers to introduce new data races on stores.
9596 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9597 unless implicitly set by the @option{-fmemory-model=} option.
9599 @item allow-packed-load-data-races
9600 Allow optimizers to introduce new data races on packed data loads.
9601 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9602 unless implicitly set by the @option{-fmemory-model=} option.
9604 @item allow-packed-store-data-races
9605 Allow optimizers to introduce new data races on packed data stores.
9606 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9607 unless implicitly set by the @option{-fmemory-model=} option.
9609 @item case-values-threshold
9610 The smallest number of different values for which it is best to use a
9611 jump-table instead of a tree of conditional branches.  If the value is
9612 0, use the default for the machine.  The default is 0.
9614 @item tree-reassoc-width
9615 Set the maximum number of instructions executed in parallel in
9616 reassociated tree. This parameter overrides target dependent
9617 heuristics used by default if has non zero value.
9619 @item sched-pressure-algorithm
9620 Choose between the two available implementations of
9621 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
9622 and is the more likely to prevent instructions from being reordered.
9623 Algorithm 2 was designed to be a compromise between the relatively
9624 conservative approach taken by algorithm 1 and the rather aggressive
9625 approach taken by the default scheduler.  It relies more heavily on
9626 having a regular register file and accurate register pressure classes.
9627 See @file{haifa-sched.c} in the GCC sources for more details.
9629 The default choice depends on the target.
9631 @item max-slsr-cand-scan
9632 Set the maximum number of existing candidates that will be considered when
9633 seeking a basis for a new straight-line strength reduction candidate.
9635 @end table
9636 @end table
9638 @node Preprocessor Options
9639 @section Options Controlling the Preprocessor
9640 @cindex preprocessor options
9641 @cindex options, preprocessor
9643 These options control the C preprocessor, which is run on each C source
9644 file before actual compilation.
9646 If you use the @option{-E} option, nothing is done except preprocessing.
9647 Some of these options make sense only together with @option{-E} because
9648 they cause the preprocessor output to be unsuitable for actual
9649 compilation.
9651 @table @gcctabopt
9652 @item -Wp,@var{option}
9653 @opindex Wp
9654 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9655 and pass @var{option} directly through to the preprocessor.  If
9656 @var{option} contains commas, it is split into multiple options at the
9657 commas.  However, many options are modified, translated or interpreted
9658 by the compiler driver before being passed to the preprocessor, and
9659 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9660 interface is undocumented and subject to change, so whenever possible
9661 you should avoid using @option{-Wp} and let the driver handle the
9662 options instead.
9664 @item -Xpreprocessor @var{option}
9665 @opindex Xpreprocessor
9666 Pass @var{option} as an option to the preprocessor.  You can use this to
9667 supply system-specific preprocessor options that GCC does not 
9668 recognize.
9670 If you want to pass an option that takes an argument, you must use
9671 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9673 @item -no-integrated-cpp
9674 @opindex no-integrated-cpp
9675 Perform preprocessing as a separate pass before compilation.
9676 By default, GCC performs preprocessing as an integrated part of
9677 input tokenization and parsing.
9678 If this option is provided, the appropriate language front end
9679 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
9680 and Objective-C, respectively) is instead invoked twice,
9681 once for preprocessing only and once for actual compilation
9682 of the preprocessed input.
9683 This option may be useful in conjunction with the @option{-B} or
9684 @option{-wrapper} options to specify an alternate preprocessor or
9685 perform additional processing of the program source between
9686 normal preprocessing and compilation.
9687 @end table
9689 @include cppopts.texi
9691 @node Assembler Options
9692 @section Passing Options to the Assembler
9694 @c prevent bad page break with this line
9695 You can pass options to the assembler.
9697 @table @gcctabopt
9698 @item -Wa,@var{option}
9699 @opindex Wa
9700 Pass @var{option} as an option to the assembler.  If @var{option}
9701 contains commas, it is split into multiple options at the commas.
9703 @item -Xassembler @var{option}
9704 @opindex Xassembler
9705 Pass @var{option} as an option to the assembler.  You can use this to
9706 supply system-specific assembler options that GCC does not
9707 recognize.
9709 If you want to pass an option that takes an argument, you must use
9710 @option{-Xassembler} twice, once for the option and once for the argument.
9712 @end table
9714 @node Link Options
9715 @section Options for Linking
9716 @cindex link options
9717 @cindex options, linking
9719 These options come into play when the compiler links object files into
9720 an executable output file.  They are meaningless if the compiler is
9721 not doing a link step.
9723 @table @gcctabopt
9724 @cindex file names
9725 @item @var{object-file-name}
9726 A file name that does not end in a special recognized suffix is
9727 considered to name an object file or library.  (Object files are
9728 distinguished from libraries by the linker according to the file
9729 contents.)  If linking is done, these object files are used as input
9730 to the linker.
9732 @item -c
9733 @itemx -S
9734 @itemx -E
9735 @opindex c
9736 @opindex S
9737 @opindex E
9738 If any of these options is used, then the linker is not run, and
9739 object file names should not be used as arguments.  @xref{Overall
9740 Options}.
9742 @cindex Libraries
9743 @item -l@var{library}
9744 @itemx -l @var{library}
9745 @opindex l
9746 Search the library named @var{library} when linking.  (The second
9747 alternative with the library as a separate argument is only for
9748 POSIX compliance and is not recommended.)
9750 It makes a difference where in the command you write this option; the
9751 linker searches and processes libraries and object files in the order they
9752 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9753 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9754 to functions in @samp{z}, those functions may not be loaded.
9756 The linker searches a standard list of directories for the library,
9757 which is actually a file named @file{lib@var{library}.a}.  The linker
9758 then uses this file as if it had been specified precisely by name.
9760 The directories searched include several standard system directories
9761 plus any that you specify with @option{-L}.
9763 Normally the files found this way are library files---archive files
9764 whose members are object files.  The linker handles an archive file by
9765 scanning through it for members which define symbols that have so far
9766 been referenced but not defined.  But if the file that is found is an
9767 ordinary object file, it is linked in the usual fashion.  The only
9768 difference between using an @option{-l} option and specifying a file name
9769 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9770 and searches several directories.
9772 @item -lobjc
9773 @opindex lobjc
9774 You need this special case of the @option{-l} option in order to
9775 link an Objective-C or Objective-C++ program.
9777 @item -nostartfiles
9778 @opindex nostartfiles
9779 Do not use the standard system startup files when linking.
9780 The standard system libraries are used normally, unless @option{-nostdlib}
9781 or @option{-nodefaultlibs} is used.
9783 @item -nodefaultlibs
9784 @opindex nodefaultlibs
9785 Do not use the standard system libraries when linking.
9786 Only the libraries you specify are passed to the linker, and options
9787 specifying linkage of the system libraries, such as @code{-static-libgcc}
9788 or @code{-shared-libgcc}, are ignored.  
9789 The standard startup files are used normally, unless @option{-nostartfiles}
9790 is used.  
9792 The compiler may generate calls to @code{memcmp},
9793 @code{memset}, @code{memcpy} and @code{memmove}.
9794 These entries are usually resolved by entries in
9795 libc.  These entry points should be supplied through some other
9796 mechanism when this option is specified.
9798 @item -nostdlib
9799 @opindex nostdlib
9800 Do not use the standard system startup files or libraries when linking.
9801 No startup files and only the libraries you specify are passed to
9802 the linker, and options specifying linkage of the system libraries, such as
9803 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
9805 The compiler may generate calls to @code{memcmp}, @code{memset},
9806 @code{memcpy} and @code{memmove}.
9807 These entries are usually resolved by entries in
9808 libc.  These entry points should be supplied through some other
9809 mechanism when this option is specified.
9811 @cindex @option{-lgcc}, use with @option{-nostdlib}
9812 @cindex @option{-nostdlib} and unresolved references
9813 @cindex unresolved references and @option{-nostdlib}
9814 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9815 @cindex @option{-nodefaultlibs} and unresolved references
9816 @cindex unresolved references and @option{-nodefaultlibs}
9817 One of the standard libraries bypassed by @option{-nostdlib} and
9818 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9819 which GCC uses to overcome shortcomings of particular machines, or special
9820 needs for some languages.
9821 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
9822 Collection (GCC) Internals},
9823 for more discussion of @file{libgcc.a}.)
9824 In most cases, you need @file{libgcc.a} even when you want to avoid
9825 other standard libraries.  In other words, when you specify @option{-nostdlib}
9826 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9827 This ensures that you have no unresolved references to internal GCC
9828 library subroutines.
9829 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
9830 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
9831 GNU Compiler Collection (GCC) Internals}.)
9833 @item -pie
9834 @opindex pie
9835 Produce a position independent executable on targets that support it.
9836 For predictable results, you must also specify the same set of options
9837 used for compilation (@option{-fpie}, @option{-fPIE},
9838 or model suboptions) when you specify this linker option.
9840 @item -rdynamic
9841 @opindex rdynamic
9842 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9843 that support it. This instructs the linker to add all symbols, not
9844 only used ones, to the dynamic symbol table. This option is needed
9845 for some uses of @code{dlopen} or to allow obtaining backtraces
9846 from within a program.
9848 @item -s
9849 @opindex s
9850 Remove all symbol table and relocation information from the executable.
9852 @item -static
9853 @opindex static
9854 On systems that support dynamic linking, this prevents linking with the shared
9855 libraries.  On other systems, this option has no effect.
9857 @item -shared
9858 @opindex shared
9859 Produce a shared object which can then be linked with other objects to
9860 form an executable.  Not all systems support this option.  For predictable
9861 results, you must also specify the same set of options used for compilation
9862 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
9863 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
9864 needs to build supplementary stub code for constructors to work.  On
9865 multi-libbed systems, @samp{gcc -shared} must select the correct support
9866 libraries to link against.  Failing to supply the correct flags may lead
9867 to subtle defects.  Supplying them in cases where they are not necessary
9868 is innocuous.}
9870 @item -shared-libgcc
9871 @itemx -static-libgcc
9872 @opindex shared-libgcc
9873 @opindex static-libgcc
9874 On systems that provide @file{libgcc} as a shared library, these options
9875 force the use of either the shared or static version, respectively.
9876 If no shared version of @file{libgcc} was built when the compiler was
9877 configured, these options have no effect.
9879 There are several situations in which an application should use the
9880 shared @file{libgcc} instead of the static version.  The most common
9881 of these is when the application wishes to throw and catch exceptions
9882 across different shared libraries.  In that case, each of the libraries
9883 as well as the application itself should use the shared @file{libgcc}.
9885 Therefore, the G++ and GCJ drivers automatically add
9886 @option{-shared-libgcc} whenever you build a shared library or a main
9887 executable, because C++ and Java programs typically use exceptions, so
9888 this is the right thing to do.
9890 If, instead, you use the GCC driver to create shared libraries, you may
9891 find that they are not always linked with the shared @file{libgcc}.
9892 If GCC finds, at its configuration time, that you have a non-GNU linker
9893 or a GNU linker that does not support option @option{--eh-frame-hdr},
9894 it links the shared version of @file{libgcc} into shared libraries
9895 by default.  Otherwise, it takes advantage of the linker and optimizes
9896 away the linking with the shared version of @file{libgcc}, linking with
9897 the static version of libgcc by default.  This allows exceptions to
9898 propagate through such shared libraries, without incurring relocation
9899 costs at library load time.
9901 However, if a library or main executable is supposed to throw or catch
9902 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9903 for the languages used in the program, or using the option
9904 @option{-shared-libgcc}, such that it is linked with the shared
9905 @file{libgcc}.
9907 @item -static-libstdc++
9908 When the @command{g++} program is used to link a C++ program, it
9909 normally automatically links against @option{libstdc++}.  If
9910 @file{libstdc++} is available as a shared library, and the
9911 @option{-static} option is not used, then this links against the
9912 shared version of @file{libstdc++}.  That is normally fine.  However, it
9913 is sometimes useful to freeze the version of @file{libstdc++} used by
9914 the program without going all the way to a fully static link.  The
9915 @option{-static-libstdc++} option directs the @command{g++} driver to
9916 link @file{libstdc++} statically, without necessarily linking other
9917 libraries statically.
9919 @item -symbolic
9920 @opindex symbolic
9921 Bind references to global symbols when building a shared object.  Warn
9922 about any unresolved references (unless overridden by the link editor
9923 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
9924 this option.
9926 @item -T @var{script}
9927 @opindex T
9928 @cindex linker script
9929 Use @var{script} as the linker script.  This option is supported by most
9930 systems using the GNU linker.  On some targets, such as bare-board
9931 targets without an operating system, the @option{-T} option may be required
9932 when linking to avoid references to undefined symbols.
9934 @item -Xlinker @var{option}
9935 @opindex Xlinker
9936 Pass @var{option} as an option to the linker.  You can use this to
9937 supply system-specific linker options that GCC does not recognize.
9939 If you want to pass an option that takes a separate argument, you must use
9940 @option{-Xlinker} twice, once for the option and once for the argument.
9941 For example, to pass @option{-assert definitions}, you must write
9942 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
9943 @option{-Xlinker "-assert definitions"}, because this passes the entire
9944 string as a single argument, which is not what the linker expects.
9946 When using the GNU linker, it is usually more convenient to pass
9947 arguments to linker options using the @option{@var{option}=@var{value}}
9948 syntax than as separate arguments.  For example, you can specify
9949 @option{-Xlinker -Map=output.map} rather than
9950 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
9951 this syntax for command-line options.
9953 @item -Wl,@var{option}
9954 @opindex Wl
9955 Pass @var{option} as an option to the linker.  If @var{option} contains
9956 commas, it is split into multiple options at the commas.  You can use this
9957 syntax to pass an argument to the option.
9958 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
9959 linker.  When using the GNU linker, you can also get the same effect with
9960 @option{-Wl,-Map=output.map}.
9962 @item -u @var{symbol}
9963 @opindex u
9964 Pretend the symbol @var{symbol} is undefined, to force linking of
9965 library modules to define it.  You can use @option{-u} multiple times with
9966 different symbols to force loading of additional library modules.
9967 @end table
9969 @node Directory Options
9970 @section Options for Directory Search
9971 @cindex directory options
9972 @cindex options, directory search
9973 @cindex search path
9975 These options specify directories to search for header files, for
9976 libraries and for parts of the compiler:
9978 @table @gcctabopt
9979 @item -I@var{dir}
9980 @opindex I
9981 Add the directory @var{dir} to the head of the list of directories to be
9982 searched for header files.  This can be used to override a system header
9983 file, substituting your own version, since these directories are
9984 searched before the system header file directories.  However, you should
9985 not use this option to add directories that contain vendor-supplied
9986 system header files (use @option{-isystem} for that).  If you use more than
9987 one @option{-I} option, the directories are scanned in left-to-right
9988 order; the standard system directories come after.
9990 If a standard system include directory, or a directory specified with
9991 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9992 option is ignored.  The directory is still searched but as a
9993 system directory at its normal position in the system include chain.
9994 This is to ensure that GCC's procedure to fix buggy system headers and
9995 the ordering for the @code{include_next} directive are not inadvertently changed.
9996 If you really need to change the search order for system directories,
9997 use the @option{-nostdinc} and/or @option{-isystem} options.
9999 @item -iplugindir=@var{dir}
10000 Set the directory to search for plugins that are passed
10001 by @option{-fplugin=@var{name}} instead of
10002 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10003 to be used by the user, but only passed by the driver.
10005 @item -iquote@var{dir}
10006 @opindex iquote
10007 Add the directory @var{dir} to the head of the list of directories to
10008 be searched for header files only for the case of @samp{#include
10009 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
10010 otherwise just like @option{-I}.
10012 @item -L@var{dir}
10013 @opindex L
10014 Add directory @var{dir} to the list of directories to be searched
10015 for @option{-l}.
10017 @item -B@var{prefix}
10018 @opindex B
10019 This option specifies where to find the executables, libraries,
10020 include files, and data files of the compiler itself.
10022 The compiler driver program runs one or more of the subprograms
10023 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10024 @var{prefix} as a prefix for each program it tries to run, both with and
10025 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
10027 For each subprogram to be run, the compiler driver first tries the
10028 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10029 is not specified, the driver tries two standard prefixes, 
10030 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10031 those results in a file name that is found, the unmodified program
10032 name is searched for using the directories specified in your
10033 @env{PATH} environment variable.
10035 The compiler checks to see if the path provided by the @option{-B}
10036 refers to a directory, and if necessary it adds a directory
10037 separator character at the end of the path.
10039 @option{-B} prefixes that effectively specify directory names also apply
10040 to libraries in the linker, because the compiler translates these
10041 options into @option{-L} options for the linker.  They also apply to
10042 includes files in the preprocessor, because the compiler translates these
10043 options into @option{-isystem} options for the preprocessor.  In this case,
10044 the compiler appends @samp{include} to the prefix.
10046 The runtime support file @file{libgcc.a} can also be searched for using
10047 the @option{-B} prefix, if needed.  If it is not found there, the two
10048 standard prefixes above are tried, and that is all.  The file is left
10049 out of the link if it is not found by those means.
10051 Another way to specify a prefix much like the @option{-B} prefix is to use
10052 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10053 Variables}.
10055 As a special kludge, if the path provided by @option{-B} is
10056 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10057 9, then it is replaced by @file{[dir/]include}.  This is to help
10058 with boot-strapping the compiler.
10060 @item -specs=@var{file}
10061 @opindex specs
10062 Process @var{file} after the compiler reads in the standard @file{specs}
10063 file, in order to override the defaults which the @command{gcc} driver
10064 program uses when determining what switches to pass to @command{cc1},
10065 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
10066 @option{-specs=@var{file}} can be specified on the command line, and they
10067 are processed in order, from left to right.
10069 @item --sysroot=@var{dir}
10070 @opindex sysroot
10071 Use @var{dir} as the logical root directory for headers and libraries.
10072 For example, if the compiler normally searches for headers in
10073 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
10074 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
10076 If you use both this option and the @option{-isysroot} option, then
10077 the @option{--sysroot} option applies to libraries, but the
10078 @option{-isysroot} option applies to header files.
10080 The GNU linker (beginning with version 2.16) has the necessary support
10081 for this option.  If your linker does not support this option, the
10082 header file aspect of @option{--sysroot} still works, but the
10083 library aspect does not.
10085 @item --no-sysroot-suffix
10086 @opindex no-sysroot-suffix
10087 For some targets, a suffix is added to the root directory specified
10088 with @option{--sysroot}, depending on the other options used, so that
10089 headers may for example be found in
10090 @file{@var{dir}/@var{suffix}/usr/include} instead of
10091 @file{@var{dir}/usr/include}.  This option disables the addition of
10092 such a suffix.
10094 @item -I-
10095 @opindex I-
10096 This option has been deprecated.  Please use @option{-iquote} instead for
10097 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
10098 Any directories you specify with @option{-I} options before the @option{-I-}
10099 option are searched only for the case of @samp{#include "@var{file}"};
10100 they are not searched for @samp{#include <@var{file}>}.
10102 If additional directories are specified with @option{-I} options after
10103 the @option{-I-}, these directories are searched for all @samp{#include}
10104 directives.  (Ordinarily @emph{all} @option{-I} directories are used
10105 this way.)
10107 In addition, the @option{-I-} option inhibits the use of the current
10108 directory (where the current input file came from) as the first search
10109 directory for @samp{#include "@var{file}"}.  There is no way to
10110 override this effect of @option{-I-}.  With @option{-I.} you can specify
10111 searching the directory that is current when the compiler is
10112 invoked.  That is not exactly the same as what the preprocessor does
10113 by default, but it is often satisfactory.
10115 @option{-I-} does not inhibit the use of the standard system directories
10116 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
10117 independent.
10118 @end table
10120 @c man end
10122 @node Spec Files
10123 @section Specifying subprocesses and the switches to pass to them
10124 @cindex Spec Files
10126 @command{gcc} is a driver program.  It performs its job by invoking a
10127 sequence of other programs to do the work of compiling, assembling and
10128 linking.  GCC interprets its command-line parameters and uses these to
10129 deduce which programs it should invoke, and which command-line options
10130 it ought to place on their command lines.  This behavior is controlled
10131 by @dfn{spec strings}.  In most cases there is one spec string for each
10132 program that GCC can invoke, but a few programs have multiple spec
10133 strings to control their behavior.  The spec strings built into GCC can
10134 be overridden by using the @option{-specs=} command-line switch to specify
10135 a spec file.
10137 @dfn{Spec files} are plaintext files that are used to construct spec
10138 strings.  They consist of a sequence of directives separated by blank
10139 lines.  The type of directive is determined by the first non-whitespace
10140 character on the line, which can be one of the following:
10142 @table @code
10143 @item %@var{command}
10144 Issues a @var{command} to the spec file processor.  The commands that can
10145 appear here are:
10147 @table @code
10148 @item %include <@var{file}>
10149 @cindex @code{%include}
10150 Search for @var{file} and insert its text at the current point in the
10151 specs file.
10153 @item %include_noerr <@var{file}>
10154 @cindex @code{%include_noerr}
10155 Just like @samp{%include}, but do not generate an error message if the include
10156 file cannot be found.
10158 @item %rename @var{old_name} @var{new_name}
10159 @cindex @code{%rename}
10160 Rename the spec string @var{old_name} to @var{new_name}.
10162 @end table
10164 @item *[@var{spec_name}]:
10165 This tells the compiler to create, override or delete the named spec
10166 string.  All lines after this directive up to the next directive or
10167 blank line are considered to be the text for the spec string.  If this
10168 results in an empty string then the spec is deleted.  (Or, if the
10169 spec did not exist, then nothing happens.)  Otherwise, if the spec
10170 does not currently exist a new spec is created.  If the spec does
10171 exist then its contents are overridden by the text of this
10172 directive, unless the first character of that text is the @samp{+}
10173 character, in which case the text is appended to the spec.
10175 @item [@var{suffix}]:
10176 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
10177 and up to the next directive or blank line are considered to make up the
10178 spec string for the indicated suffix.  When the compiler encounters an
10179 input file with the named suffix, it processes the spec string in
10180 order to work out how to compile that file.  For example:
10182 @smallexample
10183 .ZZ:
10184 z-compile -input %i
10185 @end smallexample
10187 This says that any input file whose name ends in @samp{.ZZ} should be
10188 passed to the program @samp{z-compile}, which should be invoked with the
10189 command-line switch @option{-input} and with the result of performing the
10190 @samp{%i} substitution.  (See below.)
10192 As an alternative to providing a spec string, the text following a
10193 suffix directive can be one of the following:
10195 @table @code
10196 @item @@@var{language}
10197 This says that the suffix is an alias for a known @var{language}.  This is
10198 similar to using the @option{-x} command-line switch to GCC to specify a
10199 language explicitly.  For example:
10201 @smallexample
10202 .ZZ:
10203 @@c++
10204 @end smallexample
10206 Says that .ZZ files are, in fact, C++ source files.
10208 @item #@var{name}
10209 This causes an error messages saying:
10211 @smallexample
10212 @var{name} compiler not installed on this system.
10213 @end smallexample
10214 @end table
10216 GCC already has an extensive list of suffixes built into it.
10217 This directive adds an entry to the end of the list of suffixes, but
10218 since the list is searched from the end backwards, it is effectively
10219 possible to override earlier entries using this technique.
10221 @end table
10223 GCC has the following spec strings built into it.  Spec files can
10224 override these strings or create their own.  Note that individual
10225 targets can also add their own spec strings to this list.
10227 @smallexample
10228 asm          Options to pass to the assembler
10229 asm_final    Options to pass to the assembler post-processor
10230 cpp          Options to pass to the C preprocessor
10231 cc1          Options to pass to the C compiler
10232 cc1plus      Options to pass to the C++ compiler
10233 endfile      Object files to include at the end of the link
10234 link         Options to pass to the linker
10235 lib          Libraries to include on the command line to the linker
10236 libgcc       Decides which GCC support library to pass to the linker
10237 linker       Sets the name of the linker
10238 predefines   Defines to be passed to the C preprocessor
10239 signed_char  Defines to pass to CPP to say whether @code{char} is signed
10240              by default
10241 startfile    Object files to include at the start of the link
10242 @end smallexample
10244 Here is a small example of a spec file:
10246 @smallexample
10247 %rename lib                 old_lib
10249 *lib:
10250 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
10251 @end smallexample
10253 This example renames the spec called @samp{lib} to @samp{old_lib} and
10254 then overrides the previous definition of @samp{lib} with a new one.
10255 The new definition adds in some extra command-line options before
10256 including the text of the old definition.
10258 @dfn{Spec strings} are a list of command-line options to be passed to their
10259 corresponding program.  In addition, the spec strings can contain
10260 @samp{%}-prefixed sequences to substitute variable text or to
10261 conditionally insert text into the command line.  Using these constructs
10262 it is possible to generate quite complex command lines.
10264 Here is a table of all defined @samp{%}-sequences for spec
10265 strings.  Note that spaces are not generated automatically around the
10266 results of expanding these sequences.  Therefore you can concatenate them
10267 together or combine them with constant text in a single argument.
10269 @table @code
10270 @item %%
10271 Substitute one @samp{%} into the program name or argument.
10273 @item %i
10274 Substitute the name of the input file being processed.
10276 @item %b
10277 Substitute the basename of the input file being processed.
10278 This is the substring up to (and not including) the last period
10279 and not including the directory.
10281 @item %B
10282 This is the same as @samp{%b}, but include the file suffix (text after
10283 the last period).
10285 @item %d
10286 Marks the argument containing or following the @samp{%d} as a
10287 temporary file name, so that that file is deleted if GCC exits
10288 successfully.  Unlike @samp{%g}, this contributes no text to the
10289 argument.
10291 @item %g@var{suffix}
10292 Substitute a file name that has suffix @var{suffix} and is chosen
10293 once per compilation, and mark the argument in the same way as
10294 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
10295 name is now chosen in a way that is hard to predict even when previously
10296 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
10297 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
10298 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
10299 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
10300 was simply substituted with a file name chosen once per compilation,
10301 without regard to any appended suffix (which was therefore treated
10302 just like ordinary text), making such attacks more likely to succeed.
10304 @item %u@var{suffix}
10305 Like @samp{%g}, but generates a new temporary file name
10306 each time it appears instead of once per compilation.
10308 @item %U@var{suffix}
10309 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
10310 new one if there is no such last file name.  In the absence of any
10311 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
10312 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
10313 involves the generation of two distinct file names, one
10314 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
10315 simply substituted with a file name chosen for the previous @samp{%u},
10316 without regard to any appended suffix.
10318 @item %j@var{suffix}
10319 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
10320 writable, and if @option{-save-temps} is not used; 
10321 otherwise, substitute the name
10322 of a temporary file, just like @samp{%u}.  This temporary file is not
10323 meant for communication between processes, but rather as a junk
10324 disposal mechanism.
10326 @item %|@var{suffix}
10327 @itemx %m@var{suffix}
10328 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
10329 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
10330 all.  These are the two most common ways to instruct a program that it
10331 should read from standard input or write to standard output.  If you
10332 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
10333 construct: see for example @file{f/lang-specs.h}.
10335 @item %.@var{SUFFIX}
10336 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
10337 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
10338 terminated by the next space or %.
10340 @item %w
10341 Marks the argument containing or following the @samp{%w} as the
10342 designated output file of this compilation.  This puts the argument
10343 into the sequence of arguments that @samp{%o} substitutes.
10345 @item %o
10346 Substitutes the names of all the output files, with spaces
10347 automatically placed around them.  You should write spaces
10348 around the @samp{%o} as well or the results are undefined.
10349 @samp{%o} is for use in the specs for running the linker.
10350 Input files whose names have no recognized suffix are not compiled
10351 at all, but they are included among the output files, so they are
10352 linked.
10354 @item %O
10355 Substitutes the suffix for object files.  Note that this is
10356 handled specially when it immediately follows @samp{%g, %u, or %U},
10357 because of the need for those to form complete file names.  The
10358 handling is such that @samp{%O} is treated exactly as if it had already
10359 been substituted, except that @samp{%g, %u, and %U} do not currently
10360 support additional @var{suffix} characters following @samp{%O} as they do
10361 following, for example, @samp{.o}.
10363 @item %p
10364 Substitutes the standard macro predefinitions for the
10365 current target machine.  Use this when running @code{cpp}.
10367 @item %P
10368 Like @samp{%p}, but puts @samp{__} before and after the name of each
10369 predefined macro, except for macros that start with @samp{__} or with
10370 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
10373 @item %I
10374 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
10375 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
10376 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
10377 and @option{-imultilib} as necessary.
10379 @item %s
10380 Current argument is the name of a library or startup file of some sort.
10381 Search for that file in a standard list of directories and substitute
10382 the full name found.  The current working directory is included in the
10383 list of directories scanned.
10385 @item %T
10386 Current argument is the name of a linker script.  Search for that file
10387 in the current list of directories to scan for libraries. If the file
10388 is located insert a @option{--script} option into the command line
10389 followed by the full path name found.  If the file is not found then
10390 generate an error message.  Note: the current working directory is not
10391 searched.
10393 @item %e@var{str}
10394 Print @var{str} as an error message.  @var{str} is terminated by a newline.
10395 Use this when inconsistent options are detected.
10397 @item %(@var{name})
10398 Substitute the contents of spec string @var{name} at this point.
10400 @item %x@{@var{option}@}
10401 Accumulate an option for @samp{%X}.
10403 @item %X
10404 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
10405 spec string.
10407 @item %Y
10408 Output the accumulated assembler options specified by @option{-Wa}.
10410 @item %Z
10411 Output the accumulated preprocessor options specified by @option{-Wp}.
10413 @item %a
10414 Process the @code{asm} spec.  This is used to compute the
10415 switches to be passed to the assembler.
10417 @item %A
10418 Process the @code{asm_final} spec.  This is a spec string for
10419 passing switches to an assembler post-processor, if such a program is
10420 needed.
10422 @item %l
10423 Process the @code{link} spec.  This is the spec for computing the
10424 command line passed to the linker.  Typically it makes use of the
10425 @samp{%L %G %S %D and %E} sequences.
10427 @item %D
10428 Dump out a @option{-L} option for each directory that GCC believes might
10429 contain startup files.  If the target supports multilibs then the
10430 current multilib directory is prepended to each of these paths.
10432 @item %L
10433 Process the @code{lib} spec.  This is a spec string for deciding which
10434 libraries are included on the command line to the linker.
10436 @item %G
10437 Process the @code{libgcc} spec.  This is a spec string for deciding
10438 which GCC support library is included on the command line to the linker.
10440 @item %S
10441 Process the @code{startfile} spec.  This is a spec for deciding which
10442 object files are the first ones passed to the linker.  Typically
10443 this might be a file named @file{crt0.o}.
10445 @item %E
10446 Process the @code{endfile} spec.  This is a spec string that specifies
10447 the last object files that are passed to the linker.
10449 @item %C
10450 Process the @code{cpp} spec.  This is used to construct the arguments
10451 to be passed to the C preprocessor.
10453 @item %1
10454 Process the @code{cc1} spec.  This is used to construct the options to be
10455 passed to the actual C compiler (@samp{cc1}).
10457 @item %2
10458 Process the @code{cc1plus} spec.  This is used to construct the options to be
10459 passed to the actual C++ compiler (@samp{cc1plus}).
10461 @item %*
10462 Substitute the variable part of a matched option.  See below.
10463 Note that each comma in the substituted string is replaced by
10464 a single space.
10466 @item %<@code{S}
10467 Remove all occurrences of @code{-S} from the command line.  Note---this
10468 command is position dependent.  @samp{%} commands in the spec string
10469 before this one see @code{-S}, @samp{%} commands in the spec string
10470 after this one do not.
10472 @item %:@var{function}(@var{args})
10473 Call the named function @var{function}, passing it @var{args}.
10474 @var{args} is first processed as a nested spec string, then split
10475 into an argument vector in the usual fashion.  The function returns
10476 a string which is processed as if it had appeared literally as part
10477 of the current spec.
10479 The following built-in spec functions are provided:
10481 @table @code
10482 @item @code{getenv}
10483 The @code{getenv} spec function takes two arguments: an environment
10484 variable name and a string.  If the environment variable is not
10485 defined, a fatal error is issued.  Otherwise, the return value is the
10486 value of the environment variable concatenated with the string.  For
10487 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
10489 @smallexample
10490 %:getenv(TOPDIR /include)
10491 @end smallexample
10493 expands to @file{/path/to/top/include}.
10495 @item @code{if-exists}
10496 The @code{if-exists} spec function takes one argument, an absolute
10497 pathname to a file.  If the file exists, @code{if-exists} returns the
10498 pathname.  Here is a small example of its usage:
10500 @smallexample
10501 *startfile:
10502 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10503 @end smallexample
10505 @item @code{if-exists-else}
10506 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10507 spec function, except that it takes two arguments.  The first argument is
10508 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10509 returns the pathname.  If it does not exist, it returns the second argument.
10510 This way, @code{if-exists-else} can be used to select one file or another,
10511 based on the existence of the first.  Here is a small example of its usage:
10513 @smallexample
10514 *startfile:
10515 crt0%O%s %:if-exists(crti%O%s) \
10516 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10517 @end smallexample
10519 @item @code{replace-outfile}
10520 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10521 first argument in the outfiles array and replaces it with the second argument.  Here
10522 is a small example of its usage:
10524 @smallexample
10525 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10526 @end smallexample
10528 @item @code{remove-outfile}
10529 The @code{remove-outfile} spec function takes one argument.  It looks for the
10530 first argument in the outfiles array and removes it.  Here is a small example
10531 its usage:
10533 @smallexample
10534 %:remove-outfile(-lm)
10535 @end smallexample
10537 @item @code{pass-through-libs}
10538 The @code{pass-through-libs} spec function takes any number of arguments.  It
10539 finds any @option{-l} options and any non-options ending in @file{.a} (which it
10540 assumes are the names of linker input library archive files) and returns a
10541 result containing all the found arguments each prepended by
10542 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10543 intended to be passed to the LTO linker plugin.
10545 @smallexample
10546 %:pass-through-libs(%G %L %G)
10547 @end smallexample
10549 @item @code{print-asm-header}
10550 The @code{print-asm-header} function takes no arguments and simply
10551 prints a banner like:
10553 @smallexample
10554 Assembler options
10555 =================
10557 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10558 @end smallexample
10560 It is used to separate compiler options from assembler options
10561 in the @option{--target-help} output.
10562 @end table
10564 @item %@{@code{S}@}
10565 Substitutes the @code{-S} switch, if that switch is given to GCC@.
10566 If that switch is not specified, this substitutes nothing.  Note that
10567 the leading dash is omitted when specifying this option, and it is
10568 automatically inserted if the substitution is performed.  Thus the spec
10569 string @samp{%@{foo@}} matches the command-line option @option{-foo}
10570 and outputs the command-line option @option{-foo}.
10572 @item %W@{@code{S}@}
10573 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10574 deleted on failure.
10576 @item %@{@code{S}*@}
10577 Substitutes all the switches specified to GCC whose names start
10578 with @code{-S}, but which also take an argument.  This is used for
10579 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10580 GCC considers @option{-o foo} as being
10581 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
10582 text, including the space.  Thus two arguments are generated.
10584 @item %@{@code{S}*&@code{T}*@}
10585 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10586 (the order of @code{S} and @code{T} in the spec is not significant).
10587 There can be any number of ampersand-separated variables; for each the
10588 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10590 @item %@{@code{S}:@code{X}@}
10591 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
10593 @item %@{!@code{S}:@code{X}@}
10594 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
10596 @item %@{@code{S}*:@code{X}@}
10597 Substitutes @code{X} if one or more switches whose names start with
10598 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10599 once, no matter how many such switches appeared.  However, if @code{%*}
10600 appears somewhere in @code{X}, then @code{X} is substituted once
10601 for each matching switch, with the @code{%*} replaced by the part of
10602 that switch matching the @code{*}.
10604 @item %@{.@code{S}:@code{X}@}
10605 Substitutes @code{X}, if processing a file with suffix @code{S}.
10607 @item %@{!.@code{S}:@code{X}@}
10608 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10610 @item %@{,@code{S}:@code{X}@}
10611 Substitutes @code{X}, if processing a file for language @code{S}.
10613 @item %@{!,@code{S}:@code{X}@}
10614 Substitutes @code{X}, if not processing a file for language @code{S}.
10616 @item %@{@code{S}|@code{P}:@code{X}@}
10617 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
10618 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10619 @code{*} sequences as well, although they have a stronger binding than
10620 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10621 alternatives must be starred, and only the first matching alternative
10622 is substituted.
10624 For example, a spec string like this:
10626 @smallexample
10627 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10628 @end smallexample
10630 @noindent
10631 outputs the following command-line options from the following input
10632 command-line options:
10634 @smallexample
10635 fred.c        -foo -baz
10636 jim.d         -bar -boggle
10637 -d fred.c     -foo -baz -boggle
10638 -d jim.d      -bar -baz -boggle
10639 @end smallexample
10641 @item %@{S:X; T:Y; :D@}
10643 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
10644 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10645 be as many clauses as you need.  This may be combined with @code{.},
10646 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10649 @end table
10651 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10652 construct may contain other nested @samp{%} constructs or spaces, or
10653 even newlines.  They are processed as usual, as described above.
10654 Trailing white space in @code{X} is ignored.  White space may also
10655 appear anywhere on the left side of the colon in these constructs,
10656 except between @code{.} or @code{*} and the corresponding word.
10658 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10659 handled specifically in these constructs.  If another value of
10660 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10661 @option{-W} switch is found later in the command line, the earlier
10662 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10663 just one letter, which passes all matching options.
10665 The character @samp{|} at the beginning of the predicate text is used to
10666 indicate that a command should be piped to the following command, but
10667 only if @option{-pipe} is specified.
10669 It is built into GCC which switches take arguments and which do not.
10670 (You might think it would be useful to generalize this to allow each
10671 compiler's spec to say which switches take arguments.  But this cannot
10672 be done in a consistent fashion.  GCC cannot even decide which input
10673 files have been specified without knowing which switches take arguments,
10674 and it must know which input files to compile in order to tell which
10675 compilers to run).
10677 GCC also knows implicitly that arguments starting in @option{-l} are to be
10678 treated as compiler output files, and passed to the linker in their
10679 proper position among the other output files.
10681 @c man begin OPTIONS
10683 @node Target Options
10684 @section Specifying Target Machine and Compiler Version
10685 @cindex target options
10686 @cindex cross compiling
10687 @cindex specifying machine version
10688 @cindex specifying compiler version and target machine
10689 @cindex compiler version, specifying
10690 @cindex target machine, specifying
10692 The usual way to run GCC is to run the executable called @command{gcc}, or
10693 @command{@var{machine}-gcc} when cross-compiling, or
10694 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10695 one that was installed last.
10697 @node Submodel Options
10698 @section Hardware Models and Configurations
10699 @cindex submodel options
10700 @cindex specifying hardware config
10701 @cindex hardware models and configurations, specifying
10702 @cindex machine dependent options
10704 Each target machine types can have its own
10705 special options, starting with @samp{-m}, to choose among various
10706 hardware models or configurations---for example, 68010 vs 68020,
10707 floating coprocessor or none.  A single installed version of the
10708 compiler can compile for any model or configuration, according to the
10709 options specified.
10711 Some configurations of the compiler also support additional special
10712 options, usually for compatibility with other compilers on the same
10713 platform.
10715 @c This list is ordered alphanumerically by subsection name.
10716 @c It should be the same order and spelling as these options are listed
10717 @c in Machine Dependent Options
10719 @menu
10720 * AArch64 Options::
10721 * Adapteva Epiphany Options::
10722 * ARM Options::
10723 * AVR Options::
10724 * Blackfin Options::
10725 * C6X Options::
10726 * CRIS Options::
10727 * CR16 Options::
10728 * Darwin Options::
10729 * DEC Alpha Options::
10730 * FR30 Options::
10731 * FRV Options::
10732 * GNU/Linux Options::
10733 * H8/300 Options::
10734 * HPPA Options::
10735 * i386 and x86-64 Options::
10736 * i386 and x86-64 Windows Options::
10737 * IA-64 Options::
10738 * LM32 Options::
10739 * M32C Options::
10740 * M32R/D Options::
10741 * M680x0 Options::
10742 * MCore Options::
10743 * MeP Options::
10744 * MicroBlaze Options::
10745 * MIPS Options::
10746 * MMIX Options::
10747 * MN10300 Options::
10748 * Moxie Options::
10749 * PDP-11 Options::
10750 * picoChip Options::
10751 * PowerPC Options::
10752 * RL78 Options::
10753 * RS/6000 and PowerPC Options::
10754 * RX Options::
10755 * S/390 and zSeries Options::
10756 * Score Options::
10757 * SH Options::
10758 * Solaris 2 Options::
10759 * SPARC Options::
10760 * SPU Options::
10761 * System V Options::
10762 * TILE-Gx Options::
10763 * TILEPro Options::
10764 * V850 Options::
10765 * VAX Options::
10766 * VMS Options::
10767 * VxWorks Options::
10768 * x86-64 Options::
10769 * Xstormy16 Options::
10770 * Xtensa Options::
10771 * zSeries Options::
10772 @end menu
10774 @node Adapteva Epiphany Options
10775 @subsection Adapteva Epiphany Options
10777 These @samp{-m} options are defined for Adapteva Epiphany:
10779 @table @gcctabopt
10780 @item -mhalf-reg-file
10781 @opindex mhalf-reg-file
10782 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
10783 That allows code to run on hardware variants that lack these registers.
10785 @item -mprefer-short-insn-regs
10786 @opindex mprefer-short-insn-regs
10787 Preferrentially allocate registers that allow short instruction generation.
10788 This can result in increased instruction count, so this may either reduce or
10789 increase overall code size.
10791 @item -mbranch-cost=@var{num}
10792 @opindex mbranch-cost
10793 Set the cost of branches to roughly @var{num} ``simple'' instructions.
10794 This cost is only a heuristic and is not guaranteed to produce
10795 consistent results across releases.
10797 @item -mcmove
10798 @opindex mcmove
10799 Enable the generation of conditional moves.
10801 @item -mnops=@var{num}
10802 @opindex mnops
10803 Emit @var{num} NOPs before every other generated instruction.
10805 @item -mno-soft-cmpsf
10806 @opindex mno-soft-cmpsf
10807 For single-precision floating-point comparisons, emit an @code{fsub} instruction
10808 and test the flags.  This is faster than a software comparison, but can
10809 get incorrect results in the presence of NaNs, or when two different small
10810 numbers are compared such that their difference is calculated as zero.
10811 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
10812 software comparisons.
10814 @item -mstack-offset=@var{num}
10815 @opindex mstack-offset
10816 Set the offset between the top of the stack and the stack pointer.
10817 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
10818 can be used by leaf functions without stack allocation.
10819 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
10820 Note also that this option changes the ABI; compiling a program with a
10821 different stack offset than the libraries have been compiled with
10822 generally does not work.
10823 This option can be useful if you want to evaluate if a different stack
10824 offset would give you better code, but to actually use a different stack
10825 offset to build working programs, it is recommended to configure the
10826 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
10828 @item -mno-round-nearest
10829 @opindex mno-round-nearest
10830 Make the scheduler assume that the rounding mode has been set to
10831 truncating.  The default is @option{-mround-nearest}.
10833 @item -mlong-calls
10834 @opindex mlong-calls
10835 If not otherwise specified by an attribute, assume all calls might be beyond
10836 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
10837 function address into a register before performing a (otherwise direct) call.
10838 This is the default.
10840 @item -mshort-calls
10841 @opindex short-calls
10842 If not otherwise specified by an attribute, assume all direct calls are
10843 in the range of the @code{b} / @code{bl} instructions, so use these instructions
10844 for direct calls.  The default is @option{-mlong-calls}.
10846 @item -msmall16
10847 @opindex msmall16
10848 Assume addresses can be loaded as 16-bit unsigned values.  This does not
10849 apply to function addresses for which @option{-mlong-calls} semantics
10850 are in effect.
10852 @item -mfp-mode=@var{mode}
10853 @opindex mfp-mode
10854 Set the prevailing mode of the floating-point unit.
10855 This determines the floating-point mode that is provided and expected
10856 at function call and return time.  Making this mode match the mode you
10857 predominantly need at function start can make your programs smaller and
10858 faster by avoiding unnecessary mode switches.
10860 @var{mode} can be set to one the following values:
10862 @table @samp
10863 @item caller
10864 Any mode at function entry is valid, and retained or restored when
10865 the function returns, and when it calls other functions.
10866 This mode is useful for compiling libraries or other compilation units
10867 you might want to incorporate into different programs with different
10868 prevailing FPU modes, and the convenience of being able to use a single
10869 object file outweighs the size and speed overhead for any extra
10870 mode switching that might be needed, compared with what would be needed
10871 with a more specific choice of prevailing FPU mode.
10873 @item truncate
10874 This is the mode used for floating-point calculations with
10875 truncating (i.e.@: round towards zero) rounding mode.  That includes
10876 conversion from floating point to integer.
10878 @item round-nearest
10879 This is the mode used for floating-point calculations with
10880 round-to-nearest-or-even rounding mode.
10882 @item int
10883 This is the mode used to perform integer calculations in the FPU, e.g.@:
10884 integer multiply, or integer multiply-and-accumulate.
10885 @end table
10887 The default is @option{-mfp-mode=caller}
10889 @item -mnosplit-lohi
10890 @itemx -mno-postinc
10891 @itemx -mno-postmodify
10892 @opindex mnosplit-lohi
10893 @opindex mno-postinc
10894 @opindex mno-postmodify
10895 Code generation tweaks that disable, respectively, splitting of 32-bit
10896 loads, generation of post-increment addresses, and generation of
10897 post-modify addresses.  The defaults are @option{msplit-lohi},
10898 @option{-mpost-inc}, and @option{-mpost-modify}.
10900 @item -mnovect-double
10901 @opindex mno-vect-double
10902 Change the preferred SIMD mode to SImode.  The default is
10903 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
10905 @item -max-vect-align=@var{num}
10906 @opindex max-vect-align
10907 The maximum alignment for SIMD vector mode types.
10908 @var{num} may be 4 or 8.  The default is 8.
10909 Note that this is an ABI change, even though many library function
10910 interfaces are unaffected if they don't use SIMD vector modes
10911 in places that affect size and/or alignment of relevant types.
10913 @item -msplit-vecmove-early
10914 @opindex msplit-vecmove-early
10915 Split vector moves into single word moves before reload.  In theory this
10916 can give better register allocation, but so far the reverse seems to be
10917 generally the case.
10919 @item -m1reg-@var{reg}
10920 @opindex m1reg-
10921 Specify a register to hold the constant @minus{}1, which makes loading small negative
10922 constants and certain bitmasks faster.
10923 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
10924 which specify use of that register as a fixed register,
10925 and @samp{none}, which means that no register is used for this
10926 purpose.  The default is @option{-m1reg-none}.
10928 @end table
10930 @node AArch64 Options
10931 @subsection AArch64 Options
10932 @cindex AArch64 Options
10934 These options are defined for AArch64 implementations:
10936 @table @gcctabopt
10938 @item -mbig-endian
10939 @opindex mbig-endian
10940 Generate big-endian code.  This is the default when GCC is configured for an
10941 @samp{aarch64_be-*-*} target.
10943 @item -mgeneral-regs-only
10944 @opindex mgeneral-regs-only
10945 Generate code which uses only the general registers.
10947 @item -mlittle-endian
10948 @opindex mlittle-endian
10949 Generate little-endian code.  This is the default when GCC is configured for an
10950 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
10952 @item -mcmodel=tiny
10953 @opindex mcmodel=tiny
10954 Generate code for the tiny code model.  The program and its statically defined
10955 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
10956 be statically or dynamically linked.  This model is not fully implemented and
10957 mostly treated as @samp{small}.
10959 @item -mcmodel=small
10960 @opindex mcmodel=small
10961 Generate code for the small code model.  The program and its statically defined
10962 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
10963 be statically or dynamically linked.  This is the default code model.
10965 @item -mcmodel=large
10966 @opindex mcmodel=large
10967 Generate code for the large code model.  This makes no assumptions about
10968 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
10969 statically linked only.
10971 @item -mstrict-align
10972 @opindex mstrict-align
10973 Do not assume that unaligned memory references will be handled by the system.
10975 @item -momit-leaf-frame-pointer
10976 @itemx -mno-omit-leaf-frame-pointer
10977 @opindex momit-leaf-frame-pointer
10978 @opindex mno-omit-leaf-frame-pointer
10979 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
10980 default.
10982 @item -mtls-dialect=desc
10983 @opindex mtls-dialect=desc
10984 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
10985 of TLS variables.  This is the default.
10987 @item -mtls-dialect=traditional
10988 @opindex mtls-dialect=traditional
10989 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
10990 of TLS variables.
10992 @item -march=@var{name}
10993 @opindex march
10994 Specify the name of the target architecture, optionally suffixed by one or
10995 more feature modifiers.  This option has the form
10996 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
10997 only value for @var{arch} is @samp{armv8-a}.  The possible values for
10998 @var{feature} are documented in the sub-section below.
11000 Where conflicting feature modifiers are specified, the right-most feature is
11001 used.
11003 GCC uses this name to determine what kind of instructions it can emit when
11004 generating assembly code.  This option can be used in conjunction with or
11005 instead of the @option{-mcpu=} option.
11007 @item -mcpu=@var{name}
11008 @opindex mcpu
11009 Specify the name of the target processor, optionally suffixed by one or more
11010 feature modifiers.  This option has the form
11011 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11012 possible values for @var{cpu} are @samp{generic}, @samp{large}.  The
11013 possible values for @var{feature} are documented in the sub-section
11014 below.
11016 Where conflicting feature modifiers are specified, the right-most feature is
11017 used.
11019 GCC uses this name to determine what kind of instructions it can emit when
11020 generating assembly code.
11022 @item -mtune=@var{name}
11023 @opindex mtune
11024 Specify the name of the processor to tune the performance for.  The code will
11025 be tuned as if the target processor were of the type specified in this option,
11026 but still using instructions compatible with the target processor specified
11027 by a @option{-mcpu=} option.  This option cannot be suffixed by feature
11028 modifiers.
11030 @end table
11032 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
11033 @cindex @option{-march} feature modifiers
11034 @cindex @option{-mcpu} feature modifiers
11035 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
11036 the following:
11038 @table @samp
11039 @item crypto
11040 Enable Crypto extension.  This implies Advanced SIMD is enabled.
11041 @item fp
11042 Enable floating-point instructions.
11043 @item simd
11044 Enable Advanced SIMD instructions.  This implies floating-point instructions
11045 are enabled.  This is the default for all current possible values for options
11046 @option{-march} and @option{-mcpu=}.
11047 @end table
11049 @node ARM Options
11050 @subsection ARM Options
11051 @cindex ARM options
11053 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
11054 architectures:
11056 @table @gcctabopt
11057 @item -mabi=@var{name}
11058 @opindex mabi
11059 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
11060 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
11062 @item -mapcs-frame
11063 @opindex mapcs-frame
11064 Generate a stack frame that is compliant with the ARM Procedure Call
11065 Standard for all functions, even if this is not strictly necessary for
11066 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
11067 with this option causes the stack frames not to be generated for
11068 leaf functions.  The default is @option{-mno-apcs-frame}.
11070 @item -mapcs
11071 @opindex mapcs
11072 This is a synonym for @option{-mapcs-frame}.
11074 @ignore
11075 @c not currently implemented
11076 @item -mapcs-stack-check
11077 @opindex mapcs-stack-check
11078 Generate code to check the amount of stack space available upon entry to
11079 every function (that actually uses some stack space).  If there is
11080 insufficient space available then either the function
11081 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
11082 called, depending upon the amount of stack space required.  The runtime
11083 system is required to provide these functions.  The default is
11084 @option{-mno-apcs-stack-check}, since this produces smaller code.
11086 @c not currently implemented
11087 @item -mapcs-float
11088 @opindex mapcs-float
11089 Pass floating-point arguments using the floating-point registers.  This is
11090 one of the variants of the APCS@.  This option is recommended if the
11091 target hardware has a floating-point unit or if a lot of floating-point
11092 arithmetic is going to be performed by the code.  The default is
11093 @option{-mno-apcs-float}, since the size of integer-only code is 
11094 slightly increased if @option{-mapcs-float} is used.
11096 @c not currently implemented
11097 @item -mapcs-reentrant
11098 @opindex mapcs-reentrant
11099 Generate reentrant, position-independent code.  The default is
11100 @option{-mno-apcs-reentrant}.
11101 @end ignore
11103 @item -mthumb-interwork
11104 @opindex mthumb-interwork
11105 Generate code that supports calling between the ARM and Thumb
11106 instruction sets.  Without this option, on pre-v5 architectures, the
11107 two instruction sets cannot be reliably used inside one program.  The
11108 default is @option{-mno-thumb-interwork}, since slightly larger code
11109 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
11110 configurations this option is meaningless.
11112 @item -mno-sched-prolog
11113 @opindex mno-sched-prolog
11114 Prevent the reordering of instructions in the function prologue, or the
11115 merging of those instruction with the instructions in the function's
11116 body.  This means that all functions start with a recognizable set
11117 of instructions (or in fact one of a choice from a small set of
11118 different function prologues), and this information can be used to
11119 locate the start of functions inside an executable piece of code.  The
11120 default is @option{-msched-prolog}.
11122 @item -mfloat-abi=@var{name}
11123 @opindex mfloat-abi
11124 Specifies which floating-point ABI to use.  Permissible values
11125 are: @samp{soft}, @samp{softfp} and @samp{hard}.
11127 Specifying @samp{soft} causes GCC to generate output containing
11128 library calls for floating-point operations.
11129 @samp{softfp} allows the generation of code using hardware floating-point
11130 instructions, but still uses the soft-float calling conventions.
11131 @samp{hard} allows generation of floating-point instructions
11132 and uses FPU-specific calling conventions.
11134 The default depends on the specific target configuration.  Note that
11135 the hard-float and soft-float ABIs are not link-compatible; you must
11136 compile your entire program with the same ABI, and link with a
11137 compatible set of libraries.
11139 @item -mlittle-endian
11140 @opindex mlittle-endian
11141 Generate code for a processor running in little-endian mode.  This is
11142 the default for all standard configurations.
11144 @item -mbig-endian
11145 @opindex mbig-endian
11146 Generate code for a processor running in big-endian mode; the default is
11147 to compile code for a little-endian processor.
11149 @item -mwords-little-endian
11150 @opindex mwords-little-endian
11151 This option only applies when generating code for big-endian processors.
11152 Generate code for a little-endian word order but a big-endian byte
11153 order.  That is, a byte order of the form @samp{32107654}.  Note: this
11154 option should only be used if you require compatibility with code for
11155 big-endian ARM processors generated by versions of the compiler prior to
11156 2.8.  This option is now deprecated.
11158 @item -mcpu=@var{name}
11159 @opindex mcpu
11160 This specifies the name of the target ARM processor.  GCC uses this name
11161 to determine what kind of instructions it can emit when generating
11162 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
11163 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
11164 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
11165 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
11166 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
11167 @samp{arm720},
11168 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
11169 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
11170 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
11171 @samp{strongarm1110},
11172 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
11173 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
11174 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
11175 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
11176 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
11177 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
11178 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
11179 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
11180 @samp{cortex-a15}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
11181 @samp{cortex-m4}, @samp{cortex-m3},
11182 @samp{cortex-m1},
11183 @samp{cortex-m0},
11184 @samp{cortex-m0plus},
11185 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
11186 @samp{fa526}, @samp{fa626},
11187 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
11190 @option{-mcpu=generic-@var{arch}} is also permissible, and is
11191 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
11192 See @option{-mtune} for more information.
11194 @option{-mcpu=native} causes the compiler to auto-detect the CPU
11195 of the build computer.  At present, this feature is only supported on
11196 Linux, and not all architectures are recognized.  If the auto-detect is
11197 unsuccessful the option has no effect.
11199 @item -mtune=@var{name}
11200 @opindex mtune
11201 This option is very similar to the @option{-mcpu=} option, except that
11202 instead of specifying the actual target processor type, and hence
11203 restricting which instructions can be used, it specifies that GCC should
11204 tune the performance of the code as if the target were of the type
11205 specified in this option, but still choosing the instructions it
11206 generates based on the CPU specified by a @option{-mcpu=} option.
11207 For some ARM implementations better performance can be obtained by using
11208 this option.
11210 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
11211 performance for a blend of processors within architecture @var{arch}.
11212 The aim is to generate code that run well on the current most popular
11213 processors, balancing between optimizations that benefit some CPUs in the
11214 range, and avoiding performance pitfalls of other CPUs.  The effects of
11215 this option may change in future GCC versions as CPU models come and go.
11217 @option{-mtune=native} causes the compiler to auto-detect the CPU
11218 of the build computer.  At present, this feature is only supported on
11219 Linux, and not all architectures are recognized.  If the auto-detect is
11220 unsuccessful the option has no effect.
11222 @item -march=@var{name}
11223 @opindex march
11224 This specifies the name of the target ARM architecture.  GCC uses this
11225 name to determine what kind of instructions it can emit when generating
11226 assembly code.  This option can be used in conjunction with or instead
11227 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
11228 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
11229 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
11230 @samp{armv6}, @samp{armv6j},
11231 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
11232 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
11233 @samp{armv8-a},
11234 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
11236 @option{-march=native} causes the compiler to auto-detect the architecture
11237 of the build computer.  At present, this feature is only supported on
11238 Linux, and not all architectures are recognized.  If the auto-detect is
11239 unsuccessful the option has no effect.
11241 @item -mfpu=@var{name}
11242 @opindex mfpu
11243 This specifies what floating-point hardware (or hardware emulation) is
11244 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
11245 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
11246 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
11247 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
11248 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
11250 If @option{-msoft-float} is specified this specifies the format of
11251 floating-point values.
11253 If the selected floating-point hardware includes the NEON extension
11254 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
11255 operations are not generated by GCC's auto-vectorization pass unless
11256 @option{-funsafe-math-optimizations} is also specified.  This is
11257 because NEON hardware does not fully implement the IEEE 754 standard for
11258 floating-point arithmetic (in particular denormal values are treated as
11259 zero), so the use of NEON instructions may lead to a loss of precision.
11261 @item -mfp16-format=@var{name}
11262 @opindex mfp16-format
11263 Specify the format of the @code{__fp16} half-precision floating-point type.
11264 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
11265 the default is @samp{none}, in which case the @code{__fp16} type is not
11266 defined.  @xref{Half-Precision}, for more information.
11268 @item -mstructure-size-boundary=@var{n}
11269 @opindex mstructure-size-boundary
11270 The sizes of all structures and unions are rounded up to a multiple
11271 of the number of bits set by this option.  Permissible values are 8, 32
11272 and 64.  The default value varies for different toolchains.  For the COFF
11273 targeted toolchain the default value is 8.  A value of 64 is only allowed
11274 if the underlying ABI supports it.
11276 Specifying a larger number can produce faster, more efficient code, but
11277 can also increase the size of the program.  Different values are potentially
11278 incompatible.  Code compiled with one value cannot necessarily expect to
11279 work with code or libraries compiled with another value, if they exchange
11280 information using structures or unions.
11282 @item -mabort-on-noreturn
11283 @opindex mabort-on-noreturn
11284 Generate a call to the function @code{abort} at the end of a
11285 @code{noreturn} function.  It is executed if the function tries to
11286 return.
11288 @item -mlong-calls
11289 @itemx -mno-long-calls
11290 @opindex mlong-calls
11291 @opindex mno-long-calls
11292 Tells the compiler to perform function calls by first loading the
11293 address of the function into a register and then performing a subroutine
11294 call on this register.  This switch is needed if the target function
11295 lies outside of the 64-megabyte addressing range of the offset-based
11296 version of subroutine call instruction.
11298 Even if this switch is enabled, not all function calls are turned
11299 into long calls.  The heuristic is that static functions, functions
11300 that have the @samp{short-call} attribute, functions that are inside
11301 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
11302 definitions have already been compiled within the current compilation
11303 unit are not turned into long calls.  The exceptions to this rule are
11304 that weak function definitions, functions with the @samp{long-call}
11305 attribute or the @samp{section} attribute, and functions that are within
11306 the scope of a @samp{#pragma long_calls} directive are always
11307 turned into long calls.
11309 This feature is not enabled by default.  Specifying
11310 @option{-mno-long-calls} restores the default behavior, as does
11311 placing the function calls within the scope of a @samp{#pragma
11312 long_calls_off} directive.  Note these switches have no effect on how
11313 the compiler generates code to handle function calls via function
11314 pointers.
11316 @item -msingle-pic-base
11317 @opindex msingle-pic-base
11318 Treat the register used for PIC addressing as read-only, rather than
11319 loading it in the prologue for each function.  The runtime system is
11320 responsible for initializing this register with an appropriate value
11321 before execution begins.
11323 @item -mpic-register=@var{reg}
11324 @opindex mpic-register
11325 Specify the register to be used for PIC addressing.  The default is R10
11326 unless stack-checking is enabled, when R9 is used.
11328 @item -mcirrus-fix-invalid-insns
11329 @opindex mcirrus-fix-invalid-insns
11330 @opindex mno-cirrus-fix-invalid-insns
11331 Insert NOPs into the instruction stream to in order to work around
11332 problems with invalid Maverick instruction combinations.  This option
11333 is only valid if the @option{-mcpu=ep9312} option has been used to
11334 enable generation of instructions for the Cirrus Maverick floating-point
11335 co-processor.  This option is not enabled by default, since the
11336 problem is only present in older Maverick implementations.  The default
11337 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
11338 switch.
11340 @item -mpoke-function-name
11341 @opindex mpoke-function-name
11342 Write the name of each function into the text section, directly
11343 preceding the function prologue.  The generated code is similar to this:
11345 @smallexample
11346      t0
11347          .ascii "arm_poke_function_name", 0
11348          .align
11349      t1
11350          .word 0xff000000 + (t1 - t0)
11351      arm_poke_function_name
11352          mov     ip, sp
11353          stmfd   sp!, @{fp, ip, lr, pc@}
11354          sub     fp, ip, #4
11355 @end smallexample
11357 When performing a stack backtrace, code can inspect the value of
11358 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
11359 location @code{pc - 12} and the top 8 bits are set, then we know that
11360 there is a function name embedded immediately preceding this location
11361 and has length @code{((pc[-3]) & 0xff000000)}.
11363 @item -mthumb
11364 @itemx -marm
11365 @opindex marm
11366 @opindex mthumb
11368 Select between generating code that executes in ARM and Thumb
11369 states.  The default for most configurations is to generate code
11370 that executes in ARM state, but the default can be changed by
11371 configuring GCC with the @option{--with-mode=}@var{state}
11372 configure option.
11374 @item -mtpcs-frame
11375 @opindex mtpcs-frame
11376 Generate a stack frame that is compliant with the Thumb Procedure Call
11377 Standard for all non-leaf functions.  (A leaf function is one that does
11378 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
11380 @item -mtpcs-leaf-frame
11381 @opindex mtpcs-leaf-frame
11382 Generate a stack frame that is compliant with the Thumb Procedure Call
11383 Standard for all leaf functions.  (A leaf function is one that does
11384 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
11386 @item -mcallee-super-interworking
11387 @opindex mcallee-super-interworking
11388 Gives all externally visible functions in the file being compiled an ARM
11389 instruction set header which switches to Thumb mode before executing the
11390 rest of the function.  This allows these functions to be called from
11391 non-interworking code.  This option is not valid in AAPCS configurations
11392 because interworking is enabled by default.
11394 @item -mcaller-super-interworking
11395 @opindex mcaller-super-interworking
11396 Allows calls via function pointers (including virtual functions) to
11397 execute correctly regardless of whether the target code has been
11398 compiled for interworking or not.  There is a small overhead in the cost
11399 of executing a function pointer if this option is enabled.  This option
11400 is not valid in AAPCS configurations because interworking is enabled
11401 by default.
11403 @item -mtp=@var{name}
11404 @opindex mtp
11405 Specify the access model for the thread local storage pointer.  The valid
11406 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
11407 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
11408 (supported in the arm6k architecture), and @option{auto}, which uses the
11409 best available method for the selected processor.  The default setting is
11410 @option{auto}.
11412 @item -mtls-dialect=@var{dialect}
11413 @opindex mtls-dialect
11414 Specify the dialect to use for accessing thread local storage.  Two
11415 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
11416 @samp{gnu} dialect selects the original GNU scheme for supporting
11417 local and global dynamic TLS models.  The @samp{gnu2} dialect
11418 selects the GNU descriptor scheme, which provides better performance
11419 for shared libraries.  The GNU descriptor scheme is compatible with
11420 the original scheme, but does require new assembler, linker and
11421 library support.  Initial and local exec TLS models are unaffected by
11422 this option and always use the original scheme.
11424 @item -mword-relocations
11425 @opindex mword-relocations
11426 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
11427 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
11428 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
11429 is specified.
11431 @item -mfix-cortex-m3-ldrd
11432 @opindex mfix-cortex-m3-ldrd
11433 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
11434 with overlapping destination and base registers are used.  This option avoids
11435 generating these instructions.  This option is enabled by default when
11436 @option{-mcpu=cortex-m3} is specified.
11438 @item -munaligned-access
11439 @itemx -mno-unaligned-access
11440 @opindex munaligned-access
11441 @opindex mno-unaligned-access
11442 Enables (or disables) reading and writing of 16- and 32- bit values
11443 from addresses that are not 16- or 32- bit aligned.  By default
11444 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
11445 architectures, and enabled for all other architectures.  If unaligned
11446 access is not enabled then words in packed data structures will be
11447 accessed a byte at a time.
11449 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
11450 generated object file to either true or false, depending upon the
11451 setting of this option.  If unaligned access is enabled then the
11452 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
11453 defined.
11455 @end table
11457 @node AVR Options
11458 @subsection AVR Options
11459 @cindex AVR Options
11461 These options are defined for AVR implementations:
11463 @table @gcctabopt
11464 @item -mmcu=@var{mcu}
11465 @opindex mmcu
11466 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
11468 The default for this option is@tie{}@code{avr2}.
11470 GCC supports the following AVR devices and ISAs:
11472 @include avr-mmcu.texi
11474 @item -maccumulate-args
11475 @opindex maccumulate-args
11476 Accumulate outgoing function arguments and acquire/release the needed
11477 stack space for outgoing function arguments once in function
11478 prologue/epilogue.  Without this option, outgoing arguments are pushed
11479 before calling a function and popped afterwards.
11481 Popping the arguments after the function call can be expensive on
11482 AVR so that accumulating the stack space might lead to smaller
11483 executables because arguments need not to be removed from the
11484 stack after such a function call.
11486 This option can lead to reduced code size for functions that perform
11487 several calls to functions that get their arguments on the stack like
11488 calls to printf-like functions.
11490 @item -mbranch-cost=@var{cost}
11491 @opindex mbranch-cost
11492 Set the branch costs for conditional branch instructions to
11493 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
11494 integers. The default branch cost is 0.
11496 @item -mcall-prologues
11497 @opindex mcall-prologues
11498 Functions prologues/epilogues are expanded as calls to appropriate
11499 subroutines.  Code size is smaller.
11501 @item -mint8
11502 @opindex mint8
11503 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
11504 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
11505 and @code{long long} is 4 bytes.  Please note that this option does not
11506 conform to the C standards, but it results in smaller code
11507 size.
11509 @item -mno-interrupts
11510 @opindex mno-interrupts
11511 Generated code is not compatible with hardware interrupts.
11512 Code size is smaller.
11514 @item -mrelax
11515 @opindex mrelax
11516 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
11517 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
11518 Setting @code{-mrelax} just adds the @code{--relax} option to the
11519 linker command line when the linker is called.
11521 Jump relaxing is performed by the linker because jump offsets are not
11522 known before code is located. Therefore, the assembler code generated by the
11523 compiler is the same, but the instructions in the executable may
11524 differ from instructions in the assembler code.
11526 Relaxing must be turned on if linker stubs are needed, see the
11527 section on @code{EIND} and linker stubs below.
11529 @item -msp8
11530 @opindex msp8
11531 Treat the stack pointer register as an 8-bit register,
11532 i.e.@: assume the high byte of the stack pointer is zero.
11533 In general, you don't need to set this option by hand.
11535 This option is used internally by the compiler to select and
11536 build multilibs for architectures @code{avr2} and @code{avr25}.
11537 These architectures mix devices with and without @code{SPH}.
11538 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
11539 the compiler driver will add or remove this option from the compiler
11540 proper's command line, because the compiler then knows if the device
11541 or architecture has an 8-bit stack pointer and thus no @code{SPH}
11542 register or not.
11544 @item -mstrict-X
11545 @opindex mstrict-X
11546 Use address register @code{X} in a way proposed by the hardware.  This means
11547 that @code{X} is only used in indirect, post-increment or
11548 pre-decrement addressing.
11550 Without this option, the @code{X} register may be used in the same way
11551 as @code{Y} or @code{Z} which then is emulated by additional
11552 instructions.  
11553 For example, loading a value with @code{X+const} addressing with a
11554 small non-negative @code{const < 64} to a register @var{Rn} is
11555 performed as
11557 @example
11558 adiw r26, const   ; X += const
11559 ld   @var{Rn}, X        ; @var{Rn} = *X
11560 sbiw r26, const   ; X -= const
11561 @end example
11563 @item -mtiny-stack
11564 @opindex mtiny-stack
11565 Only change the lower 8@tie{}bits of the stack pointer.
11566 @end table
11568 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
11569 @cindex @code{EIND}
11570 Pointers in the implementation are 16@tie{}bits wide.
11571 The address of a function or label is represented as word address so
11572 that indirect jumps and calls can target any code address in the
11573 range of 64@tie{}Ki words.
11575 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
11576 bytes of program memory space, there is a special function register called
11577 @code{EIND} that serves as most significant part of the target address
11578 when @code{EICALL} or @code{EIJMP} instructions are used.
11580 Indirect jumps and calls on these devices are handled as follows by
11581 the compiler and are subject to some limitations:
11583 @itemize @bullet
11585 @item
11586 The compiler never sets @code{EIND}.
11588 @item
11589 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
11590 instructions or might read @code{EIND} directly in order to emulate an
11591 indirect call/jump by means of a @code{RET} instruction.
11593 @item
11594 The compiler assumes that @code{EIND} never changes during the startup
11595 code or during the application. In particular, @code{EIND} is not
11596 saved/restored in function or interrupt service routine
11597 prologue/epilogue.
11599 @item
11600 For indirect calls to functions and computed goto, the linker
11601 generates @emph{stubs}. Stubs are jump pads sometimes also called
11602 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
11603 The stub contains a direct jump to the desired address.
11605 @item
11606 Linker relaxation must be turned on so that the linker will generate
11607 the stubs correctly an all situaltion. See the compiler option
11608 @code{-mrelax} and the linler option @code{--relax}.
11609 There are corner cases where the linker is supposed to generate stubs
11610 but aborts without relaxation and without a helpful error message.
11612 @item
11613 The default linker script is arranged for code with @code{EIND = 0}.
11614 If code is supposed to work for a setup with @code{EIND != 0}, a custom
11615 linker script has to be used in order to place the sections whose
11616 name start with @code{.trampolines} into the segment where @code{EIND}
11617 points to.
11619 @item
11620 The startup code from libgcc never sets @code{EIND}.
11621 Notice that startup code is a blend of code from libgcc and AVR-LibC.
11622 For the impact of AVR-LibC on @code{EIND}, see the
11623 @w{@uref{http://nongnu.org/avr-libc/user-manual,AVR-LibC user manual}}.
11625 @item
11626 It is legitimate for user-specific startup code to set up @code{EIND}
11627 early, for example by means of initialization code located in
11628 section @code{.init3}. Such code runs prior to general startup code
11629 that initializes RAM and calls constructors, but after the bit
11630 of startup code from AVR-LibC that sets @code{EIND} to the segment
11631 where the vector table is located.
11632 @example
11633 #include <avr/io.h>
11635 static void
11636 __attribute__((section(".init3"),naked,used,no_instrument_function))
11637 init3_set_eind (void)
11639   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
11640                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
11642 @end example
11644 @noindent
11645 The @code{__trampolines_start} symbol is defined in the linker script.
11647 @item
11648 Stubs are generated automatically by the linker if
11649 the following two conditions are met:
11650 @itemize @minus
11652 @item The address of a label is taken by means of the @code{gs} modifier
11653 (short for @emph{generate stubs}) like so:
11654 @example
11655 LDI r24, lo8(gs(@var{func}))
11656 LDI r25, hi8(gs(@var{func}))
11657 @end example
11658 @item The final location of that label is in a code segment
11659 @emph{outside} the segment where the stubs are located.
11660 @end itemize
11662 @item
11663 The compiler emits such @code{gs} modifiers for code labels in the
11664 following situations:
11665 @itemize @minus
11666 @item Taking address of a function or code label.
11667 @item Computed goto.
11668 @item If prologue-save function is used, see @option{-mcall-prologues}
11669 command-line option.
11670 @item Switch/case dispatch tables. If you do not want such dispatch
11671 tables you can specify the @option{-fno-jump-tables} command-line option.
11672 @item C and C++ constructors/destructors called during startup/shutdown.
11673 @item If the tools hit a @code{gs()} modifier explained above.
11674 @end itemize
11676 @item
11677 Jumping to non-symbolic addresses like so is @emph{not} supported:
11679 @example
11680 int main (void)
11682     /* Call function at word address 0x2 */
11683     return ((int(*)(void)) 0x2)();
11685 @end example
11687 Instead, a stub has to be set up, i.e.@: the function has to be called
11688 through a symbol (@code{func_4} in the example):
11690 @example
11691 int main (void)
11693     extern int func_4 (void);
11695     /* Call function at byte address 0x4 */
11696     return func_4();
11698 @end example
11700 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
11701 Alternatively, @code{func_4} can be defined in the linker script.
11702 @end itemize
11704 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
11705 @cindex @code{RAMPD}
11706 @cindex @code{RAMPX}
11707 @cindex @code{RAMPY}
11708 @cindex @code{RAMPZ}
11709 Some AVR devices support memories larger than the 64@tie{}KiB range
11710 that can be accessed with 16-bit pointers.  To access memory locations
11711 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
11712 register is used as high part of the address:
11713 The @code{X}, @code{Y}, @code{Z} address register is concatenated
11714 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
11715 register, respectively, to get a wide address. Similarly,
11716 @code{RAMPD} is used together with direct addressing.
11718 @itemize
11719 @item
11720 The startup code initializes the @code{RAMP} special function
11721 registers with zero.
11723 @item
11724 If a @ref{AVR Named Address Spaces,named address space} other than
11725 generic or @code{__flash} is used, then @code{RAMPZ} is set
11726 as needed before the operation.
11728 @item
11729 If the device supports RAM larger than 64@tie{KiB} and the compiler
11730 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
11731 is reset to zero after the operation.
11733 @item
11734 If the device comes with a specific @code{RAMP} register, the ISR
11735 prologue/epilogue saves/restores that SFR and initializes it with
11736 zero in case the ISR code might (implicitly) use it.
11738 @item
11739 RAM larger than 64@tie{KiB} is not supported by GCC for AVR targets.
11740 If you use inline assembler to read from locations outside the
11741 16-bit address range and change one of the @code{RAMP} registers,
11742 you must reset it to zero after the access.
11744 @end itemize
11746 @subsubsection AVR Built-in Macros
11748 GCC defines several built-in macros so that the user code can test
11749 for the presence or absence of features.  Almost any of the following
11750 built-in macros are deduced from device capabilities and thus
11751 triggered by the @code{-mmcu=} command-line option.
11753 For even more AVR-specific built-in macros see
11754 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
11756 @table @code
11758 @item __AVR_ARCH__
11759 Build-in macro that resolves to a decimal number that identifies the
11760 architecture and depends on the @code{-mmcu=@var{mcu}} option.
11761 Possible values are:
11763 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
11764 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
11765 @code{105}, @code{106}, @code{107}
11767 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
11768 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
11769 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
11770 @code{avrxmega6}, @code{avrxmega7}, respectively.
11771 If @var{mcu} specifies a device, this built-in macro is set
11772 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
11773 defined to @code{4}.
11775 @item __AVR_@var{Device}__
11776 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
11777 the device's name. For example, @code{-mmcu=atmega8} defines the
11778 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
11779 @code{__AVR_ATtiny261A__}, etc.
11781 The built-in macros' names follow
11782 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
11783 the device name as from the AVR user manual. The difference between
11784 @var{Device} in the built-in macro and @var{device} in
11785 @code{-mmcu=@var{device}} is that the latter is always lowercase.
11787 If @var{device} is not a device but only a core architecture like
11788 @code{avr51}, this macro will not be defined.
11790 @item __AVR_HAVE_ELPM__
11791 The device has the the @code{ELPM} instruction.
11793 @item __AVR_HAVE_ELPMX__
11794 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
11795 R@var{n},Z+} instructions.
11797 @item __AVR_HAVE_MOVW__
11798 The device has the @code{MOVW} instruction to perform 16-bit
11799 register-register moves.
11801 @item __AVR_HAVE_LPMX__
11802 The device has the @code{LPM R@var{n},Z} and
11803 @code{LPM R@var{n},Z+} instructions.
11805 @item __AVR_HAVE_MUL__
11806 The device has a hardware multiplier. 
11808 @item __AVR_HAVE_JMP_CALL__
11809 The device has the @code{JMP} and @code{CALL} instructions.
11810 This is the case for devices with at least 16@tie{}KiB of program
11811 memory.
11813 @item __AVR_HAVE_EIJMP_EICALL__
11814 @itemx __AVR_3_BYTE_PC__
11815 The device has the @code{EIJMP} and @code{EICALL} instructions.
11816 This is the case for devices with more than 128@tie{}KiB of program memory.
11817 This also means that the program counter
11818 (PC) is 3@tie{}bytes wide.
11820 @item __AVR_2_BYTE_PC__
11821 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
11822 with up to 128@tie{}KiB of program memory.
11824 @item __AVR_HAVE_8BIT_SP__
11825 @itemx __AVR_HAVE_16BIT_SP__
11826 The stack pointer (SP) register is treated as 8-bit respectively
11827 16-bit register by the compiler.
11828 The definition of these macros is affected by @code{-mtiny-stack}.
11830 @item __AVR_HAVE_SPH__
11831 @itemx __AVR_SP8__
11832 The device has the SPH (high part of stack pointer) special function
11833 register or has an 8-bit stack pointer, respectively.
11834 The definition of these macros is affected by @code{-mmcu=} and
11835 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
11836 by @code{-msp8}.
11838 @item __AVR_HAVE_RAMPD__
11839 @itemx __AVR_HAVE_RAMPX__
11840 @itemx __AVR_HAVE_RAMPY__
11841 @itemx __AVR_HAVE_RAMPZ__
11842 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
11843 @code{RAMPZ} special function register, respectively.
11845 @item __NO_INTERRUPTS__
11846 This macro reflects the @code{-mno-interrupts} command line option.
11848 @item __AVR_ERRATA_SKIP__
11849 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
11850 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
11851 instructions because of a hardware erratum.  Skip instructions are
11852 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
11853 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
11854 set.
11856 @item __AVR_SFR_OFFSET__=@var{offset}
11857 Instructions that can address I/O special function registers directly
11858 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
11859 address as if addressed by an instruction to access RAM like @code{LD}
11860 or @code{STS}. This offset depends on the device architecture and has
11861 to be subtracted from the RAM address in order to get the
11862 respective I/O@tie{}address.
11864 @item __WITH_AVRLIBC__
11865 The compiler is configured to be used together with AVR-Libc.
11866 See the @code{--with-avrlibc} configure option.
11868 @end table
11870 @node Blackfin Options
11871 @subsection Blackfin Options
11872 @cindex Blackfin Options
11874 @table @gcctabopt
11875 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
11876 @opindex mcpu=
11877 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
11878 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
11879 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
11880 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
11881 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
11882 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
11883 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
11884 @samp{bf561}, @samp{bf592}.
11886 The optional @var{sirevision} specifies the silicon revision of the target
11887 Blackfin processor.  Any workarounds available for the targeted silicon revision
11888 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
11889 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
11890 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
11891 hexadecimal digits representing the major and minor numbers in the silicon
11892 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
11893 is not defined.  If @var{sirevision} is @samp{any}, the
11894 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
11895 If this optional @var{sirevision} is not used, GCC assumes the latest known
11896 silicon revision of the targeted Blackfin processor.
11898 GCC defines a preprocessor macro for the specified @var{cpu}.
11899 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
11900 provided by libgloss to be linked in if @option{-msim} is not given.
11902 Without this option, @samp{bf532} is used as the processor by default.
11904 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
11905 only the preprocessor macro is defined.
11907 @item -msim
11908 @opindex msim
11909 Specifies that the program will be run on the simulator.  This causes
11910 the simulator BSP provided by libgloss to be linked in.  This option
11911 has effect only for @samp{bfin-elf} toolchain.
11912 Certain other options, such as @option{-mid-shared-library} and
11913 @option{-mfdpic}, imply @option{-msim}.
11915 @item -momit-leaf-frame-pointer
11916 @opindex momit-leaf-frame-pointer
11917 Don't keep the frame pointer in a register for leaf functions.  This
11918 avoids the instructions to save, set up and restore frame pointers and
11919 makes an extra register available in leaf functions.  The option
11920 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
11921 which might make debugging harder.
11923 @item -mspecld-anomaly
11924 @opindex mspecld-anomaly
11925 When enabled, the compiler ensures that the generated code does not
11926 contain speculative loads after jump instructions. If this option is used,
11927 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
11929 @item -mno-specld-anomaly
11930 @opindex mno-specld-anomaly
11931 Don't generate extra code to prevent speculative loads from occurring.
11933 @item -mcsync-anomaly
11934 @opindex mcsync-anomaly
11935 When enabled, the compiler ensures that the generated code does not
11936 contain CSYNC or SSYNC instructions too soon after conditional branches.
11937 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
11939 @item -mno-csync-anomaly
11940 @opindex mno-csync-anomaly
11941 Don't generate extra code to prevent CSYNC or SSYNC instructions from
11942 occurring too soon after a conditional branch.
11944 @item -mlow-64k
11945 @opindex mlow-64k
11946 When enabled, the compiler is free to take advantage of the knowledge that
11947 the entire program fits into the low 64k of memory.
11949 @item -mno-low-64k
11950 @opindex mno-low-64k
11951 Assume that the program is arbitrarily large.  This is the default.
11953 @item -mstack-check-l1
11954 @opindex mstack-check-l1
11955 Do stack checking using information placed into L1 scratchpad memory by the
11956 uClinux kernel.
11958 @item -mid-shared-library
11959 @opindex mid-shared-library
11960 Generate code that supports shared libraries via the library ID method.
11961 This allows for execute in place and shared libraries in an environment
11962 without virtual memory management.  This option implies @option{-fPIC}.
11963 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11965 @item -mno-id-shared-library
11966 @opindex mno-id-shared-library
11967 Generate code that doesn't assume ID-based shared libraries are being used.
11968 This is the default.
11970 @item -mleaf-id-shared-library
11971 @opindex mleaf-id-shared-library
11972 Generate code that supports shared libraries via the library ID method,
11973 but assumes that this library or executable won't link against any other
11974 ID shared libraries.  That allows the compiler to use faster code for jumps
11975 and calls.
11977 @item -mno-leaf-id-shared-library
11978 @opindex mno-leaf-id-shared-library
11979 Do not assume that the code being compiled won't link against any ID shared
11980 libraries.  Slower code is generated for jump and call insns.
11982 @item -mshared-library-id=n
11983 @opindex mshared-library-id
11984 Specifies the identification number of the ID-based shared library being
11985 compiled.  Specifying a value of 0 generates more compact code; specifying
11986 other values forces the allocation of that number to the current
11987 library but is no more space- or time-efficient than omitting this option.
11989 @item -msep-data
11990 @opindex msep-data
11991 Generate code that allows the data segment to be located in a different
11992 area of memory from the text segment.  This allows for execute in place in
11993 an environment without virtual memory management by eliminating relocations
11994 against the text section.
11996 @item -mno-sep-data
11997 @opindex mno-sep-data
11998 Generate code that assumes that the data segment follows the text segment.
11999 This is the default.
12001 @item -mlong-calls
12002 @itemx -mno-long-calls
12003 @opindex mlong-calls
12004 @opindex mno-long-calls
12005 Tells the compiler to perform function calls by first loading the
12006 address of the function into a register and then performing a subroutine
12007 call on this register.  This switch is needed if the target function
12008 lies outside of the 24-bit addressing range of the offset-based
12009 version of subroutine call instruction.
12011 This feature is not enabled by default.  Specifying
12012 @option{-mno-long-calls} restores the default behavior.  Note these
12013 switches have no effect on how the compiler generates code to handle
12014 function calls via function pointers.
12016 @item -mfast-fp
12017 @opindex mfast-fp
12018 Link with the fast floating-point library. This library relaxes some of
12019 the IEEE floating-point standard's rules for checking inputs against
12020 Not-a-Number (NAN), in the interest of performance.
12022 @item -minline-plt
12023 @opindex minline-plt
12024 Enable inlining of PLT entries in function calls to functions that are
12025 not known to bind locally.  It has no effect without @option{-mfdpic}.
12027 @item -mmulticore
12028 @opindex mmulticore
12029 Build a standalone application for multicore Blackfin processors. 
12030 This option causes proper start files and link scripts supporting 
12031 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
12032 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
12034 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
12035 selects the one-application-per-core programming model.  Without
12036 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
12037 programming model is used. In this model, the main function of Core B
12038 should be named as @code{coreb_main}.
12040 If this option is not used, the single-core application programming
12041 model is used.
12043 @item -mcorea
12044 @opindex mcorea
12045 Build a standalone application for Core A of BF561 when using
12046 the one-application-per-core programming model. Proper start files
12047 and link scripts are used to support Core A, and the macro
12048 @code{__BFIN_COREA} is defined.
12049 This option can only be used in conjunction with @option{-mmulticore}.
12051 @item -mcoreb
12052 @opindex mcoreb
12053 Build a standalone application for Core B of BF561 when using
12054 the one-application-per-core programming model. Proper start files
12055 and link scripts are used to support Core B, and the macro
12056 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
12057 should be used instead of @code{main}. 
12058 This option can only be used in conjunction with @option{-mmulticore}.
12060 @item -msdram
12061 @opindex msdram
12062 Build a standalone application for SDRAM. Proper start files and
12063 link scripts are used to put the application into SDRAM, and the macro
12064 @code{__BFIN_SDRAM} is defined.
12065 The loader should initialize SDRAM before loading the application.
12067 @item -micplb
12068 @opindex micplb
12069 Assume that ICPLBs are enabled at run time.  This has an effect on certain
12070 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
12071 are enabled; for standalone applications the default is off.
12072 @end table
12074 @node C6X Options
12075 @subsection C6X Options
12076 @cindex C6X Options
12078 @table @gcctabopt
12079 @item -march=@var{name}
12080 @opindex march
12081 This specifies the name of the target architecture.  GCC uses this
12082 name to determine what kind of instructions it can emit when generating
12083 assembly code.  Permissible names are: @samp{c62x},
12084 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
12086 @item -mbig-endian
12087 @opindex mbig-endian
12088 Generate code for a big-endian target.
12090 @item -mlittle-endian
12091 @opindex mlittle-endian
12092 Generate code for a little-endian target.  This is the default.
12094 @item -msim
12095 @opindex msim
12096 Choose startup files and linker script suitable for the simulator.
12098 @item -msdata=default
12099 @opindex msdata=default
12100 Put small global and static data in the @samp{.neardata} section,
12101 which is pointed to by register @code{B14}.  Put small uninitialized
12102 global and static data in the @samp{.bss} section, which is adjacent
12103 to the @samp{.neardata} section.  Put small read-only data into the
12104 @samp{.rodata} section.  The corresponding sections used for large
12105 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
12107 @item -msdata=all
12108 @opindex msdata=all
12109 Put all data, not just small objects, into the sections reserved for
12110 small data, and use addressing relative to the @code{B14} register to
12111 access them.
12113 @item -msdata=none
12114 @opindex msdata=none
12115 Make no use of the sections reserved for small data, and use absolute
12116 addresses to access all data.  Put all initialized global and static
12117 data in the @samp{.fardata} section, and all uninitialized data in the
12118 @samp{.far} section.  Put all constant data into the @samp{.const}
12119 section.
12120 @end table
12122 @node CRIS Options
12123 @subsection CRIS Options
12124 @cindex CRIS Options
12126 These options are defined specifically for the CRIS ports.
12128 @table @gcctabopt
12129 @item -march=@var{architecture-type}
12130 @itemx -mcpu=@var{architecture-type}
12131 @opindex march
12132 @opindex mcpu
12133 Generate code for the specified architecture.  The choices for
12134 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
12135 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
12136 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
12137 @samp{v10}.
12139 @item -mtune=@var{architecture-type}
12140 @opindex mtune
12141 Tune to @var{architecture-type} everything applicable about the generated
12142 code, except for the ABI and the set of available instructions.  The
12143 choices for @var{architecture-type} are the same as for
12144 @option{-march=@var{architecture-type}}.
12146 @item -mmax-stack-frame=@var{n}
12147 @opindex mmax-stack-frame
12148 Warn when the stack frame of a function exceeds @var{n} bytes.
12150 @item -metrax4
12151 @itemx -metrax100
12152 @opindex metrax4
12153 @opindex metrax100
12154 The options @option{-metrax4} and @option{-metrax100} are synonyms for
12155 @option{-march=v3} and @option{-march=v8} respectively.
12157 @item -mmul-bug-workaround
12158 @itemx -mno-mul-bug-workaround
12159 @opindex mmul-bug-workaround
12160 @opindex mno-mul-bug-workaround
12161 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
12162 models where it applies.  This option is active by default.
12164 @item -mpdebug
12165 @opindex mpdebug
12166 Enable CRIS-specific verbose debug-related information in the assembly
12167 code.  This option also has the effect of turning off the @samp{#NO_APP}
12168 formatted-code indicator to the assembler at the beginning of the
12169 assembly file.
12171 @item -mcc-init
12172 @opindex mcc-init
12173 Do not use condition-code results from previous instruction; always emit
12174 compare and test instructions before use of condition codes.
12176 @item -mno-side-effects
12177 @opindex mno-side-effects
12178 Do not emit instructions with side effects in addressing modes other than
12179 post-increment.
12181 @item -mstack-align
12182 @itemx -mno-stack-align
12183 @itemx -mdata-align
12184 @itemx -mno-data-align
12185 @itemx -mconst-align
12186 @itemx -mno-const-align
12187 @opindex mstack-align
12188 @opindex mno-stack-align
12189 @opindex mdata-align
12190 @opindex mno-data-align
12191 @opindex mconst-align
12192 @opindex mno-const-align
12193 These options (@samp{no-} options) arrange (eliminate arrangements) for the
12194 stack frame, individual data and constants to be aligned for the maximum
12195 single data access size for the chosen CPU model.  The default is to
12196 arrange for 32-bit alignment.  ABI details such as structure layout are
12197 not affected by these options.
12199 @item -m32-bit
12200 @itemx -m16-bit
12201 @itemx -m8-bit
12202 @opindex m32-bit
12203 @opindex m16-bit
12204 @opindex m8-bit
12205 Similar to the stack- data- and const-align options above, these options
12206 arrange for stack frame, writable data and constants to all be 32-bit,
12207 16-bit or 8-bit aligned.  The default is 32-bit alignment.
12209 @item -mno-prologue-epilogue
12210 @itemx -mprologue-epilogue
12211 @opindex mno-prologue-epilogue
12212 @opindex mprologue-epilogue
12213 With @option{-mno-prologue-epilogue}, the normal function prologue and
12214 epilogue which set up the stack frame are omitted and no return
12215 instructions or return sequences are generated in the code.  Use this
12216 option only together with visual inspection of the compiled code: no
12217 warnings or errors are generated when call-saved registers must be saved,
12218 or storage for local variables needs to be allocated.
12220 @item -mno-gotplt
12221 @itemx -mgotplt
12222 @opindex mno-gotplt
12223 @opindex mgotplt
12224 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
12225 instruction sequences that load addresses for functions from the PLT part
12226 of the GOT rather than (traditional on other architectures) calls to the
12227 PLT@.  The default is @option{-mgotplt}.
12229 @item -melf
12230 @opindex melf
12231 Legacy no-op option only recognized with the cris-axis-elf and
12232 cris-axis-linux-gnu targets.
12234 @item -mlinux
12235 @opindex mlinux
12236 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
12238 @item -sim
12239 @opindex sim
12240 This option, recognized for the cris-axis-elf, arranges
12241 to link with input-output functions from a simulator library.  Code,
12242 initialized data and zero-initialized data are allocated consecutively.
12244 @item -sim2
12245 @opindex sim2
12246 Like @option{-sim}, but pass linker options to locate initialized data at
12247 0x40000000 and zero-initialized data at 0x80000000.
12248 @end table
12250 @node CR16 Options
12251 @subsection CR16 Options
12252 @cindex CR16 Options
12254 These options are defined specifically for the CR16 ports.
12256 @table @gcctabopt
12258 @item -mmac
12259 @opindex mmac
12260 Enable the use of multiply-accumulate instructions. Disabled by default.
12262 @item -mcr16cplus
12263 @itemx -mcr16c
12264 @opindex mcr16cplus
12265 @opindex mcr16c
12266 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
12267 is default.
12269 @item -msim
12270 @opindex msim
12271 Links the library libsim.a which is in compatible with simulator. Applicable
12272 to ELF compiler only.
12274 @item -mint32
12275 @opindex mint32
12276 Choose integer type as 32-bit wide.
12278 @item -mbit-ops
12279 @opindex mbit-ops
12280 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
12282 @item -mdata-model=@var{model}
12283 @opindex mdata-model
12284 Choose a data model. The choices for @var{model} are @samp{near},
12285 @samp{far} or @samp{medium}. @samp{medium} is default.
12286 However, @samp{far} is not valid with @option{-mcr16c}, as the
12287 CR16C architecture does not support the far data model.
12288 @end table
12290 @node Darwin Options
12291 @subsection Darwin Options
12292 @cindex Darwin options
12294 These options are defined for all architectures running the Darwin operating
12295 system.
12297 FSF GCC on Darwin does not create ``fat'' object files; it creates
12298 an object file for the single architecture that GCC was built to
12299 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
12300 @option{-arch} options are used; it does so by running the compiler or
12301 linker multiple times and joining the results together with
12302 @file{lipo}.
12304 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
12305 @samp{i686}) is determined by the flags that specify the ISA
12306 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
12307 @option{-force_cpusubtype_ALL} option can be used to override this.
12309 The Darwin tools vary in their behavior when presented with an ISA
12310 mismatch.  The assembler, @file{as}, only permits instructions to
12311 be used that are valid for the subtype of the file it is generating,
12312 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
12313 The linker for shared libraries, @file{/usr/bin/libtool}, fails
12314 and prints an error if asked to create a shared library with a less
12315 restrictive subtype than its input files (for instance, trying to put
12316 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
12317 for executables, @command{ld}, quietly gives the executable the most
12318 restrictive subtype of any of its input files.
12320 @table @gcctabopt
12321 @item -F@var{dir}
12322 @opindex F
12323 Add the framework directory @var{dir} to the head of the list of
12324 directories to be searched for header files.  These directories are
12325 interleaved with those specified by @option{-I} options and are
12326 scanned in a left-to-right order.
12328 A framework directory is a directory with frameworks in it.  A
12329 framework is a directory with a @file{Headers} and/or
12330 @file{PrivateHeaders} directory contained directly in it that ends
12331 in @file{.framework}.  The name of a framework is the name of this
12332 directory excluding the @file{.framework}.  Headers associated with
12333 the framework are found in one of those two directories, with
12334 @file{Headers} being searched first.  A subframework is a framework
12335 directory that is in a framework's @file{Frameworks} directory.
12336 Includes of subframework headers can only appear in a header of a
12337 framework that contains the subframework, or in a sibling subframework
12338 header.  Two subframeworks are siblings if they occur in the same
12339 framework.  A subframework should not have the same name as a
12340 framework; a warning is issued if this is violated.  Currently a
12341 subframework cannot have subframeworks; in the future, the mechanism
12342 may be extended to support this.  The standard frameworks can be found
12343 in @file{/System/Library/Frameworks} and
12344 @file{/Library/Frameworks}.  An example include looks like
12345 @code{#include <Framework/header.h>}, where @file{Framework} denotes
12346 the name of the framework and @file{header.h} is found in the
12347 @file{PrivateHeaders} or @file{Headers} directory.
12349 @item -iframework@var{dir}
12350 @opindex iframework
12351 Like @option{-F} except the directory is a treated as a system
12352 directory.  The main difference between this @option{-iframework} and
12353 @option{-F} is that with @option{-iframework} the compiler does not
12354 warn about constructs contained within header files found via
12355 @var{dir}.  This option is valid only for the C family of languages.
12357 @item -gused
12358 @opindex gused
12359 Emit debugging information for symbols that are used.  For stabs
12360 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
12361 This is by default ON@.
12363 @item -gfull
12364 @opindex gfull
12365 Emit debugging information for all symbols and types.
12367 @item -mmacosx-version-min=@var{version}
12368 The earliest version of MacOS X that this executable will run on
12369 is @var{version}.  Typical values of @var{version} include @code{10.1},
12370 @code{10.2}, and @code{10.3.9}.
12372 If the compiler was built to use the system's headers by default,
12373 then the default for this option is the system version on which the
12374 compiler is running, otherwise the default is to make choices that
12375 are compatible with as many systems and code bases as possible.
12377 @item -mkernel
12378 @opindex mkernel
12379 Enable kernel development mode.  The @option{-mkernel} option sets
12380 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
12381 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
12382 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
12383 applicable.  This mode also sets @option{-mno-altivec},
12384 @option{-msoft-float}, @option{-fno-builtin} and
12385 @option{-mlong-branch} for PowerPC targets.
12387 @item -mone-byte-bool
12388 @opindex mone-byte-bool
12389 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
12390 By default @samp{sizeof(bool)} is @samp{4} when compiling for
12391 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
12392 option has no effect on x86.
12394 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
12395 to generate code that is not binary compatible with code generated
12396 without that switch.  Using this switch may require recompiling all
12397 other modules in a program, including system libraries.  Use this
12398 switch to conform to a non-default data model.
12400 @item -mfix-and-continue
12401 @itemx -ffix-and-continue
12402 @itemx -findirect-data
12403 @opindex mfix-and-continue
12404 @opindex ffix-and-continue
12405 @opindex findirect-data
12406 Generate code suitable for fast turnaround development, such as to
12407 allow GDB to dynamically load @code{.o} files into already-running
12408 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
12409 are provided for backwards compatibility.
12411 @item -all_load
12412 @opindex all_load
12413 Loads all members of static archive libraries.
12414 See man ld(1) for more information.
12416 @item -arch_errors_fatal
12417 @opindex arch_errors_fatal
12418 Cause the errors having to do with files that have the wrong architecture
12419 to be fatal.
12421 @item -bind_at_load
12422 @opindex bind_at_load
12423 Causes the output file to be marked such that the dynamic linker will
12424 bind all undefined references when the file is loaded or launched.
12426 @item -bundle
12427 @opindex bundle
12428 Produce a Mach-o bundle format file.
12429 See man ld(1) for more information.
12431 @item -bundle_loader @var{executable}
12432 @opindex bundle_loader
12433 This option specifies the @var{executable} that will load the build
12434 output file being linked.  See man ld(1) for more information.
12436 @item -dynamiclib
12437 @opindex dynamiclib
12438 When passed this option, GCC produces a dynamic library instead of
12439 an executable when linking, using the Darwin @file{libtool} command.
12441 @item -force_cpusubtype_ALL
12442 @opindex force_cpusubtype_ALL
12443 This causes GCC's output file to have the @var{ALL} subtype, instead of
12444 one controlled by the @option{-mcpu} or @option{-march} option.
12446 @item -allowable_client  @var{client_name}
12447 @itemx -client_name
12448 @itemx -compatibility_version
12449 @itemx -current_version
12450 @itemx -dead_strip
12451 @itemx -dependency-file
12452 @itemx -dylib_file
12453 @itemx -dylinker_install_name
12454 @itemx -dynamic
12455 @itemx -exported_symbols_list
12456 @itemx -filelist
12457 @need 800
12458 @itemx -flat_namespace
12459 @itemx -force_flat_namespace
12460 @itemx -headerpad_max_install_names
12461 @itemx -image_base
12462 @itemx -init
12463 @itemx -install_name
12464 @itemx -keep_private_externs
12465 @itemx -multi_module
12466 @itemx -multiply_defined
12467 @itemx -multiply_defined_unused
12468 @need 800
12469 @itemx -noall_load
12470 @itemx -no_dead_strip_inits_and_terms
12471 @itemx -nofixprebinding
12472 @itemx -nomultidefs
12473 @itemx -noprebind
12474 @itemx -noseglinkedit
12475 @itemx -pagezero_size
12476 @itemx -prebind
12477 @itemx -prebind_all_twolevel_modules
12478 @itemx -private_bundle
12479 @need 800
12480 @itemx -read_only_relocs
12481 @itemx -sectalign
12482 @itemx -sectobjectsymbols
12483 @itemx -whyload
12484 @itemx -seg1addr
12485 @itemx -sectcreate
12486 @itemx -sectobjectsymbols
12487 @itemx -sectorder
12488 @itemx -segaddr
12489 @itemx -segs_read_only_addr
12490 @need 800
12491 @itemx -segs_read_write_addr
12492 @itemx -seg_addr_table
12493 @itemx -seg_addr_table_filename
12494 @itemx -seglinkedit
12495 @itemx -segprot
12496 @itemx -segs_read_only_addr
12497 @itemx -segs_read_write_addr
12498 @itemx -single_module
12499 @itemx -static
12500 @itemx -sub_library
12501 @need 800
12502 @itemx -sub_umbrella
12503 @itemx -twolevel_namespace
12504 @itemx -umbrella
12505 @itemx -undefined
12506 @itemx -unexported_symbols_list
12507 @itemx -weak_reference_mismatches
12508 @itemx -whatsloaded
12509 @opindex allowable_client
12510 @opindex client_name
12511 @opindex compatibility_version
12512 @opindex current_version
12513 @opindex dead_strip
12514 @opindex dependency-file
12515 @opindex dylib_file
12516 @opindex dylinker_install_name
12517 @opindex dynamic
12518 @opindex exported_symbols_list
12519 @opindex filelist
12520 @opindex flat_namespace
12521 @opindex force_flat_namespace
12522 @opindex headerpad_max_install_names
12523 @opindex image_base
12524 @opindex init
12525 @opindex install_name
12526 @opindex keep_private_externs
12527 @opindex multi_module
12528 @opindex multiply_defined
12529 @opindex multiply_defined_unused
12530 @opindex noall_load
12531 @opindex no_dead_strip_inits_and_terms
12532 @opindex nofixprebinding
12533 @opindex nomultidefs
12534 @opindex noprebind
12535 @opindex noseglinkedit
12536 @opindex pagezero_size
12537 @opindex prebind
12538 @opindex prebind_all_twolevel_modules
12539 @opindex private_bundle
12540 @opindex read_only_relocs
12541 @opindex sectalign
12542 @opindex sectobjectsymbols
12543 @opindex whyload
12544 @opindex seg1addr
12545 @opindex sectcreate
12546 @opindex sectobjectsymbols
12547 @opindex sectorder
12548 @opindex segaddr
12549 @opindex segs_read_only_addr
12550 @opindex segs_read_write_addr
12551 @opindex seg_addr_table
12552 @opindex seg_addr_table_filename
12553 @opindex seglinkedit
12554 @opindex segprot
12555 @opindex segs_read_only_addr
12556 @opindex segs_read_write_addr
12557 @opindex single_module
12558 @opindex static
12559 @opindex sub_library
12560 @opindex sub_umbrella
12561 @opindex twolevel_namespace
12562 @opindex umbrella
12563 @opindex undefined
12564 @opindex unexported_symbols_list
12565 @opindex weak_reference_mismatches
12566 @opindex whatsloaded
12567 These options are passed to the Darwin linker.  The Darwin linker man page
12568 describes them in detail.
12569 @end table
12571 @node DEC Alpha Options
12572 @subsection DEC Alpha Options
12574 These @samp{-m} options are defined for the DEC Alpha implementations:
12576 @table @gcctabopt
12577 @item -mno-soft-float
12578 @itemx -msoft-float
12579 @opindex mno-soft-float
12580 @opindex msoft-float
12581 Use (do not use) the hardware floating-point instructions for
12582 floating-point operations.  When @option{-msoft-float} is specified,
12583 functions in @file{libgcc.a} are used to perform floating-point
12584 operations.  Unless they are replaced by routines that emulate the
12585 floating-point operations, or compiled in such a way as to call such
12586 emulations routines, these routines issue floating-point
12587 operations.   If you are compiling for an Alpha without floating-point
12588 operations, you must ensure that the library is built so as not to call
12589 them.
12591 Note that Alpha implementations without floating-point operations are
12592 required to have floating-point registers.
12594 @item -mfp-reg
12595 @itemx -mno-fp-regs
12596 @opindex mfp-reg
12597 @opindex mno-fp-regs
12598 Generate code that uses (does not use) the floating-point register set.
12599 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
12600 register set is not used, floating-point operands are passed in integer
12601 registers as if they were integers and floating-point results are passed
12602 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
12603 so any function with a floating-point argument or return value called by code
12604 compiled with @option{-mno-fp-regs} must also be compiled with that
12605 option.
12607 A typical use of this option is building a kernel that does not use,
12608 and hence need not save and restore, any floating-point registers.
12610 @item -mieee
12611 @opindex mieee
12612 The Alpha architecture implements floating-point hardware optimized for
12613 maximum performance.  It is mostly compliant with the IEEE floating-point
12614 standard.  However, for full compliance, software assistance is
12615 required.  This option generates code fully IEEE-compliant code
12616 @emph{except} that the @var{inexact-flag} is not maintained (see below).
12617 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
12618 defined during compilation.  The resulting code is less efficient but is
12619 able to correctly support denormalized numbers and exceptional IEEE
12620 values such as not-a-number and plus/minus infinity.  Other Alpha
12621 compilers call this option @option{-ieee_with_no_inexact}.
12623 @item -mieee-with-inexact
12624 @opindex mieee-with-inexact
12625 This is like @option{-mieee} except the generated code also maintains
12626 the IEEE @var{inexact-flag}.  Turning on this option causes the
12627 generated code to implement fully-compliant IEEE math.  In addition to
12628 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
12629 macro.  On some Alpha implementations the resulting code may execute
12630 significantly slower than the code generated by default.  Since there is
12631 very little code that depends on the @var{inexact-flag}, you should
12632 normally not specify this option.  Other Alpha compilers call this
12633 option @option{-ieee_with_inexact}.
12635 @item -mfp-trap-mode=@var{trap-mode}
12636 @opindex mfp-trap-mode
12637 This option controls what floating-point related traps are enabled.
12638 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
12639 The trap mode can be set to one of four values:
12641 @table @samp
12642 @item n
12643 This is the default (normal) setting.  The only traps that are enabled
12644 are the ones that cannot be disabled in software (e.g., division by zero
12645 trap).
12647 @item u
12648 In addition to the traps enabled by @samp{n}, underflow traps are enabled
12649 as well.
12651 @item su
12652 Like @samp{u}, but the instructions are marked to be safe for software
12653 completion (see Alpha architecture manual for details).
12655 @item sui
12656 Like @samp{su}, but inexact traps are enabled as well.
12657 @end table
12659 @item -mfp-rounding-mode=@var{rounding-mode}
12660 @opindex mfp-rounding-mode
12661 Selects the IEEE rounding mode.  Other Alpha compilers call this option
12662 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
12665 @table @samp
12666 @item n
12667 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
12668 the nearest machine number or towards the even machine number in case
12669 of a tie.
12671 @item m
12672 Round towards minus infinity.
12674 @item c
12675 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
12677 @item d
12678 Dynamic rounding mode.  A field in the floating-point control register
12679 (@var{fpcr}, see Alpha architecture reference manual) controls the
12680 rounding mode in effect.  The C library initializes this register for
12681 rounding towards plus infinity.  Thus, unless your program modifies the
12682 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
12683 @end table
12685 @item -mtrap-precision=@var{trap-precision}
12686 @opindex mtrap-precision
12687 In the Alpha architecture, floating-point traps are imprecise.  This
12688 means without software assistance it is impossible to recover from a
12689 floating trap and program execution normally needs to be terminated.
12690 GCC can generate code that can assist operating system trap handlers
12691 in determining the exact location that caused a floating-point trap.
12692 Depending on the requirements of an application, different levels of
12693 precisions can be selected:
12695 @table @samp
12696 @item p
12697 Program precision.  This option is the default and means a trap handler
12698 can only identify which program caused a floating-point exception.
12700 @item f
12701 Function precision.  The trap handler can determine the function that
12702 caused a floating-point exception.
12704 @item i
12705 Instruction precision.  The trap handler can determine the exact
12706 instruction that caused a floating-point exception.
12707 @end table
12709 Other Alpha compilers provide the equivalent options called
12710 @option{-scope_safe} and @option{-resumption_safe}.
12712 @item -mieee-conformant
12713 @opindex mieee-conformant
12714 This option marks the generated code as IEEE conformant.  You must not
12715 use this option unless you also specify @option{-mtrap-precision=i} and either
12716 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
12717 is to emit the line @samp{.eflag 48} in the function prologue of the
12718 generated assembly file.
12720 @item -mbuild-constants
12721 @opindex mbuild-constants
12722 Normally GCC examines a 32- or 64-bit integer constant to
12723 see if it can construct it from smaller constants in two or three
12724 instructions.  If it cannot, it outputs the constant as a literal and
12725 generates code to load it from the data segment at run time.
12727 Use this option to require GCC to construct @emph{all} integer constants
12728 using code, even if it takes more instructions (the maximum is six).
12730 You typically use this option to build a shared library dynamic
12731 loader.  Itself a shared library, it must relocate itself in memory
12732 before it can find the variables and constants in its own data segment.
12734 @item -mbwx
12735 @itemx -mno-bwx
12736 @itemx -mcix
12737 @itemx -mno-cix
12738 @itemx -mfix
12739 @itemx -mno-fix
12740 @itemx -mmax
12741 @itemx -mno-max
12742 @opindex mbwx
12743 @opindex mno-bwx
12744 @opindex mcix
12745 @opindex mno-cix
12746 @opindex mfix
12747 @opindex mno-fix
12748 @opindex mmax
12749 @opindex mno-max
12750 Indicate whether GCC should generate code to use the optional BWX,
12751 CIX, FIX and MAX instruction sets.  The default is to use the instruction
12752 sets supported by the CPU type specified via @option{-mcpu=} option or that
12753 of the CPU on which GCC was built if none is specified.
12755 @item -mfloat-vax
12756 @itemx -mfloat-ieee
12757 @opindex mfloat-vax
12758 @opindex mfloat-ieee
12759 Generate code that uses (does not use) VAX F and G floating-point
12760 arithmetic instead of IEEE single and double precision.
12762 @item -mexplicit-relocs
12763 @itemx -mno-explicit-relocs
12764 @opindex mexplicit-relocs
12765 @opindex mno-explicit-relocs
12766 Older Alpha assemblers provided no way to generate symbol relocations
12767 except via assembler macros.  Use of these macros does not allow
12768 optimal instruction scheduling.  GNU binutils as of version 2.12
12769 supports a new syntax that allows the compiler to explicitly mark
12770 which relocations should apply to which instructions.  This option
12771 is mostly useful for debugging, as GCC detects the capabilities of
12772 the assembler when it is built and sets the default accordingly.
12774 @item -msmall-data
12775 @itemx -mlarge-data
12776 @opindex msmall-data
12777 @opindex mlarge-data
12778 When @option{-mexplicit-relocs} is in effect, static data is
12779 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
12780 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
12781 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
12782 16-bit relocations off of the @code{$gp} register.  This limits the
12783 size of the small data area to 64KB, but allows the variables to be
12784 directly accessed via a single instruction.
12786 The default is @option{-mlarge-data}.  With this option the data area
12787 is limited to just below 2GB@.  Programs that require more than 2GB of
12788 data must use @code{malloc} or @code{mmap} to allocate the data in the
12789 heap instead of in the program's data segment.
12791 When generating code for shared libraries, @option{-fpic} implies
12792 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
12794 @item -msmall-text
12795 @itemx -mlarge-text
12796 @opindex msmall-text
12797 @opindex mlarge-text
12798 When @option{-msmall-text} is used, the compiler assumes that the
12799 code of the entire program (or shared library) fits in 4MB, and is
12800 thus reachable with a branch instruction.  When @option{-msmall-data}
12801 is used, the compiler can assume that all local symbols share the
12802 same @code{$gp} value, and thus reduce the number of instructions
12803 required for a function call from 4 to 1.
12805 The default is @option{-mlarge-text}.
12807 @item -mcpu=@var{cpu_type}
12808 @opindex mcpu
12809 Set the instruction set and instruction scheduling parameters for
12810 machine type @var{cpu_type}.  You can specify either the @samp{EV}
12811 style name or the corresponding chip number.  GCC supports scheduling
12812 parameters for the EV4, EV5 and EV6 family of processors and
12813 chooses the default values for the instruction set from the processor
12814 you specify.  If you do not specify a processor type, GCC defaults
12815 to the processor on which the compiler was built.
12817 Supported values for @var{cpu_type} are
12819 @table @samp
12820 @item ev4
12821 @itemx ev45
12822 @itemx 21064
12823 Schedules as an EV4 and has no instruction set extensions.
12825 @item ev5
12826 @itemx 21164
12827 Schedules as an EV5 and has no instruction set extensions.
12829 @item ev56
12830 @itemx 21164a
12831 Schedules as an EV5 and supports the BWX extension.
12833 @item pca56
12834 @itemx 21164pc
12835 @itemx 21164PC
12836 Schedules as an EV5 and supports the BWX and MAX extensions.
12838 @item ev6
12839 @itemx 21264
12840 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
12842 @item ev67
12843 @itemx 21264a
12844 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
12845 @end table
12847 Native toolchains also support the value @samp{native},
12848 which selects the best architecture option for the host processor.
12849 @option{-mcpu=native} has no effect if GCC does not recognize
12850 the processor.
12852 @item -mtune=@var{cpu_type}
12853 @opindex mtune
12854 Set only the instruction scheduling parameters for machine type
12855 @var{cpu_type}.  The instruction set is not changed.
12857 Native toolchains also support the value @samp{native},
12858 which selects the best architecture option for the host processor.
12859 @option{-mtune=native} has no effect if GCC does not recognize
12860 the processor.
12862 @item -mmemory-latency=@var{time}
12863 @opindex mmemory-latency
12864 Sets the latency the scheduler should assume for typical memory
12865 references as seen by the application.  This number is highly
12866 dependent on the memory access patterns used by the application
12867 and the size of the external cache on the machine.
12869 Valid options for @var{time} are
12871 @table @samp
12872 @item @var{number}
12873 A decimal number representing clock cycles.
12875 @item L1
12876 @itemx L2
12877 @itemx L3
12878 @itemx main
12879 The compiler contains estimates of the number of clock cycles for
12880 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
12881 (also called Dcache, Scache, and Bcache), as well as to main memory.
12882 Note that L3 is only valid for EV5.
12884 @end table
12885 @end table
12887 @node FR30 Options
12888 @subsection FR30 Options
12889 @cindex FR30 Options
12891 These options are defined specifically for the FR30 port.
12893 @table @gcctabopt
12895 @item -msmall-model
12896 @opindex msmall-model
12897 Use the small address space model.  This can produce smaller code, but
12898 it does assume that all symbolic values and addresses fit into a
12899 20-bit range.
12901 @item -mno-lsim
12902 @opindex mno-lsim
12903 Assume that runtime support has been provided and so there is no need
12904 to include the simulator library (@file{libsim.a}) on the linker
12905 command line.
12907 @end table
12909 @node FRV Options
12910 @subsection FRV Options
12911 @cindex FRV Options
12913 @table @gcctabopt
12914 @item -mgpr-32
12915 @opindex mgpr-32
12917 Only use the first 32 general-purpose registers.
12919 @item -mgpr-64
12920 @opindex mgpr-64
12922 Use all 64 general-purpose registers.
12924 @item -mfpr-32
12925 @opindex mfpr-32
12927 Use only the first 32 floating-point registers.
12929 @item -mfpr-64
12930 @opindex mfpr-64
12932 Use all 64 floating-point registers.
12934 @item -mhard-float
12935 @opindex mhard-float
12937 Use hardware instructions for floating-point operations.
12939 @item -msoft-float
12940 @opindex msoft-float
12942 Use library routines for floating-point operations.
12944 @item -malloc-cc
12945 @opindex malloc-cc
12947 Dynamically allocate condition code registers.
12949 @item -mfixed-cc
12950 @opindex mfixed-cc
12952 Do not try to dynamically allocate condition code registers, only
12953 use @code{icc0} and @code{fcc0}.
12955 @item -mdword
12956 @opindex mdword
12958 Change ABI to use double word insns.
12960 @item -mno-dword
12961 @opindex mno-dword
12963 Do not use double word instructions.
12965 @item -mdouble
12966 @opindex mdouble
12968 Use floating-point double instructions.
12970 @item -mno-double
12971 @opindex mno-double
12973 Do not use floating-point double instructions.
12975 @item -mmedia
12976 @opindex mmedia
12978 Use media instructions.
12980 @item -mno-media
12981 @opindex mno-media
12983 Do not use media instructions.
12985 @item -mmuladd
12986 @opindex mmuladd
12988 Use multiply and add/subtract instructions.
12990 @item -mno-muladd
12991 @opindex mno-muladd
12993 Do not use multiply and add/subtract instructions.
12995 @item -mfdpic
12996 @opindex mfdpic
12998 Select the FDPIC ABI, which uses function descriptors to represent
12999 pointers to functions.  Without any PIC/PIE-related options, it
13000 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
13001 assumes GOT entries and small data are within a 12-bit range from the
13002 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
13003 are computed with 32 bits.
13004 With a @samp{bfin-elf} target, this option implies @option{-msim}.
13006 @item -minline-plt
13007 @opindex minline-plt
13009 Enable inlining of PLT entries in function calls to functions that are
13010 not known to bind locally.  It has no effect without @option{-mfdpic}.
13011 It's enabled by default if optimizing for speed and compiling for
13012 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
13013 optimization option such as @option{-O3} or above is present in the
13014 command line.
13016 @item -mTLS
13017 @opindex mTLS
13019 Assume a large TLS segment when generating thread-local code.
13021 @item -mtls
13022 @opindex mtls
13024 Do not assume a large TLS segment when generating thread-local code.
13026 @item -mgprel-ro
13027 @opindex mgprel-ro
13029 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
13030 that is known to be in read-only sections.  It's enabled by default,
13031 except for @option{-fpic} or @option{-fpie}: even though it may help
13032 make the global offset table smaller, it trades 1 instruction for 4.
13033 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
13034 one of which may be shared by multiple symbols, and it avoids the need
13035 for a GOT entry for the referenced symbol, so it's more likely to be a
13036 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
13038 @item -multilib-library-pic
13039 @opindex multilib-library-pic
13041 Link with the (library, not FD) pic libraries.  It's implied by
13042 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
13043 @option{-fpic} without @option{-mfdpic}.  You should never have to use
13044 it explicitly.
13046 @item -mlinked-fp
13047 @opindex mlinked-fp
13049 Follow the EABI requirement of always creating a frame pointer whenever
13050 a stack frame is allocated.  This option is enabled by default and can
13051 be disabled with @option{-mno-linked-fp}.
13053 @item -mlong-calls
13054 @opindex mlong-calls
13056 Use indirect addressing to call functions outside the current
13057 compilation unit.  This allows the functions to be placed anywhere
13058 within the 32-bit address space.
13060 @item -malign-labels
13061 @opindex malign-labels
13063 Try to align labels to an 8-byte boundary by inserting NOPs into the
13064 previous packet.  This option only has an effect when VLIW packing
13065 is enabled.  It doesn't create new packets; it merely adds NOPs to
13066 existing ones.
13068 @item -mlibrary-pic
13069 @opindex mlibrary-pic
13071 Generate position-independent EABI code.
13073 @item -macc-4
13074 @opindex macc-4
13076 Use only the first four media accumulator registers.
13078 @item -macc-8
13079 @opindex macc-8
13081 Use all eight media accumulator registers.
13083 @item -mpack
13084 @opindex mpack
13086 Pack VLIW instructions.
13088 @item -mno-pack
13089 @opindex mno-pack
13091 Do not pack VLIW instructions.
13093 @item -mno-eflags
13094 @opindex mno-eflags
13096 Do not mark ABI switches in e_flags.
13098 @item -mcond-move
13099 @opindex mcond-move
13101 Enable the use of conditional-move instructions (default).
13103 This switch is mainly for debugging the compiler and will likely be removed
13104 in a future version.
13106 @item -mno-cond-move
13107 @opindex mno-cond-move
13109 Disable the use of conditional-move instructions.
13111 This switch is mainly for debugging the compiler and will likely be removed
13112 in a future version.
13114 @item -mscc
13115 @opindex mscc
13117 Enable the use of conditional set instructions (default).
13119 This switch is mainly for debugging the compiler and will likely be removed
13120 in a future version.
13122 @item -mno-scc
13123 @opindex mno-scc
13125 Disable the use of conditional set instructions.
13127 This switch is mainly for debugging the compiler and will likely be removed
13128 in a future version.
13130 @item -mcond-exec
13131 @opindex mcond-exec
13133 Enable the use of conditional execution (default).
13135 This switch is mainly for debugging the compiler and will likely be removed
13136 in a future version.
13138 @item -mno-cond-exec
13139 @opindex mno-cond-exec
13141 Disable the use of conditional execution.
13143 This switch is mainly for debugging the compiler and will likely be removed
13144 in a future version.
13146 @item -mvliw-branch
13147 @opindex mvliw-branch
13149 Run a pass to pack branches into VLIW instructions (default).
13151 This switch is mainly for debugging the compiler and will likely be removed
13152 in a future version.
13154 @item -mno-vliw-branch
13155 @opindex mno-vliw-branch
13157 Do not run a pass to pack branches into VLIW instructions.
13159 This switch is mainly for debugging the compiler and will likely be removed
13160 in a future version.
13162 @item -mmulti-cond-exec
13163 @opindex mmulti-cond-exec
13165 Enable optimization of @code{&&} and @code{||} in conditional execution
13166 (default).
13168 This switch is mainly for debugging the compiler and will likely be removed
13169 in a future version.
13171 @item -mno-multi-cond-exec
13172 @opindex mno-multi-cond-exec
13174 Disable optimization of @code{&&} and @code{||} in conditional execution.
13176 This switch is mainly for debugging the compiler and will likely be removed
13177 in a future version.
13179 @item -mnested-cond-exec
13180 @opindex mnested-cond-exec
13182 Enable nested conditional execution optimizations (default).
13184 This switch is mainly for debugging the compiler and will likely be removed
13185 in a future version.
13187 @item -mno-nested-cond-exec
13188 @opindex mno-nested-cond-exec
13190 Disable nested conditional execution optimizations.
13192 This switch is mainly for debugging the compiler and will likely be removed
13193 in a future version.
13195 @item -moptimize-membar
13196 @opindex moptimize-membar
13198 This switch removes redundant @code{membar} instructions from the
13199 compiler-generated code.  It is enabled by default.
13201 @item -mno-optimize-membar
13202 @opindex mno-optimize-membar
13204 This switch disables the automatic removal of redundant @code{membar}
13205 instructions from the generated code.
13207 @item -mtomcat-stats
13208 @opindex mtomcat-stats
13210 Cause gas to print out tomcat statistics.
13212 @item -mcpu=@var{cpu}
13213 @opindex mcpu
13215 Select the processor type for which to generate code.  Possible values are
13216 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
13217 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
13219 @end table
13221 @node GNU/Linux Options
13222 @subsection GNU/Linux Options
13224 These @samp{-m} options are defined for GNU/Linux targets:
13226 @table @gcctabopt
13227 @item -mglibc
13228 @opindex mglibc
13229 Use the GNU C library.  This is the default except
13230 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
13232 @item -muclibc
13233 @opindex muclibc
13234 Use uClibc C library.  This is the default on
13235 @samp{*-*-linux-*uclibc*} targets.
13237 @item -mbionic
13238 @opindex mbionic
13239 Use Bionic C library.  This is the default on
13240 @samp{*-*-linux-*android*} targets.
13242 @item -mandroid
13243 @opindex mandroid
13244 Compile code compatible with Android platform.  This is the default on
13245 @samp{*-*-linux-*android*} targets.
13247 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
13248 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
13249 this option makes the GCC driver pass Android-specific options to the linker.
13250 Finally, this option causes the preprocessor macro @code{__ANDROID__}
13251 to be defined.
13253 @item -tno-android-cc
13254 @opindex tno-android-cc
13255 Disable compilation effects of @option{-mandroid}, i.e., do not enable
13256 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
13257 @option{-fno-rtti} by default.
13259 @item -tno-android-ld
13260 @opindex tno-android-ld
13261 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
13262 linking options to the linker.
13264 @end table
13266 @node H8/300 Options
13267 @subsection H8/300 Options
13269 These @samp{-m} options are defined for the H8/300 implementations:
13271 @table @gcctabopt
13272 @item -mrelax
13273 @opindex mrelax
13274 Shorten some address references at link time, when possible; uses the
13275 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
13276 ld, Using ld}, for a fuller description.
13278 @item -mh
13279 @opindex mh
13280 Generate code for the H8/300H@.
13282 @item -ms
13283 @opindex ms
13284 Generate code for the H8S@.
13286 @item -mn
13287 @opindex mn
13288 Generate code for the H8S and H8/300H in the normal mode.  This switch
13289 must be used either with @option{-mh} or @option{-ms}.
13291 @item -ms2600
13292 @opindex ms2600
13293 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
13295 @item -mexr
13296 @opindex mexr
13297 Extended registers are stored on stack before execution of function
13298 with monitor attribute. Default option is @option{-mexr}.
13299 This option is valid only for H8S targets.
13301 @item -mno-exr
13302 @opindex mno-exr
13303 Extended registers are not stored on stack before execution of function 
13304 with monitor attribute. Default option is @option{-mno-exr}. 
13305 This option is valid only for H8S targets.
13307 @item -mint32
13308 @opindex mint32
13309 Make @code{int} data 32 bits by default.
13311 @item -malign-300
13312 @opindex malign-300
13313 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
13314 The default for the H8/300H and H8S is to align longs and floats on
13315 4-byte boundaries.
13316 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
13317 This option has no effect on the H8/300.
13318 @end table
13320 @node HPPA Options
13321 @subsection HPPA Options
13322 @cindex HPPA Options
13324 These @samp{-m} options are defined for the HPPA family of computers:
13326 @table @gcctabopt
13327 @item -march=@var{architecture-type}
13328 @opindex march
13329 Generate code for the specified architecture.  The choices for
13330 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
13331 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
13332 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
13333 architecture option for your machine.  Code compiled for lower numbered
13334 architectures runs on higher numbered architectures, but not the
13335 other way around.
13337 @item -mpa-risc-1-0
13338 @itemx -mpa-risc-1-1
13339 @itemx -mpa-risc-2-0
13340 @opindex mpa-risc-1-0
13341 @opindex mpa-risc-1-1
13342 @opindex mpa-risc-2-0
13343 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
13345 @item -mbig-switch
13346 @opindex mbig-switch
13347 Generate code suitable for big switch tables.  Use this option only if
13348 the assembler/linker complain about out-of-range branches within a switch
13349 table.
13351 @item -mjump-in-delay
13352 @opindex mjump-in-delay
13353 Fill delay slots of function calls with unconditional jump instructions
13354 by modifying the return pointer for the function call to be the target
13355 of the conditional jump.
13357 @item -mdisable-fpregs
13358 @opindex mdisable-fpregs
13359 Prevent floating-point registers from being used in any manner.  This is
13360 necessary for compiling kernels that perform lazy context switching of
13361 floating-point registers.  If you use this option and attempt to perform
13362 floating-point operations, the compiler aborts.
13364 @item -mdisable-indexing
13365 @opindex mdisable-indexing
13366 Prevent the compiler from using indexing address modes.  This avoids some
13367 rather obscure problems when compiling MIG generated code under MACH@.
13369 @item -mno-space-regs
13370 @opindex mno-space-regs
13371 Generate code that assumes the target has no space registers.  This allows
13372 GCC to generate faster indirect calls and use unscaled index address modes.
13374 Such code is suitable for level 0 PA systems and kernels.
13376 @item -mfast-indirect-calls
13377 @opindex mfast-indirect-calls
13378 Generate code that assumes calls never cross space boundaries.  This
13379 allows GCC to emit code that performs faster indirect calls.
13381 This option does not work in the presence of shared libraries or nested
13382 functions.
13384 @item -mfixed-range=@var{register-range}
13385 @opindex mfixed-range
13386 Generate code treating the given register range as fixed registers.
13387 A fixed register is one that the register allocator cannot use.  This is
13388 useful when compiling kernel code.  A register range is specified as
13389 two registers separated by a dash.  Multiple register ranges can be
13390 specified separated by a comma.
13392 @item -mlong-load-store
13393 @opindex mlong-load-store
13394 Generate 3-instruction load and store sequences as sometimes required by
13395 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
13396 the HP compilers.
13398 @item -mportable-runtime
13399 @opindex mportable-runtime
13400 Use the portable calling conventions proposed by HP for ELF systems.
13402 @item -mgas
13403 @opindex mgas
13404 Enable the use of assembler directives only GAS understands.
13406 @item -mschedule=@var{cpu-type}
13407 @opindex mschedule
13408 Schedule code according to the constraints for the machine type
13409 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
13410 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
13411 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
13412 proper scheduling option for your machine.  The default scheduling is
13413 @samp{8000}.
13415 @item -mlinker-opt
13416 @opindex mlinker-opt
13417 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
13418 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
13419 linkers in which they give bogus error messages when linking some programs.
13421 @item -msoft-float
13422 @opindex msoft-float
13423 Generate output containing library calls for floating point.
13424 @strong{Warning:} the requisite libraries are not available for all HPPA
13425 targets.  Normally the facilities of the machine's usual C compiler are
13426 used, but this cannot be done directly in cross-compilation.  You must make
13427 your own arrangements to provide suitable library functions for
13428 cross-compilation.
13430 @option{-msoft-float} changes the calling convention in the output file;
13431 therefore, it is only useful if you compile @emph{all} of a program with
13432 this option.  In particular, you need to compile @file{libgcc.a}, the
13433 library that comes with GCC, with @option{-msoft-float} in order for
13434 this to work.
13436 @item -msio
13437 @opindex msio
13438 Generate the predefine, @code{_SIO}, for server IO@.  The default is
13439 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
13440 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
13441 options are available under HP-UX and HI-UX@.
13443 @item -mgnu-ld
13444 @opindex mgnu-ld
13445 Use options specific to GNU @command{ld}.
13446 This passes @option{-shared} to @command{ld} when
13447 building a shared library.  It is the default when GCC is configured,
13448 explicitly or implicitly, with the GNU linker.  This option does not
13449 affect which @command{ld} is called; it only changes what parameters
13450 are passed to that @command{ld}.
13451 The @command{ld} that is called is determined by the
13452 @option{--with-ld} configure option, GCC's program search path, and
13453 finally by the user's @env{PATH}.  The linker used by GCC can be printed
13454 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
13455 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13457 @item -mhp-ld
13458 @opindex mhp-ld
13459 Use options specific to HP @command{ld}.
13460 This passes @option{-b} to @command{ld} when building
13461 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
13462 links.  It is the default when GCC is configured, explicitly or
13463 implicitly, with the HP linker.  This option does not affect
13464 which @command{ld} is called; it only changes what parameters are passed to that
13465 @command{ld}.
13466 The @command{ld} that is called is determined by the @option{--with-ld}
13467 configure option, GCC's program search path, and finally by the user's
13468 @env{PATH}.  The linker used by GCC can be printed using @samp{which
13469 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
13470 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13472 @item -mlong-calls
13473 @opindex mno-long-calls
13474 Generate code that uses long call sequences.  This ensures that a call
13475 is always able to reach linker generated stubs.  The default is to generate
13476 long calls only when the distance from the call site to the beginning
13477 of the function or translation unit, as the case may be, exceeds a
13478 predefined limit set by the branch type being used.  The limits for
13479 normal calls are 7,600,000 and 240,000 bytes, respectively for the
13480 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
13481 240,000 bytes.
13483 Distances are measured from the beginning of functions when using the
13484 @option{-ffunction-sections} option, or when using the @option{-mgas}
13485 and @option{-mno-portable-runtime} options together under HP-UX with
13486 the SOM linker.
13488 It is normally not desirable to use this option as it degrades
13489 performance.  However, it may be useful in large applications,
13490 particularly when partial linking is used to build the application.
13492 The types of long calls used depends on the capabilities of the
13493 assembler and linker, and the type of code being generated.  The
13494 impact on systems that support long absolute calls, and long pic
13495 symbol-difference or pc-relative calls should be relatively small.
13496 However, an indirect call is used on 32-bit ELF systems in pic code
13497 and it is quite long.
13499 @item -munix=@var{unix-std}
13500 @opindex march
13501 Generate compiler predefines and select a startfile for the specified
13502 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
13503 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
13504 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
13505 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
13506 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
13507 and later.
13509 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
13510 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
13511 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
13512 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
13513 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
13514 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
13516 It is @emph{important} to note that this option changes the interfaces
13517 for various library routines.  It also affects the operational behavior
13518 of the C library.  Thus, @emph{extreme} care is needed in using this
13519 option.
13521 Library code that is intended to operate with more than one UNIX
13522 standard must test, set and restore the variable @var{__xpg4_extended_mask}
13523 as appropriate.  Most GNU software doesn't provide this capability.
13525 @item -nolibdld
13526 @opindex nolibdld
13527 Suppress the generation of link options to search libdld.sl when the
13528 @option{-static} option is specified on HP-UX 10 and later.
13530 @item -static
13531 @opindex static
13532 The HP-UX implementation of setlocale in libc has a dependency on
13533 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
13534 when the @option{-static} option is specified, special link options
13535 are needed to resolve this dependency.
13537 On HP-UX 10 and later, the GCC driver adds the necessary options to
13538 link with libdld.sl when the @option{-static} option is specified.
13539 This causes the resulting binary to be dynamic.  On the 64-bit port,
13540 the linkers generate dynamic binaries by default in any case.  The
13541 @option{-nolibdld} option can be used to prevent the GCC driver from
13542 adding these link options.
13544 @item -threads
13545 @opindex threads
13546 Add support for multithreading with the @dfn{dce thread} library
13547 under HP-UX@.  This option sets flags for both the preprocessor and
13548 linker.
13549 @end table
13551 @node i386 and x86-64 Options
13552 @subsection Intel 386 and AMD x86-64 Options
13553 @cindex i386 Options
13554 @cindex x86-64 Options
13555 @cindex Intel 386 Options
13556 @cindex AMD x86-64 Options
13558 These @samp{-m} options are defined for the i386 and x86-64 family of
13559 computers:
13561 @table @gcctabopt
13563 @item -march=@var{cpu-type}
13564 @opindex march
13565 Generate instructions for the machine type @var{cpu-type}.  In contrast to
13566 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
13567 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
13568 to generate code that may not run at all on processors other than the one
13569 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
13570 @option{-mtune=@var{cpu-type}}.
13572 The choices for @var{cpu-type} are:
13574 @table @samp
13575 @item native
13576 This selects the CPU to generate code for at compilation time by determining
13577 the processor type of the compiling machine.  Using @option{-march=native}
13578 enables all instruction subsets supported by the local machine (hence
13579 the result might not run on different machines).  Using @option{-mtune=native}
13580 produces code optimized for the local machine under the constraints
13581 of the selected instruction set.  
13583 @item i386
13584 Original Intel i386 CPU@.
13586 @item i486
13587 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
13589 @item i586
13590 @itemx pentium
13591 Intel Pentium CPU with no MMX support.
13593 @item pentium-mmx
13594 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
13596 @item pentiumpro
13597 Intel Pentium Pro CPU@.
13599 @item i686
13600 When used with @option{-march}, the Pentium Pro
13601 instruction set is used, so the code runs on all i686 family chips.
13602 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
13604 @item pentium2
13605 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
13606 support.
13608 @item pentium3
13609 @itemx pentium3m
13610 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
13611 set support.
13613 @item pentium-m
13614 Intel Pentium M; low-power version of Intel Pentium III CPU
13615 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
13617 @item pentium4
13618 @itemx pentium4m
13619 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
13621 @item prescott
13622 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
13623 set support.
13625 @item nocona
13626 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
13627 SSE2 and SSE3 instruction set support.
13629 @item core2
13630 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13631 instruction set support.
13633 @item corei7
13634 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
13635 and SSE4.2 instruction set support.
13637 @item corei7-avx
13638 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13639 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
13641 @item core-avx-i
13642 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13643 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
13644 set support.
13646 @item atom
13647 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13648 instruction set support.
13650 @item k6
13651 AMD K6 CPU with MMX instruction set support.
13653 @item k6-2
13654 @itemx k6-3
13655 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
13657 @item athlon
13658 @itemx athlon-tbird
13659 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
13660 support.
13662 @item athlon-4
13663 @itemx athlon-xp
13664 @itemx athlon-mp
13665 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
13666 instruction set support.
13668 @item k8
13669 @itemx opteron
13670 @itemx athlon64
13671 @itemx athlon-fx
13672 Processors based on the AMD K8 core with x86-64 instruction set support,
13673 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
13674 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
13675 instruction set extensions.)
13677 @item k8-sse3
13678 @itemx opteron-sse3
13679 @itemx athlon64-sse3
13680 Improved versions of AMD K8 cores with SSE3 instruction set support.
13682 @item amdfam10
13683 @itemx barcelona
13684 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
13685 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
13686 instruction set extensions.)
13688 @item bdver1
13689 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
13690 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
13691 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
13692 @item bdver2
13693 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
13694 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
13695 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
13696 extensions.)
13698 @item btver1
13699 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
13700 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
13701 instruction set extensions.)
13703 @item btver2
13704 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
13705 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
13706 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
13708 @item winchip-c6
13709 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
13710 set support.
13712 @item winchip2
13713 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
13714 instruction set support.
13716 @item c3
13717 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
13718 implemented for this chip.)
13720 @item c3-2
13721 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
13722 (No scheduling is
13723 implemented for this chip.)
13725 @item geode
13726 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
13727 @end table
13729 @item -mtune=@var{cpu-type}
13730 @opindex mtune
13731 Tune to @var{cpu-type} everything applicable about the generated code, except
13732 for the ABI and the set of available instructions.  
13733 While picking a specific @var{cpu-type} schedules things appropriately
13734 for that particular chip, the compiler does not generate any code that
13735 cannot run on the default machine type unless you use a
13736 @option{-march=@var{cpu-type}} option.
13737 For example, if GCC is configured for i686-pc-linux-gnu
13738 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
13739 but still runs on i686 machines.
13741 The choices for @var{cpu-type} are the same as for @option{-march}.
13742 In addition, @option{-mtune} supports an extra choice for @var{cpu-type}:
13744 @table @samp
13745 @item generic
13746 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
13747 If you know the CPU on which your code will run, then you should use
13748 the corresponding @option{-mtune} or @option{-march} option instead of
13749 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
13750 of your application will have, then you should use this option.
13752 As new processors are deployed in the marketplace, the behavior of this
13753 option will change.  Therefore, if you upgrade to a newer version of
13754 GCC, code generation controlled by this option will change to reflect
13755 the processors
13756 that are most common at the time that version of GCC is released.
13758 There is no @option{-march=generic} option because @option{-march}
13759 indicates the instruction set the compiler can use, and there is no
13760 generic instruction set applicable to all processors.  In contrast,
13761 @option{-mtune} indicates the processor (or, in this case, collection of
13762 processors) for which the code is optimized.
13763 @end table
13765 @item -mcpu=@var{cpu-type}
13766 @opindex mcpu
13767 A deprecated synonym for @option{-mtune}.
13769 @item -mfpmath=@var{unit}
13770 @opindex mfpmath
13771 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
13772 for @var{unit} are:
13774 @table @samp
13775 @item 387
13776 Use the standard 387 floating-point coprocessor present on the majority of chips and
13777 emulated otherwise.  Code compiled with this option runs almost everywhere.
13778 The temporary results are computed in 80-bit precision instead of the precision
13779 specified by the type, resulting in slightly different results compared to most
13780 of other chips.  See @option{-ffloat-store} for more detailed description.
13782 This is the default choice for i386 compiler.
13784 @item sse
13785 Use scalar floating-point instructions present in the SSE instruction set.
13786 This instruction set is supported by Pentium III and newer chips,
13787 and in the AMD line
13788 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
13789 instruction set supports only single-precision arithmetic, thus the double and
13790 extended-precision arithmetic are still done using 387.  A later version, present
13791 only in Pentium 4 and AMD x86-64 chips, supports double-precision
13792 arithmetic too.
13794 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
13795 or @option{-msse2} switches to enable SSE extensions and make this option
13796 effective.  For the x86-64 compiler, these extensions are enabled by default.
13798 The resulting code should be considerably faster in the majority of cases and avoid
13799 the numerical instability problems of 387 code, but may break some existing
13800 code that expects temporaries to be 80 bits.
13802 This is the default choice for the x86-64 compiler.
13804 @item sse,387
13805 @itemx sse+387
13806 @itemx both
13807 Attempt to utilize both instruction sets at once.  This effectively doubles the
13808 amount of available registers, and on chips with separate execution units for
13809 387 and SSE the execution resources too.  Use this option with care, as it is
13810 still experimental, because the GCC register allocator does not model separate
13811 functional units well, resulting in unstable performance.
13812 @end table
13814 @item -masm=@var{dialect}
13815 @opindex masm=@var{dialect}
13816 Output assembly instructions using selected @var{dialect}.  Supported
13817 choices are @samp{intel} or @samp{att} (the default).  Darwin does
13818 not support @samp{intel}.
13820 @item -mieee-fp
13821 @itemx -mno-ieee-fp
13822 @opindex mieee-fp
13823 @opindex mno-ieee-fp
13824 Control whether or not the compiler uses IEEE floating-point
13825 comparisons.  These correctly handle the case where the result of a
13826 comparison is unordered.
13828 @item -msoft-float
13829 @opindex msoft-float
13830 Generate output containing library calls for floating point.
13832 @strong{Warning:} the requisite libraries are not part of GCC@.
13833 Normally the facilities of the machine's usual C compiler are used, but
13834 this can't be done directly in cross-compilation.  You must make your
13835 own arrangements to provide suitable library functions for
13836 cross-compilation.
13838 On machines where a function returns floating-point results in the 80387
13839 register stack, some floating-point opcodes may be emitted even if
13840 @option{-msoft-float} is used.
13842 @item -mno-fp-ret-in-387
13843 @opindex mno-fp-ret-in-387
13844 Do not use the FPU registers for return values of functions.
13846 The usual calling convention has functions return values of types
13847 @code{float} and @code{double} in an FPU register, even if there
13848 is no FPU@.  The idea is that the operating system should emulate
13849 an FPU@.
13851 The option @option{-mno-fp-ret-in-387} causes such values to be returned
13852 in ordinary CPU registers instead.
13854 @item -mno-fancy-math-387
13855 @opindex mno-fancy-math-387
13856 Some 387 emulators do not support the @code{sin}, @code{cos} and
13857 @code{sqrt} instructions for the 387.  Specify this option to avoid
13858 generating those instructions.  This option is the default on FreeBSD,
13859 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
13860 indicates that the target CPU always has an FPU and so the
13861 instruction does not need emulation.  These
13862 instructions are not generated unless you also use the
13863 @option{-funsafe-math-optimizations} switch.
13865 @item -malign-double
13866 @itemx -mno-align-double
13867 @opindex malign-double
13868 @opindex mno-align-double
13869 Control whether GCC aligns @code{double}, @code{long double}, and
13870 @code{long long} variables on a two-word boundary or a one-word
13871 boundary.  Aligning @code{double} variables on a two-word boundary
13872 produces code that runs somewhat faster on a Pentium at the
13873 expense of more memory.
13875 On x86-64, @option{-malign-double} is enabled by default.
13877 @strong{Warning:} if you use the @option{-malign-double} switch,
13878 structures containing the above types are aligned differently than
13879 the published application binary interface specifications for the 386
13880 and are not binary compatible with structures in code compiled
13881 without that switch.
13883 @item -m96bit-long-double
13884 @itemx -m128bit-long-double
13885 @opindex m96bit-long-double
13886 @opindex m128bit-long-double
13887 These switches control the size of @code{long double} type.  The i386
13888 application binary interface specifies the size to be 96 bits,
13889 so @option{-m96bit-long-double} is the default in 32-bit mode.
13891 Modern architectures (Pentium and newer) prefer @code{long double}
13892 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
13893 conforming to the ABI, this is not possible.  So specifying
13894 @option{-m128bit-long-double} aligns @code{long double}
13895 to a 16-byte boundary by padding the @code{long double} with an additional
13896 32-bit zero.
13898 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
13899 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
13901 Notice that neither of these options enable any extra precision over the x87
13902 standard of 80 bits for a @code{long double}.
13904 @strong{Warning:} if you override the default value for your target ABI, this
13905 changes the size of 
13906 structures and arrays containing @code{long double} variables,
13907 as well as modifying the function calling convention for functions taking
13908 @code{long double}.  Hence they are not binary-compatible
13909 with code compiled without that switch.
13911 @item -mlong-double-64
13912 @itemx -mlong-double-80
13913 @opindex mlong-double-64
13914 @opindex mlong-double-80
13915 These switches control the size of @code{long double} type. A size
13916 of 64 bits makes the @code{long double} type equivalent to the @code{double}
13917 type. This is the default for Bionic C library.
13919 @strong{Warning:} if you override the default value for your target ABI, this
13920 changes the size of
13921 structures and arrays containing @code{long double} variables,
13922 as well as modifying the function calling convention for functions taking
13923 @code{long double}.  Hence they are not binary-compatible
13924 with code compiled without that switch.
13926 @item -mlarge-data-threshold=@var{threshold}
13927 @opindex mlarge-data-threshold
13928 When @option{-mcmodel=medium} is specified, data objects larger than
13929 @var{threshold} are placed in the large data section.  This value must be the
13930 same across all objects linked into the binary, and defaults to 65535.
13932 @item -mrtd
13933 @opindex mrtd
13934 Use a different function-calling convention, in which functions that
13935 take a fixed number of arguments return with the @code{ret @var{num}}
13936 instruction, which pops their arguments while returning.  This saves one
13937 instruction in the caller since there is no need to pop the arguments
13938 there.
13940 You can specify that an individual function is called with this calling
13941 sequence with the function attribute @samp{stdcall}.  You can also
13942 override the @option{-mrtd} option by using the function attribute
13943 @samp{cdecl}.  @xref{Function Attributes}.
13945 @strong{Warning:} this calling convention is incompatible with the one
13946 normally used on Unix, so you cannot use it if you need to call
13947 libraries compiled with the Unix compiler.
13949 Also, you must provide function prototypes for all functions that
13950 take variable numbers of arguments (including @code{printf});
13951 otherwise incorrect code is generated for calls to those
13952 functions.
13954 In addition, seriously incorrect code results if you call a
13955 function with too many arguments.  (Normally, extra arguments are
13956 harmlessly ignored.)
13958 @item -mregparm=@var{num}
13959 @opindex mregparm
13960 Control how many registers are used to pass integer arguments.  By
13961 default, no registers are used to pass arguments, and at most 3
13962 registers can be used.  You can control this behavior for a specific
13963 function by using the function attribute @samp{regparm}.
13964 @xref{Function Attributes}.
13966 @strong{Warning:} if you use this switch, and
13967 @var{num} is nonzero, then you must build all modules with the same
13968 value, including any libraries.  This includes the system libraries and
13969 startup modules.
13971 @item -msseregparm
13972 @opindex msseregparm
13973 Use SSE register passing conventions for float and double arguments
13974 and return values.  You can control this behavior for a specific
13975 function by using the function attribute @samp{sseregparm}.
13976 @xref{Function Attributes}.
13978 @strong{Warning:} if you use this switch then you must build all
13979 modules with the same value, including any libraries.  This includes
13980 the system libraries and startup modules.
13982 @item -mvect8-ret-in-mem
13983 @opindex mvect8-ret-in-mem
13984 Return 8-byte vectors in memory instead of MMX registers.  This is the
13985 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
13986 Studio compilers until version 12.  Later compiler versions (starting
13987 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
13988 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
13989 you need to remain compatible with existing code produced by those
13990 previous compiler versions or older versions of GCC@.
13992 @item -mpc32
13993 @itemx -mpc64
13994 @itemx -mpc80
13995 @opindex mpc32
13996 @opindex mpc64
13997 @opindex mpc80
13999 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
14000 is specified, the significands of results of floating-point operations are
14001 rounded to 24 bits (single precision); @option{-mpc64} rounds the
14002 significands of results of floating-point operations to 53 bits (double
14003 precision) and @option{-mpc80} rounds the significands of results of
14004 floating-point operations to 64 bits (extended double precision), which is
14005 the default.  When this option is used, floating-point operations in higher
14006 precisions are not available to the programmer without setting the FPU
14007 control word explicitly.
14009 Setting the rounding of floating-point operations to less than the default
14010 80 bits can speed some programs by 2% or more.  Note that some mathematical
14011 libraries assume that extended-precision (80-bit) floating-point operations
14012 are enabled by default; routines in such libraries could suffer significant
14013 loss of accuracy, typically through so-called ``catastrophic cancellation'',
14014 when this option is used to set the precision to less than extended precision.
14016 @item -mstackrealign
14017 @opindex mstackrealign
14018 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
14019 option generates an alternate prologue and epilogue that realigns the
14020 run-time stack if necessary.  This supports mixing legacy codes that keep
14021 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
14022 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
14023 applicable to individual functions.
14025 @item -mpreferred-stack-boundary=@var{num}
14026 @opindex mpreferred-stack-boundary
14027 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
14028 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
14029 the default is 4 (16 bytes or 128 bits).
14031 @strong{Warning:} When generating code for the x86-64 architecture with
14032 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
14033 used to keep the stack boundary aligned to 8 byte boundary.  Since
14034 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
14035 intended to be used in controlled environment where stack space is
14036 important limitation.  This option will lead to wrong code when functions
14037 compiled with 16 byte stack alignment (such as functions from a standard
14038 library) are called with misaligned stack.  In this case, SSE
14039 instructions may lead to misaligned memory access traps.  In addition,
14040 variable arguments will be handled incorrectly for 16 byte aligned
14041 objects (including x87 long double and __int128), leading to wrong
14042 results.  You must build all modules with
14043 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
14044 includes the system libraries and startup modules.
14046 @item -mincoming-stack-boundary=@var{num}
14047 @opindex mincoming-stack-boundary
14048 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
14049 boundary.  If @option{-mincoming-stack-boundary} is not specified,
14050 the one specified by @option{-mpreferred-stack-boundary} is used.
14052 On Pentium and Pentium Pro, @code{double} and @code{long double} values
14053 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
14054 suffer significant run time performance penalties.  On Pentium III, the
14055 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
14056 properly if it is not 16-byte aligned.
14058 To ensure proper alignment of this values on the stack, the stack boundary
14059 must be as aligned as that required by any value stored on the stack.
14060 Further, every function must be generated such that it keeps the stack
14061 aligned.  Thus calling a function compiled with a higher preferred
14062 stack boundary from a function compiled with a lower preferred stack
14063 boundary most likely misaligns the stack.  It is recommended that
14064 libraries that use callbacks always use the default setting.
14066 This extra alignment does consume extra stack space, and generally
14067 increases code size.  Code that is sensitive to stack space usage, such
14068 as embedded systems and operating system kernels, may want to reduce the
14069 preferred alignment to @option{-mpreferred-stack-boundary=2}.
14071 @item -mmmx
14072 @itemx -mno-mmx
14073 @itemx -msse
14074 @itemx -mno-sse
14075 @itemx -msse2
14076 @itemx -mno-sse2
14077 @itemx -msse3
14078 @itemx -mno-sse3
14079 @itemx -mssse3
14080 @itemx -mno-ssse3
14081 @itemx -msse4.1
14082 @need 800
14083 @itemx -mno-sse4.1
14084 @itemx -msse4.2
14085 @itemx -mno-sse4.2
14086 @itemx -msse4
14087 @itemx -mno-sse4
14088 @itemx -mavx
14089 @itemx -mno-avx
14090 @itemx -mavx2
14091 @itemx -mno-avx2
14092 @itemx -maes
14093 @itemx -mno-aes
14094 @itemx -mpclmul
14095 @need 800
14096 @itemx -mno-pclmul
14097 @itemx -mfsgsbase
14098 @itemx -mno-fsgsbase
14099 @itemx -mrdrnd
14100 @itemx -mno-rdrnd
14101 @itemx -mf16c
14102 @itemx -mno-f16c
14103 @itemx -mfma
14104 @itemx -mno-fma
14105 @itemx -msse4a
14106 @itemx -mno-sse4a
14107 @itemx -mfma4
14108 @need 800
14109 @itemx -mno-fma4
14110 @itemx -mxop
14111 @itemx -mno-xop
14112 @itemx -mlwp
14113 @itemx -mno-lwp
14114 @itemx -m3dnow
14115 @itemx -mno-3dnow
14116 @itemx -mpopcnt
14117 @itemx -mno-popcnt
14118 @itemx -mabm
14119 @itemx -mno-abm
14120 @itemx -mbmi
14121 @itemx -mbmi2
14122 @itemx -mno-bmi
14123 @itemx -mno-bmi2
14124 @itemx -mlzcnt
14125 @itemx -mno-lzcnt
14126 @itemx -mrtm
14127 @itemx -mtbm
14128 @itemx -mno-tbm
14129 @opindex mmmx
14130 @opindex mno-mmx
14131 @opindex msse
14132 @opindex mno-sse
14133 @opindex m3dnow
14134 @opindex mno-3dnow
14135 These switches enable or disable the use of instructions in the MMX, SSE,
14136 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, F16C,
14137 FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2, LZCNT, RTM or 3DNow!@:
14138 extended instruction sets.
14139 These extensions are also available as built-in functions: see
14140 @ref{X86 Built-in Functions}, for details of the functions enabled and
14141 disabled by these switches.
14143 To generate SSE/SSE2 instructions automatically from floating-point
14144 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
14146 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
14147 generates new AVX instructions or AVX equivalence for all SSEx instructions
14148 when needed.
14150 These options enable GCC to use these extended instructions in
14151 generated code, even without @option{-mfpmath=sse}.  Applications that
14152 perform run-time CPU detection must compile separate files for each
14153 supported architecture, using the appropriate flags.  In particular,
14154 the file containing the CPU detection code should be compiled without
14155 these options.
14157 @item -mcld
14158 @opindex mcld
14159 This option instructs GCC to emit a @code{cld} instruction in the prologue
14160 of functions that use string instructions.  String instructions depend on
14161 the DF flag to select between autoincrement or autodecrement mode.  While the
14162 ABI specifies the DF flag to be cleared on function entry, some operating
14163 systems violate this specification by not clearing the DF flag in their
14164 exception dispatchers.  The exception handler can be invoked with the DF flag
14165 set, which leads to wrong direction mode when string instructions are used.
14166 This option can be enabled by default on 32-bit x86 targets by configuring
14167 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
14168 instructions can be suppressed with the @option{-mno-cld} compiler option
14169 in this case.
14171 @item -mvzeroupper
14172 @opindex mvzeroupper
14173 This option instructs GCC to emit a @code{vzeroupper} instruction
14174 before a transfer of control flow out of the function to minimize
14175 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
14176 intrinsics.
14178 @item -mprefer-avx128
14179 @opindex mprefer-avx128
14180 This option instructs GCC to use 128-bit AVX instructions instead of
14181 256-bit AVX instructions in the auto-vectorizer.
14183 @item -mcx16
14184 @opindex mcx16
14185 This option enables GCC to generate @code{CMPXCHG16B} instructions.
14186 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
14187 (or oword) data types.  
14188 This is useful for high-resolution counters that can be updated
14189 by multiple processors (or cores).  This instruction is generated as part of
14190 atomic built-in functions: see @ref{__sync Builtins} or
14191 @ref{__atomic Builtins} for details.
14193 @item -msahf
14194 @opindex msahf
14195 This option enables generation of @code{SAHF} instructions in 64-bit code.
14196 Early Intel Pentium 4 CPUs with Intel 64 support,
14197 prior to the introduction of Pentium 4 G1 step in December 2005,
14198 lacked the @code{LAHF} and @code{SAHF} instructions
14199 which were supported by AMD64.
14200 These are load and store instructions, respectively, for certain status flags.
14201 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
14202 @code{drem}, and @code{remainder} built-in functions;
14203 see @ref{Other Builtins} for details.
14205 @item -mmovbe
14206 @opindex mmovbe
14207 This option enables use of the @code{movbe} instruction to implement
14208 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
14210 @item -mcrc32
14211 @opindex mcrc32
14212 This option enables built-in functions @code{__builtin_ia32_crc32qi},
14213 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
14214 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
14216 @item -mrecip
14217 @opindex mrecip
14218 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
14219 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
14220 with an additional Newton-Raphson step
14221 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
14222 (and their vectorized
14223 variants) for single-precision floating-point arguments.  These instructions
14224 are generated only when @option{-funsafe-math-optimizations} is enabled
14225 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
14226 Note that while the throughput of the sequence is higher than the throughput
14227 of the non-reciprocal instruction, the precision of the sequence can be
14228 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
14230 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
14231 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
14232 combination), and doesn't need @option{-mrecip}.
14234 Also note that GCC emits the above sequence with additional Newton-Raphson step
14235 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
14236 already with @option{-ffast-math} (or the above option combination), and
14237 doesn't need @option{-mrecip}.
14239 @item -mrecip=@var{opt}
14240 @opindex mrecip=opt
14241 This option controls which reciprocal estimate instructions
14242 may be used.  @var{opt} is a comma-separated list of options, which may
14243 be preceded by a @samp{!} to invert the option:
14245 @table @samp
14246 @item all
14247 Enable all estimate instructions.
14249 @item default
14250 Enable the default instructions, equivalent to @option{-mrecip}.
14252 @item none
14253 Disable all estimate instructions, equivalent to @option{-mno-recip}.
14255 @item div
14256 Enable the approximation for scalar division.
14258 @item vec-div
14259 Enable the approximation for vectorized division.
14261 @item sqrt
14262 Enable the approximation for scalar square root.
14264 @item vec-sqrt
14265 Enable the approximation for vectorized square root.
14266 @end table
14268 So, for example, @option{-mrecip=all,!sqrt} enables
14269 all of the reciprocal approximations, except for square root.
14271 @item -mveclibabi=@var{type}
14272 @opindex mveclibabi
14273 Specifies the ABI type to use for vectorizing intrinsics using an
14274 external library.  Supported values for @var{type} are @samp{svml} 
14275 for the Intel short
14276 vector math library and @samp{acml} for the AMD math core library.
14277 To use this option, both @option{-ftree-vectorize} and
14278 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
14279 ABI-compatible library must be specified at link time.
14281 GCC currently emits calls to @code{vmldExp2},
14282 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
14283 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
14284 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
14285 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
14286 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
14287 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
14288 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
14289 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
14290 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
14291 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
14292 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
14293 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
14294 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
14295 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
14296 when @option{-mveclibabi=acml} is used.  
14298 @item -mabi=@var{name}
14299 @opindex mabi
14300 Generate code for the specified calling convention.  Permissible values
14301 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
14302 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
14303 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
14304 You can control this behavior for a specific function by
14305 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
14306 @xref{Function Attributes}.
14308 @item -mtls-dialect=@var{type}
14309 @opindex mtls-dialect
14310 Generate code to access thread-local storage using the @samp{gnu} or
14311 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
14312 @samp{gnu2} is more efficient, but it may add compile- and run-time
14313 requirements that cannot be satisfied on all systems.
14315 @item -mpush-args
14316 @itemx -mno-push-args
14317 @opindex mpush-args
14318 @opindex mno-push-args
14319 Use PUSH operations to store outgoing parameters.  This method is shorter
14320 and usually equally fast as method using SUB/MOV operations and is enabled
14321 by default.  In some cases disabling it may improve performance because of
14322 improved scheduling and reduced dependencies.
14324 @item -maccumulate-outgoing-args
14325 @opindex maccumulate-outgoing-args
14326 If enabled, the maximum amount of space required for outgoing arguments is
14327 computed in the function prologue.  This is faster on most modern CPUs
14328 because of reduced dependencies, improved scheduling and reduced stack usage
14329 when the preferred stack boundary is not equal to 2.  The drawback is a notable
14330 increase in code size.  This switch implies @option{-mno-push-args}.
14332 @item -mthreads
14333 @opindex mthreads
14334 Support thread-safe exception handling on MinGW.  Programs that rely
14335 on thread-safe exception handling must compile and link all code with the
14336 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
14337 @code{-D_MT}; when linking, it links in a special thread helper library
14338 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
14340 @item -mno-align-stringops
14341 @opindex mno-align-stringops
14342 Do not align the destination of inlined string operations.  This switch reduces
14343 code size and improves performance in case the destination is already aligned,
14344 but GCC doesn't know about it.
14346 @item -minline-all-stringops
14347 @opindex minline-all-stringops
14348 By default GCC inlines string operations only when the destination is 
14349 known to be aligned to least a 4-byte boundary.  
14350 This enables more inlining and increases code
14351 size, but may improve performance of code that depends on fast
14352 @code{memcpy}, @code{strlen},
14353 and @code{memset} for short lengths.
14355 @item -minline-stringops-dynamically
14356 @opindex minline-stringops-dynamically
14357 For string operations of unknown size, use run-time checks with
14358 inline code for small blocks and a library call for large blocks.
14360 @item -mstringop-strategy=@var{alg}
14361 @opindex mstringop-strategy=@var{alg}
14362 Override the internal decision heuristic for the particular algorithm to use
14363 for inlining string operations.  The allowed values for @var{alg} are:
14365 @table @samp
14366 @item rep_byte
14367 @itemx rep_4byte
14368 @itemx rep_8byte
14369 Expand using i386 @code{rep} prefix of the specified size.
14371 @item byte_loop
14372 @itemx loop
14373 @itemx unrolled_loop
14374 Expand into an inline loop.
14376 @item libcall
14377 Always use a library call.
14378 @end table
14380 @item -momit-leaf-frame-pointer
14381 @opindex momit-leaf-frame-pointer
14382 Don't keep the frame pointer in a register for leaf functions.  This
14383 avoids the instructions to save, set up, and restore frame pointers and
14384 makes an extra register available in leaf functions.  The option
14385 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
14386 which might make debugging harder.
14388 @item -mtls-direct-seg-refs
14389 @itemx -mno-tls-direct-seg-refs
14390 @opindex mtls-direct-seg-refs
14391 Controls whether TLS variables may be accessed with offsets from the
14392 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
14393 or whether the thread base pointer must be added.  Whether or not this
14394 is valid depends on the operating system, and whether it maps the
14395 segment to cover the entire TLS area.
14397 For systems that use the GNU C Library, the default is on.
14399 @item -msse2avx
14400 @itemx -mno-sse2avx
14401 @opindex msse2avx
14402 Specify that the assembler should encode SSE instructions with VEX
14403 prefix.  The option @option{-mavx} turns this on by default.
14405 @item -mfentry
14406 @itemx -mno-fentry
14407 @opindex mfentry
14408 If profiling is active (@option{-pg}), put the profiling
14409 counter call before the prologue.
14410 Note: On x86 architectures the attribute @code{ms_hook_prologue}
14411 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
14413 @item -m8bit-idiv
14414 @itemx -mno-8bit-idiv
14415 @opindex 8bit-idiv
14416 On some processors, like Intel Atom, 8-bit unsigned integer divide is
14417 much faster than 32-bit/64-bit integer divide.  This option generates a
14418 run-time check.  If both dividend and divisor are within range of 0
14419 to 255, 8-bit unsigned integer divide is used instead of
14420 32-bit/64-bit integer divide.
14422 @item -mavx256-split-unaligned-load
14423 @itemx -mavx256-split-unaligned-store
14424 @opindex avx256-split-unaligned-load
14425 @opindex avx256-split-unaligned-store
14426 Split 32-byte AVX unaligned load and store.
14428 @end table
14430 These @samp{-m} switches are supported in addition to the above
14431 on x86-64 processors in 64-bit environments.
14433 @table @gcctabopt
14434 @item -m32
14435 @itemx -m64
14436 @itemx -mx32
14437 @opindex m32
14438 @opindex m64
14439 @opindex mx32
14440 Generate code for a 32-bit or 64-bit environment.
14441 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
14442 to 32 bits, and
14443 generates code that runs on any i386 system.
14445 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
14446 types to 64 bits, and generates code for the x86-64 architecture.
14447 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
14448 and @option{-mdynamic-no-pic} options.
14450 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
14451 to 32 bits, and
14452 generates code for the x86-64 architecture.
14454 @item -mno-red-zone
14455 @opindex mno-red-zone
14456 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
14457 by the x86-64 ABI; it is a 128-byte area beyond the location of the
14458 stack pointer that is not modified by signal or interrupt handlers
14459 and therefore can be used for temporary data without adjusting the stack
14460 pointer.  The flag @option{-mno-red-zone} disables this red zone.
14462 @item -mcmodel=small
14463 @opindex mcmodel=small
14464 Generate code for the small code model: the program and its symbols must
14465 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
14466 Programs can be statically or dynamically linked.  This is the default
14467 code model.
14469 @item -mcmodel=kernel
14470 @opindex mcmodel=kernel
14471 Generate code for the kernel code model.  The kernel runs in the
14472 negative 2 GB of the address space.
14473 This model has to be used for Linux kernel code.
14475 @item -mcmodel=medium
14476 @opindex mcmodel=medium
14477 Generate code for the medium model: the program is linked in the lower 2
14478 GB of the address space.  Small symbols are also placed there.  Symbols
14479 with sizes larger than @option{-mlarge-data-threshold} are put into
14480 large data or BSS sections and can be located above 2GB.  Programs can
14481 be statically or dynamically linked.
14483 @item -mcmodel=large
14484 @opindex mcmodel=large
14485 Generate code for the large model.  This model makes no assumptions
14486 about addresses and sizes of sections.
14488 @item -maddress-mode=long
14489 @opindex maddress-mode=long
14490 Generate code for long address mode.  This is only supported for 64-bit
14491 and x32 environments.  It is the default address mode for 64-bit
14492 environments.
14494 @item -maddress-mode=short
14495 @opindex maddress-mode=short
14496 Generate code for short address mode.  This is only supported for 32-bit
14497 and x32 environments.  It is the default address mode for 32-bit and
14498 x32 environments.
14499 @end table
14501 @node i386 and x86-64 Windows Options
14502 @subsection i386 and x86-64 Windows Options
14503 @cindex i386 and x86-64 Windows Options
14505 These additional options are available for Microsoft Windows targets:
14507 @table @gcctabopt
14508 @item -mconsole
14509 @opindex mconsole
14510 This option
14511 specifies that a console application is to be generated, by
14512 instructing the linker to set the PE header subsystem type
14513 required for console applications.
14514 This option is available for Cygwin and MinGW targets and is
14515 enabled by default on those targets.
14517 @item -mdll
14518 @opindex mdll
14519 This option is available for Cygwin and MinGW targets.  It
14520 specifies that a DLL---a dynamic link library---is to be
14521 generated, enabling the selection of the required runtime
14522 startup object and entry point.
14524 @item -mnop-fun-dllimport
14525 @opindex mnop-fun-dllimport
14526 This option is available for Cygwin and MinGW targets.  It
14527 specifies that the @code{dllimport} attribute should be ignored.
14529 @item -mthread
14530 @opindex mthread
14531 This option is available for MinGW targets. It specifies
14532 that MinGW-specific thread support is to be used.
14534 @item -municode
14535 @opindex municode
14536 This option is available for MinGW-w64 targets.  It causes
14537 the @code{UNICODE} preprocessor macro to be predefined, and
14538 chooses Unicode-capable runtime startup code.
14540 @item -mwin32
14541 @opindex mwin32
14542 This option is available for Cygwin and MinGW targets.  It
14543 specifies that the typical Microsoft Windows predefined macros are to
14544 be set in the pre-processor, but does not influence the choice
14545 of runtime library/startup code.
14547 @item -mwindows
14548 @opindex mwindows
14549 This option is available for Cygwin and MinGW targets.  It
14550 specifies that a GUI application is to be generated by
14551 instructing the linker to set the PE header subsystem type
14552 appropriately.
14554 @item -fno-set-stack-executable
14555 @opindex fno-set-stack-executable
14556 This option is available for MinGW targets. It specifies that
14557 the executable flag for the stack used by nested functions isn't
14558 set. This is necessary for binaries running in kernel mode of
14559 Microsoft Windows, as there the User32 API, which is used to set executable
14560 privileges, isn't available.
14562 @item -fwritable-relocated-rdata
14563 @opindex fno-writable-relocated-rdata
14564 This option is available for MinGW and Cygwin targets.  It specifies
14565 that relocated-data in read-only section is put into .data
14566 section.  This is a necessary for older runtimes not supporting
14567 modification of .rdata sections for pseudo-relocation.
14569 @item -mpe-aligned-commons
14570 @opindex mpe-aligned-commons
14571 This option is available for Cygwin and MinGW targets.  It
14572 specifies that the GNU extension to the PE file format that
14573 permits the correct alignment of COMMON variables should be
14574 used when generating code.  It is enabled by default if
14575 GCC detects that the target assembler found during configuration
14576 supports the feature.
14577 @end table
14579 See also under @ref{i386 and x86-64 Options} for standard options.
14581 @node IA-64 Options
14582 @subsection IA-64 Options
14583 @cindex IA-64 Options
14585 These are the @samp{-m} options defined for the Intel IA-64 architecture.
14587 @table @gcctabopt
14588 @item -mbig-endian
14589 @opindex mbig-endian
14590 Generate code for a big-endian target.  This is the default for HP-UX@.
14592 @item -mlittle-endian
14593 @opindex mlittle-endian
14594 Generate code for a little-endian target.  This is the default for AIX5
14595 and GNU/Linux.
14597 @item -mgnu-as
14598 @itemx -mno-gnu-as
14599 @opindex mgnu-as
14600 @opindex mno-gnu-as
14601 Generate (or don't) code for the GNU assembler.  This is the default.
14602 @c Also, this is the default if the configure option @option{--with-gnu-as}
14603 @c is used.
14605 @item -mgnu-ld
14606 @itemx -mno-gnu-ld
14607 @opindex mgnu-ld
14608 @opindex mno-gnu-ld
14609 Generate (or don't) code for the GNU linker.  This is the default.
14610 @c Also, this is the default if the configure option @option{--with-gnu-ld}
14611 @c is used.
14613 @item -mno-pic
14614 @opindex mno-pic
14615 Generate code that does not use a global pointer register.  The result
14616 is not position independent code, and violates the IA-64 ABI@.
14618 @item -mvolatile-asm-stop
14619 @itemx -mno-volatile-asm-stop
14620 @opindex mvolatile-asm-stop
14621 @opindex mno-volatile-asm-stop
14622 Generate (or don't) a stop bit immediately before and after volatile asm
14623 statements.
14625 @item -mregister-names
14626 @itemx -mno-register-names
14627 @opindex mregister-names
14628 @opindex mno-register-names
14629 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
14630 the stacked registers.  This may make assembler output more readable.
14632 @item -mno-sdata
14633 @itemx -msdata
14634 @opindex mno-sdata
14635 @opindex msdata
14636 Disable (or enable) optimizations that use the small data section.  This may
14637 be useful for working around optimizer bugs.
14639 @item -mconstant-gp
14640 @opindex mconstant-gp
14641 Generate code that uses a single constant global pointer value.  This is
14642 useful when compiling kernel code.
14644 @item -mauto-pic
14645 @opindex mauto-pic
14646 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
14647 This is useful when compiling firmware code.
14649 @item -minline-float-divide-min-latency
14650 @opindex minline-float-divide-min-latency
14651 Generate code for inline divides of floating-point values
14652 using the minimum latency algorithm.
14654 @item -minline-float-divide-max-throughput
14655 @opindex minline-float-divide-max-throughput
14656 Generate code for inline divides of floating-point values
14657 using the maximum throughput algorithm.
14659 @item -mno-inline-float-divide
14660 @opindex mno-inline-float-divide
14661 Do not generate inline code for divides of floating-point values.
14663 @item -minline-int-divide-min-latency
14664 @opindex minline-int-divide-min-latency
14665 Generate code for inline divides of integer values
14666 using the minimum latency algorithm.
14668 @item -minline-int-divide-max-throughput
14669 @opindex minline-int-divide-max-throughput
14670 Generate code for inline divides of integer values
14671 using the maximum throughput algorithm.
14673 @item -mno-inline-int-divide
14674 @opindex mno-inline-int-divide
14675 Do not generate inline code for divides of integer values.
14677 @item -minline-sqrt-min-latency
14678 @opindex minline-sqrt-min-latency
14679 Generate code for inline square roots
14680 using the minimum latency algorithm.
14682 @item -minline-sqrt-max-throughput
14683 @opindex minline-sqrt-max-throughput
14684 Generate code for inline square roots
14685 using the maximum throughput algorithm.
14687 @item -mno-inline-sqrt
14688 @opindex mno-inline-sqrt
14689 Do not generate inline code for @code{sqrt}.
14691 @item -mfused-madd
14692 @itemx -mno-fused-madd
14693 @opindex mfused-madd
14694 @opindex mno-fused-madd
14695 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
14696 instructions.  The default is to use these instructions.
14698 @item -mno-dwarf2-asm
14699 @itemx -mdwarf2-asm
14700 @opindex mno-dwarf2-asm
14701 @opindex mdwarf2-asm
14702 Don't (or do) generate assembler code for the DWARF 2 line number debugging
14703 info.  This may be useful when not using the GNU assembler.
14705 @item -mearly-stop-bits
14706 @itemx -mno-early-stop-bits
14707 @opindex mearly-stop-bits
14708 @opindex mno-early-stop-bits
14709 Allow stop bits to be placed earlier than immediately preceding the
14710 instruction that triggered the stop bit.  This can improve instruction
14711 scheduling, but does not always do so.
14713 @item -mfixed-range=@var{register-range}
14714 @opindex mfixed-range
14715 Generate code treating the given register range as fixed registers.
14716 A fixed register is one that the register allocator cannot use.  This is
14717 useful when compiling kernel code.  A register range is specified as
14718 two registers separated by a dash.  Multiple register ranges can be
14719 specified separated by a comma.
14721 @item -mtls-size=@var{tls-size}
14722 @opindex mtls-size
14723 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
14726 @item -mtune=@var{cpu-type}
14727 @opindex mtune
14728 Tune the instruction scheduling for a particular CPU, Valid values are
14729 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
14730 and @samp{mckinley}.
14732 @item -milp32
14733 @itemx -mlp64
14734 @opindex milp32
14735 @opindex mlp64
14736 Generate code for a 32-bit or 64-bit environment.
14737 The 32-bit environment sets int, long and pointer to 32 bits.
14738 The 64-bit environment sets int to 32 bits and long and pointer
14739 to 64 bits.  These are HP-UX specific flags.
14741 @item -mno-sched-br-data-spec
14742 @itemx -msched-br-data-spec
14743 @opindex mno-sched-br-data-spec
14744 @opindex msched-br-data-spec
14745 (Dis/En)able data speculative scheduling before reload.
14746 This results in generation of @code{ld.a} instructions and
14747 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14748 The default is 'disable'.
14750 @item -msched-ar-data-spec
14751 @itemx -mno-sched-ar-data-spec
14752 @opindex msched-ar-data-spec
14753 @opindex mno-sched-ar-data-spec
14754 (En/Dis)able data speculative scheduling after reload.
14755 This results in generation of @code{ld.a} instructions and
14756 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14757 The default is 'enable'.
14759 @item -mno-sched-control-spec
14760 @itemx -msched-control-spec
14761 @opindex mno-sched-control-spec
14762 @opindex msched-control-spec
14763 (Dis/En)able control speculative scheduling.  This feature is
14764 available only during region scheduling (i.e.@: before reload).
14765 This results in generation of the @code{ld.s} instructions and
14766 the corresponding check instructions @code{chk.s}.
14767 The default is 'disable'.
14769 @item -msched-br-in-data-spec
14770 @itemx -mno-sched-br-in-data-spec
14771 @opindex msched-br-in-data-spec
14772 @opindex mno-sched-br-in-data-spec
14773 (En/Dis)able speculative scheduling of the instructions that
14774 are dependent on the data speculative loads before reload.
14775 This is effective only with @option{-msched-br-data-spec} enabled.
14776 The default is 'enable'.
14778 @item -msched-ar-in-data-spec
14779 @itemx -mno-sched-ar-in-data-spec
14780 @opindex msched-ar-in-data-spec
14781 @opindex mno-sched-ar-in-data-spec
14782 (En/Dis)able speculative scheduling of the instructions that
14783 are dependent on the data speculative loads after reload.
14784 This is effective only with @option{-msched-ar-data-spec} enabled.
14785 The default is 'enable'.
14787 @item -msched-in-control-spec
14788 @itemx -mno-sched-in-control-spec
14789 @opindex msched-in-control-spec
14790 @opindex mno-sched-in-control-spec
14791 (En/Dis)able speculative scheduling of the instructions that
14792 are dependent on the control speculative loads.
14793 This is effective only with @option{-msched-control-spec} enabled.
14794 The default is 'enable'.
14796 @item -mno-sched-prefer-non-data-spec-insns
14797 @itemx -msched-prefer-non-data-spec-insns
14798 @opindex mno-sched-prefer-non-data-spec-insns
14799 @opindex msched-prefer-non-data-spec-insns
14800 If enabled, data-speculative instructions are chosen for schedule
14801 only if there are no other choices at the moment.  This makes
14802 the use of the data speculation much more conservative.
14803 The default is 'disable'.
14805 @item -mno-sched-prefer-non-control-spec-insns
14806 @itemx -msched-prefer-non-control-spec-insns
14807 @opindex mno-sched-prefer-non-control-spec-insns
14808 @opindex msched-prefer-non-control-spec-insns
14809 If enabled, control-speculative instructions are chosen for schedule
14810 only if there are no other choices at the moment.  This makes
14811 the use of the control speculation much more conservative.
14812 The default is 'disable'.
14814 @item -mno-sched-count-spec-in-critical-path
14815 @itemx -msched-count-spec-in-critical-path
14816 @opindex mno-sched-count-spec-in-critical-path
14817 @opindex msched-count-spec-in-critical-path
14818 If enabled, speculative dependencies are considered during
14819 computation of the instructions priorities.  This makes the use of the
14820 speculation a bit more conservative.
14821 The default is 'disable'.
14823 @item -msched-spec-ldc
14824 @opindex msched-spec-ldc
14825 Use a simple data speculation check.  This option is on by default.
14827 @item -msched-control-spec-ldc
14828 @opindex msched-spec-ldc
14829 Use a simple check for control speculation.  This option is on by default.
14831 @item -msched-stop-bits-after-every-cycle
14832 @opindex msched-stop-bits-after-every-cycle
14833 Place a stop bit after every cycle when scheduling.  This option is on
14834 by default.
14836 @item -msched-fp-mem-deps-zero-cost
14837 @opindex msched-fp-mem-deps-zero-cost
14838 Assume that floating-point stores and loads are not likely to cause a conflict
14839 when placed into the same instruction group.  This option is disabled by
14840 default.
14842 @item -msel-sched-dont-check-control-spec
14843 @opindex msel-sched-dont-check-control-spec
14844 Generate checks for control speculation in selective scheduling.
14845 This flag is disabled by default.
14847 @item -msched-max-memory-insns=@var{max-insns}
14848 @opindex msched-max-memory-insns
14849 Limit on the number of memory insns per instruction group, giving lower
14850 priority to subsequent memory insns attempting to schedule in the same
14851 instruction group. Frequently useful to prevent cache bank conflicts.
14852 The default value is 1.
14854 @item -msched-max-memory-insns-hard-limit
14855 @opindex msched-max-memory-insns-hard-limit
14856 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
14857 disallowing more than that number in an instruction group.
14858 Otherwise, the limit is ``soft'', meaning that non-memory operations
14859 are preferred when the limit is reached, but memory operations may still
14860 be scheduled.
14862 @end table
14864 @node LM32 Options
14865 @subsection LM32 Options
14866 @cindex LM32 options
14868 These @option{-m} options are defined for the LatticeMico32 architecture:
14870 @table @gcctabopt
14871 @item -mbarrel-shift-enabled
14872 @opindex mbarrel-shift-enabled
14873 Enable barrel-shift instructions.
14875 @item -mdivide-enabled
14876 @opindex mdivide-enabled
14877 Enable divide and modulus instructions.
14879 @item -mmultiply-enabled
14880 @opindex multiply-enabled
14881 Enable multiply instructions.
14883 @item -msign-extend-enabled
14884 @opindex msign-extend-enabled
14885 Enable sign extend instructions.
14887 @item -muser-enabled
14888 @opindex muser-enabled
14889 Enable user-defined instructions.
14891 @end table
14893 @node M32C Options
14894 @subsection M32C Options
14895 @cindex M32C options
14897 @table @gcctabopt
14898 @item -mcpu=@var{name}
14899 @opindex mcpu=
14900 Select the CPU for which code is generated.  @var{name} may be one of
14901 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
14902 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
14903 the M32C/80 series.
14905 @item -msim
14906 @opindex msim
14907 Specifies that the program will be run on the simulator.  This causes
14908 an alternate runtime library to be linked in which supports, for
14909 example, file I/O@.  You must not use this option when generating
14910 programs that will run on real hardware; you must provide your own
14911 runtime library for whatever I/O functions are needed.
14913 @item -memregs=@var{number}
14914 @opindex memregs=
14915 Specifies the number of memory-based pseudo-registers GCC uses
14916 during code generation.  These pseudo-registers are used like real
14917 registers, so there is a tradeoff between GCC's ability to fit the
14918 code into available registers, and the performance penalty of using
14919 memory instead of registers.  Note that all modules in a program must
14920 be compiled with the same value for this option.  Because of that, you
14921 must not use this option with GCC's default runtime libraries.
14923 @end table
14925 @node M32R/D Options
14926 @subsection M32R/D Options
14927 @cindex M32R/D options
14929 These @option{-m} options are defined for Renesas M32R/D architectures:
14931 @table @gcctabopt
14932 @item -m32r2
14933 @opindex m32r2
14934 Generate code for the M32R/2@.
14936 @item -m32rx
14937 @opindex m32rx
14938 Generate code for the M32R/X@.
14940 @item -m32r
14941 @opindex m32r
14942 Generate code for the M32R@.  This is the default.
14944 @item -mmodel=small
14945 @opindex mmodel=small
14946 Assume all objects live in the lower 16MB of memory (so that their addresses
14947 can be loaded with the @code{ld24} instruction), and assume all subroutines
14948 are reachable with the @code{bl} instruction.
14949 This is the default.
14951 The addressability of a particular object can be set with the
14952 @code{model} attribute.
14954 @item -mmodel=medium
14955 @opindex mmodel=medium
14956 Assume objects may be anywhere in the 32-bit address space (the compiler
14957 generates @code{seth/add3} instructions to load their addresses), and
14958 assume all subroutines are reachable with the @code{bl} instruction.
14960 @item -mmodel=large
14961 @opindex mmodel=large
14962 Assume objects may be anywhere in the 32-bit address space (the compiler
14963 generates @code{seth/add3} instructions to load their addresses), and
14964 assume subroutines may not be reachable with the @code{bl} instruction
14965 (the compiler generates the much slower @code{seth/add3/jl}
14966 instruction sequence).
14968 @item -msdata=none
14969 @opindex msdata=none
14970 Disable use of the small data area.  Variables are put into
14971 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
14972 @code{section} attribute has been specified).
14973 This is the default.
14975 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
14976 Objects may be explicitly put in the small data area with the
14977 @code{section} attribute using one of these sections.
14979 @item -msdata=sdata
14980 @opindex msdata=sdata
14981 Put small global and static data in the small data area, but do not
14982 generate special code to reference them.
14984 @item -msdata=use
14985 @opindex msdata=use
14986 Put small global and static data in the small data area, and generate
14987 special instructions to reference them.
14989 @item -G @var{num}
14990 @opindex G
14991 @cindex smaller data references
14992 Put global and static objects less than or equal to @var{num} bytes
14993 into the small data or BSS sections instead of the normal data or BSS
14994 sections.  The default value of @var{num} is 8.
14995 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
14996 for this option to have any effect.
14998 All modules should be compiled with the same @option{-G @var{num}} value.
14999 Compiling with different values of @var{num} may or may not work; if it
15000 doesn't the linker gives an error message---incorrect code is not
15001 generated.
15003 @item -mdebug
15004 @opindex mdebug
15005 Makes the M32R-specific code in the compiler display some statistics
15006 that might help in debugging programs.
15008 @item -malign-loops
15009 @opindex malign-loops
15010 Align all loops to a 32-byte boundary.
15012 @item -mno-align-loops
15013 @opindex mno-align-loops
15014 Do not enforce a 32-byte alignment for loops.  This is the default.
15016 @item -missue-rate=@var{number}
15017 @opindex missue-rate=@var{number}
15018 Issue @var{number} instructions per cycle.  @var{number} can only be 1
15019 or 2.
15021 @item -mbranch-cost=@var{number}
15022 @opindex mbranch-cost=@var{number}
15023 @var{number} can only be 1 or 2.  If it is 1 then branches are
15024 preferred over conditional code, if it is 2, then the opposite applies.
15026 @item -mflush-trap=@var{number}
15027 @opindex mflush-trap=@var{number}
15028 Specifies the trap number to use to flush the cache.  The default is
15029 12.  Valid numbers are between 0 and 15 inclusive.
15031 @item -mno-flush-trap
15032 @opindex mno-flush-trap
15033 Specifies that the cache cannot be flushed by using a trap.
15035 @item -mflush-func=@var{name}
15036 @opindex mflush-func=@var{name}
15037 Specifies the name of the operating system function to call to flush
15038 the cache.  The default is @emph{_flush_cache}, but a function call
15039 is only used if a trap is not available.
15041 @item -mno-flush-func
15042 @opindex mno-flush-func
15043 Indicates that there is no OS function for flushing the cache.
15045 @end table
15047 @node M680x0 Options
15048 @subsection M680x0 Options
15049 @cindex M680x0 options
15051 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
15052 The default settings depend on which architecture was selected when
15053 the compiler was configured; the defaults for the most common choices
15054 are given below.
15056 @table @gcctabopt
15057 @item -march=@var{arch}
15058 @opindex march
15059 Generate code for a specific M680x0 or ColdFire instruction set
15060 architecture.  Permissible values of @var{arch} for M680x0
15061 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
15062 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
15063 architectures are selected according to Freescale's ISA classification
15064 and the permissible values are: @samp{isaa}, @samp{isaaplus},
15065 @samp{isab} and @samp{isac}.
15067 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
15068 code for a ColdFire target.  The @var{arch} in this macro is one of the
15069 @option{-march} arguments given above.
15071 When used together, @option{-march} and @option{-mtune} select code
15072 that runs on a family of similar processors but that is optimized
15073 for a particular microarchitecture.
15075 @item -mcpu=@var{cpu}
15076 @opindex mcpu
15077 Generate code for a specific M680x0 or ColdFire processor.
15078 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
15079 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
15080 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
15081 below, which also classifies the CPUs into families:
15083 @multitable @columnfractions 0.20 0.80
15084 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
15085 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51ag} @samp{51cn} @samp{51em} @samp{51je} @samp{51jf} @samp{51jg} @samp{51jm} @samp{51mm} @samp{51qe} @samp{51qm}
15086 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
15087 @item @samp{5206e} @tab @samp{5206e}
15088 @item @samp{5208} @tab @samp{5207} @samp{5208}
15089 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
15090 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
15091 @item @samp{5216} @tab @samp{5214} @samp{5216}
15092 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
15093 @item @samp{5225} @tab @samp{5224} @samp{5225}
15094 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
15095 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
15096 @item @samp{5249} @tab @samp{5249}
15097 @item @samp{5250} @tab @samp{5250}
15098 @item @samp{5271} @tab @samp{5270} @samp{5271}
15099 @item @samp{5272} @tab @samp{5272}
15100 @item @samp{5275} @tab @samp{5274} @samp{5275}
15101 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
15102 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
15103 @item @samp{5307} @tab @samp{5307}
15104 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
15105 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
15106 @item @samp{5407} @tab @samp{5407}
15107 @item @samp{5475} @tab @samp{5470} @samp{5471} @samp{5472} @samp{5473} @samp{5474} @samp{5475} @samp{547x} @samp{5480} @samp{5481} @samp{5482} @samp{5483} @samp{5484} @samp{5485}
15108 @end multitable
15110 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
15111 @var{arch} is compatible with @var{cpu}.  Other combinations of
15112 @option{-mcpu} and @option{-march} are rejected.
15114 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
15115 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
15116 where the value of @var{family} is given by the table above.
15118 @item -mtune=@var{tune}
15119 @opindex mtune
15120 Tune the code for a particular microarchitecture within the
15121 constraints set by @option{-march} and @option{-mcpu}.
15122 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
15123 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
15124 and @samp{cpu32}.  The ColdFire microarchitectures
15125 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
15127 You can also use @option{-mtune=68020-40} for code that needs
15128 to run relatively well on 68020, 68030 and 68040 targets.
15129 @option{-mtune=68020-60} is similar but includes 68060 targets
15130 as well.  These two options select the same tuning decisions as
15131 @option{-m68020-40} and @option{-m68020-60} respectively.
15133 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
15134 when tuning for 680x0 architecture @var{arch}.  It also defines
15135 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
15136 option is used.  If GCC is tuning for a range of architectures,
15137 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
15138 it defines the macros for every architecture in the range.
15140 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
15141 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
15142 of the arguments given above.
15144 @item -m68000
15145 @itemx -mc68000
15146 @opindex m68000
15147 @opindex mc68000
15148 Generate output for a 68000.  This is the default
15149 when the compiler is configured for 68000-based systems.
15150 It is equivalent to @option{-march=68000}.
15152 Use this option for microcontrollers with a 68000 or EC000 core,
15153 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
15155 @item -m68010
15156 @opindex m68010
15157 Generate output for a 68010.  This is the default
15158 when the compiler is configured for 68010-based systems.
15159 It is equivalent to @option{-march=68010}.
15161 @item -m68020
15162 @itemx -mc68020
15163 @opindex m68020
15164 @opindex mc68020
15165 Generate output for a 68020.  This is the default
15166 when the compiler is configured for 68020-based systems.
15167 It is equivalent to @option{-march=68020}.
15169 @item -m68030
15170 @opindex m68030
15171 Generate output for a 68030.  This is the default when the compiler is
15172 configured for 68030-based systems.  It is equivalent to
15173 @option{-march=68030}.
15175 @item -m68040
15176 @opindex m68040
15177 Generate output for a 68040.  This is the default when the compiler is
15178 configured for 68040-based systems.  It is equivalent to
15179 @option{-march=68040}.
15181 This option inhibits the use of 68881/68882 instructions that have to be
15182 emulated by software on the 68040.  Use this option if your 68040 does not
15183 have code to emulate those instructions.
15185 @item -m68060
15186 @opindex m68060
15187 Generate output for a 68060.  This is the default when the compiler is
15188 configured for 68060-based systems.  It is equivalent to
15189 @option{-march=68060}.
15191 This option inhibits the use of 68020 and 68881/68882 instructions that
15192 have to be emulated by software on the 68060.  Use this option if your 68060
15193 does not have code to emulate those instructions.
15195 @item -mcpu32
15196 @opindex mcpu32
15197 Generate output for a CPU32.  This is the default
15198 when the compiler is configured for CPU32-based systems.
15199 It is equivalent to @option{-march=cpu32}.
15201 Use this option for microcontrollers with a
15202 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
15203 68336, 68340, 68341, 68349 and 68360.
15205 @item -m5200
15206 @opindex m5200
15207 Generate output for a 520X ColdFire CPU@.  This is the default
15208 when the compiler is configured for 520X-based systems.
15209 It is equivalent to @option{-mcpu=5206}, and is now deprecated
15210 in favor of that option.
15212 Use this option for microcontroller with a 5200 core, including
15213 the MCF5202, MCF5203, MCF5204 and MCF5206.
15215 @item -m5206e
15216 @opindex m5206e
15217 Generate output for a 5206e ColdFire CPU@.  The option is now
15218 deprecated in favor of the equivalent @option{-mcpu=5206e}.
15220 @item -m528x
15221 @opindex m528x
15222 Generate output for a member of the ColdFire 528X family.
15223 The option is now deprecated in favor of the equivalent
15224 @option{-mcpu=528x}.
15226 @item -m5307
15227 @opindex m5307
15228 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
15229 in favor of the equivalent @option{-mcpu=5307}.
15231 @item -m5407
15232 @opindex m5407
15233 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
15234 in favor of the equivalent @option{-mcpu=5407}.
15236 @item -mcfv4e
15237 @opindex mcfv4e
15238 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
15239 This includes use of hardware floating-point instructions.
15240 The option is equivalent to @option{-mcpu=547x}, and is now
15241 deprecated in favor of that option.
15243 @item -m68020-40
15244 @opindex m68020-40
15245 Generate output for a 68040, without using any of the new instructions.
15246 This results in code that can run relatively efficiently on either a
15247 68020/68881 or a 68030 or a 68040.  The generated code does use the
15248 68881 instructions that are emulated on the 68040.
15250 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
15252 @item -m68020-60
15253 @opindex m68020-60
15254 Generate output for a 68060, without using any of the new instructions.
15255 This results in code that can run relatively efficiently on either a
15256 68020/68881 or a 68030 or a 68040.  The generated code does use the
15257 68881 instructions that are emulated on the 68060.
15259 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
15261 @item -mhard-float
15262 @itemx -m68881
15263 @opindex mhard-float
15264 @opindex m68881
15265 Generate floating-point instructions.  This is the default for 68020
15266 and above, and for ColdFire devices that have an FPU@.  It defines the
15267 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
15268 on ColdFire targets.
15270 @item -msoft-float
15271 @opindex msoft-float
15272 Do not generate floating-point instructions; use library calls instead.
15273 This is the default for 68000, 68010, and 68832 targets.  It is also
15274 the default for ColdFire devices that have no FPU.
15276 @item -mdiv
15277 @itemx -mno-div
15278 @opindex mdiv
15279 @opindex mno-div
15280 Generate (do not generate) ColdFire hardware divide and remainder
15281 instructions.  If @option{-march} is used without @option{-mcpu},
15282 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
15283 architectures.  Otherwise, the default is taken from the target CPU
15284 (either the default CPU, or the one specified by @option{-mcpu}).  For
15285 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
15286 @option{-mcpu=5206e}.
15288 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
15290 @item -mshort
15291 @opindex mshort
15292 Consider type @code{int} to be 16 bits wide, like @code{short int}.
15293 Additionally, parameters passed on the stack are also aligned to a
15294 16-bit boundary even on targets whose API mandates promotion to 32-bit.
15296 @item -mno-short
15297 @opindex mno-short
15298 Do not consider type @code{int} to be 16 bits wide.  This is the default.
15300 @item -mnobitfield
15301 @itemx -mno-bitfield
15302 @opindex mnobitfield
15303 @opindex mno-bitfield
15304 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
15305 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
15307 @item -mbitfield
15308 @opindex mbitfield
15309 Do use the bit-field instructions.  The @option{-m68020} option implies
15310 @option{-mbitfield}.  This is the default if you use a configuration
15311 designed for a 68020.
15313 @item -mrtd
15314 @opindex mrtd
15315 Use a different function-calling convention, in which functions
15316 that take a fixed number of arguments return with the @code{rtd}
15317 instruction, which pops their arguments while returning.  This
15318 saves one instruction in the caller since there is no need to pop
15319 the arguments there.
15321 This calling convention is incompatible with the one normally
15322 used on Unix, so you cannot use it if you need to call libraries
15323 compiled with the Unix compiler.
15325 Also, you must provide function prototypes for all functions that
15326 take variable numbers of arguments (including @code{printf});
15327 otherwise incorrect code is generated for calls to those
15328 functions.
15330 In addition, seriously incorrect code results if you call a
15331 function with too many arguments.  (Normally, extra arguments are
15332 harmlessly ignored.)
15334 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
15335 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
15337 @item -mno-rtd
15338 @opindex mno-rtd
15339 Do not use the calling conventions selected by @option{-mrtd}.
15340 This is the default.
15342 @item -malign-int
15343 @itemx -mno-align-int
15344 @opindex malign-int
15345 @opindex mno-align-int
15346 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
15347 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
15348 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
15349 Aligning variables on 32-bit boundaries produces code that runs somewhat
15350 faster on processors with 32-bit busses at the expense of more memory.
15352 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
15353 aligns structures containing the above types differently than
15354 most published application binary interface specifications for the m68k.
15356 @item -mpcrel
15357 @opindex mpcrel
15358 Use the pc-relative addressing mode of the 68000 directly, instead of
15359 using a global offset table.  At present, this option implies @option{-fpic},
15360 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
15361 not presently supported with @option{-mpcrel}, though this could be supported for
15362 68020 and higher processors.
15364 @item -mno-strict-align
15365 @itemx -mstrict-align
15366 @opindex mno-strict-align
15367 @opindex mstrict-align
15368 Do not (do) assume that unaligned memory references are handled by
15369 the system.
15371 @item -msep-data
15372 Generate code that allows the data segment to be located in a different
15373 area of memory from the text segment.  This allows for execute-in-place in
15374 an environment without virtual memory management.  This option implies
15375 @option{-fPIC}.
15377 @item -mno-sep-data
15378 Generate code that assumes that the data segment follows the text segment.
15379 This is the default.
15381 @item -mid-shared-library
15382 Generate code that supports shared libraries via the library ID method.
15383 This allows for execute-in-place and shared libraries in an environment
15384 without virtual memory management.  This option implies @option{-fPIC}.
15386 @item -mno-id-shared-library
15387 Generate code that doesn't assume ID-based shared libraries are being used.
15388 This is the default.
15390 @item -mshared-library-id=n
15391 Specifies the identification number of the ID-based shared library being
15392 compiled.  Specifying a value of 0 generates more compact code; specifying
15393 other values forces the allocation of that number to the current
15394 library, but is no more space- or time-efficient than omitting this option.
15396 @item -mxgot
15397 @itemx -mno-xgot
15398 @opindex mxgot
15399 @opindex mno-xgot
15400 When generating position-independent code for ColdFire, generate code
15401 that works if the GOT has more than 8192 entries.  This code is
15402 larger and slower than code generated without this option.  On M680x0
15403 processors, this option is not needed; @option{-fPIC} suffices.
15405 GCC normally uses a single instruction to load values from the GOT@.
15406 While this is relatively efficient, it only works if the GOT
15407 is smaller than about 64k.  Anything larger causes the linker
15408 to report an error such as:
15410 @cindex relocation truncated to fit (ColdFire)
15411 @smallexample
15412 relocation truncated to fit: R_68K_GOT16O foobar
15413 @end smallexample
15415 If this happens, you should recompile your code with @option{-mxgot}.
15416 It should then work with very large GOTs.  However, code generated with
15417 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
15418 the value of a global symbol.
15420 Note that some linkers, including newer versions of the GNU linker,
15421 can create multiple GOTs and sort GOT entries.  If you have such a linker,
15422 you should only need to use @option{-mxgot} when compiling a single
15423 object file that accesses more than 8192 GOT entries.  Very few do.
15425 These options have no effect unless GCC is generating
15426 position-independent code.
15428 @end table
15430 @node MCore Options
15431 @subsection MCore Options
15432 @cindex MCore options
15434 These are the @samp{-m} options defined for the Motorola M*Core
15435 processors.
15437 @table @gcctabopt
15439 @item -mhardlit
15440 @itemx -mno-hardlit
15441 @opindex mhardlit
15442 @opindex mno-hardlit
15443 Inline constants into the code stream if it can be done in two
15444 instructions or less.
15446 @item -mdiv
15447 @itemx -mno-div
15448 @opindex mdiv
15449 @opindex mno-div
15450 Use the divide instruction.  (Enabled by default).
15452 @item -mrelax-immediate
15453 @itemx -mno-relax-immediate
15454 @opindex mrelax-immediate
15455 @opindex mno-relax-immediate
15456 Allow arbitrary-sized immediates in bit operations.
15458 @item -mwide-bitfields
15459 @itemx -mno-wide-bitfields
15460 @opindex mwide-bitfields
15461 @opindex mno-wide-bitfields
15462 Always treat bit-fields as @code{int}-sized.
15464 @item -m4byte-functions
15465 @itemx -mno-4byte-functions
15466 @opindex m4byte-functions
15467 @opindex mno-4byte-functions
15468 Force all functions to be aligned to a 4-byte boundary.
15470 @item -mcallgraph-data
15471 @itemx -mno-callgraph-data
15472 @opindex mcallgraph-data
15473 @opindex mno-callgraph-data
15474 Emit callgraph information.
15476 @item -mslow-bytes
15477 @itemx -mno-slow-bytes
15478 @opindex mslow-bytes
15479 @opindex mno-slow-bytes
15480 Prefer word access when reading byte quantities.
15482 @item -mlittle-endian
15483 @itemx -mbig-endian
15484 @opindex mlittle-endian
15485 @opindex mbig-endian
15486 Generate code for a little-endian target.
15488 @item -m210
15489 @itemx -m340
15490 @opindex m210
15491 @opindex m340
15492 Generate code for the 210 processor.
15494 @item -mno-lsim
15495 @opindex mno-lsim
15496 Assume that runtime support has been provided and so omit the
15497 simulator library (@file{libsim.a)} from the linker command line.
15499 @item -mstack-increment=@var{size}
15500 @opindex mstack-increment
15501 Set the maximum amount for a single stack increment operation.  Large
15502 values can increase the speed of programs that contain functions
15503 that need a large amount of stack space, but they can also trigger a
15504 segmentation fault if the stack is extended too much.  The default
15505 value is 0x1000.
15507 @end table
15509 @node MeP Options
15510 @subsection MeP Options
15511 @cindex MeP options
15513 @table @gcctabopt
15515 @item -mabsdiff
15516 @opindex mabsdiff
15517 Enables the @code{abs} instruction, which is the absolute difference
15518 between two registers.
15520 @item -mall-opts
15521 @opindex mall-opts
15522 Enables all the optional instructions---average, multiply, divide, bit
15523 operations, leading zero, absolute difference, min/max, clip, and
15524 saturation.
15527 @item -maverage
15528 @opindex maverage
15529 Enables the @code{ave} instruction, which computes the average of two
15530 registers.
15532 @item -mbased=@var{n}
15533 @opindex mbased=
15534 Variables of size @var{n} bytes or smaller are placed in the
15535 @code{.based} section by default.  Based variables use the @code{$tp}
15536 register as a base register, and there is a 128-byte limit to the
15537 @code{.based} section.
15539 @item -mbitops
15540 @opindex mbitops
15541 Enables the bit operation instructions---bit test (@code{btstm}), set
15542 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
15543 test-and-set (@code{tas}).
15545 @item -mc=@var{name}
15546 @opindex mc=
15547 Selects which section constant data is placed in.  @var{name} may
15548 be @code{tiny}, @code{near}, or @code{far}.
15550 @item -mclip
15551 @opindex mclip
15552 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
15553 useful unless you also provide @code{-mminmax}.
15555 @item -mconfig=@var{name}
15556 @opindex mconfig=
15557 Selects one of the built-in core configurations.  Each MeP chip has
15558 one or more modules in it; each module has a core CPU and a variety of
15559 coprocessors, optional instructions, and peripherals.  The
15560 @code{MeP-Integrator} tool, not part of GCC, provides these
15561 configurations through this option; using this option is the same as
15562 using all the corresponding command-line options.  The default
15563 configuration is @code{default}.
15565 @item -mcop
15566 @opindex mcop
15567 Enables the coprocessor instructions.  By default, this is a 32-bit
15568 coprocessor.  Note that the coprocessor is normally enabled via the
15569 @code{-mconfig=} option.
15571 @item -mcop32
15572 @opindex mcop32
15573 Enables the 32-bit coprocessor's instructions.
15575 @item -mcop64
15576 @opindex mcop64
15577 Enables the 64-bit coprocessor's instructions.
15579 @item -mivc2
15580 @opindex mivc2
15581 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
15583 @item -mdc
15584 @opindex mdc
15585 Causes constant variables to be placed in the @code{.near} section.
15587 @item -mdiv
15588 @opindex mdiv
15589 Enables the @code{div} and @code{divu} instructions.
15591 @item -meb
15592 @opindex meb
15593 Generate big-endian code.
15595 @item -mel
15596 @opindex mel
15597 Generate little-endian code.
15599 @item -mio-volatile
15600 @opindex mio-volatile
15601 Tells the compiler that any variable marked with the @code{io}
15602 attribute is to be considered volatile.
15604 @item -ml
15605 @opindex ml
15606 Causes variables to be assigned to the @code{.far} section by default.
15608 @item -mleadz
15609 @opindex mleadz
15610 Enables the @code{leadz} (leading zero) instruction.
15612 @item -mm
15613 @opindex mm
15614 Causes variables to be assigned to the @code{.near} section by default.
15616 @item -mminmax
15617 @opindex mminmax
15618 Enables the @code{min} and @code{max} instructions.
15620 @item -mmult
15621 @opindex mmult
15622 Enables the multiplication and multiply-accumulate instructions.
15624 @item -mno-opts
15625 @opindex mno-opts
15626 Disables all the optional instructions enabled by @code{-mall-opts}.
15628 @item -mrepeat
15629 @opindex mrepeat
15630 Enables the @code{repeat} and @code{erepeat} instructions, used for
15631 low-overhead looping.
15633 @item -ms
15634 @opindex ms
15635 Causes all variables to default to the @code{.tiny} section.  Note
15636 that there is a 65536-byte limit to this section.  Accesses to these
15637 variables use the @code{%gp} base register.
15639 @item -msatur
15640 @opindex msatur
15641 Enables the saturation instructions.  Note that the compiler does not
15642 currently generate these itself, but this option is included for
15643 compatibility with other tools, like @code{as}.
15645 @item -msdram
15646 @opindex msdram
15647 Link the SDRAM-based runtime instead of the default ROM-based runtime.
15649 @item -msim
15650 @opindex msim
15651 Link the simulator runtime libraries.
15653 @item -msimnovec
15654 @opindex msimnovec
15655 Link the simulator runtime libraries, excluding built-in support
15656 for reset and exception vectors and tables.
15658 @item -mtf
15659 @opindex mtf
15660 Causes all functions to default to the @code{.far} section.  Without
15661 this option, functions default to the @code{.near} section.
15663 @item -mtiny=@var{n}
15664 @opindex mtiny=
15665 Variables that are @var{n} bytes or smaller are allocated to the
15666 @code{.tiny} section.  These variables use the @code{$gp} base
15667 register.  The default for this option is 4, but note that there's a
15668 65536-byte limit to the @code{.tiny} section.
15670 @end table
15672 @node MicroBlaze Options
15673 @subsection MicroBlaze Options
15674 @cindex MicroBlaze Options
15676 @table @gcctabopt
15678 @item -msoft-float
15679 @opindex msoft-float
15680 Use software emulation for floating point (default).
15682 @item -mhard-float
15683 @opindex mhard-float
15684 Use hardware floating-point instructions.
15686 @item -mmemcpy
15687 @opindex mmemcpy
15688 Do not optimize block moves, use @code{memcpy}.
15690 @item -mno-clearbss
15691 @opindex mno-clearbss
15692 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
15694 @item -mcpu=@var{cpu-type}
15695 @opindex mcpu=
15696 Use features of, and schedule code for, the given CPU.
15697 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
15698 where @var{X} is a major version, @var{YY} is the minor version, and
15699 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
15700 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
15702 @item -mxl-soft-mul
15703 @opindex mxl-soft-mul
15704 Use software multiply emulation (default).
15706 @item -mxl-soft-div
15707 @opindex mxl-soft-div
15708 Use software emulation for divides (default).
15710 @item -mxl-barrel-shift
15711 @opindex mxl-barrel-shift
15712 Use the hardware barrel shifter.
15714 @item -mxl-pattern-compare
15715 @opindex mxl-pattern-compare
15716 Use pattern compare instructions.
15718 @item -msmall-divides
15719 @opindex msmall-divides
15720 Use table lookup optimization for small signed integer divisions.
15722 @item -mxl-stack-check
15723 @opindex mxl-stack-check
15724 This option is deprecated.  Use @option{-fstack-check} instead.
15726 @item -mxl-gp-opt
15727 @opindex mxl-gp-opt
15728 Use GP-relative @code{.sdata}/@code{.sbss} sections.
15730 @item -mxl-multiply-high
15731 @opindex mxl-multiply-high
15732 Use multiply high instructions for high part of 32x32 multiply.
15734 @item -mxl-float-convert
15735 @opindex mxl-float-convert
15736 Use hardware floating-point conversion instructions.
15738 @item -mxl-float-sqrt
15739 @opindex mxl-float-sqrt
15740 Use hardware floating-point square root instruction.
15742 @item -mxl-mode-@var{app-model}
15743 Select application model @var{app-model}.  Valid models are
15744 @table @samp
15745 @item executable
15746 normal executable (default), uses startup code @file{crt0.o}.
15748 @item xmdstub
15749 for use with Xilinx Microprocessor Debugger (XMD) based
15750 software intrusive debug agent called xmdstub. This uses startup file
15751 @file{crt1.o} and sets the start address of the program to 0x800.
15753 @item bootstrap
15754 for applications that are loaded using a bootloader.
15755 This model uses startup file @file{crt2.o} which does not contain a processor
15756 reset vector handler. This is suitable for transferring control on a
15757 processor reset to the bootloader rather than the application.
15759 @item novectors
15760 for applications that do not require any of the
15761 MicroBlaze vectors. This option may be useful for applications running
15762 within a monitoring application. This model uses @file{crt3.o} as a startup file.
15763 @end table
15765 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
15766 @option{-mxl-mode-@var{app-model}}.
15768 @end table
15770 @node MIPS Options
15771 @subsection MIPS Options
15772 @cindex MIPS options
15774 @table @gcctabopt
15776 @item -EB
15777 @opindex EB
15778 Generate big-endian code.
15780 @item -EL
15781 @opindex EL
15782 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
15783 configurations.
15785 @item -march=@var{arch}
15786 @opindex march
15787 Generate code that runs on @var{arch}, which can be the name of a
15788 generic MIPS ISA, or the name of a particular processor.
15789 The ISA names are:
15790 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
15791 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
15792 The processor names are:
15793 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
15794 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
15795 @samp{5kc}, @samp{5kf},
15796 @samp{20kc},
15797 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
15798 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
15799 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
15800 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
15801 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
15802 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
15803 @samp{m4k},
15804 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
15805 @samp{orion},
15806 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
15807 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
15808 @samp{rm7000}, @samp{rm9000},
15809 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
15810 @samp{sb1},
15811 @samp{sr71000},
15812 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
15813 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
15814 @samp{xlr} and @samp{xlp}.
15815 The special value @samp{from-abi} selects the
15816 most compatible architecture for the selected ABI (that is,
15817 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
15819 The native Linux/GNU toolchain also supports the value @samp{native},
15820 which selects the best architecture option for the host processor.
15821 @option{-march=native} has no effect if GCC does not recognize
15822 the processor.
15824 In processor names, a final @samp{000} can be abbreviated as @samp{k}
15825 (for example, @option{-march=r2k}).  Prefixes are optional, and
15826 @samp{vr} may be written @samp{r}.
15828 Names of the form @samp{@var{n}f2_1} refer to processors with
15829 FPUs clocked at half the rate of the core, names of the form
15830 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
15831 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
15832 processors with FPUs clocked a ratio of 3:2 with respect to the core.
15833 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
15834 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
15835 accepted as synonyms for @samp{@var{n}f1_1}.
15837 GCC defines two macros based on the value of this option.  The first
15838 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
15839 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
15840 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
15841 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
15842 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
15844 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
15845 above.  In other words, it has the full prefix and does not
15846 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
15847 the macro names the resolved architecture (either @samp{"mips1"} or
15848 @samp{"mips3"}).  It names the default architecture when no
15849 @option{-march} option is given.
15851 @item -mtune=@var{arch}
15852 @opindex mtune
15853 Optimize for @var{arch}.  Among other things, this option controls
15854 the way instructions are scheduled, and the perceived cost of arithmetic
15855 operations.  The list of @var{arch} values is the same as for
15856 @option{-march}.
15858 When this option is not used, GCC optimizes for the processor
15859 specified by @option{-march}.  By using @option{-march} and
15860 @option{-mtune} together, it is possible to generate code that
15861 runs on a family of processors, but optimize the code for one
15862 particular member of that family.
15864 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
15865 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
15866 @option{-march} ones described above.
15868 @item -mips1
15869 @opindex mips1
15870 Equivalent to @option{-march=mips1}.
15872 @item -mips2
15873 @opindex mips2
15874 Equivalent to @option{-march=mips2}.
15876 @item -mips3
15877 @opindex mips3
15878 Equivalent to @option{-march=mips3}.
15880 @item -mips4
15881 @opindex mips4
15882 Equivalent to @option{-march=mips4}.
15884 @item -mips32
15885 @opindex mips32
15886 Equivalent to @option{-march=mips32}.
15888 @item -mips32r2
15889 @opindex mips32r2
15890 Equivalent to @option{-march=mips32r2}.
15892 @item -mips64
15893 @opindex mips64
15894 Equivalent to @option{-march=mips64}.
15896 @item -mips64r2
15897 @opindex mips64r2
15898 Equivalent to @option{-march=mips64r2}.
15900 @item -mips16
15901 @itemx -mno-mips16
15902 @opindex mips16
15903 @opindex mno-mips16
15904 Generate (do not generate) MIPS16 code.  If GCC is targeting a
15905 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
15907 MIPS16 code generation can also be controlled on a per-function basis
15908 by means of @code{mips16} and @code{nomips16} attributes.
15909 @xref{Function Attributes}, for more information.
15911 @item -mflip-mips16
15912 @opindex mflip-mips16
15913 Generate MIPS16 code on alternating functions.  This option is provided
15914 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
15915 not intended for ordinary use in compiling user code.
15917 @item -minterlink-mips16
15918 @itemx -mno-interlink-mips16
15919 @opindex minterlink-mips16
15920 @opindex mno-interlink-mips16
15921 Require (do not require) that non-MIPS16 code be link-compatible with
15922 MIPS16 code.
15924 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
15925 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
15926 therefore disables direct jumps unless GCC knows that the target of the
15927 jump is not MIPS16.
15929 @item -mabi=32
15930 @itemx -mabi=o64
15931 @itemx -mabi=n32
15932 @itemx -mabi=64
15933 @itemx -mabi=eabi
15934 @opindex mabi=32
15935 @opindex mabi=o64
15936 @opindex mabi=n32
15937 @opindex mabi=64
15938 @opindex mabi=eabi
15939 Generate code for the given ABI@.
15941 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
15942 generates 64-bit code when you select a 64-bit architecture, but you
15943 can use @option{-mgp32} to get 32-bit code instead.
15945 For information about the O64 ABI, see
15946 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
15948 GCC supports a variant of the o32 ABI in which floating-point registers
15949 are 64 rather than 32 bits wide.  You can select this combination with
15950 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
15951 and @code{mfhc1} instructions and is therefore only supported for
15952 MIPS32R2 processors.
15954 The register assignments for arguments and return values remain the
15955 same, but each scalar value is passed in a single 64-bit register
15956 rather than a pair of 32-bit registers.  For example, scalar
15957 floating-point values are returned in @samp{$f0} only, not a
15958 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
15959 remains the same, but all 64 bits are saved.
15961 @item -mabicalls
15962 @itemx -mno-abicalls
15963 @opindex mabicalls
15964 @opindex mno-abicalls
15965 Generate (do not generate) code that is suitable for SVR4-style
15966 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
15967 systems.
15969 @item -mshared
15970 @itemx -mno-shared
15971 Generate (do not generate) code that is fully position-independent,
15972 and that can therefore be linked into shared libraries.  This option
15973 only affects @option{-mabicalls}.
15975 All @option{-mabicalls} code has traditionally been position-independent,
15976 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
15977 as an extension, the GNU toolchain allows executables to use absolute
15978 accesses for locally-binding symbols.  It can also use shorter GP
15979 initialization sequences and generate direct calls to locally-defined
15980 functions.  This mode is selected by @option{-mno-shared}.
15982 @option{-mno-shared} depends on binutils 2.16 or higher and generates
15983 objects that can only be linked by the GNU linker.  However, the option
15984 does not affect the ABI of the final executable; it only affects the ABI
15985 of relocatable objects.  Using @option{-mno-shared} generally makes
15986 executables both smaller and quicker.
15988 @option{-mshared} is the default.
15990 @item -mplt
15991 @itemx -mno-plt
15992 @opindex mplt
15993 @opindex mno-plt
15994 Assume (do not assume) that the static and dynamic linkers
15995 support PLTs and copy relocations.  This option only affects
15996 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
15997 has no effect without @option{-msym32}.
15999 You can make @option{-mplt} the default by configuring
16000 GCC with @option{--with-mips-plt}.  The default is
16001 @option{-mno-plt} otherwise.
16003 @item -mxgot
16004 @itemx -mno-xgot
16005 @opindex mxgot
16006 @opindex mno-xgot
16007 Lift (do not lift) the usual restrictions on the size of the global
16008 offset table.
16010 GCC normally uses a single instruction to load values from the GOT@.
16011 While this is relatively efficient, it only works if the GOT
16012 is smaller than about 64k.  Anything larger causes the linker
16013 to report an error such as:
16015 @cindex relocation truncated to fit (MIPS)
16016 @smallexample
16017 relocation truncated to fit: R_MIPS_GOT16 foobar
16018 @end smallexample
16020 If this happens, you should recompile your code with @option{-mxgot}.
16021 This works with very large GOTs, although the code is also
16022 less efficient, since it takes three instructions to fetch the
16023 value of a global symbol.
16025 Note that some linkers can create multiple GOTs.  If you have such a
16026 linker, you should only need to use @option{-mxgot} when a single object
16027 file accesses more than 64k's worth of GOT entries.  Very few do.
16029 These options have no effect unless GCC is generating position
16030 independent code.
16032 @item -mgp32
16033 @opindex mgp32
16034 Assume that general-purpose registers are 32 bits wide.
16036 @item -mgp64
16037 @opindex mgp64
16038 Assume that general-purpose registers are 64 bits wide.
16040 @item -mfp32
16041 @opindex mfp32
16042 Assume that floating-point registers are 32 bits wide.
16044 @item -mfp64
16045 @opindex mfp64
16046 Assume that floating-point registers are 64 bits wide.
16048 @item -mhard-float
16049 @opindex mhard-float
16050 Use floating-point coprocessor instructions.
16052 @item -msoft-float
16053 @opindex msoft-float
16054 Do not use floating-point coprocessor instructions.  Implement
16055 floating-point calculations using library calls instead.
16057 @item -mno-float
16058 @opindex mno-float
16059 Equivalent to @option{-msoft-float}, but additionally asserts that the
16060 program being compiled does not perform any floating-point operations.
16061 This option is presently supported only by some bare-metal MIPS
16062 configurations, where it may select a special set of libraries
16063 that lack all floating-point support (including, for example, the
16064 floating-point @code{printf} formats).  
16065 If code compiled with @code{-mno-float} accidentally contains
16066 floating-point operations, it is likely to suffer a link-time
16067 or run-time failure.
16069 @item -msingle-float
16070 @opindex msingle-float
16071 Assume that the floating-point coprocessor only supports single-precision
16072 operations.
16074 @item -mdouble-float
16075 @opindex mdouble-float
16076 Assume that the floating-point coprocessor supports double-precision
16077 operations.  This is the default.
16079 @item -mllsc
16080 @itemx -mno-llsc
16081 @opindex mllsc
16082 @opindex mno-llsc
16083 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
16084 implement atomic memory built-in functions.  When neither option is
16085 specified, GCC uses the instructions if the target architecture
16086 supports them.
16088 @option{-mllsc} is useful if the runtime environment can emulate the
16089 instructions and @option{-mno-llsc} can be useful when compiling for
16090 nonstandard ISAs.  You can make either option the default by
16091 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
16092 respectively.  @option{--with-llsc} is the default for some
16093 configurations; see the installation documentation for details.
16095 @item -mdsp
16096 @itemx -mno-dsp
16097 @opindex mdsp
16098 @opindex mno-dsp
16099 Use (do not use) revision 1 of the MIPS DSP ASE@.
16100 @xref{MIPS DSP Built-in Functions}.  This option defines the
16101 preprocessor macro @samp{__mips_dsp}.  It also defines
16102 @samp{__mips_dsp_rev} to 1.
16104 @item -mdspr2
16105 @itemx -mno-dspr2
16106 @opindex mdspr2
16107 @opindex mno-dspr2
16108 Use (do not use) revision 2 of the MIPS DSP ASE@.
16109 @xref{MIPS DSP Built-in Functions}.  This option defines the
16110 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
16111 It also defines @samp{__mips_dsp_rev} to 2.
16113 @item -msmartmips
16114 @itemx -mno-smartmips
16115 @opindex msmartmips
16116 @opindex mno-smartmips
16117 Use (do not use) the MIPS SmartMIPS ASE.
16119 @item -mpaired-single
16120 @itemx -mno-paired-single
16121 @opindex mpaired-single
16122 @opindex mno-paired-single
16123 Use (do not use) paired-single floating-point instructions.
16124 @xref{MIPS Paired-Single Support}.  This option requires
16125 hardware floating-point support to be enabled.
16127 @item -mdmx
16128 @itemx -mno-mdmx
16129 @opindex mdmx
16130 @opindex mno-mdmx
16131 Use (do not use) MIPS Digital Media Extension instructions.
16132 This option can only be used when generating 64-bit code and requires
16133 hardware floating-point support to be enabled.
16135 @item -mips3d
16136 @itemx -mno-mips3d
16137 @opindex mips3d
16138 @opindex mno-mips3d
16139 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
16140 The option @option{-mips3d} implies @option{-mpaired-single}.
16142 @item -mmt
16143 @itemx -mno-mt
16144 @opindex mmt
16145 @opindex mno-mt
16146 Use (do not use) MT Multithreading instructions.
16148 @item -mmcu
16149 @itemx -mno-mcu
16150 @opindex mmcu
16151 @opindex mno-mcu
16152 Use (do not use) the MIPS MCU ASE instructions.
16154 @item -mlong64
16155 @opindex mlong64
16156 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
16157 an explanation of the default and the way that the pointer size is
16158 determined.
16160 @item -mlong32
16161 @opindex mlong32
16162 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
16164 The default size of @code{int}s, @code{long}s and pointers depends on
16165 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
16166 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
16167 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
16168 or the same size as integer registers, whichever is smaller.
16170 @item -msym32
16171 @itemx -mno-sym32
16172 @opindex msym32
16173 @opindex mno-sym32
16174 Assume (do not assume) that all symbols have 32-bit values, regardless
16175 of the selected ABI@.  This option is useful in combination with
16176 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
16177 to generate shorter and faster references to symbolic addresses.
16179 @item -G @var{num}
16180 @opindex G
16181 Put definitions of externally-visible data in a small data section
16182 if that data is no bigger than @var{num} bytes.  GCC can then generate
16183 more efficient accesses to the data; see @option{-mgpopt} for details.
16185 The default @option{-G} option depends on the configuration.
16187 @item -mlocal-sdata
16188 @itemx -mno-local-sdata
16189 @opindex mlocal-sdata
16190 @opindex mno-local-sdata
16191 Extend (do not extend) the @option{-G} behavior to local data too,
16192 such as to static variables in C@.  @option{-mlocal-sdata} is the
16193 default for all configurations.
16195 If the linker complains that an application is using too much small data,
16196 you might want to try rebuilding the less performance-critical parts with
16197 @option{-mno-local-sdata}.  You might also want to build large
16198 libraries with @option{-mno-local-sdata}, so that the libraries leave
16199 more room for the main program.
16201 @item -mextern-sdata
16202 @itemx -mno-extern-sdata
16203 @opindex mextern-sdata
16204 @opindex mno-extern-sdata
16205 Assume (do not assume) that externally-defined data is in
16206 a small data section if the size of that data is within the @option{-G} limit.
16207 @option{-mextern-sdata} is the default for all configurations.
16209 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
16210 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
16211 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
16212 is placed in a small data section.  If @var{Var} is defined by another
16213 module, you must either compile that module with a high-enough
16214 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
16215 definition.  If @var{Var} is common, you must link the application
16216 with a high-enough @option{-G} setting.
16218 The easiest way of satisfying these restrictions is to compile
16219 and link every module with the same @option{-G} option.  However,
16220 you may wish to build a library that supports several different
16221 small data limits.  You can do this by compiling the library with
16222 the highest supported @option{-G} setting and additionally using
16223 @option{-mno-extern-sdata} to stop the library from making assumptions
16224 about externally-defined data.
16226 @item -mgpopt
16227 @itemx -mno-gpopt
16228 @opindex mgpopt
16229 @opindex mno-gpopt
16230 Use (do not use) GP-relative accesses for symbols that are known to be
16231 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
16232 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
16233 configurations.
16235 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
16236 might not hold the value of @code{_gp}.  For example, if the code is
16237 part of a library that might be used in a boot monitor, programs that
16238 call boot monitor routines pass an unknown value in @code{$gp}.
16239 (In such situations, the boot monitor itself is usually compiled
16240 with @option{-G0}.)
16242 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
16243 @option{-mno-extern-sdata}.
16245 @item -membedded-data
16246 @itemx -mno-embedded-data
16247 @opindex membedded-data
16248 @opindex mno-embedded-data
16249 Allocate variables to the read-only data section first if possible, then
16250 next in the small data section if possible, otherwise in data.  This gives
16251 slightly slower code than the default, but reduces the amount of RAM required
16252 when executing, and thus may be preferred for some embedded systems.
16254 @item -muninit-const-in-rodata
16255 @itemx -mno-uninit-const-in-rodata
16256 @opindex muninit-const-in-rodata
16257 @opindex mno-uninit-const-in-rodata
16258 Put uninitialized @code{const} variables in the read-only data section.
16259 This option is only meaningful in conjunction with @option{-membedded-data}.
16261 @item -mcode-readable=@var{setting}
16262 @opindex mcode-readable
16263 Specify whether GCC may generate code that reads from executable sections.
16264 There are three possible settings:
16266 @table @gcctabopt
16267 @item -mcode-readable=yes
16268 Instructions may freely access executable sections.  This is the
16269 default setting.
16271 @item -mcode-readable=pcrel
16272 MIPS16 PC-relative load instructions can access executable sections,
16273 but other instructions must not do so.  This option is useful on 4KSc
16274 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
16275 It is also useful on processors that can be configured to have a dual
16276 instruction/data SRAM interface and that, like the M4K, automatically
16277 redirect PC-relative loads to the instruction RAM.
16279 @item -mcode-readable=no
16280 Instructions must not access executable sections.  This option can be
16281 useful on targets that are configured to have a dual instruction/data
16282 SRAM interface but that (unlike the M4K) do not automatically redirect
16283 PC-relative loads to the instruction RAM.
16284 @end table
16286 @item -msplit-addresses
16287 @itemx -mno-split-addresses
16288 @opindex msplit-addresses
16289 @opindex mno-split-addresses
16290 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
16291 relocation operators.  This option has been superseded by
16292 @option{-mexplicit-relocs} but is retained for backwards compatibility.
16294 @item -mexplicit-relocs
16295 @itemx -mno-explicit-relocs
16296 @opindex mexplicit-relocs
16297 @opindex mno-explicit-relocs
16298 Use (do not use) assembler relocation operators when dealing with symbolic
16299 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
16300 is to use assembler macros instead.
16302 @option{-mexplicit-relocs} is the default if GCC was configured
16303 to use an assembler that supports relocation operators.
16305 @item -mcheck-zero-division
16306 @itemx -mno-check-zero-division
16307 @opindex mcheck-zero-division
16308 @opindex mno-check-zero-division
16309 Trap (do not trap) on integer division by zero.
16311 The default is @option{-mcheck-zero-division}.
16313 @item -mdivide-traps
16314 @itemx -mdivide-breaks
16315 @opindex mdivide-traps
16316 @opindex mdivide-breaks
16317 MIPS systems check for division by zero by generating either a
16318 conditional trap or a break instruction.  Using traps results in
16319 smaller code, but is only supported on MIPS II and later.  Also, some
16320 versions of the Linux kernel have a bug that prevents trap from
16321 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
16322 allow conditional traps on architectures that support them and
16323 @option{-mdivide-breaks} to force the use of breaks.
16325 The default is usually @option{-mdivide-traps}, but this can be
16326 overridden at configure time using @option{--with-divide=breaks}.
16327 Divide-by-zero checks can be completely disabled using
16328 @option{-mno-check-zero-division}.
16330 @item -mmemcpy
16331 @itemx -mno-memcpy
16332 @opindex mmemcpy
16333 @opindex mno-memcpy
16334 Force (do not force) the use of @code{memcpy()} for non-trivial block
16335 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
16336 most constant-sized copies.
16338 @item -mlong-calls
16339 @itemx -mno-long-calls
16340 @opindex mlong-calls
16341 @opindex mno-long-calls
16342 Disable (do not disable) use of the @code{jal} instruction.  Calling
16343 functions using @code{jal} is more efficient but requires the caller
16344 and callee to be in the same 256 megabyte segment.
16346 This option has no effect on abicalls code.  The default is
16347 @option{-mno-long-calls}.
16349 @item -mmad
16350 @itemx -mno-mad
16351 @opindex mmad
16352 @opindex mno-mad
16353 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
16354 instructions, as provided by the R4650 ISA@.
16356 @item -mfused-madd
16357 @itemx -mno-fused-madd
16358 @opindex mfused-madd
16359 @opindex mno-fused-madd
16360 Enable (disable) use of the floating-point multiply-accumulate
16361 instructions, when they are available.  The default is
16362 @option{-mfused-madd}.
16364 When multiply-accumulate instructions are used, the intermediate
16365 product is calculated to infinite precision and is not subject to
16366 the FCSR Flush to Zero bit.  This may be undesirable in some
16367 circumstances.
16369 @item -nocpp
16370 @opindex nocpp
16371 Tell the MIPS assembler to not run its preprocessor over user
16372 assembler files (with a @samp{.s} suffix) when assembling them.
16374 @item -mfix-24k
16375 @item -mno-fix-24k
16376 @opindex mfix-24k
16377 @opindex mno-fix-24k
16378 Work around the 24K E48 (lost data on stores during refill) errata.
16379 The workarounds are implemented by the assembler rather than by GCC@.
16381 @item -mfix-r4000
16382 @itemx -mno-fix-r4000
16383 @opindex mfix-r4000
16384 @opindex mno-fix-r4000
16385 Work around certain R4000 CPU errata:
16386 @itemize @minus
16387 @item
16388 A double-word or a variable shift may give an incorrect result if executed
16389 immediately after starting an integer division.
16390 @item
16391 A double-word or a variable shift may give an incorrect result if executed
16392 while an integer multiplication is in progress.
16393 @item
16394 An integer division may give an incorrect result if started in a delay slot
16395 of a taken branch or a jump.
16396 @end itemize
16398 @item -mfix-r4400
16399 @itemx -mno-fix-r4400
16400 @opindex mfix-r4400
16401 @opindex mno-fix-r4400
16402 Work around certain R4400 CPU errata:
16403 @itemize @minus
16404 @item
16405 A double-word or a variable shift may give an incorrect result if executed
16406 immediately after starting an integer division.
16407 @end itemize
16409 @item -mfix-r10000
16410 @itemx -mno-fix-r10000
16411 @opindex mfix-r10000
16412 @opindex mno-fix-r10000
16413 Work around certain R10000 errata:
16414 @itemize @minus
16415 @item
16416 @code{ll}/@code{sc} sequences may not behave atomically on revisions
16417 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
16418 @end itemize
16420 This option can only be used if the target architecture supports
16421 branch-likely instructions.  @option{-mfix-r10000} is the default when
16422 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
16423 otherwise.
16425 @item -mfix-vr4120
16426 @itemx -mno-fix-vr4120
16427 @opindex mfix-vr4120
16428 Work around certain VR4120 errata:
16429 @itemize @minus
16430 @item
16431 @code{dmultu} does not always produce the correct result.
16432 @item
16433 @code{div} and @code{ddiv} do not always produce the correct result if one
16434 of the operands is negative.
16435 @end itemize
16436 The workarounds for the division errata rely on special functions in
16437 @file{libgcc.a}.  At present, these functions are only provided by
16438 the @code{mips64vr*-elf} configurations.
16440 Other VR4120 errata require a NOP to be inserted between certain pairs of
16441 instructions.  These errata are handled by the assembler, not by GCC itself.
16443 @item -mfix-vr4130
16444 @opindex mfix-vr4130
16445 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
16446 workarounds are implemented by the assembler rather than by GCC,
16447 although GCC avoids using @code{mflo} and @code{mfhi} if the
16448 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
16449 instructions are available instead.
16451 @item -mfix-sb1
16452 @itemx -mno-fix-sb1
16453 @opindex mfix-sb1
16454 Work around certain SB-1 CPU core errata.
16455 (This flag currently works around the SB-1 revision 2
16456 ``F1'' and ``F2'' floating-point errata.)
16458 @item -mr10k-cache-barrier=@var{setting}
16459 @opindex mr10k-cache-barrier
16460 Specify whether GCC should insert cache barriers to avoid the
16461 side-effects of speculation on R10K processors.
16463 In common with many processors, the R10K tries to predict the outcome
16464 of a conditional branch and speculatively executes instructions from
16465 the ``taken'' branch.  It later aborts these instructions if the
16466 predicted outcome is wrong.  However, on the R10K, even aborted
16467 instructions can have side effects.
16469 This problem only affects kernel stores and, depending on the system,
16470 kernel loads.  As an example, a speculatively-executed store may load
16471 the target memory into cache and mark the cache line as dirty, even if
16472 the store itself is later aborted.  If a DMA operation writes to the
16473 same area of memory before the ``dirty'' line is flushed, the cached
16474 data overwrites the DMA-ed data.  See the R10K processor manual
16475 for a full description, including other potential problems.
16477 One workaround is to insert cache barrier instructions before every memory
16478 access that might be speculatively executed and that might have side
16479 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
16480 controls GCC's implementation of this workaround.  It assumes that
16481 aborted accesses to any byte in the following regions does not have
16482 side effects:
16484 @enumerate
16485 @item
16486 the memory occupied by the current function's stack frame;
16488 @item
16489 the memory occupied by an incoming stack argument;
16491 @item
16492 the memory occupied by an object with a link-time-constant address.
16493 @end enumerate
16495 It is the kernel's responsibility to ensure that speculative
16496 accesses to these regions are indeed safe.
16498 If the input program contains a function declaration such as:
16500 @smallexample
16501 void foo (void);
16502 @end smallexample
16504 then the implementation of @code{foo} must allow @code{j foo} and
16505 @code{jal foo} to be executed speculatively.  GCC honors this
16506 restriction for functions it compiles itself.  It expects non-GCC
16507 functions (such as hand-written assembly code) to do the same.
16509 The option has three forms:
16511 @table @gcctabopt
16512 @item -mr10k-cache-barrier=load-store
16513 Insert a cache barrier before a load or store that might be
16514 speculatively executed and that might have side effects even
16515 if aborted.
16517 @item -mr10k-cache-barrier=store
16518 Insert a cache barrier before a store that might be speculatively
16519 executed and that might have side effects even if aborted.
16521 @item -mr10k-cache-barrier=none
16522 Disable the insertion of cache barriers.  This is the default setting.
16523 @end table
16525 @item -mflush-func=@var{func}
16526 @itemx -mno-flush-func
16527 @opindex mflush-func
16528 Specifies the function to call to flush the I and D caches, or to not
16529 call any such function.  If called, the function must take the same
16530 arguments as the common @code{_flush_func()}, that is, the address of the
16531 memory range for which the cache is being flushed, the size of the
16532 memory range, and the number 3 (to flush both caches).  The default
16533 depends on the target GCC was configured for, but commonly is either
16534 @samp{_flush_func} or @samp{__cpu_flush}.
16536 @item mbranch-cost=@var{num}
16537 @opindex mbranch-cost
16538 Set the cost of branches to roughly @var{num} ``simple'' instructions.
16539 This cost is only a heuristic and is not guaranteed to produce
16540 consistent results across releases.  A zero cost redundantly selects
16541 the default, which is based on the @option{-mtune} setting.
16543 @item -mbranch-likely
16544 @itemx -mno-branch-likely
16545 @opindex mbranch-likely
16546 @opindex mno-branch-likely
16547 Enable or disable use of Branch Likely instructions, regardless of the
16548 default for the selected architecture.  By default, Branch Likely
16549 instructions may be generated if they are supported by the selected
16550 architecture.  An exception is for the MIPS32 and MIPS64 architectures
16551 and processors that implement those architectures; for those, Branch
16552 Likely instructions are not be generated by default because the MIPS32
16553 and MIPS64 architectures specifically deprecate their use.
16555 @item -mfp-exceptions
16556 @itemx -mno-fp-exceptions
16557 @opindex mfp-exceptions
16558 Specifies whether FP exceptions are enabled.  This affects how
16559 FP instructions are scheduled for some processors.
16560 The default is that FP exceptions are
16561 enabled.
16563 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
16564 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
16565 FP pipe.
16567 @item -mvr4130-align
16568 @itemx -mno-vr4130-align
16569 @opindex mvr4130-align
16570 The VR4130 pipeline is two-way superscalar, but can only issue two
16571 instructions together if the first one is 8-byte aligned.  When this
16572 option is enabled, GCC aligns pairs of instructions that it
16573 thinks should execute in parallel.
16575 This option only has an effect when optimizing for the VR4130.
16576 It normally makes code faster, but at the expense of making it bigger.
16577 It is enabled by default at optimization level @option{-O3}.
16579 @item -msynci
16580 @itemx -mno-synci
16581 @opindex msynci
16582 Enable (disable) generation of @code{synci} instructions on
16583 architectures that support it.  The @code{synci} instructions (if
16584 enabled) are generated when @code{__builtin___clear_cache()} is
16585 compiled.
16587 This option defaults to @code{-mno-synci}, but the default can be
16588 overridden by configuring with @code{--with-synci}.
16590 When compiling code for single processor systems, it is generally safe
16591 to use @code{synci}.  However, on many multi-core (SMP) systems, it
16592 does not invalidate the instruction caches on all cores and may lead
16593 to undefined behavior.
16595 @item -mrelax-pic-calls
16596 @itemx -mno-relax-pic-calls
16597 @opindex mrelax-pic-calls
16598 Try to turn PIC calls that are normally dispatched via register
16599 @code{$25} into direct calls.  This is only possible if the linker can
16600 resolve the destination at link-time and if the destination is within
16601 range for a direct call.
16603 @option{-mrelax-pic-calls} is the default if GCC was configured to use
16604 an assembler and a linker that support the @code{.reloc} assembly
16605 directive and @code{-mexplicit-relocs} is in effect.  With
16606 @code{-mno-explicit-relocs}, this optimization can be performed by the
16607 assembler and the linker alone without help from the compiler.
16609 @item -mmcount-ra-address
16610 @itemx -mno-mcount-ra-address
16611 @opindex mmcount-ra-address
16612 @opindex mno-mcount-ra-address
16613 Emit (do not emit) code that allows @code{_mcount} to modify the
16614 calling function's return address.  When enabled, this option extends
16615 the usual @code{_mcount} interface with a new @var{ra-address}
16616 parameter, which has type @code{intptr_t *} and is passed in register
16617 @code{$12}.  @code{_mcount} can then modify the return address by
16618 doing both of the following:
16619 @itemize
16620 @item
16621 Returning the new address in register @code{$31}.
16622 @item
16623 Storing the new address in @code{*@var{ra-address}},
16624 if @var{ra-address} is nonnull.
16625 @end itemize
16627 The default is @option{-mno-mcount-ra-address}.
16629 @end table
16631 @node MMIX Options
16632 @subsection MMIX Options
16633 @cindex MMIX Options
16635 These options are defined for the MMIX:
16637 @table @gcctabopt
16638 @item -mlibfuncs
16639 @itemx -mno-libfuncs
16640 @opindex mlibfuncs
16641 @opindex mno-libfuncs
16642 Specify that intrinsic library functions are being compiled, passing all
16643 values in registers, no matter the size.
16645 @item -mepsilon
16646 @itemx -mno-epsilon
16647 @opindex mepsilon
16648 @opindex mno-epsilon
16649 Generate floating-point comparison instructions that compare with respect
16650 to the @code{rE} epsilon register.
16652 @item -mabi=mmixware
16653 @itemx -mabi=gnu
16654 @opindex mabi=mmixware
16655 @opindex mabi=gnu
16656 Generate code that passes function parameters and return values that (in
16657 the called function) are seen as registers @code{$0} and up, as opposed to
16658 the GNU ABI which uses global registers @code{$231} and up.
16660 @item -mzero-extend
16661 @itemx -mno-zero-extend
16662 @opindex mzero-extend
16663 @opindex mno-zero-extend
16664 When reading data from memory in sizes shorter than 64 bits, use (do not
16665 use) zero-extending load instructions by default, rather than
16666 sign-extending ones.
16668 @item -mknuthdiv
16669 @itemx -mno-knuthdiv
16670 @opindex mknuthdiv
16671 @opindex mno-knuthdiv
16672 Make the result of a division yielding a remainder have the same sign as
16673 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
16674 remainder follows the sign of the dividend.  Both methods are
16675 arithmetically valid, the latter being almost exclusively used.
16677 @item -mtoplevel-symbols
16678 @itemx -mno-toplevel-symbols
16679 @opindex mtoplevel-symbols
16680 @opindex mno-toplevel-symbols
16681 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
16682 code can be used with the @code{PREFIX} assembly directive.
16684 @item -melf
16685 @opindex melf
16686 Generate an executable in the ELF format, rather than the default
16687 @samp{mmo} format used by the @command{mmix} simulator.
16689 @item -mbranch-predict
16690 @itemx -mno-branch-predict
16691 @opindex mbranch-predict
16692 @opindex mno-branch-predict
16693 Use (do not use) the probable-branch instructions, when static branch
16694 prediction indicates a probable branch.
16696 @item -mbase-addresses
16697 @itemx -mno-base-addresses
16698 @opindex mbase-addresses
16699 @opindex mno-base-addresses
16700 Generate (do not generate) code that uses @emph{base addresses}.  Using a
16701 base address automatically generates a request (handled by the assembler
16702 and the linker) for a constant to be set up in a global register.  The
16703 register is used for one or more base address requests within the range 0
16704 to 255 from the value held in the register.  The generally leads to short
16705 and fast code, but the number of different data items that can be
16706 addressed is limited.  This means that a program that uses lots of static
16707 data may require @option{-mno-base-addresses}.
16709 @item -msingle-exit
16710 @itemx -mno-single-exit
16711 @opindex msingle-exit
16712 @opindex mno-single-exit
16713 Force (do not force) generated code to have a single exit point in each
16714 function.
16715 @end table
16717 @node MN10300 Options
16718 @subsection MN10300 Options
16719 @cindex MN10300 options
16721 These @option{-m} options are defined for Matsushita MN10300 architectures:
16723 @table @gcctabopt
16724 @item -mmult-bug
16725 @opindex mmult-bug
16726 Generate code to avoid bugs in the multiply instructions for the MN10300
16727 processors.  This is the default.
16729 @item -mno-mult-bug
16730 @opindex mno-mult-bug
16731 Do not generate code to avoid bugs in the multiply instructions for the
16732 MN10300 processors.
16734 @item -mam33
16735 @opindex mam33
16736 Generate code using features specific to the AM33 processor.
16738 @item -mno-am33
16739 @opindex mno-am33
16740 Do not generate code using features specific to the AM33 processor.  This
16741 is the default.
16743 @item -mam33-2
16744 @opindex mam33-2
16745 Generate code using features specific to the AM33/2.0 processor.
16747 @item -mam34
16748 @opindex mam34
16749 Generate code using features specific to the AM34 processor.
16751 @item -mtune=@var{cpu-type}
16752 @opindex mtune
16753 Use the timing characteristics of the indicated CPU type when
16754 scheduling instructions.  This does not change the targeted processor
16755 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
16756 @samp{am33-2} or @samp{am34}.
16758 @item -mreturn-pointer-on-d0
16759 @opindex mreturn-pointer-on-d0
16760 When generating a function that returns a pointer, return the pointer
16761 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
16762 only in @code{a0}, and attempts to call such functions without a prototype
16763 result in errors.  Note that this option is on by default; use
16764 @option{-mno-return-pointer-on-d0} to disable it.
16766 @item -mno-crt0
16767 @opindex mno-crt0
16768 Do not link in the C run-time initialization object file.
16770 @item -mrelax
16771 @opindex mrelax
16772 Indicate to the linker that it should perform a relaxation optimization pass
16773 to shorten branches, calls and absolute memory addresses.  This option only
16774 has an effect when used on the command line for the final link step.
16776 This option makes symbolic debugging impossible.
16778 @item -mliw
16779 @opindex mliw
16780 Allow the compiler to generate @emph{Long Instruction Word}
16781 instructions if the target is the @samp{AM33} or later.  This is the
16782 default.  This option defines the preprocessor macro @samp{__LIW__}.
16784 @item -mnoliw
16785 @opindex mnoliw
16786 Do not allow the compiler to generate @emph{Long Instruction Word}
16787 instructions.  This option defines the preprocessor macro
16788 @samp{__NO_LIW__}.
16790 @item -msetlb
16791 @opindex msetlb
16792 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
16793 instructions if the target is the @samp{AM33} or later.  This is the
16794 default.  This option defines the preprocessor macro @samp{__SETLB__}.
16796 @item -mnosetlb
16797 @opindex mnosetlb
16798 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
16799 instructions.  This option defines the preprocessor macro
16800 @samp{__NO_SETLB__}.
16802 @end table
16804 @node Moxie Options
16805 @subsection Moxie Options
16806 @cindex Moxie Options
16808 @table @gcctabopt
16810 @item -meb
16811 @opindex meb
16812 Generate big-endian code.  This is the default for @samp{moxie-*-*}
16813 configurations.
16815 @item -mel
16816 @opindex mel
16817 Generate little-endian code.
16819 @item -mno-crt0
16820 @opindex mno-crt0
16821 Do not link in the C run-time initialization object file.
16823 @end table
16825 @node PDP-11 Options
16826 @subsection PDP-11 Options
16827 @cindex PDP-11 Options
16829 These options are defined for the PDP-11:
16831 @table @gcctabopt
16832 @item -mfpu
16833 @opindex mfpu
16834 Use hardware FPP floating point.  This is the default.  (FIS floating
16835 point on the PDP-11/40 is not supported.)
16837 @item -msoft-float
16838 @opindex msoft-float
16839 Do not use hardware floating point.
16841 @item -mac0
16842 @opindex mac0
16843 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
16845 @item -mno-ac0
16846 @opindex mno-ac0
16847 Return floating-point results in memory.  This is the default.
16849 @item -m40
16850 @opindex m40
16851 Generate code for a PDP-11/40.
16853 @item -m45
16854 @opindex m45
16855 Generate code for a PDP-11/45.  This is the default.
16857 @item -m10
16858 @opindex m10
16859 Generate code for a PDP-11/10.
16861 @item -mbcopy-builtin
16862 @opindex mbcopy-builtin
16863 Use inline @code{movmemhi} patterns for copying memory.  This is the
16864 default.
16866 @item -mbcopy
16867 @opindex mbcopy
16868 Do not use inline @code{movmemhi} patterns for copying memory.
16870 @item -mint16
16871 @itemx -mno-int32
16872 @opindex mint16
16873 @opindex mno-int32
16874 Use 16-bit @code{int}.  This is the default.
16876 @item -mint32
16877 @itemx -mno-int16
16878 @opindex mint32
16879 @opindex mno-int16
16880 Use 32-bit @code{int}.
16882 @item -mfloat64
16883 @itemx -mno-float32
16884 @opindex mfloat64
16885 @opindex mno-float32
16886 Use 64-bit @code{float}.  This is the default.
16888 @item -mfloat32
16889 @itemx -mno-float64
16890 @opindex mfloat32
16891 @opindex mno-float64
16892 Use 32-bit @code{float}.
16894 @item -mabshi
16895 @opindex mabshi
16896 Use @code{abshi2} pattern.  This is the default.
16898 @item -mno-abshi
16899 @opindex mno-abshi
16900 Do not use @code{abshi2} pattern.
16902 @item -mbranch-expensive
16903 @opindex mbranch-expensive
16904 Pretend that branches are expensive.  This is for experimenting with
16905 code generation only.
16907 @item -mbranch-cheap
16908 @opindex mbranch-cheap
16909 Do not pretend that branches are expensive.  This is the default.
16911 @item -munix-asm
16912 @opindex munix-asm
16913 Use Unix assembler syntax.  This is the default when configured for
16914 @samp{pdp11-*-bsd}.
16916 @item -mdec-asm
16917 @opindex mdec-asm
16918 Use DEC assembler syntax.  This is the default when configured for any
16919 PDP-11 target other than @samp{pdp11-*-bsd}.
16920 @end table
16922 @node picoChip Options
16923 @subsection picoChip Options
16924 @cindex picoChip options
16926 These @samp{-m} options are defined for picoChip implementations:
16928 @table @gcctabopt
16930 @item -mae=@var{ae_type}
16931 @opindex mcpu
16932 Set the instruction set, register set, and instruction scheduling
16933 parameters for array element type @var{ae_type}.  Supported values
16934 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
16936 @option{-mae=ANY} selects a completely generic AE type.  Code
16937 generated with this option runs on any of the other AE types.  The
16938 code is not as efficient as it would be if compiled for a specific
16939 AE type, and some types of operation (e.g., multiplication) do not
16940 work properly on all types of AE.
16942 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
16943 for compiled code, and is the default.
16945 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
16946 option may suffer from poor performance of byte (char) manipulation,
16947 since the DSP AE does not provide hardware support for byte load/stores.
16949 @item -msymbol-as-address
16950 Enable the compiler to directly use a symbol name as an address in a
16951 load/store instruction, without first loading it into a
16952 register.  Typically, the use of this option generates larger
16953 programs, which run faster than when the option isn't used.  However, the
16954 results vary from program to program, so it is left as a user option,
16955 rather than being permanently enabled.
16957 @item -mno-inefficient-warnings
16958 Disables warnings about the generation of inefficient code.  These
16959 warnings can be generated, for example, when compiling code that
16960 performs byte-level memory operations on the MAC AE type.  The MAC AE has
16961 no hardware support for byte-level memory operations, so all byte
16962 load/stores must be synthesized from word load/store operations.  This is
16963 inefficient and a warning is generated to indicate
16964 that you should rewrite the code to avoid byte operations, or to target
16965 an AE type that has the necessary hardware support.  This option disables
16966 these warnings.
16968 @end table
16970 @node PowerPC Options
16971 @subsection PowerPC Options
16972 @cindex PowerPC options
16974 These are listed under @xref{RS/6000 and PowerPC Options}.
16976 @node RL78 Options
16977 @subsection RL78 Options
16978 @cindex RL78 Options
16980 @table @gcctabopt
16982 @item -msim
16983 @opindex msim
16984 Links in additional target libraries to support operation within a
16985 simulator.
16987 @item -mmul=none
16988 @itemx -mmul=g13
16989 @itemx -mmul=rl78
16990 @opindex mmul
16991 Specifies the type of hardware multiplication support to be used.  The
16992 default is @code{none}, which uses software multiplication functions.
16993 The @code{g13} option is for the hardware multiply/divide peripheral
16994 only on the RL78/G13 targets.  The @code{rl78} option is for the
16995 standard hardware multiplication defined in the RL78 software manual.
16997 @end table
16999 @node RS/6000 and PowerPC Options
17000 @subsection IBM RS/6000 and PowerPC Options
17001 @cindex RS/6000 and PowerPC Options
17002 @cindex IBM RS/6000 and PowerPC Options
17004 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
17005 @table @gcctabopt
17006 @item -mpowerpc-gpopt
17007 @itemx -mno-powerpc-gpopt
17008 @itemx -mpowerpc-gfxopt
17009 @itemx -mno-powerpc-gfxopt
17010 @need 800
17011 @itemx -mpowerpc64
17012 @itemx -mno-powerpc64
17013 @itemx -mmfcrf
17014 @itemx -mno-mfcrf
17015 @itemx -mpopcntb
17016 @itemx -mno-popcntb
17017 @itemx -mpopcntd
17018 @itemx -mno-popcntd
17019 @itemx -mfprnd
17020 @itemx -mno-fprnd
17021 @need 800
17022 @itemx -mcmpb
17023 @itemx -mno-cmpb
17024 @itemx -mmfpgpr
17025 @itemx -mno-mfpgpr
17026 @itemx -mhard-dfp
17027 @itemx -mno-hard-dfp
17028 @opindex mpowerpc-gpopt
17029 @opindex mno-powerpc-gpopt
17030 @opindex mpowerpc-gfxopt
17031 @opindex mno-powerpc-gfxopt
17032 @opindex mpowerpc64
17033 @opindex mno-powerpc64
17034 @opindex mmfcrf
17035 @opindex mno-mfcrf
17036 @opindex mpopcntb
17037 @opindex mno-popcntb
17038 @opindex mpopcntd
17039 @opindex mno-popcntd
17040 @opindex mfprnd
17041 @opindex mno-fprnd
17042 @opindex mcmpb
17043 @opindex mno-cmpb
17044 @opindex mmfpgpr
17045 @opindex mno-mfpgpr
17046 @opindex mhard-dfp
17047 @opindex mno-hard-dfp
17048 You use these options to specify which instructions are available on the
17049 processor you are using.  The default value of these options is
17050 determined when configuring GCC@.  Specifying the
17051 @option{-mcpu=@var{cpu_type}} overrides the specification of these
17052 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
17053 rather than the options listed above.
17055 Specifying @option{-mpowerpc-gpopt} allows
17056 GCC to use the optional PowerPC architecture instructions in the
17057 General Purpose group, including floating-point square root.  Specifying
17058 @option{-mpowerpc-gfxopt} allows GCC to
17059 use the optional PowerPC architecture instructions in the Graphics
17060 group, including floating-point select.
17062 The @option{-mmfcrf} option allows GCC to generate the move from
17063 condition register field instruction implemented on the POWER4
17064 processor and other processors that support the PowerPC V2.01
17065 architecture.
17066 The @option{-mpopcntb} option allows GCC to generate the popcount and
17067 double-precision FP reciprocal estimate instruction implemented on the
17068 POWER5 processor and other processors that support the PowerPC V2.02
17069 architecture.
17070 The @option{-mpopcntd} option allows GCC to generate the popcount
17071 instruction implemented on the POWER7 processor and other processors
17072 that support the PowerPC V2.06 architecture.
17073 The @option{-mfprnd} option allows GCC to generate the FP round to
17074 integer instructions implemented on the POWER5+ processor and other
17075 processors that support the PowerPC V2.03 architecture.
17076 The @option{-mcmpb} option allows GCC to generate the compare bytes
17077 instruction implemented on the POWER6 processor and other processors
17078 that support the PowerPC V2.05 architecture.
17079 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
17080 general-purpose register instructions implemented on the POWER6X
17081 processor and other processors that support the extended PowerPC V2.05
17082 architecture.
17083 The @option{-mhard-dfp} option allows GCC to generate the decimal
17084 floating-point instructions implemented on some POWER processors.
17086 The @option{-mpowerpc64} option allows GCC to generate the additional
17087 64-bit instructions that are found in the full PowerPC64 architecture
17088 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
17089 @option{-mno-powerpc64}.
17091 @item -mcpu=@var{cpu_type}
17092 @opindex mcpu
17093 Set architecture type, register usage, and
17094 instruction scheduling parameters for machine type @var{cpu_type}.
17095 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
17096 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
17097 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
17098 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
17099 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
17100 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
17101 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
17102 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
17103 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
17104 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
17105 @samp{powerpc64}, and @samp{rs64}.
17107 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
17108 PowerPC and 64-bit PowerPC architecture machine
17109 types, with an appropriate, generic processor model assumed for
17110 scheduling purposes.
17112 The other options specify a specific processor.  Code generated under
17113 those options runs best on that processor, and may not run at all on
17114 others.
17116 The @option{-mcpu} options automatically enable or disable the
17117 following options:
17119 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
17120 -mpopcntb -mpopcntd  -mpowerpc64 @gol
17121 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
17122 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
17124 The particular options set for any particular CPU varies between
17125 compiler versions, depending on what setting seems to produce optimal
17126 code for that CPU; it doesn't necessarily reflect the actual hardware's
17127 capabilities.  If you wish to set an individual option to a particular
17128 value, you may specify it after the @option{-mcpu} option, like
17129 @option{-mcpu=970 -mno-altivec}.
17131 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
17132 not enabled or disabled by the @option{-mcpu} option at present because
17133 AIX does not have full support for these options.  You may still
17134 enable or disable them individually if you're sure it'll work in your
17135 environment.
17137 @item -mtune=@var{cpu_type}
17138 @opindex mtune
17139 Set the instruction scheduling parameters for machine type
17140 @var{cpu_type}, but do not set the architecture type or register usage,
17141 as @option{-mcpu=@var{cpu_type}} does.  The same
17142 values for @var{cpu_type} are used for @option{-mtune} as for
17143 @option{-mcpu}.  If both are specified, the code generated uses the
17144 architecture and registers set by @option{-mcpu}, but the
17145 scheduling parameters set by @option{-mtune}.
17147 @item -mcmodel=small
17148 @opindex mcmodel=small
17149 Generate PowerPC64 code for the small model: The TOC is limited to
17150 64k.
17152 @item -mcmodel=medium
17153 @opindex mcmodel=medium
17154 Generate PowerPC64 code for the medium model: The TOC and other static
17155 data may be up to a total of 4G in size.
17157 @item -mcmodel=large
17158 @opindex mcmodel=large
17159 Generate PowerPC64 code for the large model: The TOC may be up to 4G
17160 in size.  Other data and code is only limited by the 64-bit address
17161 space.
17163 @item -maltivec
17164 @itemx -mno-altivec
17165 @opindex maltivec
17166 @opindex mno-altivec
17167 Generate code that uses (does not use) AltiVec instructions, and also
17168 enable the use of built-in functions that allow more direct access to
17169 the AltiVec instruction set.  You may also need to set
17170 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
17171 enhancements.
17173 @item -mvrsave
17174 @itemx -mno-vrsave
17175 @opindex mvrsave
17176 @opindex mno-vrsave
17177 Generate VRSAVE instructions when generating AltiVec code.
17179 @item -mgen-cell-microcode
17180 @opindex mgen-cell-microcode
17181 Generate Cell microcode instructions.
17183 @item -mwarn-cell-microcode
17184 @opindex mwarn-cell-microcode
17185 Warn when a Cell microcode instruction is emitted.  An example
17186 of a Cell microcode instruction is a variable shift.
17188 @item -msecure-plt
17189 @opindex msecure-plt
17190 Generate code that allows @command{ld} and @command{ld.so}
17191 to build executables and shared
17192 libraries with non-executable @code{.plt} and @code{.got} sections.
17193 This is a PowerPC
17194 32-bit SYSV ABI option.
17196 @item -mbss-plt
17197 @opindex mbss-plt
17198 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
17199 fills in, and
17200 requires @code{.plt} and @code{.got}
17201 sections that are both writable and executable.
17202 This is a PowerPC 32-bit SYSV ABI option.
17204 @item -misel
17205 @itemx -mno-isel
17206 @opindex misel
17207 @opindex mno-isel
17208 This switch enables or disables the generation of ISEL instructions.
17210 @item -misel=@var{yes/no}
17211 This switch has been deprecated.  Use @option{-misel} and
17212 @option{-mno-isel} instead.
17214 @item -mspe
17215 @itemx -mno-spe
17216 @opindex mspe
17217 @opindex mno-spe
17218 This switch enables or disables the generation of SPE simd
17219 instructions.
17221 @item -mpaired
17222 @itemx -mno-paired
17223 @opindex mpaired
17224 @opindex mno-paired
17225 This switch enables or disables the generation of PAIRED simd
17226 instructions.
17228 @item -mspe=@var{yes/no}
17229 This option has been deprecated.  Use @option{-mspe} and
17230 @option{-mno-spe} instead.
17232 @item -mvsx
17233 @itemx -mno-vsx
17234 @opindex mvsx
17235 @opindex mno-vsx
17236 Generate code that uses (does not use) vector/scalar (VSX)
17237 instructions, and also enable the use of built-in functions that allow
17238 more direct access to the VSX instruction set.
17240 @item -mfloat-gprs=@var{yes/single/double/no}
17241 @itemx -mfloat-gprs
17242 @opindex mfloat-gprs
17243 This switch enables or disables the generation of floating-point
17244 operations on the general-purpose registers for architectures that
17245 support it.
17247 The argument @var{yes} or @var{single} enables the use of
17248 single-precision floating-point operations.
17250 The argument @var{double} enables the use of single and
17251 double-precision floating-point operations.
17253 The argument @var{no} disables floating-point operations on the
17254 general-purpose registers.
17256 This option is currently only available on the MPC854x.
17258 @item -m32
17259 @itemx -m64
17260 @opindex m32
17261 @opindex m64
17262 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
17263 targets (including GNU/Linux).  The 32-bit environment sets int, long
17264 and pointer to 32 bits and generates code that runs on any PowerPC
17265 variant.  The 64-bit environment sets int to 32 bits and long and
17266 pointer to 64 bits, and generates code for PowerPC64, as for
17267 @option{-mpowerpc64}.
17269 @item -mfull-toc
17270 @itemx -mno-fp-in-toc
17271 @itemx -mno-sum-in-toc
17272 @itemx -mminimal-toc
17273 @opindex mfull-toc
17274 @opindex mno-fp-in-toc
17275 @opindex mno-sum-in-toc
17276 @opindex mminimal-toc
17277 Modify generation of the TOC (Table Of Contents), which is created for
17278 every executable file.  The @option{-mfull-toc} option is selected by
17279 default.  In that case, GCC allocates at least one TOC entry for
17280 each unique non-automatic variable reference in your program.  GCC
17281 also places floating-point constants in the TOC@.  However, only
17282 16,384 entries are available in the TOC@.
17284 If you receive a linker error message that saying you have overflowed
17285 the available TOC space, you can reduce the amount of TOC space used
17286 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
17287 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
17288 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
17289 generate code to calculate the sum of an address and a constant at
17290 run time instead of putting that sum into the TOC@.  You may specify one
17291 or both of these options.  Each causes GCC to produce very slightly
17292 slower and larger code at the expense of conserving TOC space.
17294 If you still run out of space in the TOC even when you specify both of
17295 these options, specify @option{-mminimal-toc} instead.  This option causes
17296 GCC to make only one TOC entry for every file.  When you specify this
17297 option, GCC produces code that is slower and larger but which
17298 uses extremely little TOC space.  You may wish to use this option
17299 only on files that contain less frequently-executed code.
17301 @item -maix64
17302 @itemx -maix32
17303 @opindex maix64
17304 @opindex maix32
17305 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
17306 @code{long} type, and the infrastructure needed to support them.
17307 Specifying @option{-maix64} implies @option{-mpowerpc64},
17308 while @option{-maix32} disables the 64-bit ABI and
17309 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
17311 @item -mxl-compat
17312 @itemx -mno-xl-compat
17313 @opindex mxl-compat
17314 @opindex mno-xl-compat
17315 Produce code that conforms more closely to IBM XL compiler semantics
17316 when using AIX-compatible ABI@.  Pass floating-point arguments to
17317 prototyped functions beyond the register save area (RSA) on the stack
17318 in addition to argument FPRs.  Do not assume that most significant
17319 double in 128-bit long double value is properly rounded when comparing
17320 values and converting to double.  Use XL symbol names for long double
17321 support routines.
17323 The AIX calling convention was extended but not initially documented to
17324 handle an obscure K&R C case of calling a function that takes the
17325 address of its arguments with fewer arguments than declared.  IBM XL
17326 compilers access floating-point arguments that do not fit in the
17327 RSA from the stack when a subroutine is compiled without
17328 optimization.  Because always storing floating-point arguments on the
17329 stack is inefficient and rarely needed, this option is not enabled by
17330 default and only is necessary when calling subroutines compiled by IBM
17331 XL compilers without optimization.
17333 @item -mpe
17334 @opindex mpe
17335 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
17336 application written to use message passing with special startup code to
17337 enable the application to run.  The system must have PE installed in the
17338 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
17339 must be overridden with the @option{-specs=} option to specify the
17340 appropriate directory location.  The Parallel Environment does not
17341 support threads, so the @option{-mpe} option and the @option{-pthread}
17342 option are incompatible.
17344 @item -malign-natural
17345 @itemx -malign-power
17346 @opindex malign-natural
17347 @opindex malign-power
17348 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
17349 @option{-malign-natural} overrides the ABI-defined alignment of larger
17350 types, such as floating-point doubles, on their natural size-based boundary.
17351 The option @option{-malign-power} instructs GCC to follow the ABI-specified
17352 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
17354 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
17355 is not supported.
17357 @item -msoft-float
17358 @itemx -mhard-float
17359 @opindex msoft-float
17360 @opindex mhard-float
17361 Generate code that does not use (uses) the floating-point register set.
17362 Software floating-point emulation is provided if you use the
17363 @option{-msoft-float} option, and pass the option to GCC when linking.
17365 @item -msingle-float
17366 @itemx -mdouble-float
17367 @opindex msingle-float
17368 @opindex mdouble-float
17369 Generate code for single- or double-precision floating-point operations.
17370 @option{-mdouble-float} implies @option{-msingle-float}.
17372 @item -msimple-fpu
17373 @opindex msimple-fpu
17374 Do not generate @code{sqrt} and @code{div} instructions for hardware
17375 floating-point unit.
17377 @item -mfpu=@var{name}
17378 @opindex mfpu
17379 Specify type of floating-point unit.  Valid values for @var{name} are
17380 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
17381 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
17382 @samp{sp_full} (equivalent to @option{-msingle-float}),
17383 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
17385 @item -mxilinx-fpu
17386 @opindex mxilinx-fpu
17387 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
17389 @item -mmultiple
17390 @itemx -mno-multiple
17391 @opindex mmultiple
17392 @opindex mno-multiple
17393 Generate code that uses (does not use) the load multiple word
17394 instructions and the store multiple word instructions.  These
17395 instructions are generated by default on POWER systems, and not
17396 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
17397 PowerPC systems, since those instructions do not work when the
17398 processor is in little-endian mode.  The exceptions are PPC740 and
17399 PPC750 which permit these instructions in little-endian mode.
17401 @item -mstring
17402 @itemx -mno-string
17403 @opindex mstring
17404 @opindex mno-string
17405 Generate code that uses (does not use) the load string instructions
17406 and the store string word instructions to save multiple registers and
17407 do small block moves.  These instructions are generated by default on
17408 POWER systems, and not generated on PowerPC systems.  Do not use
17409 @option{-mstring} on little-endian PowerPC systems, since those
17410 instructions do not work when the processor is in little-endian mode.
17411 The exceptions are PPC740 and PPC750 which permit these instructions
17412 in little-endian mode.
17414 @item -mupdate
17415 @itemx -mno-update
17416 @opindex mupdate
17417 @opindex mno-update
17418 Generate code that uses (does not use) the load or store instructions
17419 that update the base register to the address of the calculated memory
17420 location.  These instructions are generated by default.  If you use
17421 @option{-mno-update}, there is a small window between the time that the
17422 stack pointer is updated and the address of the previous frame is
17423 stored, which means code that walks the stack frame across interrupts or
17424 signals may get corrupted data.
17426 @item -mavoid-indexed-addresses
17427 @itemx -mno-avoid-indexed-addresses
17428 @opindex mavoid-indexed-addresses
17429 @opindex mno-avoid-indexed-addresses
17430 Generate code that tries to avoid (not avoid) the use of indexed load
17431 or store instructions. These instructions can incur a performance
17432 penalty on Power6 processors in certain situations, such as when
17433 stepping through large arrays that cross a 16M boundary.  This option
17434 is enabled by default when targeting Power6 and disabled otherwise.
17436 @item -mfused-madd
17437 @itemx -mno-fused-madd
17438 @opindex mfused-madd
17439 @opindex mno-fused-madd
17440 Generate code that uses (does not use) the floating-point multiply and
17441 accumulate instructions.  These instructions are generated by default
17442 if hardware floating point is used.  The machine-dependent
17443 @option{-mfused-madd} option is now mapped to the machine-independent
17444 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
17445 mapped to @option{-ffp-contract=off}.
17447 @item -mmulhw
17448 @itemx -mno-mulhw
17449 @opindex mmulhw
17450 @opindex mno-mulhw
17451 Generate code that uses (does not use) the half-word multiply and
17452 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
17453 These instructions are generated by default when targeting those
17454 processors.
17456 @item -mdlmzb
17457 @itemx -mno-dlmzb
17458 @opindex mdlmzb
17459 @opindex mno-dlmzb
17460 Generate code that uses (does not use) the string-search @samp{dlmzb}
17461 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
17462 generated by default when targeting those processors.
17464 @item -mno-bit-align
17465 @itemx -mbit-align
17466 @opindex mno-bit-align
17467 @opindex mbit-align
17468 On System V.4 and embedded PowerPC systems do not (do) force structures
17469 and unions that contain bit-fields to be aligned to the base type of the
17470 bit-field.
17472 For example, by default a structure containing nothing but 8
17473 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
17474 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
17475 the structure is aligned to a 1-byte boundary and is 1 byte in
17476 size.
17478 @item -mno-strict-align
17479 @itemx -mstrict-align
17480 @opindex mno-strict-align
17481 @opindex mstrict-align
17482 On System V.4 and embedded PowerPC systems do not (do) assume that
17483 unaligned memory references are handled by the system.
17485 @item -mrelocatable
17486 @itemx -mno-relocatable
17487 @opindex mrelocatable
17488 @opindex mno-relocatable
17489 Generate code that allows (does not allow) a static executable to be
17490 relocated to a different address at run time.  A simple embedded
17491 PowerPC system loader should relocate the entire contents of
17492 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
17493 a table of 32-bit addresses generated by this option.  For this to
17494 work, all objects linked together must be compiled with
17495 @option{-mrelocatable} or @option{-mrelocatable-lib}.
17496 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
17498 @item -mrelocatable-lib
17499 @itemx -mno-relocatable-lib
17500 @opindex mrelocatable-lib
17501 @opindex mno-relocatable-lib
17502 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
17503 @code{.fixup} section to allow static executables to be relocated at
17504 run time, but @option{-mrelocatable-lib} does not use the smaller stack
17505 alignment of @option{-mrelocatable}.  Objects compiled with
17506 @option{-mrelocatable-lib} may be linked with objects compiled with
17507 any combination of the @option{-mrelocatable} options.
17509 @item -mno-toc
17510 @itemx -mtoc
17511 @opindex mno-toc
17512 @opindex mtoc
17513 On System V.4 and embedded PowerPC systems do not (do) assume that
17514 register 2 contains a pointer to a global area pointing to the addresses
17515 used in the program.
17517 @item -mlittle
17518 @itemx -mlittle-endian
17519 @opindex mlittle
17520 @opindex mlittle-endian
17521 On System V.4 and embedded PowerPC systems compile code for the
17522 processor in little-endian mode.  The @option{-mlittle-endian} option is
17523 the same as @option{-mlittle}.
17525 @item -mbig
17526 @itemx -mbig-endian
17527 @opindex mbig
17528 @opindex mbig-endian
17529 On System V.4 and embedded PowerPC systems compile code for the
17530 processor in big-endian mode.  The @option{-mbig-endian} option is
17531 the same as @option{-mbig}.
17533 @item -mdynamic-no-pic
17534 @opindex mdynamic-no-pic
17535 On Darwin and Mac OS X systems, compile code so that it is not
17536 relocatable, but that its external references are relocatable.  The
17537 resulting code is suitable for applications, but not shared
17538 libraries.
17540 @item -msingle-pic-base
17541 @opindex msingle-pic-base
17542 Treat the register used for PIC addressing as read-only, rather than
17543 loading it in the prologue for each function.  The runtime system is
17544 responsible for initializing this register with an appropriate value
17545 before execution begins.
17547 @item -mprioritize-restricted-insns=@var{priority}
17548 @opindex mprioritize-restricted-insns
17549 This option controls the priority that is assigned to
17550 dispatch-slot restricted instructions during the second scheduling
17551 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
17552 or @samp{2} to assign no, highest, or second-highest (respectively) 
17553 priority to dispatch-slot restricted
17554 instructions.
17556 @item -msched-costly-dep=@var{dependence_type}
17557 @opindex msched-costly-dep
17558 This option controls which dependences are considered costly
17559 by the target during instruction scheduling.  The argument
17560 @var{dependence_type} takes one of the following values:
17562 @table @asis
17563 @item @samp{no}
17564 No dependence is costly.
17566 @item @samp{all}
17567 All dependences are costly.
17569 @item @samp{true_store_to_load}
17570 A true dependence from store to load is costly.
17572 @item @samp{store_to_load}
17573 Any dependence from store to load is costly.
17575 @item @var{number}
17576 Any dependence for which the latency is greater than or equal to 
17577 @var{number} is costly.
17578 @end table
17580 @item -minsert-sched-nops=@var{scheme}
17581 @opindex minsert-sched-nops
17582 This option controls which NOP insertion scheme is used during
17583 the second scheduling pass.  The argument @var{scheme} takes one of the
17584 following values:
17586 @table @asis
17587 @item @samp{no}
17588 Don't insert NOPs.
17590 @item @samp{pad}
17591 Pad with NOPs any dispatch group that has vacant issue slots,
17592 according to the scheduler's grouping.
17594 @item @samp{regroup_exact}
17595 Insert NOPs to force costly dependent insns into
17596 separate groups.  Insert exactly as many NOPs as needed to force an insn
17597 to a new group, according to the estimated processor grouping.
17599 @item @var{number}
17600 Insert NOPs to force costly dependent insns into
17601 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
17602 @end table
17604 @item -mcall-sysv
17605 @opindex mcall-sysv
17606 On System V.4 and embedded PowerPC systems compile code using calling
17607 conventions that adhere to the March 1995 draft of the System V
17608 Application Binary Interface, PowerPC processor supplement.  This is the
17609 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
17611 @item -mcall-sysv-eabi
17612 @itemx -mcall-eabi
17613 @opindex mcall-sysv-eabi
17614 @opindex mcall-eabi
17615 Specify both @option{-mcall-sysv} and @option{-meabi} options.
17617 @item -mcall-sysv-noeabi
17618 @opindex mcall-sysv-noeabi
17619 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
17621 @item -mcall-aixdesc
17622 @opindex m
17623 On System V.4 and embedded PowerPC systems compile code for the AIX
17624 operating system.
17626 @item -mcall-linux
17627 @opindex mcall-linux
17628 On System V.4 and embedded PowerPC systems compile code for the
17629 Linux-based GNU system.
17631 @item -mcall-freebsd
17632 @opindex mcall-freebsd
17633 On System V.4 and embedded PowerPC systems compile code for the
17634 FreeBSD operating system.
17636 @item -mcall-netbsd
17637 @opindex mcall-netbsd
17638 On System V.4 and embedded PowerPC systems compile code for the
17639 NetBSD operating system.
17641 @item -mcall-openbsd
17642 @opindex mcall-netbsd
17643 On System V.4 and embedded PowerPC systems compile code for the
17644 OpenBSD operating system.
17646 @item -maix-struct-return
17647 @opindex maix-struct-return
17648 Return all structures in memory (as specified by the AIX ABI)@.
17650 @item -msvr4-struct-return
17651 @opindex msvr4-struct-return
17652 Return structures smaller than 8 bytes in registers (as specified by the
17653 SVR4 ABI)@.
17655 @item -mabi=@var{abi-type}
17656 @opindex mabi
17657 Extend the current ABI with a particular extension, or remove such extension.
17658 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
17659 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
17661 @item -mabi=spe
17662 @opindex mabi=spe
17663 Extend the current ABI with SPE ABI extensions.  This does not change
17664 the default ABI, instead it adds the SPE ABI extensions to the current
17665 ABI@.
17667 @item -mabi=no-spe
17668 @opindex mabi=no-spe
17669 Disable Book-E SPE ABI extensions for the current ABI@.
17671 @item -mabi=ibmlongdouble
17672 @opindex mabi=ibmlongdouble
17673 Change the current ABI to use IBM extended-precision long double.
17674 This is a PowerPC 32-bit SYSV ABI option.
17676 @item -mabi=ieeelongdouble
17677 @opindex mabi=ieeelongdouble
17678 Change the current ABI to use IEEE extended-precision long double.
17679 This is a PowerPC 32-bit Linux ABI option.
17681 @item -mprototype
17682 @itemx -mno-prototype
17683 @opindex mprototype
17684 @opindex mno-prototype
17685 On System V.4 and embedded PowerPC systems assume that all calls to
17686 variable argument functions are properly prototyped.  Otherwise, the
17687 compiler must insert an instruction before every non-prototyped call to
17688 set or clear bit 6 of the condition code register (@var{CR}) to
17689 indicate whether floating-point values are passed in the floating-point
17690 registers in case the function takes variable arguments.  With
17691 @option{-mprototype}, only calls to prototyped variable argument functions
17692 set or clear the bit.
17694 @item -msim
17695 @opindex msim
17696 On embedded PowerPC systems, assume that the startup module is called
17697 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
17698 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
17699 configurations.
17701 @item -mmvme
17702 @opindex mmvme
17703 On embedded PowerPC systems, assume that the startup module is called
17704 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
17705 @file{libc.a}.
17707 @item -mads
17708 @opindex mads
17709 On embedded PowerPC systems, assume that the startup module is called
17710 @file{crt0.o} and the standard C libraries are @file{libads.a} and
17711 @file{libc.a}.
17713 @item -myellowknife
17714 @opindex myellowknife
17715 On embedded PowerPC systems, assume that the startup module is called
17716 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
17717 @file{libc.a}.
17719 @item -mvxworks
17720 @opindex mvxworks
17721 On System V.4 and embedded PowerPC systems, specify that you are
17722 compiling for a VxWorks system.
17724 @item -memb
17725 @opindex memb
17726 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
17727 header to indicate that @samp{eabi} extended relocations are used.
17729 @item -meabi
17730 @itemx -mno-eabi
17731 @opindex meabi
17732 @opindex mno-eabi
17733 On System V.4 and embedded PowerPC systems do (do not) adhere to the
17734 Embedded Applications Binary Interface (EABI), which is a set of
17735 modifications to the System V.4 specifications.  Selecting @option{-meabi}
17736 means that the stack is aligned to an 8-byte boundary, a function
17737 @code{__eabi} is called from @code{main} to set up the EABI
17738 environment, and the @option{-msdata} option can use both @code{r2} and
17739 @code{r13} to point to two separate small data areas.  Selecting
17740 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
17741 no EABI initialization function is called from @code{main}, and the
17742 @option{-msdata} option only uses @code{r13} to point to a single
17743 small data area.  The @option{-meabi} option is on by default if you
17744 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
17746 @item -msdata=eabi
17747 @opindex msdata=eabi
17748 On System V.4 and embedded PowerPC systems, put small initialized
17749 @code{const} global and static data in the @samp{.sdata2} section, which
17750 is pointed to by register @code{r2}.  Put small initialized
17751 non-@code{const} global and static data in the @samp{.sdata} section,
17752 which is pointed to by register @code{r13}.  Put small uninitialized
17753 global and static data in the @samp{.sbss} section, which is adjacent to
17754 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
17755 incompatible with the @option{-mrelocatable} option.  The
17756 @option{-msdata=eabi} option also sets the @option{-memb} option.
17758 @item -msdata=sysv
17759 @opindex msdata=sysv
17760 On System V.4 and embedded PowerPC systems, put small global and static
17761 data in the @samp{.sdata} section, which is pointed to by register
17762 @code{r13}.  Put small uninitialized global and static data in the
17763 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
17764 The @option{-msdata=sysv} option is incompatible with the
17765 @option{-mrelocatable} option.
17767 @item -msdata=default
17768 @itemx -msdata
17769 @opindex msdata=default
17770 @opindex msdata
17771 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
17772 compile code the same as @option{-msdata=eabi}, otherwise compile code the
17773 same as @option{-msdata=sysv}.
17775 @item -msdata=data
17776 @opindex msdata=data
17777 On System V.4 and embedded PowerPC systems, put small global
17778 data in the @samp{.sdata} section.  Put small uninitialized global
17779 data in the @samp{.sbss} section.  Do not use register @code{r13}
17780 to address small data however.  This is the default behavior unless
17781 other @option{-msdata} options are used.
17783 @item -msdata=none
17784 @itemx -mno-sdata
17785 @opindex msdata=none
17786 @opindex mno-sdata
17787 On embedded PowerPC systems, put all initialized global and static data
17788 in the @samp{.data} section, and all uninitialized data in the
17789 @samp{.bss} section.
17791 @item -mblock-move-inline-limit=@var{num}
17792 @opindex mblock-move-inline-limit
17793 Inline all block moves (such as calls to @code{memcpy} or structure
17794 copies) less than or equal to @var{num} bytes.  The minimum value for
17795 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
17796 targets.  The default value is target-specific.
17798 @item -G @var{num}
17799 @opindex G
17800 @cindex smaller data references (PowerPC)
17801 @cindex .sdata/.sdata2 references (PowerPC)
17802 On embedded PowerPC systems, put global and static items less than or
17803 equal to @var{num} bytes into the small data or BSS sections instead of
17804 the normal data or BSS section.  By default, @var{num} is 8.  The
17805 @option{-G @var{num}} switch is also passed to the linker.
17806 All modules should be compiled with the same @option{-G @var{num}} value.
17808 @item -mregnames
17809 @itemx -mno-regnames
17810 @opindex mregnames
17811 @opindex mno-regnames
17812 On System V.4 and embedded PowerPC systems do (do not) emit register
17813 names in the assembly language output using symbolic forms.
17815 @item -mlongcall
17816 @itemx -mno-longcall
17817 @opindex mlongcall
17818 @opindex mno-longcall
17819 By default assume that all calls are far away so that a longer and more
17820 expensive calling sequence is required.  This is required for calls
17821 farther than 32 megabytes (33,554,432 bytes) from the current location.
17822 A short call is generated if the compiler knows
17823 the call cannot be that far away.  This setting can be overridden by
17824 the @code{shortcall} function attribute, or by @code{#pragma
17825 longcall(0)}.
17827 Some linkers are capable of detecting out-of-range calls and generating
17828 glue code on the fly.  On these systems, long calls are unnecessary and
17829 generate slower code.  As of this writing, the AIX linker can do this,
17830 as can the GNU linker for PowerPC/64.  It is planned to add this feature
17831 to the GNU linker for 32-bit PowerPC systems as well.
17833 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
17834 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
17835 addresses represent the callee and the branch island.  The
17836 Darwin/PPC linker prefers the first address and generates a @code{bl
17837 callee} if the PPC @code{bl} instruction reaches the callee directly;
17838 otherwise, the linker generates @code{bl L42} to call the branch
17839 island.  The branch island is appended to the body of the
17840 calling function; it computes the full 32-bit address of the callee
17841 and jumps to it.
17843 On Mach-O (Darwin) systems, this option directs the compiler emit to
17844 the glue for every direct call, and the Darwin linker decides whether
17845 to use or discard it.
17847 In the future, GCC may ignore all longcall specifications
17848 when the linker is known to generate glue.
17850 @item -mtls-markers
17851 @itemx -mno-tls-markers
17852 @opindex mtls-markers
17853 @opindex mno-tls-markers
17854 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
17855 specifying the function argument.  The relocation allows the linker to
17856 reliably associate function call with argument setup instructions for
17857 TLS optimization, which in turn allows GCC to better schedule the
17858 sequence.
17860 @item -pthread
17861 @opindex pthread
17862 Adds support for multithreading with the @dfn{pthreads} library.
17863 This option sets flags for both the preprocessor and linker.
17865 @item -mrecip
17866 @itemx -mno-recip
17867 @opindex mrecip
17868 This option enables use of the reciprocal estimate and
17869 reciprocal square root estimate instructions with additional
17870 Newton-Raphson steps to increase precision instead of doing a divide or
17871 square root and divide for floating-point arguments.  You should use
17872 the @option{-ffast-math} option when using @option{-mrecip} (or at
17873 least @option{-funsafe-math-optimizations},
17874 @option{-finite-math-only}, @option{-freciprocal-math} and
17875 @option{-fno-trapping-math}).  Note that while the throughput of the
17876 sequence is generally higher than the throughput of the non-reciprocal
17877 instruction, the precision of the sequence can be decreased by up to 2
17878 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
17879 roots.
17881 @item -mrecip=@var{opt}
17882 @opindex mrecip=opt
17883 This option controls which reciprocal estimate instructions
17884 may be used.  @var{opt} is a comma-separated list of options, which may
17885 be preceded by a @code{!} to invert the option:
17886 @code{all}: enable all estimate instructions,
17887 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
17888 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
17889 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
17890 @code{divf}: enable the single-precision reciprocal approximation instructions;
17891 @code{divd}: enable the double-precision reciprocal approximation instructions;
17892 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
17893 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
17894 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
17896 So, for example, @option{-mrecip=all,!rsqrtd} enables
17897 all of the reciprocal estimate instructions, except for the
17898 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
17899 which handle the double-precision reciprocal square root calculations.
17901 @item -mrecip-precision
17902 @itemx -mno-recip-precision
17903 @opindex mrecip-precision
17904 Assume (do not assume) that the reciprocal estimate instructions
17905 provide higher-precision estimates than is mandated by the PowerPC
17906 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
17907 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
17908 The double-precision square root estimate instructions are not generated by
17909 default on low-precision machines, since they do not provide an
17910 estimate that converges after three steps.
17912 @item -mveclibabi=@var{type}
17913 @opindex mveclibabi
17914 Specifies the ABI type to use for vectorizing intrinsics using an
17915 external library.  The only type supported at present is @code{mass},
17916 which specifies to use IBM's Mathematical Acceleration Subsystem
17917 (MASS) libraries for vectorizing intrinsics using external libraries.
17918 GCC currently emits calls to @code{acosd2}, @code{acosf4},
17919 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
17920 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
17921 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
17922 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
17923 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
17924 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
17925 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
17926 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
17927 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
17928 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
17929 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
17930 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
17931 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
17932 for power7.  Both @option{-ftree-vectorize} and
17933 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
17934 libraries must be specified at link time.
17936 @item -mfriz
17937 @itemx -mno-friz
17938 @opindex mfriz
17939 Generate (do not generate) the @code{friz} instruction when the
17940 @option{-funsafe-math-optimizations} option is used to optimize
17941 rounding of floating-point values to 64-bit integer and back to floating
17942 point.  The @code{friz} instruction does not return the same value if
17943 the floating-point number is too large to fit in an integer.
17945 @item -mpointers-to-nested-functions
17946 @itemx -mno-pointers-to-nested-functions
17947 @opindex mpointers-to-nested-functions
17948 Generate (do not generate) code to load up the static chain register
17949 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
17950 systems where a function pointer points to a 3-word descriptor giving
17951 the function address, TOC value to be loaded in register @var{r2}, and
17952 static chain value to be loaded in register @var{r11}.  The
17953 @option{-mpointers-to-nested-functions} is on by default.  You cannot
17954 call through pointers to nested functions or pointers
17955 to functions compiled in other languages that use the static chain if
17956 you use the @option{-mno-pointers-to-nested-functions}.
17958 @item -msave-toc-indirect
17959 @itemx -mno-save-toc-indirect
17960 @opindex msave-toc-indirect
17961 Generate (do not generate) code to save the TOC value in the reserved
17962 stack location in the function prologue if the function calls through
17963 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
17964 saved in the prologue, it is saved just before the call through the
17965 pointer.  The @option{-mno-save-toc-indirect} option is the default.
17966 @end table
17968 @node RX Options
17969 @subsection RX Options
17970 @cindex RX Options
17972 These command-line options are defined for RX targets:
17974 @table @gcctabopt
17975 @item -m64bit-doubles
17976 @itemx -m32bit-doubles
17977 @opindex m64bit-doubles
17978 @opindex m32bit-doubles
17979 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
17980 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
17981 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
17982 works on 32-bit values, which is why the default is
17983 @option{-m32bit-doubles}.
17985 @item -fpu
17986 @itemx -nofpu
17987 @opindex fpu
17988 @opindex nofpu
17989 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
17990 floating-point hardware.  The default is enabled for the @var{RX600}
17991 series and disabled for the @var{RX200} series.
17993 Floating-point instructions are only generated for 32-bit floating-point 
17994 values, however, so the FPU hardware is not used for doubles if the
17995 @option{-m64bit-doubles} option is used.
17997 @emph{Note} If the @option{-fpu} option is enabled then
17998 @option{-funsafe-math-optimizations} is also enabled automatically.
17999 This is because the RX FPU instructions are themselves unsafe.
18001 @item -mcpu=@var{name}
18002 @opindex -mcpu
18003 Selects the type of RX CPU to be targeted.  Currently three types are
18004 supported, the generic @var{RX600} and @var{RX200} series hardware and
18005 the specific @var{RX610} CPU.  The default is @var{RX600}.
18007 The only difference between @var{RX600} and @var{RX610} is that the
18008 @var{RX610} does not support the @code{MVTIPL} instruction.
18010 The @var{RX200} series does not have a hardware floating-point unit
18011 and so @option{-nofpu} is enabled by default when this type is
18012 selected.
18014 @item -mbig-endian-data
18015 @itemx -mlittle-endian-data
18016 @opindex mbig-endian-data
18017 @opindex mlittle-endian-data
18018 Store data (but not code) in the big-endian format.  The default is
18019 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
18020 format.
18022 @item -msmall-data-limit=@var{N}
18023 @opindex msmall-data-limit
18024 Specifies the maximum size in bytes of global and static variables
18025 which can be placed into the small data area.  Using the small data
18026 area can lead to smaller and faster code, but the size of area is
18027 limited and it is up to the programmer to ensure that the area does
18028 not overflow.  Also when the small data area is used one of the RX's
18029 registers (usually @code{r13}) is reserved for use pointing to this
18030 area, so it is no longer available for use by the compiler.  This
18031 could result in slower and/or larger code if variables are pushed onto
18032 the stack instead of being held in this register.
18034 Note, common variables (variables that have not been initialized) and
18035 constants are not placed into the small data area as they are assigned
18036 to other sections in the output executable.
18038 The default value is zero, which disables this feature.  Note, this
18039 feature is not enabled by default with higher optimization levels
18040 (@option{-O2} etc) because of the potentially detrimental effects of
18041 reserving a register.  It is up to the programmer to experiment and
18042 discover whether this feature is of benefit to their program.  See the
18043 description of the @option{-mpid} option for a description of how the
18044 actual register to hold the small data area pointer is chosen.
18046 @item -msim
18047 @itemx -mno-sim
18048 @opindex msim
18049 @opindex mno-sim
18050 Use the simulator runtime.  The default is to use the libgloss
18051 board-specific runtime.
18053 @item -mas100-syntax
18054 @itemx -mno-as100-syntax
18055 @opindex mas100-syntax
18056 @opindex mno-as100-syntax
18057 When generating assembler output use a syntax that is compatible with
18058 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
18059 assembler, but it has some restrictions so it is not generated by default.
18061 @item -mmax-constant-size=@var{N}
18062 @opindex mmax-constant-size
18063 Specifies the maximum size, in bytes, of a constant that can be used as
18064 an operand in a RX instruction.  Although the RX instruction set does
18065 allow constants of up to 4 bytes in length to be used in instructions,
18066 a longer value equates to a longer instruction.  Thus in some
18067 circumstances it can be beneficial to restrict the size of constants
18068 that are used in instructions.  Constants that are too big are instead
18069 placed into a constant pool and referenced via register indirection.
18071 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
18072 or 4 means that constants of any size are allowed.
18074 @item -mrelax
18075 @opindex mrelax
18076 Enable linker relaxation.  Linker relaxation is a process whereby the
18077 linker attempts to reduce the size of a program by finding shorter
18078 versions of various instructions.  Disabled by default.
18080 @item -mint-register=@var{N}
18081 @opindex mint-register
18082 Specify the number of registers to reserve for fast interrupt handler
18083 functions.  The value @var{N} can be between 0 and 4.  A value of 1
18084 means that register @code{r13} is reserved for the exclusive use
18085 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
18086 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
18087 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
18088 A value of 0, the default, does not reserve any registers.
18090 @item -msave-acc-in-interrupts
18091 @opindex msave-acc-in-interrupts
18092 Specifies that interrupt handler functions should preserve the
18093 accumulator register.  This is only necessary if normal code might use
18094 the accumulator register, for example because it performs 64-bit
18095 multiplications.  The default is to ignore the accumulator as this
18096 makes the interrupt handlers faster.
18098 @item -mpid
18099 @itemx -mno-pid
18100 @opindex mpid
18101 @opindex mno-pid
18102 Enables the generation of position independent data.  When enabled any
18103 access to constant data is done via an offset from a base address
18104 held in a register.  This allows the location of constant data to be
18105 determined at run time without requiring the executable to be
18106 relocated, which is a benefit to embedded applications with tight
18107 memory constraints.  Data that can be modified is not affected by this
18108 option.
18110 Note, using this feature reserves a register, usually @code{r13}, for
18111 the constant data base address.  This can result in slower and/or
18112 larger code, especially in complicated functions.
18114 The actual register chosen to hold the constant data base address
18115 depends upon whether the @option{-msmall-data-limit} and/or the
18116 @option{-mint-register} command-line options are enabled.  Starting
18117 with register @code{r13} and proceeding downwards, registers are
18118 allocated first to satisfy the requirements of @option{-mint-register},
18119 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
18120 is possible for the small data area register to be @code{r8} if both
18121 @option{-mint-register=4} and @option{-mpid} are specified on the
18122 command line.
18124 By default this feature is not enabled.  The default can be restored
18125 via the @option{-mno-pid} command-line option.
18127 @item -mno-warn-multiple-fast-interrupts
18128 @itemx -mwarn-multiple-fast-interrupts
18129 @opindex mno-warn-multiple-fast-interrupts
18130 @opindex mwarn-multiple-fast-interrupts
18131 Prevents GCC from issuing a warning message if it finds more than one
18132 fast interrupt handler when it is compiling a file.  The default is to
18133 issue a warning for each extra fast interrupt handler found, as the RX
18134 only supports one such interrupt.
18136 @end table
18138 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
18139 has special significance to the RX port when used with the
18140 @code{interrupt} function attribute.  This attribute indicates a
18141 function intended to process fast interrupts.  GCC ensures
18142 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
18143 and/or @code{r13} and only provided that the normal use of the
18144 corresponding registers have been restricted via the
18145 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
18146 options.
18148 @node S/390 and zSeries Options
18149 @subsection S/390 and zSeries Options
18150 @cindex S/390 and zSeries Options
18152 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
18154 @table @gcctabopt
18155 @item -mhard-float
18156 @itemx -msoft-float
18157 @opindex mhard-float
18158 @opindex msoft-float
18159 Use (do not use) the hardware floating-point instructions and registers
18160 for floating-point operations.  When @option{-msoft-float} is specified,
18161 functions in @file{libgcc.a} are used to perform floating-point
18162 operations.  When @option{-mhard-float} is specified, the compiler
18163 generates IEEE floating-point instructions.  This is the default.
18165 @item -mhard-dfp
18166 @itemx -mno-hard-dfp
18167 @opindex mhard-dfp
18168 @opindex mno-hard-dfp
18169 Use (do not use) the hardware decimal-floating-point instructions for
18170 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
18171 specified, functions in @file{libgcc.a} are used to perform
18172 decimal-floating-point operations.  When @option{-mhard-dfp} is
18173 specified, the compiler generates decimal-floating-point hardware
18174 instructions.  This is the default for @option{-march=z9-ec} or higher.
18176 @item -mlong-double-64
18177 @itemx -mlong-double-128
18178 @opindex mlong-double-64
18179 @opindex mlong-double-128
18180 These switches control the size of @code{long double} type. A size
18181 of 64 bits makes the @code{long double} type equivalent to the @code{double}
18182 type. This is the default.
18184 @item -mbackchain
18185 @itemx -mno-backchain
18186 @opindex mbackchain
18187 @opindex mno-backchain
18188 Store (do not store) the address of the caller's frame as backchain pointer
18189 into the callee's stack frame.
18190 A backchain may be needed to allow debugging using tools that do not understand
18191 DWARF 2 call frame information.
18192 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
18193 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
18194 the backchain is placed into the topmost word of the 96/160 byte register
18195 save area.
18197 In general, code compiled with @option{-mbackchain} is call-compatible with
18198 code compiled with @option{-mmo-backchain}; however, use of the backchain
18199 for debugging purposes usually requires that the whole binary is built with
18200 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
18201 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18202 to build a linux kernel use @option{-msoft-float}.
18204 The default is to not maintain the backchain.
18206 @item -mpacked-stack
18207 @itemx -mno-packed-stack
18208 @opindex mpacked-stack
18209 @opindex mno-packed-stack
18210 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
18211 specified, the compiler uses the all fields of the 96/160 byte register save
18212 area only for their default purpose; unused fields still take up stack space.
18213 When @option{-mpacked-stack} is specified, register save slots are densely
18214 packed at the top of the register save area; unused space is reused for other
18215 purposes, allowing for more efficient use of the available stack space.
18216 However, when @option{-mbackchain} is also in effect, the topmost word of
18217 the save area is always used to store the backchain, and the return address
18218 register is always saved two words below the backchain.
18220 As long as the stack frame backchain is not used, code generated with
18221 @option{-mpacked-stack} is call-compatible with code generated with
18222 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
18223 S/390 or zSeries generated code that uses the stack frame backchain at run
18224 time, not just for debugging purposes.  Such code is not call-compatible
18225 with code compiled with @option{-mpacked-stack}.  Also, note that the
18226 combination of @option{-mbackchain},
18227 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18228 to build a linux kernel use @option{-msoft-float}.
18230 The default is to not use the packed stack layout.
18232 @item -msmall-exec
18233 @itemx -mno-small-exec
18234 @opindex msmall-exec
18235 @opindex mno-small-exec
18236 Generate (or do not generate) code using the @code{bras} instruction
18237 to do subroutine calls.
18238 This only works reliably if the total executable size does not
18239 exceed 64k.  The default is to use the @code{basr} instruction instead,
18240 which does not have this limitation.
18242 @item -m64
18243 @itemx -m31
18244 @opindex m64
18245 @opindex m31
18246 When @option{-m31} is specified, generate code compliant to the
18247 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
18248 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
18249 particular to generate 64-bit instructions.  For the @samp{s390}
18250 targets, the default is @option{-m31}, while the @samp{s390x}
18251 targets default to @option{-m64}.
18253 @item -mzarch
18254 @itemx -mesa
18255 @opindex mzarch
18256 @opindex mesa
18257 When @option{-mzarch} is specified, generate code using the
18258 instructions available on z/Architecture.
18259 When @option{-mesa} is specified, generate code using the
18260 instructions available on ESA/390.  Note that @option{-mesa} is
18261 not possible with @option{-m64}.
18262 When generating code compliant to the GNU/Linux for S/390 ABI,
18263 the default is @option{-mesa}.  When generating code compliant
18264 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
18266 @item -mmvcle
18267 @itemx -mno-mvcle
18268 @opindex mmvcle
18269 @opindex mno-mvcle
18270 Generate (or do not generate) code using the @code{mvcle} instruction
18271 to perform block moves.  When @option{-mno-mvcle} is specified,
18272 use a @code{mvc} loop instead.  This is the default unless optimizing for
18273 size.
18275 @item -mdebug
18276 @itemx -mno-debug
18277 @opindex mdebug
18278 @opindex mno-debug
18279 Print (or do not print) additional debug information when compiling.
18280 The default is to not print debug information.
18282 @item -march=@var{cpu-type}
18283 @opindex march
18284 Generate code that runs on @var{cpu-type}, which is the name of a system
18285 representing a certain processor type.  Possible values for
18286 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
18287 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
18288 When generating code using the instructions available on z/Architecture,
18289 the default is @option{-march=z900}.  Otherwise, the default is
18290 @option{-march=g5}.
18292 @item -mtune=@var{cpu-type}
18293 @opindex mtune
18294 Tune to @var{cpu-type} everything applicable about the generated code,
18295 except for the ABI and the set of available instructions.
18296 The list of @var{cpu-type} values is the same as for @option{-march}.
18297 The default is the value used for @option{-march}.
18299 @item -mtpf-trace
18300 @itemx -mno-tpf-trace
18301 @opindex mtpf-trace
18302 @opindex mno-tpf-trace
18303 Generate code that adds (does not add) in TPF OS specific branches to trace
18304 routines in the operating system.  This option is off by default, even
18305 when compiling for the TPF OS@.
18307 @item -mfused-madd
18308 @itemx -mno-fused-madd
18309 @opindex mfused-madd
18310 @opindex mno-fused-madd
18311 Generate code that uses (does not use) the floating-point multiply and
18312 accumulate instructions.  These instructions are generated by default if
18313 hardware floating point is used.
18315 @item -mwarn-framesize=@var{framesize}
18316 @opindex mwarn-framesize
18317 Emit a warning if the current function exceeds the given frame size.  Because
18318 this is a compile-time check it doesn't need to be a real problem when the program
18319 runs.  It is intended to identify functions that most probably cause
18320 a stack overflow.  It is useful to be used in an environment with limited stack
18321 size e.g.@: the linux kernel.
18323 @item -mwarn-dynamicstack
18324 @opindex mwarn-dynamicstack
18325 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
18326 arrays.  This is generally a bad idea with a limited stack size.
18328 @item -mstack-guard=@var{stack-guard}
18329 @itemx -mstack-size=@var{stack-size}
18330 @opindex mstack-guard
18331 @opindex mstack-size
18332 If these options are provided the S/390 back end emits additional instructions in
18333 the function prologue that trigger a trap if the stack size is @var{stack-guard}
18334 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
18335 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
18336 the frame size of the compiled function is chosen.
18337 These options are intended to be used to help debugging stack overflow problems.
18338 The additionally emitted code causes only little overhead and hence can also be
18339 used in production-like systems without greater performance degradation.  The given
18340 values have to be exact powers of 2 and @var{stack-size} has to be greater than
18341 @var{stack-guard} without exceeding 64k.
18342 In order to be efficient the extra code makes the assumption that the stack starts
18343 at an address aligned to the value given by @var{stack-size}.
18344 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
18345 @end table
18347 @node Score Options
18348 @subsection Score Options
18349 @cindex Score Options
18351 These options are defined for Score implementations:
18353 @table @gcctabopt
18354 @item -meb
18355 @opindex meb
18356 Compile code for big-endian mode.  This is the default.
18358 @item -mel
18359 @opindex mel
18360 Compile code for little-endian mode.
18362 @item -mnhwloop
18363 @opindex mnhwloop
18364 Disable generation of @code{bcnz} instructions.
18366 @item -muls
18367 @opindex muls
18368 Enable generation of unaligned load and store instructions.
18370 @item -mmac
18371 @opindex mmac
18372 Enable the use of multiply-accumulate instructions. Disabled by default.
18374 @item -mscore5
18375 @opindex mscore5
18376 Specify the SCORE5 as the target architecture.
18378 @item -mscore5u
18379 @opindex mscore5u
18380 Specify the SCORE5U of the target architecture.
18382 @item -mscore7
18383 @opindex mscore7
18384 Specify the SCORE7 as the target architecture. This is the default.
18386 @item -mscore7d
18387 @opindex mscore7d
18388 Specify the SCORE7D as the target architecture.
18389 @end table
18391 @node SH Options
18392 @subsection SH Options
18394 These @samp{-m} options are defined for the SH implementations:
18396 @table @gcctabopt
18397 @item -m1
18398 @opindex m1
18399 Generate code for the SH1.
18401 @item -m2
18402 @opindex m2
18403 Generate code for the SH2.
18405 @item -m2e
18406 Generate code for the SH2e.
18408 @item -m2a-nofpu
18409 @opindex m2a-nofpu
18410 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
18411 that the floating-point unit is not used.
18413 @item -m2a-single-only
18414 @opindex m2a-single-only
18415 Generate code for the SH2a-FPU, in such a way that no double-precision
18416 floating-point operations are used.
18418 @item -m2a-single
18419 @opindex m2a-single
18420 Generate code for the SH2a-FPU assuming the floating-point unit is in
18421 single-precision mode by default.
18423 @item -m2a
18424 @opindex m2a
18425 Generate code for the SH2a-FPU assuming the floating-point unit is in
18426 double-precision mode by default.
18428 @item -m3
18429 @opindex m3
18430 Generate code for the SH3.
18432 @item -m3e
18433 @opindex m3e
18434 Generate code for the SH3e.
18436 @item -m4-nofpu
18437 @opindex m4-nofpu
18438 Generate code for the SH4 without a floating-point unit.
18440 @item -m4-single-only
18441 @opindex m4-single-only
18442 Generate code for the SH4 with a floating-point unit that only
18443 supports single-precision arithmetic.
18445 @item -m4-single
18446 @opindex m4-single
18447 Generate code for the SH4 assuming the floating-point unit is in
18448 single-precision mode by default.
18450 @item -m4
18451 @opindex m4
18452 Generate code for the SH4.
18454 @item -m4a-nofpu
18455 @opindex m4a-nofpu
18456 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
18457 floating-point unit is not used.
18459 @item -m4a-single-only
18460 @opindex m4a-single-only
18461 Generate code for the SH4a, in such a way that no double-precision
18462 floating-point operations are used.
18464 @item -m4a-single
18465 @opindex m4a-single
18466 Generate code for the SH4a assuming the floating-point unit is in
18467 single-precision mode by default.
18469 @item -m4a
18470 @opindex m4a
18471 Generate code for the SH4a.
18473 @item -m4al
18474 @opindex m4al
18475 Same as @option{-m4a-nofpu}, except that it implicitly passes
18476 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
18477 instructions at the moment.
18479 @item -mb
18480 @opindex mb
18481 Compile code for the processor in big-endian mode.
18483 @item -ml
18484 @opindex ml
18485 Compile code for the processor in little-endian mode.
18487 @item -mdalign
18488 @opindex mdalign
18489 Align doubles at 64-bit boundaries.  Note that this changes the calling
18490 conventions, and thus some functions from the standard C library do
18491 not work unless you recompile it first with @option{-mdalign}.
18493 @item -mrelax
18494 @opindex mrelax
18495 Shorten some address references at link time, when possible; uses the
18496 linker option @option{-relax}.
18498 @item -mbigtable
18499 @opindex mbigtable
18500 Use 32-bit offsets in @code{switch} tables.  The default is to use
18501 16-bit offsets.
18503 @item -mbitops
18504 @opindex mbitops
18505 Enable the use of bit manipulation instructions on SH2A.
18507 @item -mfmovd
18508 @opindex mfmovd
18509 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
18510 alignment constraints.
18512 @item -mhitachi
18513 @opindex mhitachi
18514 Comply with the calling conventions defined by Renesas.
18516 @item -mrenesas
18517 @opindex mhitachi
18518 Comply with the calling conventions defined by Renesas.
18520 @item -mno-renesas
18521 @opindex mhitachi
18522 Comply with the calling conventions defined for GCC before the Renesas
18523 conventions were available.  This option is the default for all
18524 targets of the SH toolchain.
18526 @item -mnomacsave
18527 @opindex mnomacsave
18528 Mark the @code{MAC} register as call-clobbered, even if
18529 @option{-mhitachi} is given.
18531 @item -mieee
18532 @itemx -mno-ieee
18533 @opindex mieee
18534 @opindex mnoieee
18535 Control the IEEE compliance of floating-point comparisons, which affects the
18536 handling of cases where the result of a comparison is unordered.  By default
18537 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
18538 enabled @option{-mno-ieee} is implicitly set, which results in faster
18539 floating-point greater-equal and less-equal comparisons.  The implcit settings
18540 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
18542 @item -minline-ic_invalidate
18543 @opindex minline-ic_invalidate
18544 Inline code to invalidate instruction cache entries after setting up
18545 nested function trampolines.
18546 This option has no effect if @option{-musermode} is in effect and the selected
18547 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
18548 instruction.
18549 If the selected code generation option does not allow the use of the @code{icbi}
18550 instruction, and @option{-musermode} is not in effect, the inlined code
18551 manipulates the instruction cache address array directly with an associative
18552 write.  This not only requires privileged mode at run time, but it also
18553 fails if the cache line had been mapped via the TLB and has become unmapped.
18555 @item -misize
18556 @opindex misize
18557 Dump instruction size and location in the assembly code.
18559 @item -mpadstruct
18560 @opindex mpadstruct
18561 This option is deprecated.  It pads structures to multiple of 4 bytes,
18562 which is incompatible with the SH ABI@.
18564 @item -matomic-model=@var{model}
18565 @opindex matomic-model=@var{model}
18566 Sets the model of atomic operations and additional parameters as a comma
18567 separated list.  For details on the atomic built-in functions see
18568 @ref{__atomic Builtins}.  The following models and parameters are supported:
18570 @table @samp
18572 @item none
18573 Disable compiler generated atomic sequences and emit library calls for atomic
18574 operations.  This is the default if the target is not @code{sh-*-linux*}.
18576 @item soft-gusa
18577 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
18578 built-in functions.  The generated atomic sequences require additional support
18579 from the interrupt/exception handling code of the system and are only suitable
18580 for SH3* and SH4* single-core systems.  This option is enabled by default when
18581 the target is @code{sh-*-linux*} and SH3* or SH4*.  When the target is SH4A,
18582 this option will also partially utilize the hardware atomic instructions
18583 @code{movli.l} and @code{movco.l} to create more efficient code, unless
18584 @samp{strict} is specified.  
18586 @item soft-tcb
18587 Generate software atomic sequences that use a variable in the thread control
18588 block.  This is a variation of the gUSA sequences which can also be used on
18589 SH1* and SH2* targets.  The generated atomic sequences require additional
18590 support from the interrupt/exception handling code of the system and are only
18591 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
18592 parameter has to be specified as well.
18594 @item soft-imask
18595 Generate software atomic sequences that temporarily disable interrupts by
18596 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
18597 in privileged mode and is only suitable for single-core systems.  Additional
18598 support from the interrupt/exception handling code of the system is not
18599 required.  This model is enabled by default when the target is
18600 @code{sh-*-linux*} and SH1* or SH2*.
18602 @item hard-llcs
18603 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
18604 instructions only.  This is only available on SH4A and is suitable for
18605 multi-core systems.  Since the hardware instructions support only 32 bit atomic
18606 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
18607 Code compiled with this option will also be compatible with other software
18608 atomic model interrupt/exception handling systems if executed on an SH4A
18609 system.  Additional support from the interrupt/exception handling code of the
18610 system is not required for this model.
18612 @item gbr-offset=
18613 This parameter specifies the offset in bytes of the variable in the thread
18614 control block structure that should be used by the generated atomic sequences
18615 when the @samp{soft-tcb} model has been selected.  For other models this
18616 parameter is ignored.  The specified value must be an integer multiple of four
18617 and in the range 0-1020.
18619 @item strict
18620 This parameter prevents mixed usage of multiple atomic models, even though they
18621 would be compatible, and will make the compiler generate atomic sequences of the
18622 specified model only.
18624 @end table
18626 @item -mtas
18627 @opindex mtas
18628 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
18629 Notice that depending on the particular hardware and software configuration
18630 this can degrade overall performance due to the operand cache line flushes
18631 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
18632 processors the @code{tas.b} instruction must be used with caution since it
18633 can result in data corruption for certain cache configurations.
18635 @item -mspace
18636 @opindex mspace
18637 Optimize for space instead of speed.  Implied by @option{-Os}.
18639 @item -mprefergot
18640 @opindex mprefergot
18641 When generating position-independent code, emit function calls using
18642 the Global Offset Table instead of the Procedure Linkage Table.
18644 @item -musermode
18645 @opindex musermode
18646 Don't generate privileged mode only code.  This option
18647 implies @option{-mno-inline-ic_invalidate}
18648 if the inlined code would not work in user mode.
18649 This is the default when the target is @code{sh-*-linux*}.
18651 @item -multcost=@var{number}
18652 @opindex multcost=@var{number}
18653 Set the cost to assume for a multiply insn.
18655 @item -mdiv=@var{strategy}
18656 @opindex mdiv=@var{strategy}
18657 Set the division strategy to use for SHmedia code.  @var{strategy} must be
18658 one of: 
18660 @table @samp
18662 @item fp 
18663 Performs the operation in floating point.  This has a very high latency,
18664 but needs only a few instructions, so it might be a good choice if
18665 your code has enough easily-exploitable ILP to allow the compiler to
18666 schedule the floating-point instructions together with other instructions.
18667 Division by zero causes a floating-point exception.
18669 @item inv
18670 Uses integer operations to calculate the inverse of the divisor,
18671 and then multiplies the dividend with the inverse.  This strategy allows
18672 CSE and hoisting of the inverse calculation.  Division by zero calculates
18673 an unspecified result, but does not trap.
18675 @item inv:minlat
18676 A variant of @samp{inv} where, if no CSE or hoisting opportunities
18677 have been found, or if the entire operation has been hoisted to the same
18678 place, the last stages of the inverse calculation are intertwined with the
18679 final multiply to reduce the overall latency, at the expense of using a few
18680 more instructions, and thus offering fewer scheduling opportunities with
18681 other code.
18683 @item call
18684 Calls a library function that usually implements the @samp{inv:minlat}
18685 strategy.
18686 This gives high code density for @code{m5-*media-nofpu} compilations.
18688 @item call2
18689 Uses a different entry point of the same library function, where it
18690 assumes that a pointer to a lookup table has already been set up, which
18691 exposes the pointer load to CSE and code hoisting optimizations.
18693 @item inv:call
18694 @itemx inv:call2
18695 @itemx inv:fp
18696 Use the @samp{inv} algorithm for initial
18697 code generation, but if the code stays unoptimized, revert to the @samp{call},
18698 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
18699 potentially-trapping side effect of division by zero is carried by a
18700 separate instruction, so it is possible that all the integer instructions
18701 are hoisted out, but the marker for the side effect stays where it is.
18702 A recombination to floating-point operations or a call is not possible
18703 in that case.
18705 @item inv20u
18706 @itemx inv20l
18707 Variants of the @samp{inv:minlat} strategy.  In the case
18708 that the inverse calculation is not separated from the multiply, they speed
18709 up division where the dividend fits into 20 bits (plus sign where applicable)
18710 by inserting a test to skip a number of operations in this case; this test
18711 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
18712 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
18714 @end table
18716 @item -maccumulate-outgoing-args
18717 @opindex maccumulate-outgoing-args
18718 Reserve space once for outgoing arguments in the function prologue rather
18719 than around each call.  Generally beneficial for performance and size.  Also
18720 needed for unwinding to avoid changing the stack frame around conditional code.
18722 @item -mdivsi3_libfunc=@var{name}
18723 @opindex mdivsi3_libfunc=@var{name}
18724 Set the name of the library function used for 32-bit signed division to
18725 @var{name}.
18726 This only affects the name used in the @samp{call} and @samp{inv:call}
18727 division strategies, and the compiler still expects the same
18728 sets of input/output/clobbered registers as if this option were not present.
18730 @item -mfixed-range=@var{register-range}
18731 @opindex mfixed-range
18732 Generate code treating the given register range as fixed registers.
18733 A fixed register is one that the register allocator can not use.  This is
18734 useful when compiling kernel code.  A register range is specified as
18735 two registers separated by a dash.  Multiple register ranges can be
18736 specified separated by a comma.
18738 @item -mindexed-addressing
18739 @opindex mindexed-addressing
18740 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
18741 This is only safe if the hardware and/or OS implement 32-bit wrap-around
18742 semantics for the indexed addressing mode.  The architecture allows the
18743 implementation of processors with 64-bit MMU, which the OS could use to
18744 get 32-bit addressing, but since no current hardware implementation supports
18745 this or any other way to make the indexed addressing mode safe to use in
18746 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
18748 @item -mgettrcost=@var{number}
18749 @opindex mgettrcost=@var{number}
18750 Set the cost assumed for the @code{gettr} instruction to @var{number}.
18751 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
18753 @item -mpt-fixed
18754 @opindex mpt-fixed
18755 Assume @code{pt*} instructions won't trap.  This generally generates
18756 better-scheduled code, but is unsafe on current hardware.
18757 The current architecture
18758 definition says that @code{ptabs} and @code{ptrel} trap when the target 
18759 anded with 3 is 3.
18760 This has the unintentional effect of making it unsafe to schedule these
18761 instructions before a branch, or hoist them out of a loop.  For example,
18762 @code{__do_global_ctors}, a part of @file{libgcc}
18763 that runs constructors at program
18764 startup, calls functions in a list which is delimited by @minus{}1.  With the
18765 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
18766 That means that all the constructors run a bit more quickly, but when
18767 the loop comes to the end of the list, the program crashes because @code{ptabs}
18768 loads @minus{}1 into a target register.  
18770 Since this option is unsafe for any
18771 hardware implementing the current architecture specification, the default
18772 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
18773 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
18774 this deters register allocation from using target registers for storing
18775 ordinary integers.
18777 @item -minvalid-symbols
18778 @opindex minvalid-symbols
18779 Assume symbols might be invalid.  Ordinary function symbols generated by
18780 the compiler are always valid to load with
18781 @code{movi}/@code{shori}/@code{ptabs} or
18782 @code{movi}/@code{shori}/@code{ptrel},
18783 but with assembler and/or linker tricks it is possible
18784 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
18785 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
18786 It prevents cross-basic-block CSE, hoisting and most scheduling
18787 of symbol loads.  The default is @option{-mno-invalid-symbols}.
18789 @item -mbranch-cost=@var{num}
18790 @opindex mbranch-cost=@var{num}
18791 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
18792 make the compiler try to generate more branch-free code if possible.  
18793 If not specified the value is selected depending on the processor type that
18794 is being compiled for.
18796 @item -mzdcbranch
18797 @itemx -mno-zdcbranch
18798 @opindex mzdcbranch
18799 @opindex mno-zdcbranch
18800 Assume (do not assume) that zero displacement conditional branch instructions
18801 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
18802 compiler will try to prefer zero displacement branch code sequences.  This is
18803 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
18804 disabled by specifying @option{-mno-zdcbranch}.
18806 @item -mcbranchdi
18807 @opindex mcbranchdi
18808 Enable the @code{cbranchdi4} instruction pattern.
18810 @item -mcmpeqdi
18811 @opindex mcmpeqdi
18812 Emit the @code{cmpeqdi_t} instruction pattern even when @option{-mcbranchdi}
18813 is in effect.
18815 @item -mfused-madd
18816 @itemx -mno-fused-madd
18817 @opindex mfused-madd
18818 @opindex mno-fused-madd
18819 Generate code that uses (does not use) the floating-point multiply and
18820 accumulate instructions.  These instructions are generated by default
18821 if hardware floating point is used.  The machine-dependent
18822 @option{-mfused-madd} option is now mapped to the machine-independent
18823 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
18824 mapped to @option{-ffp-contract=off}.
18826 @item -mfsca
18827 @itemx -mno-fsca
18828 @opindex mfsca
18829 @opindex mno-fsca
18830 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
18831 and cosine approximations.  The option @code{-mfsca} must be used in
18832 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
18833 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
18834 approximations even if @code{-funsafe-math-optimizations} is in effect.
18836 @item -mfsrra
18837 @itemx -mno-fsrra
18838 @opindex mfsrra
18839 @opindex mno-fsrra
18840 Allow or disallow the compiler to emit the @code{fsrra} instruction for
18841 reciprocal square root approximations.  The option @code{-mfsrra} must be used
18842 in combination with @code{-funsafe-math-optimizations} and
18843 @code{-ffinite-math-only}.  It is enabled by default when generating code for
18844 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
18845 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
18846 in effect.
18848 @item -mpretend-cmove
18849 @opindex mpretend-cmove
18850 Prefer zero-displacement conditional branches for conditional move instruction
18851 patterns.  This can result in faster code on the SH4 processor.
18853 @end table
18855 @node Solaris 2 Options
18856 @subsection Solaris 2 Options
18857 @cindex Solaris 2 options
18859 These @samp{-m} options are supported on Solaris 2:
18861 @table @gcctabopt
18862 @item -mimpure-text
18863 @opindex mimpure-text
18864 @option{-mimpure-text}, used in addition to @option{-shared}, tells
18865 the compiler to not pass @option{-z text} to the linker when linking a
18866 shared object.  Using this option, you can link position-dependent
18867 code into a shared object.
18869 @option{-mimpure-text} suppresses the ``relocations remain against
18870 allocatable but non-writable sections'' linker error message.
18871 However, the necessary relocations trigger copy-on-write, and the
18872 shared object is not actually shared across processes.  Instead of
18873 using @option{-mimpure-text}, you should compile all source code with
18874 @option{-fpic} or @option{-fPIC}.
18876 @end table
18878 These switches are supported in addition to the above on Solaris 2:
18880 @table @gcctabopt
18881 @item -pthreads
18882 @opindex pthreads
18883 Add support for multithreading using the POSIX threads library.  This
18884 option sets flags for both the preprocessor and linker.  This option does
18885 not affect the thread safety of object code produced  by the compiler or
18886 that of libraries supplied with it.
18888 @item -pthread
18889 @opindex pthread
18890 This is a synonym for @option{-pthreads}.
18891 @end table
18893 @node SPARC Options
18894 @subsection SPARC Options
18895 @cindex SPARC options
18897 These @samp{-m} options are supported on the SPARC:
18899 @table @gcctabopt
18900 @item -mno-app-regs
18901 @itemx -mapp-regs
18902 @opindex mno-app-regs
18903 @opindex mapp-regs
18904 Specify @option{-mapp-regs} to generate output using the global registers
18905 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
18906 is the default.
18908 To be fully SVR4 ABI-compliant at the cost of some performance loss,
18909 specify @option{-mno-app-regs}.  You should compile libraries and system
18910 software with this option.
18912 @item -mflat
18913 @itemx -mno-flat
18914 @opindex mflat
18915 @opindex mno-flat
18916 With @option{-mflat}, the compiler does not generate save/restore instructions
18917 and uses a ``flat'' or single register window model.  This model is compatible
18918 with the regular register window model.  The local registers and the input
18919 registers (0--5) are still treated as ``call-saved'' registers and are
18920 saved on the stack as needed.
18922 With @option{-mno-flat} (the default), the compiler generates save/restore
18923 instructions (except for leaf functions).  This is the normal operating mode.
18925 @item -mfpu
18926 @itemx -mhard-float
18927 @opindex mfpu
18928 @opindex mhard-float
18929 Generate output containing floating-point instructions.  This is the
18930 default.
18932 @item -mno-fpu
18933 @itemx -msoft-float
18934 @opindex mno-fpu
18935 @opindex msoft-float
18936 Generate output containing library calls for floating point.
18937 @strong{Warning:} the requisite libraries are not available for all SPARC
18938 targets.  Normally the facilities of the machine's usual C compiler are
18939 used, but this cannot be done directly in cross-compilation.  You must make
18940 your own arrangements to provide suitable library functions for
18941 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
18942 @samp{sparclite-*-*} do provide software floating-point support.
18944 @option{-msoft-float} changes the calling convention in the output file;
18945 therefore, it is only useful if you compile @emph{all} of a program with
18946 this option.  In particular, you need to compile @file{libgcc.a}, the
18947 library that comes with GCC, with @option{-msoft-float} in order for
18948 this to work.
18950 @item -mhard-quad-float
18951 @opindex mhard-quad-float
18952 Generate output containing quad-word (long double) floating-point
18953 instructions.
18955 @item -msoft-quad-float
18956 @opindex msoft-quad-float
18957 Generate output containing library calls for quad-word (long double)
18958 floating-point instructions.  The functions called are those specified
18959 in the SPARC ABI@.  This is the default.
18961 As of this writing, there are no SPARC implementations that have hardware
18962 support for the quad-word floating-point instructions.  They all invoke
18963 a trap handler for one of these instructions, and then the trap handler
18964 emulates the effect of the instruction.  Because of the trap handler overhead,
18965 this is much slower than calling the ABI library routines.  Thus the
18966 @option{-msoft-quad-float} option is the default.
18968 @item -mno-unaligned-doubles
18969 @itemx -munaligned-doubles
18970 @opindex mno-unaligned-doubles
18971 @opindex munaligned-doubles
18972 Assume that doubles have 8-byte alignment.  This is the default.
18974 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
18975 alignment only if they are contained in another type, or if they have an
18976 absolute address.  Otherwise, it assumes they have 4-byte alignment.
18977 Specifying this option avoids some rare compatibility problems with code
18978 generated by other compilers.  It is not the default because it results
18979 in a performance loss, especially for floating-point code.
18981 @item -mno-faster-structs
18982 @itemx -mfaster-structs
18983 @opindex mno-faster-structs
18984 @opindex mfaster-structs
18985 With @option{-mfaster-structs}, the compiler assumes that structures
18986 should have 8-byte alignment.  This enables the use of pairs of
18987 @code{ldd} and @code{std} instructions for copies in structure
18988 assignment, in place of twice as many @code{ld} and @code{st} pairs.
18989 However, the use of this changed alignment directly violates the SPARC
18990 ABI@.  Thus, it's intended only for use on targets where the developer
18991 acknowledges that their resulting code is not directly in line with
18992 the rules of the ABI@.
18994 @item -mcpu=@var{cpu_type}
18995 @opindex mcpu
18996 Set the instruction set, register set, and instruction scheduling parameters
18997 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
18998 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
18999 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
19000 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
19001 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
19002 and @samp{niagara4}.
19004 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
19005 which selects the best architecture option for the host processor.
19006 @option{-mcpu=native} has no effect if GCC does not recognize
19007 the processor.
19009 Default instruction scheduling parameters are used for values that select
19010 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
19011 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
19013 Here is a list of each supported architecture and their supported
19014 implementations.
19016 @table @asis
19017 @item v7
19018 cypress
19020 @item v8
19021 supersparc, hypersparc, leon
19023 @item sparclite
19024 f930, f934, sparclite86x
19026 @item sparclet
19027 tsc701
19029 @item v9
19030 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
19031 @end table
19033 By default (unless configured otherwise), GCC generates code for the V7
19034 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
19035 additionally optimizes it for the Cypress CY7C602 chip, as used in the
19036 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
19037 SPARCStation 1, 2, IPX etc.
19039 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
19040 architecture.  The only difference from V7 code is that the compiler emits
19041 the integer multiply and integer divide instructions which exist in SPARC-V8
19042 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
19043 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
19044 2000 series.
19046 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
19047 the SPARC architecture.  This adds the integer multiply, integer divide step
19048 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
19049 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
19050 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
19051 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
19052 MB86934 chip, which is the more recent SPARClite with FPU@.
19054 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
19055 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
19056 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
19057 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
19058 optimizes it for the TEMIC SPARClet chip.
19060 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
19061 architecture.  This adds 64-bit integer and floating-point move instructions,
19062 3 additional floating-point condition code registers and conditional move
19063 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
19064 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
19065 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
19066 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
19067 @option{-mcpu=niagara}, the compiler additionally optimizes it for
19068 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
19069 additionally optimizes it for Sun UltraSPARC T2 chips. With
19070 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
19071 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
19072 additionally optimizes it for Sun UltraSPARC T4 chips.
19074 @item -mtune=@var{cpu_type}
19075 @opindex mtune
19076 Set the instruction scheduling parameters for machine type
19077 @var{cpu_type}, but do not set the instruction set or register set that the
19078 option @option{-mcpu=@var{cpu_type}} does.
19080 The same values for @option{-mcpu=@var{cpu_type}} can be used for
19081 @option{-mtune=@var{cpu_type}}, but the only useful values are those
19082 that select a particular CPU implementation.  Those are @samp{cypress},
19083 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
19084 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
19085 @samp{niagara}, @samp{niagara2}, @samp{niagara3} and @samp{niagara4}.  With
19086 native Solaris and GNU/Linux toolchains, @samp{native} can also be used.
19088 @item -mv8plus
19089 @itemx -mno-v8plus
19090 @opindex mv8plus
19091 @opindex mno-v8plus
19092 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
19093 difference from the V8 ABI is that the global and out registers are
19094 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
19095 mode for all SPARC-V9 processors.
19097 @item -mvis
19098 @itemx -mno-vis
19099 @opindex mvis
19100 @opindex mno-vis
19101 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
19102 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
19104 @item -mvis2
19105 @itemx -mno-vis2
19106 @opindex mvis2
19107 @opindex mno-vis2
19108 With @option{-mvis2}, GCC generates code that takes advantage of
19109 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
19110 default is @option{-mvis2} when targeting a cpu that supports such
19111 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
19112 also sets @option{-mvis}.
19114 @item -mvis3
19115 @itemx -mno-vis3
19116 @opindex mvis3
19117 @opindex mno-vis3
19118 With @option{-mvis3}, GCC generates code that takes advantage of
19119 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
19120 default is @option{-mvis3} when targeting a cpu that supports such
19121 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
19122 also sets @option{-mvis2} and @option{-mvis}.
19124 @item -mpopc
19125 @itemx -mno-popc
19126 @opindex mpopc
19127 @opindex mno-popc
19128 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
19129 population count instruction.  The default is @option{-mpopc}
19130 when targeting a cpu that supports such instructions, such as Niagara-2 and
19131 later.
19133 @item -mfmaf
19134 @itemx -mno-fmaf
19135 @opindex mfmaf
19136 @opindex mno-fmaf
19137 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
19138 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
19139 when targeting a cpu that supports such instructions, such as Niagara-3 and
19140 later.
19142 @item -mfix-at697f
19143 @opindex mfix-at697f
19144 Enable the documented workaround for the single erratum of the Atmel AT697F
19145 processor (which corresponds to erratum #13 of the AT697E processor).
19146 @end table
19148 These @samp{-m} options are supported in addition to the above
19149 on SPARC-V9 processors in 64-bit environments:
19151 @table @gcctabopt
19152 @item -mlittle-endian
19153 @opindex mlittle-endian
19154 Generate code for a processor running in little-endian mode.  It is only
19155 available for a few configurations and most notably not on Solaris and Linux.
19157 @item -m32
19158 @itemx -m64
19159 @opindex m32
19160 @opindex m64
19161 Generate code for a 32-bit or 64-bit environment.
19162 The 32-bit environment sets int, long and pointer to 32 bits.
19163 The 64-bit environment sets int to 32 bits and long and pointer
19164 to 64 bits.
19166 @item -mcmodel=@var{which}
19167 @opindex mcmodel
19168 Set the code model to one of
19170 @table @samp
19171 @item medlow
19172 The Medium/Low code model: 64-bit addresses, programs
19173 must be linked in the low 32 bits of memory.  Programs can be statically
19174 or dynamically linked.
19176 @item medmid
19177 The Medium/Middle code model: 64-bit addresses, programs
19178 must be linked in the low 44 bits of memory, the text and data segments must
19179 be less than 2GB in size and the data segment must be located within 2GB of
19180 the text segment.
19182 @item medany
19183 The Medium/Anywhere code model: 64-bit addresses, programs
19184 may be linked anywhere in memory, the text and data segments must be less
19185 than 2GB in size and the data segment must be located within 2GB of the
19186 text segment.
19188 @item embmedany
19189 The Medium/Anywhere code model for embedded systems:
19190 64-bit addresses, the text and data segments must be less than 2GB in
19191 size, both starting anywhere in memory (determined at link time).  The
19192 global register %g4 points to the base of the data segment.  Programs
19193 are statically linked and PIC is not supported.
19194 @end table
19196 @item -mmemory-model=@var{mem-model}
19197 @opindex mmemory-model
19198 Set the memory model in force on the processor to one of
19200 @table @samp
19201 @item default
19202 The default memory model for the processor and operating system.
19204 @item rmo
19205 Relaxed Memory Order
19207 @item pso
19208 Partial Store Order
19210 @item tso
19211 Total Store Order
19213 @item sc
19214 Sequential Consistency
19215 @end table
19217 These memory models are formally defined in Appendix D of the Sparc V9
19218 architecture manual, as set in the processor's @code{PSTATE.MM} field.
19220 @item -mstack-bias
19221 @itemx -mno-stack-bias
19222 @opindex mstack-bias
19223 @opindex mno-stack-bias
19224 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
19225 frame pointer if present, are offset by @minus{}2047 which must be added back
19226 when making stack frame references.  This is the default in 64-bit mode.
19227 Otherwise, assume no such offset is present.
19228 @end table
19230 @node SPU Options
19231 @subsection SPU Options
19232 @cindex SPU options
19234 These @samp{-m} options are supported on the SPU:
19236 @table @gcctabopt
19237 @item -mwarn-reloc
19238 @itemx -merror-reloc
19239 @opindex mwarn-reloc
19240 @opindex merror-reloc
19242 The loader for SPU does not handle dynamic relocations.  By default, GCC
19243 gives an error when it generates code that requires a dynamic
19244 relocation.  @option{-mno-error-reloc} disables the error,
19245 @option{-mwarn-reloc} generates a warning instead.
19247 @item -msafe-dma
19248 @itemx -munsafe-dma
19249 @opindex msafe-dma
19250 @opindex munsafe-dma
19252 Instructions that initiate or test completion of DMA must not be
19253 reordered with respect to loads and stores of the memory that is being
19254 accessed.
19255 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
19256 memory accesses, but that can lead to inefficient code in places where the
19257 memory is known to not change.  Rather than mark the memory as volatile,
19258 you can use @option{-msafe-dma} to tell the compiler to treat
19259 the DMA instructions as potentially affecting all memory.  
19261 @item -mbranch-hints
19262 @opindex mbranch-hints
19264 By default, GCC generates a branch hint instruction to avoid
19265 pipeline stalls for always-taken or probably-taken branches.  A hint
19266 is not generated closer than 8 instructions away from its branch.
19267 There is little reason to disable them, except for debugging purposes,
19268 or to make an object a little bit smaller.
19270 @item -msmall-mem
19271 @itemx -mlarge-mem
19272 @opindex msmall-mem
19273 @opindex mlarge-mem
19275 By default, GCC generates code assuming that addresses are never larger
19276 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
19277 a full 32-bit address.
19279 @item -mstdmain
19280 @opindex mstdmain
19282 By default, GCC links against startup code that assumes the SPU-style
19283 main function interface (which has an unconventional parameter list).
19284 With @option{-mstdmain}, GCC links your program against startup
19285 code that assumes a C99-style interface to @code{main}, including a
19286 local copy of @code{argv} strings.
19288 @item -mfixed-range=@var{register-range}
19289 @opindex mfixed-range
19290 Generate code treating the given register range as fixed registers.
19291 A fixed register is one that the register allocator cannot use.  This is
19292 useful when compiling kernel code.  A register range is specified as
19293 two registers separated by a dash.  Multiple register ranges can be
19294 specified separated by a comma.
19296 @item -mea32
19297 @itemx -mea64
19298 @opindex mea32
19299 @opindex mea64
19300 Compile code assuming that pointers to the PPU address space accessed
19301 via the @code{__ea} named address space qualifier are either 32 or 64
19302 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
19303 all object code in an executable must be compiled with the same setting.
19305 @item -maddress-space-conversion
19306 @itemx -mno-address-space-conversion
19307 @opindex maddress-space-conversion
19308 @opindex mno-address-space-conversion
19309 Allow/disallow treating the @code{__ea} address space as superset
19310 of the generic address space.  This enables explicit type casts
19311 between @code{__ea} and generic pointer as well as implicit
19312 conversions of generic pointers to @code{__ea} pointers.  The
19313 default is to allow address space pointer conversions.
19315 @item -mcache-size=@var{cache-size}
19316 @opindex mcache-size
19317 This option controls the version of libgcc that the compiler links to an
19318 executable and selects a software-managed cache for accessing variables
19319 in the @code{__ea} address space with a particular cache size.  Possible
19320 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
19321 and @samp{128}.  The default cache size is 64KB.
19323 @item -matomic-updates
19324 @itemx -mno-atomic-updates
19325 @opindex matomic-updates
19326 @opindex mno-atomic-updates
19327 This option controls the version of libgcc that the compiler links to an
19328 executable and selects whether atomic updates to the software-managed
19329 cache of PPU-side variables are used.  If you use atomic updates, changes
19330 to a PPU variable from SPU code using the @code{__ea} named address space
19331 qualifier do not interfere with changes to other PPU variables residing
19332 in the same cache line from PPU code.  If you do not use atomic updates,
19333 such interference may occur; however, writing back cache lines is
19334 more efficient.  The default behavior is to use atomic updates.
19336 @item -mdual-nops
19337 @itemx -mdual-nops=@var{n}
19338 @opindex mdual-nops
19339 By default, GCC inserts nops to increase dual issue when it expects
19340 it to increase performance.  @var{n} can be a value from 0 to 10.  A
19341 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
19342 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
19344 @item -mhint-max-nops=@var{n}
19345 @opindex mhint-max-nops
19346 Maximum number of nops to insert for a branch hint.  A branch hint must
19347 be at least 8 instructions away from the branch it is affecting.  GCC
19348 inserts up to @var{n} nops to enforce this, otherwise it does not
19349 generate the branch hint.
19351 @item -mhint-max-distance=@var{n}
19352 @opindex mhint-max-distance
19353 The encoding of the branch hint instruction limits the hint to be within
19354 256 instructions of the branch it is affecting.  By default, GCC makes
19355 sure it is within 125.
19357 @item -msafe-hints
19358 @opindex msafe-hints
19359 Work around a hardware bug that causes the SPU to stall indefinitely.
19360 By default, GCC inserts the @code{hbrp} instruction to make sure
19361 this stall won't happen.
19363 @end table
19365 @node System V Options
19366 @subsection Options for System V
19368 These additional options are available on System V Release 4 for
19369 compatibility with other compilers on those systems:
19371 @table @gcctabopt
19372 @item -G
19373 @opindex G
19374 Create a shared object.
19375 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
19377 @item -Qy
19378 @opindex Qy
19379 Identify the versions of each tool used by the compiler, in a
19380 @code{.ident} assembler directive in the output.
19382 @item -Qn
19383 @opindex Qn
19384 Refrain from adding @code{.ident} directives to the output file (this is
19385 the default).
19387 @item -YP,@var{dirs}
19388 @opindex YP
19389 Search the directories @var{dirs}, and no others, for libraries
19390 specified with @option{-l}.
19392 @item -Ym,@var{dir}
19393 @opindex Ym
19394 Look in the directory @var{dir} to find the M4 preprocessor.
19395 The assembler uses this option.
19396 @c This is supposed to go with a -Yd for predefined M4 macro files, but
19397 @c the generic assembler that comes with Solaris takes just -Ym.
19398 @end table
19400 @node TILE-Gx Options
19401 @subsection TILE-Gx Options
19402 @cindex TILE-Gx options
19404 These @samp{-m} options are supported on the TILE-Gx:
19406 @table @gcctabopt
19407 @item -mcmodel=small
19408 @opindex mcmodel=small
19409 Generate code for the small model.  The distance for direct calls is
19410 limited to 500M in either direction.  PC-relative addresses are 32
19411 bits.  Absolute addresses support the full address range.
19413 @item -mcmodel=large
19414 @opindex mcmodel=large
19415 Generate code for the large model.  There is no limitation on call
19416 distance, pc-relative addresses, or absolute addresses.
19418 @item -mcpu=@var{name}
19419 @opindex mcpu
19420 Selects the type of CPU to be targeted.  Currently the only supported
19421 type is @samp{tilegx}.
19423 @item -m32
19424 @itemx -m64
19425 @opindex m32
19426 @opindex m64
19427 Generate code for a 32-bit or 64-bit environment.  The 32-bit
19428 environment sets int, long, and pointer to 32 bits.  The 64-bit
19429 environment sets int to 32 bits and long and pointer to 64 bits.
19430 @end table
19432 @node TILEPro Options
19433 @subsection TILEPro Options
19434 @cindex TILEPro options
19436 These @samp{-m} options are supported on the TILEPro:
19438 @table @gcctabopt
19439 @item -mcpu=@var{name}
19440 @opindex mcpu
19441 Selects the type of CPU to be targeted.  Currently the only supported
19442 type is @samp{tilepro}.
19444 @item -m32
19445 @opindex m32
19446 Generate code for a 32-bit environment, which sets int, long, and
19447 pointer to 32 bits.  This is the only supported behavior so the flag
19448 is essentially ignored.
19449 @end table
19451 @node V850 Options
19452 @subsection V850 Options
19453 @cindex V850 Options
19455 These @samp{-m} options are defined for V850 implementations:
19457 @table @gcctabopt
19458 @item -mlong-calls
19459 @itemx -mno-long-calls
19460 @opindex mlong-calls
19461 @opindex mno-long-calls
19462 Treat all calls as being far away (near).  If calls are assumed to be
19463 far away, the compiler always loads the function's address into a
19464 register, and calls indirect through the pointer.
19466 @item -mno-ep
19467 @itemx -mep
19468 @opindex mno-ep
19469 @opindex mep
19470 Do not optimize (do optimize) basic blocks that use the same index
19471 pointer 4 or more times to copy pointer into the @code{ep} register, and
19472 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
19473 option is on by default if you optimize.
19475 @item -mno-prolog-function
19476 @itemx -mprolog-function
19477 @opindex mno-prolog-function
19478 @opindex mprolog-function
19479 Do not use (do use) external functions to save and restore registers
19480 at the prologue and epilogue of a function.  The external functions
19481 are slower, but use less code space if more than one function saves
19482 the same number of registers.  The @option{-mprolog-function} option
19483 is on by default if you optimize.
19485 @item -mspace
19486 @opindex mspace
19487 Try to make the code as small as possible.  At present, this just turns
19488 on the @option{-mep} and @option{-mprolog-function} options.
19490 @item -mtda=@var{n}
19491 @opindex mtda
19492 Put static or global variables whose size is @var{n} bytes or less into
19493 the tiny data area that register @code{ep} points to.  The tiny data
19494 area can hold up to 256 bytes in total (128 bytes for byte references).
19496 @item -msda=@var{n}
19497 @opindex msda
19498 Put static or global variables whose size is @var{n} bytes or less into
19499 the small data area that register @code{gp} points to.  The small data
19500 area can hold up to 64 kilobytes.
19502 @item -mzda=@var{n}
19503 @opindex mzda
19504 Put static or global variables whose size is @var{n} bytes or less into
19505 the first 32 kilobytes of memory.
19507 @item -mv850
19508 @opindex mv850
19509 Specify that the target processor is the V850.
19511 @item -mbig-switch
19512 @opindex mbig-switch
19513 Generate code suitable for big switch tables.  Use this option only if
19514 the assembler/linker complain about out of range branches within a switch
19515 table.
19517 @item -mapp-regs
19518 @opindex mapp-regs
19519 This option causes r2 and r5 to be used in the code generated by
19520 the compiler.  This setting is the default.
19522 @item -mno-app-regs
19523 @opindex mno-app-regs
19524 This option causes r2 and r5 to be treated as fixed registers.
19526 @item -mv850e2v3
19527 @opindex mv850e2v3
19528 Specify that the target processor is the V850E2V3.  The preprocessor
19529 constant @samp{__v850e2v3__} is defined if
19530 this option is used.
19532 @item -mv850e2
19533 @opindex mv850e2
19534 Specify that the target processor is the V850E2.  The preprocessor
19535 constant @samp{__v850e2__} is defined if this option is used.
19537 @item -mv850e1
19538 @opindex mv850e1
19539 Specify that the target processor is the V850E1.  The preprocessor
19540 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
19541 this option is used.
19543 @item -mv850es
19544 @opindex mv850es
19545 Specify that the target processor is the V850ES.  This is an alias for
19546 the @option{-mv850e1} option.
19548 @item -mv850e
19549 @opindex mv850e
19550 Specify that the target processor is the V850E@.  The preprocessor
19551 constant @samp{__v850e__} is defined if this option is used.
19553 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
19554 nor @option{-mv850e2} nor @option{-mv850e2v3}
19555 are defined then a default target processor is chosen and the
19556 relevant @samp{__v850*__} preprocessor constant is defined.
19558 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
19559 defined, regardless of which processor variant is the target.
19561 @item -mdisable-callt
19562 @opindex mdisable-callt
19563 This option suppresses generation of the @code{CALLT} instruction for the
19564 v850e, v850e1, v850e2 and v850e2v3 flavors of the v850 architecture.  The default is
19565 @option{-mno-disable-callt} which allows the @code{CALLT} instruction to be used.
19567 @end table
19569 @node VAX Options
19570 @subsection VAX Options
19571 @cindex VAX options
19573 These @samp{-m} options are defined for the VAX:
19575 @table @gcctabopt
19576 @item -munix
19577 @opindex munix
19578 Do not output certain jump instructions (@code{aobleq} and so on)
19579 that the Unix assembler for the VAX cannot handle across long
19580 ranges.
19582 @item -mgnu
19583 @opindex mgnu
19584 Do output those jump instructions, on the assumption that the
19585 GNU assembler is being used.
19587 @item -mg
19588 @opindex mg
19589 Output code for G-format floating-point numbers instead of D-format.
19590 @end table
19592 @node VMS Options
19593 @subsection VMS Options
19595 These @samp{-m} options are defined for the VMS implementations:
19597 @table @gcctabopt
19598 @item -mvms-return-codes
19599 @opindex mvms-return-codes
19600 Return VMS condition codes from @code{main}. The default is to return POSIX-style
19601 condition (e.g.@ error) codes.
19603 @item -mdebug-main=@var{prefix}
19604 @opindex mdebug-main=@var{prefix}
19605 Flag the first routine whose name starts with @var{prefix} as the main
19606 routine for the debugger.
19608 @item -mmalloc64
19609 @opindex mmalloc64
19610 Default to 64-bit memory allocation routines.
19612 @item -mpointer-size=@var{size}
19613 @opindex -mpointer-size=@var{size}
19614 Set the default size of pointers. Possible options for @var{size} are
19615 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
19616 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
19617 The later option disables @code{pragma pointer_size}.
19618 @end table
19620 @node VxWorks Options
19621 @subsection VxWorks Options
19622 @cindex VxWorks Options
19624 The options in this section are defined for all VxWorks targets.
19625 Options specific to the target hardware are listed with the other
19626 options for that target.
19628 @table @gcctabopt
19629 @item -mrtp
19630 @opindex mrtp
19631 GCC can generate code for both VxWorks kernels and real time processes
19632 (RTPs).  This option switches from the former to the latter.  It also
19633 defines the preprocessor macro @code{__RTP__}.
19635 @item -non-static
19636 @opindex non-static
19637 Link an RTP executable against shared libraries rather than static
19638 libraries.  The options @option{-static} and @option{-shared} can
19639 also be used for RTPs (@pxref{Link Options}); @option{-static}
19640 is the default.
19642 @item -Bstatic
19643 @itemx -Bdynamic
19644 @opindex Bstatic
19645 @opindex Bdynamic
19646 These options are passed down to the linker.  They are defined for
19647 compatibility with Diab.
19649 @item -Xbind-lazy
19650 @opindex Xbind-lazy
19651 Enable lazy binding of function calls.  This option is equivalent to
19652 @option{-Wl,-z,now} and is defined for compatibility with Diab.
19654 @item -Xbind-now
19655 @opindex Xbind-now
19656 Disable lazy binding of function calls.  This option is the default and
19657 is defined for compatibility with Diab.
19658 @end table
19660 @node x86-64 Options
19661 @subsection x86-64 Options
19662 @cindex x86-64 options
19664 These are listed under @xref{i386 and x86-64 Options}.
19666 @node Xstormy16 Options
19667 @subsection Xstormy16 Options
19668 @cindex Xstormy16 Options
19670 These options are defined for Xstormy16:
19672 @table @gcctabopt
19673 @item -msim
19674 @opindex msim
19675 Choose startup files and linker script suitable for the simulator.
19676 @end table
19678 @node Xtensa Options
19679 @subsection Xtensa Options
19680 @cindex Xtensa Options
19682 These options are supported for Xtensa targets:
19684 @table @gcctabopt
19685 @item -mconst16
19686 @itemx -mno-const16
19687 @opindex mconst16
19688 @opindex mno-const16
19689 Enable or disable use of @code{CONST16} instructions for loading
19690 constant values.  The @code{CONST16} instruction is currently not a
19691 standard option from Tensilica.  When enabled, @code{CONST16}
19692 instructions are always used in place of the standard @code{L32R}
19693 instructions.  The use of @code{CONST16} is enabled by default only if
19694 the @code{L32R} instruction is not available.
19696 @item -mfused-madd
19697 @itemx -mno-fused-madd
19698 @opindex mfused-madd
19699 @opindex mno-fused-madd
19700 Enable or disable use of fused multiply/add and multiply/subtract
19701 instructions in the floating-point option.  This has no effect if the
19702 floating-point option is not also enabled.  Disabling fused multiply/add
19703 and multiply/subtract instructions forces the compiler to use separate
19704 instructions for the multiply and add/subtract operations.  This may be
19705 desirable in some cases where strict IEEE 754-compliant results are
19706 required: the fused multiply add/subtract instructions do not round the
19707 intermediate result, thereby producing results with @emph{more} bits of
19708 precision than specified by the IEEE standard.  Disabling fused multiply
19709 add/subtract instructions also ensures that the program output is not
19710 sensitive to the compiler's ability to combine multiply and add/subtract
19711 operations.
19713 @item -mserialize-volatile
19714 @itemx -mno-serialize-volatile
19715 @opindex mserialize-volatile
19716 @opindex mno-serialize-volatile
19717 When this option is enabled, GCC inserts @code{MEMW} instructions before
19718 @code{volatile} memory references to guarantee sequential consistency.
19719 The default is @option{-mserialize-volatile}.  Use
19720 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
19722 @item -mforce-no-pic
19723 @opindex mforce-no-pic
19724 For targets, like GNU/Linux, where all user-mode Xtensa code must be
19725 position-independent code (PIC), this option disables PIC for compiling
19726 kernel code.
19728 @item -mtext-section-literals
19729 @itemx -mno-text-section-literals
19730 @opindex mtext-section-literals
19731 @opindex mno-text-section-literals
19732 Control the treatment of literal pools.  The default is
19733 @option{-mno-text-section-literals}, which places literals in a separate
19734 section in the output file.  This allows the literal pool to be placed
19735 in a data RAM/ROM, and it also allows the linker to combine literal
19736 pools from separate object files to remove redundant literals and
19737 improve code size.  With @option{-mtext-section-literals}, the literals
19738 are interspersed in the text section in order to keep them as close as
19739 possible to their references.  This may be necessary for large assembly
19740 files.
19742 @item -mtarget-align
19743 @itemx -mno-target-align
19744 @opindex mtarget-align
19745 @opindex mno-target-align
19746 When this option is enabled, GCC instructs the assembler to
19747 automatically align instructions to reduce branch penalties at the
19748 expense of some code density.  The assembler attempts to widen density
19749 instructions to align branch targets and the instructions following call
19750 instructions.  If there are not enough preceding safe density
19751 instructions to align a target, no widening is performed.  The
19752 default is @option{-mtarget-align}.  These options do not affect the
19753 treatment of auto-aligned instructions like @code{LOOP}, which the
19754 assembler always aligns, either by widening density instructions or
19755 by inserting NOP instructions.
19757 @item -mlongcalls
19758 @itemx -mno-longcalls
19759 @opindex mlongcalls
19760 @opindex mno-longcalls
19761 When this option is enabled, GCC instructs the assembler to translate
19762 direct calls to indirect calls unless it can determine that the target
19763 of a direct call is in the range allowed by the call instruction.  This
19764 translation typically occurs for calls to functions in other source
19765 files.  Specifically, the assembler translates a direct @code{CALL}
19766 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
19767 The default is @option{-mno-longcalls}.  This option should be used in
19768 programs where the call target can potentially be out of range.  This
19769 option is implemented in the assembler, not the compiler, so the
19770 assembly code generated by GCC still shows direct call
19771 instructions---look at the disassembled object code to see the actual
19772 instructions.  Note that the assembler uses an indirect call for
19773 every cross-file call, not just those that really are out of range.
19774 @end table
19776 @node zSeries Options
19777 @subsection zSeries Options
19778 @cindex zSeries options
19780 These are listed under @xref{S/390 and zSeries Options}.
19782 @node Code Gen Options
19783 @section Options for Code Generation Conventions
19784 @cindex code generation conventions
19785 @cindex options, code generation
19786 @cindex run-time options
19788 These machine-independent options control the interface conventions
19789 used in code generation.
19791 Most of them have both positive and negative forms; the negative form
19792 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
19793 one of the forms is listed---the one that is not the default.  You
19794 can figure out the other form by either removing @samp{no-} or adding
19797 @table @gcctabopt
19798 @item -fbounds-check
19799 @opindex fbounds-check
19800 For front ends that support it, generate additional code to check that
19801 indices used to access arrays are within the declared range.  This is
19802 currently only supported by the Java and Fortran front ends, where
19803 this option defaults to true and false respectively.
19805 @item -fstack-reuse=@var{reuse-level}
19806 @opindex fstack_reuse
19807 This option controls stack space reuse for user declared local/auto variables
19808 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
19809 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
19810 local variables and temporaries, @samp{named_vars} enables the reuse only for
19811 user defined local variables with names, and @samp{none} disables stack reuse
19812 completely. The default value is @samp{all}. The option is needed when the
19813 program extends the lifetime of a scoped local variable or a compiler generated
19814 temporary beyond the end point defined by the language.  When a lifetime of
19815 a variable ends, and if the variable lives in memory, the optimizing compiler
19816 has the freedom to reuse its stack space with other temporaries or scoped
19817 local variables whose live range does not overlap with it. Legacy code extending
19818 local lifetime will likely to break with the stack reuse optimization.
19820 For example,
19822 @smallexample
19823    int *p;
19824    @{
19825      int local1;
19827      p = &local1;
19828      local1 = 10;
19829      ....
19830    @}
19831    @{
19832       int local2;
19833       local2 = 20;
19834       ...
19835    @}
19837    if (*p == 10)  // out of scope use of local1
19838      @{
19840      @}
19841 @end smallexample
19843 Another example:
19844 @smallexample
19846    struct A
19847    @{
19848        A(int k) : i(k), j(k) @{ @}
19849        int i;
19850        int j;
19851    @};
19853    A *ap;
19855    void foo(const A& ar)
19856    @{
19857       ap = &ar;
19858    @}
19860    void bar()
19861    @{
19862       foo(A(10)); // temp object's lifetime ends when foo returns
19864       @{
19865         A a(20);
19866         ....
19867       @}
19868       ap->i+= 10;  // ap references out of scope temp whose space
19869                    // is reused with a. What is the value of ap->i?
19870    @}
19872 @end smallexample
19874 The lifetime of a compiler generated temporary is well defined by the C++
19875 standard. When a lifetime of a temporary ends, and if the temporary lives
19876 in memory, the optimizing compiler has the freedom to reuse its stack
19877 space with other temporaries or scoped local variables whose live range
19878 does not overlap with it. However some of the legacy code relies on
19879 the behavior of older compilers in which temporaries' stack space is
19880 not reused, the aggressive stack reuse can lead to runtime errors. This
19881 option is used to control the temporary stack reuse optimization.
19883 @item -ftrapv
19884 @opindex ftrapv
19885 This option generates traps for signed overflow on addition, subtraction,
19886 multiplication operations.
19888 @item -fwrapv
19889 @opindex fwrapv
19890 This option instructs the compiler to assume that signed arithmetic
19891 overflow of addition, subtraction and multiplication wraps around
19892 using twos-complement representation.  This flag enables some optimizations
19893 and disables others.  This option is enabled by default for the Java
19894 front end, as required by the Java language specification.
19896 @item -fexceptions
19897 @opindex fexceptions
19898 Enable exception handling.  Generates extra code needed to propagate
19899 exceptions.  For some targets, this implies GCC generates frame
19900 unwind information for all functions, which can produce significant data
19901 size overhead, although it does not affect execution.  If you do not
19902 specify this option, GCC enables it by default for languages like
19903 C++ that normally require exception handling, and disables it for
19904 languages like C that do not normally require it.  However, you may need
19905 to enable this option when compiling C code that needs to interoperate
19906 properly with exception handlers written in C++.  You may also wish to
19907 disable this option if you are compiling older C++ programs that don't
19908 use exception handling.
19910 @item -fnon-call-exceptions
19911 @opindex fnon-call-exceptions
19912 Generate code that allows trapping instructions to throw exceptions.
19913 Note that this requires platform-specific runtime support that does
19914 not exist everywhere.  Moreover, it only allows @emph{trapping}
19915 instructions to throw exceptions, i.e.@: memory references or floating-point
19916 instructions.  It does not allow exceptions to be thrown from
19917 arbitrary signal handlers such as @code{SIGALRM}.
19919 @item -fdelete-dead-exceptions
19920 @opindex fdelete-dead-exceptions
19921 Consider that instructions that may throw exceptions but don't otherwise
19922 contribute to the execution of the program can be optimized away.
19923 This option is enabled by default for the Ada front end, as permitted by
19924 the Ada language specification.
19925 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
19927 @item -funwind-tables
19928 @opindex funwind-tables
19929 Similar to @option{-fexceptions}, except that it just generates any needed
19930 static data, but does not affect the generated code in any other way.
19931 You normally do not need to enable this option; instead, a language processor
19932 that needs this handling enables it on your behalf.
19934 @item -fasynchronous-unwind-tables
19935 @opindex fasynchronous-unwind-tables
19936 Generate unwind table in DWARF 2 format, if supported by target machine.  The
19937 table is exact at each instruction boundary, so it can be used for stack
19938 unwinding from asynchronous events (such as debugger or garbage collector).
19940 @item -fpcc-struct-return
19941 @opindex fpcc-struct-return
19942 Return ``short'' @code{struct} and @code{union} values in memory like
19943 longer ones, rather than in registers.  This convention is less
19944 efficient, but it has the advantage of allowing intercallability between
19945 GCC-compiled files and files compiled with other compilers, particularly
19946 the Portable C Compiler (pcc).
19948 The precise convention for returning structures in memory depends
19949 on the target configuration macros.
19951 Short structures and unions are those whose size and alignment match
19952 that of some integer type.
19954 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
19955 switch is not binary compatible with code compiled with the
19956 @option{-freg-struct-return} switch.
19957 Use it to conform to a non-default application binary interface.
19959 @item -freg-struct-return
19960 @opindex freg-struct-return
19961 Return @code{struct} and @code{union} values in registers when possible.
19962 This is more efficient for small structures than
19963 @option{-fpcc-struct-return}.
19965 If you specify neither @option{-fpcc-struct-return} nor
19966 @option{-freg-struct-return}, GCC defaults to whichever convention is
19967 standard for the target.  If there is no standard convention, GCC
19968 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
19969 the principal compiler.  In those cases, we can choose the standard, and
19970 we chose the more efficient register return alternative.
19972 @strong{Warning:} code compiled with the @option{-freg-struct-return}
19973 switch is not binary compatible with code compiled with the
19974 @option{-fpcc-struct-return} switch.
19975 Use it to conform to a non-default application binary interface.
19977 @item -fshort-enums
19978 @opindex fshort-enums
19979 Allocate to an @code{enum} type only as many bytes as it needs for the
19980 declared range of possible values.  Specifically, the @code{enum} type
19981 is equivalent to the smallest integer type that has enough room.
19983 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
19984 code that is not binary compatible with code generated without that switch.
19985 Use it to conform to a non-default application binary interface.
19987 @item -fshort-double
19988 @opindex fshort-double
19989 Use the same size for @code{double} as for @code{float}.
19991 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
19992 code that is not binary compatible with code generated without that switch.
19993 Use it to conform to a non-default application binary interface.
19995 @item -fshort-wchar
19996 @opindex fshort-wchar
19997 Override the underlying type for @samp{wchar_t} to be @samp{short
19998 unsigned int} instead of the default for the target.  This option is
19999 useful for building programs to run under WINE@.
20001 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
20002 code that is not binary compatible with code generated without that switch.
20003 Use it to conform to a non-default application binary interface.
20005 @item -fno-common
20006 @opindex fno-common
20007 In C code, controls the placement of uninitialized global variables.
20008 Unix C compilers have traditionally permitted multiple definitions of
20009 such variables in different compilation units by placing the variables
20010 in a common block.
20011 This is the behavior specified by @option{-fcommon}, and is the default
20012 for GCC on most targets.
20013 On the other hand, this behavior is not required by ISO C, and on some
20014 targets may carry a speed or code size penalty on variable references.
20015 The @option{-fno-common} option specifies that the compiler should place
20016 uninitialized global variables in the data section of the object file,
20017 rather than generating them as common blocks.
20018 This has the effect that if the same variable is declared
20019 (without @code{extern}) in two different compilations,
20020 you get a multiple-definition error when you link them.
20021 In this case, you must compile with @option{-fcommon} instead.
20022 Compiling with @option{-fno-common} is useful on targets for which
20023 it provides better performance, or if you wish to verify that the
20024 program will work on other systems that always treat uninitialized
20025 variable declarations this way.
20027 @item -fno-ident
20028 @opindex fno-ident
20029 Ignore the @samp{#ident} directive.
20031 @item -finhibit-size-directive
20032 @opindex finhibit-size-directive
20033 Don't output a @code{.size} assembler directive, or anything else that
20034 would cause trouble if the function is split in the middle, and the
20035 two halves are placed at locations far apart in memory.  This option is
20036 used when compiling @file{crtstuff.c}; you should not need to use it
20037 for anything else.
20039 @item -fverbose-asm
20040 @opindex fverbose-asm
20041 Put extra commentary information in the generated assembly code to
20042 make it more readable.  This option is generally only of use to those
20043 who actually need to read the generated assembly code (perhaps while
20044 debugging the compiler itself).
20046 @option{-fno-verbose-asm}, the default, causes the
20047 extra information to be omitted and is useful when comparing two assembler
20048 files.
20050 @item -frecord-gcc-switches
20051 @opindex frecord-gcc-switches
20052 This switch causes the command line used to invoke the
20053 compiler to be recorded into the object file that is being created.
20054 This switch is only implemented on some targets and the exact format
20055 of the recording is target and binary file format dependent, but it
20056 usually takes the form of a section containing ASCII text.  This
20057 switch is related to the @option{-fverbose-asm} switch, but that
20058 switch only records information in the assembler output file as
20059 comments, so it never reaches the object file.
20060 See also @option{-grecord-gcc-switches} for another
20061 way of storing compiler options into the object file.
20063 @item -fpic
20064 @opindex fpic
20065 @cindex global offset table
20066 @cindex PIC
20067 Generate position-independent code (PIC) suitable for use in a shared
20068 library, if supported for the target machine.  Such code accesses all
20069 constant addresses through a global offset table (GOT)@.  The dynamic
20070 loader resolves the GOT entries when the program starts (the dynamic
20071 loader is not part of GCC; it is part of the operating system).  If
20072 the GOT size for the linked executable exceeds a machine-specific
20073 maximum size, you get an error message from the linker indicating that
20074 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
20075 instead.  (These maximums are 8k on the SPARC and 32k
20076 on the m68k and RS/6000.  The 386 has no such limit.)
20078 Position-independent code requires special support, and therefore works
20079 only on certain machines.  For the 386, GCC supports PIC for System V
20080 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
20081 position-independent.
20083 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20084 are defined to 1.
20086 @item -fPIC
20087 @opindex fPIC
20088 If supported for the target machine, emit position-independent code,
20089 suitable for dynamic linking and avoiding any limit on the size of the
20090 global offset table.  This option makes a difference on the m68k,
20091 PowerPC and SPARC@.
20093 Position-independent code requires special support, and therefore works
20094 only on certain machines.
20096 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20097 are defined to 2.
20099 @item -fpie
20100 @itemx -fPIE
20101 @opindex fpie
20102 @opindex fPIE
20103 These options are similar to @option{-fpic} and @option{-fPIC}, but
20104 generated position independent code can be only linked into executables.
20105 Usually these options are used when @option{-pie} GCC option is
20106 used during linking.
20108 @option{-fpie} and @option{-fPIE} both define the macros
20109 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
20110 for @option{-fpie} and 2 for @option{-fPIE}.
20112 @item -fno-jump-tables
20113 @opindex fno-jump-tables
20114 Do not use jump tables for switch statements even where it would be
20115 more efficient than other code generation strategies.  This option is
20116 of use in conjunction with @option{-fpic} or @option{-fPIC} for
20117 building code that forms part of a dynamic linker and cannot
20118 reference the address of a jump table.  On some targets, jump tables
20119 do not require a GOT and this option is not needed.
20121 @item -ffixed-@var{reg}
20122 @opindex ffixed
20123 Treat the register named @var{reg} as a fixed register; generated code
20124 should never refer to it (except perhaps as a stack pointer, frame
20125 pointer or in some other fixed role).
20127 @var{reg} must be the name of a register.  The register names accepted
20128 are machine-specific and are defined in the @code{REGISTER_NAMES}
20129 macro in the machine description macro file.
20131 This flag does not have a negative form, because it specifies a
20132 three-way choice.
20134 @item -fcall-used-@var{reg}
20135 @opindex fcall-used
20136 Treat the register named @var{reg} as an allocable register that is
20137 clobbered by function calls.  It may be allocated for temporaries or
20138 variables that do not live across a call.  Functions compiled this way
20139 do not save and restore the register @var{reg}.
20141 It is an error to use this flag with the frame pointer or stack pointer.
20142 Use of this flag for other registers that have fixed pervasive roles in
20143 the machine's execution model produces disastrous results.
20145 This flag does not have a negative form, because it specifies a
20146 three-way choice.
20148 @item -fcall-saved-@var{reg}
20149 @opindex fcall-saved
20150 Treat the register named @var{reg} as an allocable register saved by
20151 functions.  It may be allocated even for temporaries or variables that
20152 live across a call.  Functions compiled this way save and restore
20153 the register @var{reg} if they use it.
20155 It is an error to use this flag with the frame pointer or stack pointer.
20156 Use of this flag for other registers that have fixed pervasive roles in
20157 the machine's execution model produces disastrous results.
20159 A different sort of disaster results from the use of this flag for
20160 a register in which function values may be returned.
20162 This flag does not have a negative form, because it specifies a
20163 three-way choice.
20165 @item -fpack-struct[=@var{n}]
20166 @opindex fpack-struct
20167 Without a value specified, pack all structure members together without
20168 holes.  When a value is specified (which must be a small power of two), pack
20169 structure members according to this value, representing the maximum
20170 alignment (that is, objects with default alignment requirements larger than
20171 this are output potentially unaligned at the next fitting location.
20173 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
20174 code that is not binary compatible with code generated without that switch.
20175 Additionally, it makes the code suboptimal.
20176 Use it to conform to a non-default application binary interface.
20178 @item -finstrument-functions
20179 @opindex finstrument-functions
20180 Generate instrumentation calls for entry and exit to functions.  Just
20181 after function entry and just before function exit, the following
20182 profiling functions are called with the address of the current
20183 function and its call site.  (On some platforms,
20184 @code{__builtin_return_address} does not work beyond the current
20185 function, so the call site information may not be available to the
20186 profiling functions otherwise.)
20188 @smallexample
20189 void __cyg_profile_func_enter (void *this_fn,
20190                                void *call_site);
20191 void __cyg_profile_func_exit  (void *this_fn,
20192                                void *call_site);
20193 @end smallexample
20195 The first argument is the address of the start of the current function,
20196 which may be looked up exactly in the symbol table.
20198 This instrumentation is also done for functions expanded inline in other
20199 functions.  The profiling calls indicate where, conceptually, the
20200 inline function is entered and exited.  This means that addressable
20201 versions of such functions must be available.  If all your uses of a
20202 function are expanded inline, this may mean an additional expansion of
20203 code size.  If you use @samp{extern inline} in your C code, an
20204 addressable version of such functions must be provided.  (This is
20205 normally the case anyway, but if you get lucky and the optimizer always
20206 expands the functions inline, you might have gotten away without
20207 providing static copies.)
20209 A function may be given the attribute @code{no_instrument_function}, in
20210 which case this instrumentation is not done.  This can be used, for
20211 example, for the profiling functions listed above, high-priority
20212 interrupt routines, and any functions from which the profiling functions
20213 cannot safely be called (perhaps signal handlers, if the profiling
20214 routines generate output or allocate memory).
20216 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
20217 @opindex finstrument-functions-exclude-file-list
20219 Set the list of functions that are excluded from instrumentation (see
20220 the description of @code{-finstrument-functions}).  If the file that
20221 contains a function definition matches with one of @var{file}, then
20222 that function is not instrumented.  The match is done on substrings:
20223 if the @var{file} parameter is a substring of the file name, it is
20224 considered to be a match.
20226 For example:
20228 @smallexample
20229 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
20230 @end smallexample
20232 @noindent
20233 excludes any inline function defined in files whose pathnames
20234 contain @code{/bits/stl} or @code{include/sys}.
20236 If, for some reason, you want to include letter @code{','} in one of
20237 @var{sym}, write @code{'\,'}. For example,
20238 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
20239 (note the single quote surrounding the option).
20241 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
20242 @opindex finstrument-functions-exclude-function-list
20244 This is similar to @code{-finstrument-functions-exclude-file-list},
20245 but this option sets the list of function names to be excluded from
20246 instrumentation.  The function name to be matched is its user-visible
20247 name, such as @code{vector<int> blah(const vector<int> &)}, not the
20248 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
20249 match is done on substrings: if the @var{sym} parameter is a substring
20250 of the function name, it is considered to be a match.  For C99 and C++
20251 extended identifiers, the function name must be given in UTF-8, not
20252 using universal character names.
20254 @item -fstack-check
20255 @opindex fstack-check
20256 Generate code to verify that you do not go beyond the boundary of the
20257 stack.  You should specify this flag if you are running in an
20258 environment with multiple threads, but you only rarely need to specify it in
20259 a single-threaded environment since stack overflow is automatically
20260 detected on nearly all systems if there is only one stack.
20262 Note that this switch does not actually cause checking to be done; the
20263 operating system or the language runtime must do that.  The switch causes
20264 generation of code to ensure that they see the stack being extended.
20266 You can additionally specify a string parameter: @code{no} means no
20267 checking, @code{generic} means force the use of old-style checking,
20268 @code{specific} means use the best checking method and is equivalent
20269 to bare @option{-fstack-check}.
20271 Old-style checking is a generic mechanism that requires no specific
20272 target support in the compiler but comes with the following drawbacks:
20274 @enumerate
20275 @item
20276 Modified allocation strategy for large objects: they are always
20277 allocated dynamically if their size exceeds a fixed threshold.
20279 @item
20280 Fixed limit on the size of the static frame of functions: when it is
20281 topped by a particular function, stack checking is not reliable and
20282 a warning is issued by the compiler.
20284 @item
20285 Inefficiency: because of both the modified allocation strategy and the
20286 generic implementation, code performance is hampered.
20287 @end enumerate
20289 Note that old-style stack checking is also the fallback method for
20290 @code{specific} if no target support has been added in the compiler.
20292 @item -fstack-limit-register=@var{reg}
20293 @itemx -fstack-limit-symbol=@var{sym}
20294 @itemx -fno-stack-limit
20295 @opindex fstack-limit-register
20296 @opindex fstack-limit-symbol
20297 @opindex fno-stack-limit
20298 Generate code to ensure that the stack does not grow beyond a certain value,
20299 either the value of a register or the address of a symbol.  If a larger
20300 stack is required, a signal is raised at run time.  For most targets,
20301 the signal is raised before the stack overruns the boundary, so
20302 it is possible to catch the signal without taking special precautions.
20304 For instance, if the stack starts at absolute address @samp{0x80000000}
20305 and grows downwards, you can use the flags
20306 @option{-fstack-limit-symbol=__stack_limit} and
20307 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
20308 of 128KB@.  Note that this may only work with the GNU linker.
20310 @item -fsplit-stack
20311 @opindex fsplit-stack
20312 Generate code to automatically split the stack before it overflows.
20313 The resulting program has a discontiguous stack which can only
20314 overflow if the program is unable to allocate any more memory.  This
20315 is most useful when running threaded programs, as it is no longer
20316 necessary to calculate a good stack size to use for each thread.  This
20317 is currently only implemented for the i386 and x86_64 back ends running
20318 GNU/Linux.
20320 When code compiled with @option{-fsplit-stack} calls code compiled
20321 without @option{-fsplit-stack}, there may not be much stack space
20322 available for the latter code to run.  If compiling all code,
20323 including library code, with @option{-fsplit-stack} is not an option,
20324 then the linker can fix up these calls so that the code compiled
20325 without @option{-fsplit-stack} always has a large stack.  Support for
20326 this is implemented in the gold linker in GNU binutils release 2.21
20327 and later.
20329 @item -fleading-underscore
20330 @opindex fleading-underscore
20331 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
20332 change the way C symbols are represented in the object file.  One use
20333 is to help link with legacy assembly code.
20335 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
20336 generate code that is not binary compatible with code generated without that
20337 switch.  Use it to conform to a non-default application binary interface.
20338 Not all targets provide complete support for this switch.
20340 @item -ftls-model=@var{model}
20341 @opindex ftls-model
20342 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
20343 The @var{model} argument should be one of @code{global-dynamic},
20344 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
20346 The default without @option{-fpic} is @code{initial-exec}; with
20347 @option{-fpic} the default is @code{global-dynamic}.
20349 @item -fvisibility=@var{default|internal|hidden|protected}
20350 @opindex fvisibility
20351 Set the default ELF image symbol visibility to the specified option---all
20352 symbols are marked with this unless overridden within the code.
20353 Using this feature can very substantially improve linking and
20354 load times of shared object libraries, produce more optimized
20355 code, provide near-perfect API export and prevent symbol clashes.
20356 It is @strong{strongly} recommended that you use this in any shared objects
20357 you distribute.
20359 Despite the nomenclature, @code{default} always means public; i.e.,
20360 available to be linked against from outside the shared object.
20361 @code{protected} and @code{internal} are pretty useless in real-world
20362 usage so the only other commonly used option is @code{hidden}.
20363 The default if @option{-fvisibility} isn't specified is
20364 @code{default}, i.e., make every
20365 symbol public---this causes the same behavior as previous versions of
20366 GCC@.
20368 A good explanation of the benefits offered by ensuring ELF
20369 symbols have the correct visibility is given by ``How To Write
20370 Shared Libraries'' by Ulrich Drepper (which can be found at
20371 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
20372 solution made possible by this option to marking things hidden when
20373 the default is public is to make the default hidden and mark things
20374 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
20375 and @code{__attribute__ ((visibility("default")))} instead of
20376 @code{__declspec(dllexport)} you get almost identical semantics with
20377 identical syntax.  This is a great boon to those working with
20378 cross-platform projects.
20380 For those adding visibility support to existing code, you may find
20381 @samp{#pragma GCC visibility} of use.  This works by you enclosing
20382 the declarations you wish to set visibility for with (for example)
20383 @samp{#pragma GCC visibility push(hidden)} and
20384 @samp{#pragma GCC visibility pop}.
20385 Bear in mind that symbol visibility should be viewed @strong{as
20386 part of the API interface contract} and thus all new code should
20387 always specify visibility when it is not the default; i.e., declarations
20388 only for use within the local DSO should @strong{always} be marked explicitly
20389 as hidden as so to avoid PLT indirection overheads---making this
20390 abundantly clear also aids readability and self-documentation of the code.
20391 Note that due to ISO C++ specification requirements, @code{operator new} and
20392 @code{operator delete} must always be of default visibility.
20394 Be aware that headers from outside your project, in particular system
20395 headers and headers from any other library you use, may not be
20396 expecting to be compiled with visibility other than the default.  You
20397 may need to explicitly say @samp{#pragma GCC visibility push(default)}
20398 before including any such headers.
20400 @samp{extern} declarations are not affected by @option{-fvisibility}, so
20401 a lot of code can be recompiled with @option{-fvisibility=hidden} with
20402 no modifications.  However, this means that calls to @code{extern}
20403 functions with no explicit visibility use the PLT, so it is more
20404 effective to use @code{__attribute ((visibility))} and/or
20405 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
20406 declarations should be treated as hidden.
20408 Note that @option{-fvisibility} does affect C++ vague linkage
20409 entities. This means that, for instance, an exception class that is
20410 be thrown between DSOs must be explicitly marked with default
20411 visibility so that the @samp{type_info} nodes are unified between
20412 the DSOs.
20414 An overview of these techniques, their benefits and how to use them
20415 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
20417 @item -fstrict-volatile-bitfields
20418 @opindex fstrict-volatile-bitfields
20419 This option should be used if accesses to volatile bit-fields (or other
20420 structure fields, although the compiler usually honors those types
20421 anyway) should use a single access of the width of the
20422 field's type, aligned to a natural alignment if possible.  For
20423 example, targets with memory-mapped peripheral registers might require
20424 all such accesses to be 16 bits wide; with this flag you can
20425 declare all peripheral bit-fields as @code{unsigned short} (assuming short
20426 is 16 bits on these targets) to force GCC to use 16-bit accesses
20427 instead of, perhaps, a more efficient 32-bit access.
20429 If this option is disabled, the compiler uses the most efficient
20430 instruction.  In the previous example, that might be a 32-bit load
20431 instruction, even though that accesses bytes that do not contain
20432 any portion of the bit-field, or memory-mapped registers unrelated to
20433 the one being updated.
20435 If the target requires strict alignment, and honoring the field
20436 type would require violating this alignment, a warning is issued.
20437 If the field has @code{packed} attribute, the access is done without
20438 honoring the field type.  If the field doesn't have @code{packed}
20439 attribute, the access is done honoring the field type.  In both cases,
20440 GCC assumes that the user knows something about the target hardware
20441 that it is unaware of.
20443 The default value of this option is determined by the application binary
20444 interface for the target processor.
20446 @item -fsync-libcalls
20447 @opindex fsync-libcalls
20448 This option controls whether any out-of-line instance of the @code{__sync}
20449 family of functions may be used to implement the C++11 @code{__atomic}
20450 family of functions.
20452 The default value of this option is enabled, thus the only useful form
20453 of the option is @option{-fno-sync-libcalls}.  This option is used in
20454 the implementation of the @file{libatomic} runtime library.
20456 @end table
20458 @c man end
20460 @node Environment Variables
20461 @section Environment Variables Affecting GCC
20462 @cindex environment variables
20464 @c man begin ENVIRONMENT
20465 This section describes several environment variables that affect how GCC
20466 operates.  Some of them work by specifying directories or prefixes to use
20467 when searching for various kinds of files.  Some are used to specify other
20468 aspects of the compilation environment.
20470 Note that you can also specify places to search using options such as
20471 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
20472 take precedence over places specified using environment variables, which
20473 in turn take precedence over those specified by the configuration of GCC@.
20474 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
20475 GNU Compiler Collection (GCC) Internals}.
20477 @table @env
20478 @item LANG
20479 @itemx LC_CTYPE
20480 @c @itemx LC_COLLATE
20481 @itemx LC_MESSAGES
20482 @c @itemx LC_MONETARY
20483 @c @itemx LC_NUMERIC
20484 @c @itemx LC_TIME
20485 @itemx LC_ALL
20486 @findex LANG
20487 @findex LC_CTYPE
20488 @c @findex LC_COLLATE
20489 @findex LC_MESSAGES
20490 @c @findex LC_MONETARY
20491 @c @findex LC_NUMERIC
20492 @c @findex LC_TIME
20493 @findex LC_ALL
20494 @cindex locale
20495 These environment variables control the way that GCC uses
20496 localization information which allows GCC to work with different
20497 national conventions.  GCC inspects the locale categories
20498 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
20499 so.  These locale categories can be set to any value supported by your
20500 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
20501 Kingdom encoded in UTF-8.
20503 The @env{LC_CTYPE} environment variable specifies character
20504 classification.  GCC uses it to determine the character boundaries in
20505 a string; this is needed for some multibyte encodings that contain quote
20506 and escape characters that are otherwise interpreted as a string
20507 end or escape.
20509 The @env{LC_MESSAGES} environment variable specifies the language to
20510 use in diagnostic messages.
20512 If the @env{LC_ALL} environment variable is set, it overrides the value
20513 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
20514 and @env{LC_MESSAGES} default to the value of the @env{LANG}
20515 environment variable.  If none of these variables are set, GCC
20516 defaults to traditional C English behavior.
20518 @item TMPDIR
20519 @findex TMPDIR
20520 If @env{TMPDIR} is set, it specifies the directory to use for temporary
20521 files.  GCC uses temporary files to hold the output of one stage of
20522 compilation which is to be used as input to the next stage: for example,
20523 the output of the preprocessor, which is the input to the compiler
20524 proper.
20526 @item GCC_COMPARE_DEBUG
20527 @findex GCC_COMPARE_DEBUG
20528 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
20529 @option{-fcompare-debug} to the compiler driver.  See the documentation
20530 of this option for more details.
20532 @item GCC_EXEC_PREFIX
20533 @findex GCC_EXEC_PREFIX
20534 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
20535 names of the subprograms executed by the compiler.  No slash is added
20536 when this prefix is combined with the name of a subprogram, but you can
20537 specify a prefix that ends with a slash if you wish.
20539 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
20540 an appropriate prefix to use based on the pathname it is invoked with.
20542 If GCC cannot find the subprogram using the specified prefix, it
20543 tries looking in the usual places for the subprogram.
20545 The default value of @env{GCC_EXEC_PREFIX} is
20546 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
20547 the installed compiler. In many cases @var{prefix} is the value
20548 of @code{prefix} when you ran the @file{configure} script.
20550 Other prefixes specified with @option{-B} take precedence over this prefix.
20552 This prefix is also used for finding files such as @file{crt0.o} that are
20553 used for linking.
20555 In addition, the prefix is used in an unusual way in finding the
20556 directories to search for header files.  For each of the standard
20557 directories whose name normally begins with @samp{/usr/local/lib/gcc}
20558 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
20559 replacing that beginning with the specified prefix to produce an
20560 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
20561 @file{foo/bar} just before it searches the standard directory 
20562 @file{/usr/local/lib/bar}.
20563 If a standard directory begins with the configured
20564 @var{prefix} then the value of @var{prefix} is replaced by
20565 @env{GCC_EXEC_PREFIX} when looking for header files.
20567 @item COMPILER_PATH
20568 @findex COMPILER_PATH
20569 The value of @env{COMPILER_PATH} is a colon-separated list of
20570 directories, much like @env{PATH}.  GCC tries the directories thus
20571 specified when searching for subprograms, if it can't find the
20572 subprograms using @env{GCC_EXEC_PREFIX}.
20574 @item LIBRARY_PATH
20575 @findex LIBRARY_PATH
20576 The value of @env{LIBRARY_PATH} is a colon-separated list of
20577 directories, much like @env{PATH}.  When configured as a native compiler,
20578 GCC tries the directories thus specified when searching for special
20579 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
20580 using GCC also uses these directories when searching for ordinary
20581 libraries for the @option{-l} option (but directories specified with
20582 @option{-L} come first).
20584 @item LANG
20585 @findex LANG
20586 @cindex locale definition
20587 This variable is used to pass locale information to the compiler.  One way in
20588 which this information is used is to determine the character set to be used
20589 when character literals, string literals and comments are parsed in C and C++.
20590 When the compiler is configured to allow multibyte characters,
20591 the following values for @env{LANG} are recognized:
20593 @table @samp
20594 @item C-JIS
20595 Recognize JIS characters.
20596 @item C-SJIS
20597 Recognize SJIS characters.
20598 @item C-EUCJP
20599 Recognize EUCJP characters.
20600 @end table
20602 If @env{LANG} is not defined, or if it has some other value, then the
20603 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
20604 recognize and translate multibyte characters.
20605 @end table
20607 @noindent
20608 Some additional environment variables affect the behavior of the
20609 preprocessor.
20611 @include cppenv.texi
20613 @c man end
20615 @node Precompiled Headers
20616 @section Using Precompiled Headers
20617 @cindex precompiled headers
20618 @cindex speed of compilation
20620 Often large projects have many header files that are included in every
20621 source file.  The time the compiler takes to process these header files
20622 over and over again can account for nearly all of the time required to
20623 build the project.  To make builds faster, GCC allows you to
20624 @dfn{precompile} a header file.
20626 To create a precompiled header file, simply compile it as you would any
20627 other file, if necessary using the @option{-x} option to make the driver
20628 treat it as a C or C++ header file.  You may want to use a
20629 tool like @command{make} to keep the precompiled header up-to-date when
20630 the headers it contains change.
20632 A precompiled header file is searched for when @code{#include} is
20633 seen in the compilation.  As it searches for the included file
20634 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
20635 compiler looks for a precompiled header in each directory just before it
20636 looks for the include file in that directory.  The name searched for is
20637 the name specified in the @code{#include} with @samp{.gch} appended.  If
20638 the precompiled header file can't be used, it is ignored.
20640 For instance, if you have @code{#include "all.h"}, and you have
20641 @file{all.h.gch} in the same directory as @file{all.h}, then the
20642 precompiled header file is used if possible, and the original
20643 header is used otherwise.
20645 Alternatively, you might decide to put the precompiled header file in a
20646 directory and use @option{-I} to ensure that directory is searched
20647 before (or instead of) the directory containing the original header.
20648 Then, if you want to check that the precompiled header file is always
20649 used, you can put a file of the same name as the original header in this
20650 directory containing an @code{#error} command.
20652 This also works with @option{-include}.  So yet another way to use
20653 precompiled headers, good for projects not designed with precompiled
20654 header files in mind, is to simply take most of the header files used by
20655 a project, include them from another header file, precompile that header
20656 file, and @option{-include} the precompiled header.  If the header files
20657 have guards against multiple inclusion, they are skipped because
20658 they've already been included (in the precompiled header).
20660 If you need to precompile the same header file for different
20661 languages, targets, or compiler options, you can instead make a
20662 @emph{directory} named like @file{all.h.gch}, and put each precompiled
20663 header in the directory, perhaps using @option{-o}.  It doesn't matter
20664 what you call the files in the directory; every precompiled header in
20665 the directory is considered.  The first precompiled header
20666 encountered in the directory that is valid for this compilation is
20667 used; they're searched in no particular order.
20669 There are many other possibilities, limited only by your imagination,
20670 good sense, and the constraints of your build system.
20672 A precompiled header file can be used only when these conditions apply:
20674 @itemize
20675 @item
20676 Only one precompiled header can be used in a particular compilation.
20678 @item
20679 A precompiled header can't be used once the first C token is seen.  You
20680 can have preprocessor directives before a precompiled header; you cannot
20681 include a precompiled header from inside another header.
20683 @item
20684 The precompiled header file must be produced for the same language as
20685 the current compilation.  You can't use a C precompiled header for a C++
20686 compilation.
20688 @item
20689 The precompiled header file must have been produced by the same compiler
20690 binary as the current compilation is using.
20692 @item
20693 Any macros defined before the precompiled header is included must
20694 either be defined in the same way as when the precompiled header was
20695 generated, or must not affect the precompiled header, which usually
20696 means that they don't appear in the precompiled header at all.
20698 The @option{-D} option is one way to define a macro before a
20699 precompiled header is included; using a @code{#define} can also do it.
20700 There are also some options that define macros implicitly, like
20701 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
20702 defined this way.
20704 @item If debugging information is output when using the precompiled
20705 header, using @option{-g} or similar, the same kind of debugging information
20706 must have been output when building the precompiled header.  However,
20707 a precompiled header built using @option{-g} can be used in a compilation
20708 when no debugging information is being output.
20710 @item The same @option{-m} options must generally be used when building
20711 and using the precompiled header.  @xref{Submodel Options},
20712 for any cases where this rule is relaxed.
20714 @item Each of the following options must be the same when building and using
20715 the precompiled header:
20717 @gccoptlist{-fexceptions}
20719 @item
20720 Some other command-line options starting with @option{-f},
20721 @option{-p}, or @option{-O} must be defined in the same way as when
20722 the precompiled header was generated.  At present, it's not clear
20723 which options are safe to change and which are not; the safest choice
20724 is to use exactly the same options when generating and using the
20725 precompiled header.  The following are known to be safe:
20727 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
20728 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
20729 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
20730 -pedantic-errors}
20732 @end itemize
20734 For all of these except the last, the compiler automatically
20735 ignores the precompiled header if the conditions aren't met.  If you
20736 find an option combination that doesn't work and doesn't cause the
20737 precompiled header to be ignored, please consider filing a bug report,
20738 see @ref{Bugs}.
20740 If you do use differing options when generating and using the
20741 precompiled header, the actual behavior is a mixture of the
20742 behavior for the options.  For instance, if you use @option{-g} to
20743 generate the precompiled header but not when using it, you may or may
20744 not get debugging information for routines in the precompiled header.