Implement -mmemcpy-strategy= and -mmemset-strategy= options
[official-gcc.git] / gcc / doc / invoke.texi
blob70f09e72773509330f6b1e0cddd1bfced10ff7a8
1 @c Copyright (C) 1988-2013 Free Software Foundation, Inc.
2 @c This is part of the GCC manual.
3 @c For copying conditions, see the file gcc.texi.
5 @ignore
6 @c man begin INCLUDE
7 @include gcc-vers.texi
8 @c man end
10 @c man begin COPYRIGHT
11 Copyright @copyright{} 1988-2013 Free Software Foundation, Inc.
13 Permission is granted to copy, distribute and/or modify this document
14 under the terms of the GNU Free Documentation License, Version 1.3 or
15 any later version published by the Free Software Foundation; with the
16 Invariant Sections being ``GNU General Public License'' and ``Funding
17 Free Software'', the Front-Cover texts being (a) (see below), and with
18 the Back-Cover Texts being (b) (see below).  A copy of the license is
19 included in the gfdl(7) man page.
21 (a) The FSF's Front-Cover Text is:
23      A GNU Manual
25 (b) The FSF's Back-Cover Text is:
27      You have freedom to copy and modify this GNU Manual, like GNU
28      software.  Copies published by the Free Software Foundation raise
29      funds for GNU development.
30 @c man end
31 @c Set file name and title for the man page.
32 @setfilename gcc
33 @settitle GNU project C and C++ compiler
34 @c man begin SYNOPSIS
35 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
36     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
37     [@option{-W}@var{warn}@dots{}] [@option{-Wpedantic}]
38     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
39     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
40     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
41     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
43 Only the most useful options are listed here; see below for the
44 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
45 @c man end
46 @c man begin SEEALSO
47 gpl(7), gfdl(7), fsf-funding(7),
48 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
49 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
50 @file{ld}, @file{binutils} and @file{gdb}.
51 @c man end
52 @c man begin BUGS
53 For instructions on reporting bugs, see
54 @w{@value{BUGURL}}.
55 @c man end
56 @c man begin AUTHOR
57 See the Info entry for @command{gcc}, or
58 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
59 for contributors to GCC@.
60 @c man end
61 @end ignore
63 @node Invoking GCC
64 @chapter GCC Command Options
65 @cindex GCC command options
66 @cindex command options
67 @cindex options, GCC command
69 @c man begin DESCRIPTION
70 When you invoke GCC, it normally does preprocessing, compilation,
71 assembly and linking.  The ``overall options'' allow you to stop this
72 process at an intermediate stage.  For example, the @option{-c} option
73 says not to run the linker.  Then the output consists of object files
74 output by the assembler.
76 Other options are passed on to one stage of processing.  Some options
77 control the preprocessor and others the compiler itself.  Yet other
78 options control the assembler and linker; most of these are not
79 documented here, since you rarely need to use any of them.
81 @cindex C compilation options
82 Most of the command-line options that you can use with GCC are useful
83 for C programs; when an option is only useful with another language
84 (usually C++), the explanation says so explicitly.  If the description
85 for a particular option does not mention a source language, you can use
86 that option with all supported languages.
88 @cindex C++ compilation options
89 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
90 options for compiling C++ programs.
92 @cindex grouping options
93 @cindex options, grouping
94 The @command{gcc} program accepts options and file names as operands.  Many
95 options have multi-letter names; therefore multiple single-letter options
96 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
97 -v}}.
99 @cindex order of options
100 @cindex options, order
101 You can mix options and other arguments.  For the most part, the order
102 you use doesn't matter.  Order does matter when you use several
103 options of the same kind; for example, if you specify @option{-L} more
104 than once, the directories are searched in the order specified.  Also,
105 the placement of the @option{-l} option is significant.
107 Many options have long names starting with @samp{-f} or with
108 @samp{-W}---for example,
109 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
110 these have both positive and negative forms; the negative form of
111 @option{-ffoo} is @option{-fno-foo}.  This manual documents
112 only one of these two forms, whichever one is not the default.
114 @c man end
116 @xref{Option Index}, for an index to GCC's options.
118 @menu
119 * Option Summary::      Brief list of all options, without explanations.
120 * Overall Options::     Controlling the kind of output:
121                         an executable, object files, assembler files,
122                         or preprocessed source.
123 * Invoking G++::        Compiling C++ programs.
124 * C Dialect Options::   Controlling the variant of C language compiled.
125 * C++ Dialect Options:: Variations on C++.
126 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
127                         and Objective-C++.
128 * Language Independent Options:: Controlling how diagnostics should be
129                         formatted.
130 * Warning Options::     How picky should the compiler be?
131 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
132 * Optimize Options::    How much optimization?
133 * Preprocessor Options:: Controlling header files and macro definitions.
134                          Also, getting dependency information for Make.
135 * Assembler Options::   Passing options to the assembler.
136 * Link Options::        Specifying libraries and so on.
137 * Directory Options::   Where to find header files and libraries.
138                         Where to find the compiler executable files.
139 * Spec Files::          How to pass switches to sub-processes.
140 * Target Options::      Running a cross-compiler, or an old version of GCC.
141 * Submodel Options::    Specifying minor hardware or convention variations,
142                         such as 68010 vs 68020.
143 * Code Gen Options::    Specifying conventions for function calls, data layout
144                         and register usage.
145 * Environment Variables:: Env vars that affect GCC.
146 * Precompiled Headers:: Compiling a header once, and using it many times.
147 @end menu
149 @c man begin OPTIONS
151 @node Option Summary
152 @section Option Summary
154 Here is a summary of all the options, grouped by type.  Explanations are
155 in the following sections.
157 @table @emph
158 @item Overall Options
159 @xref{Overall Options,,Options Controlling the Kind of Output}.
160 @gccoptlist{-c  -S  -E  -o @var{file}  -no-canonical-prefixes  @gol
161 -pipe  -pass-exit-codes  @gol
162 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
163 --version -wrapper @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
164 -fdump-ada-spec@r{[}-slim@r{]} -fada-spec-parent=@var{arg} -fdump-go-spec=@var{file}}
166 @item C Language Options
167 @xref{C Dialect Options,,Options Controlling C Dialect}.
168 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
169 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
170 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
171 -fhosted  -ffreestanding -fopenmp -fms-extensions -fplan9-extensions @gol
172 -trigraphs  -traditional  -traditional-cpp @gol
173 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
174 -fsigned-bitfields  -fsigned-char @gol
175 -funsigned-bitfields  -funsigned-char}
177 @item C++ Language Options
178 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
179 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
180 -fconstexpr-depth=@var{n}  -ffriend-injection @gol
181 -fno-elide-constructors @gol
182 -fno-enforce-eh-specs @gol
183 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
184 -fno-implicit-templates @gol
185 -fno-implicit-inline-templates @gol
186 -fno-implement-inlines  -fms-extensions @gol
187 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
188 -fno-optional-diags  -fpermissive @gol
189 -fno-pretty-templates @gol
190 -frepo  -fno-rtti  -fstats  -ftemplate-backtrace-limit=@var{n} @gol
191 -ftemplate-depth=@var{n} @gol
192 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
193 -fno-default-inline  -fvisibility-inlines-hidden @gol
194 -fvtable-verify=@var{std|preinit|none} @gol
195 -fvtv-counts -fvtv-debug @gol
196 -fvisibility-ms-compat @gol
197 -fext-numeric-literals @gol
198 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
199 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
200 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
201 -Weffc++  -Wstrict-null-sentinel @gol
202 -Wno-non-template-friend  -Wold-style-cast @gol
203 -Woverloaded-virtual  -Wno-pmf-conversions @gol
204 -Wsign-promo}
206 @item Objective-C and Objective-C++ Language Options
207 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
208 Objective-C and Objective-C++ Dialects}.
209 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
210 -fgnu-runtime  -fnext-runtime @gol
211 -fno-nil-receivers @gol
212 -fobjc-abi-version=@var{n} @gol
213 -fobjc-call-cxx-cdtors @gol
214 -fobjc-direct-dispatch @gol
215 -fobjc-exceptions @gol
216 -fobjc-gc @gol
217 -fobjc-nilcheck @gol
218 -fobjc-std=objc1 @gol
219 -freplace-objc-classes @gol
220 -fzero-link @gol
221 -gen-decls @gol
222 -Wassign-intercept @gol
223 -Wno-protocol  -Wselector @gol
224 -Wstrict-selector-match @gol
225 -Wundeclared-selector}
227 @item Language Independent Options
228 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
229 @gccoptlist{-fmessage-length=@var{n}  @gol
230 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
231 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
232 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
234 @item Warning Options
235 @xref{Warning Options,,Options to Request or Suppress Warnings}.
236 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
237 -pedantic-errors @gol
238 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
239 -Waggressive-loop-optimizations -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 -Wconditionally-supported  @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 -fsanitize=@var{style} @gol
292 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
293 -fdisable-ipa-@var{pass_name} @gol
294 -fdisable-rtl-@var{pass_name} @gol
295 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
296 -fdisable-tree-@var{pass_name} @gol
297 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
298 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
299 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
300 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
301 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
302 -fdump-passes @gol
303 -fdump-statistics @gol
304 -fdump-tree-all @gol
305 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
306 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
307 -fdump-tree-cfg -fdump-tree-alias @gol
308 -fdump-tree-ch @gol
309 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
310 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
315 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
316 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
317 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
318 -fdump-tree-nrv -fdump-tree-vect @gol
319 -fdump-tree-sink @gol
320 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
321 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
322 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
323 -fdump-tree-vtable-verify @gol
324 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
325 -ftree-vectorizer-verbose=@var{n} @gol
326 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
327 -fdump-final-insns=@var{file} @gol
328 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
329 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
330 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
331 -fenable-@var{kind}-@var{pass} @gol
332 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
333 -fdebug-types-section -fmem-report-wpa @gol
334 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
335 -fopt-info @gol
336 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
337 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
338 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
339 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
340 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
341 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
342 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
343 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
344 -gvms  -gxcoff  -gxcoff+ @gol
345 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
346 -fdebug-prefix-map=@var{old}=@var{new} @gol
347 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
348 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
349 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
350 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
351 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
352 -print-sysroot -print-sysroot-headers-suffix @gol
353 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
355 @item Optimization Options
356 @xref{Optimize Options,,Options that Control Optimization}.
357 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
358 -falign-jumps[=@var{n}] @gol
359 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
360 -fassociative-math -fauto-inc-dec -fbranch-probabilities @gol
361 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
362 -fbtr-bb-exclusive -fcaller-saves @gol
363 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
364 -fcompare-elim -fcprop-registers -fcrossjumping @gol
365 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
366 -fcx-limited-range @gol
367 -fdata-sections -fdce -fdelayed-branch @gol
368 -fdelete-null-pointer-checks -fdevirtualize -fdse @gol
369 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
370 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
371 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
372 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
373 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
374 -fif-conversion2 -findirect-inlining @gol
375 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
376 -finline-small-functions -fipa-cp -fipa-cp-clone @gol
377 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
378 -fira-algorithm=@var{algorithm} @gol
379 -fira-region=@var{region} -fira-hoist-pressure @gol
380 -fira-loop-pressure -fno-ira-share-save-slots @gol
381 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
382 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
383 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
384 -floop-parallelize-all -flto -flto-compression-level @gol
385 -flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
386 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
387 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
388 -fno-default-inline @gol
389 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
390 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
391 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
392 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
393 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
394 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
395 -fprefetch-loop-arrays -fprofile-report @gol
396 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
397 -fprofile-generate=@var{path} @gol
398 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
399 -freciprocal-math -free -fregmove -frename-registers -freorder-blocks @gol
400 -freorder-blocks-and-partition -freorder-functions @gol
401 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
402 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
403 -fsched-spec-load -fsched-spec-load-dangerous @gol
404 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
405 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
406 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
407 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
408 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
409 -fselective-scheduling -fselective-scheduling2 @gol
410 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
411 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
412 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
413 -fstack-protector-all -fstack-protector-strong -fstrict-aliasing @gol
414 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
415 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
416 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
417 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
418 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
419 -ftree-loop-if-convert-stores -ftree-loop-im @gol
420 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
421 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
422 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
423 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
424 -ftree-switch-conversion -ftree-tail-merge @gol
425 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
426 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
427 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
428 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
429 -fwhole-program -fwpa -fuse-ld=@var{linker} -fuse-linker-plugin @gol
430 --param @var{name}=@var{value}
431 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
433 @item Preprocessor Options
434 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
435 @gccoptlist{-A@var{question}=@var{answer} @gol
436 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
437 -C  -dD  -dI  -dM  -dN @gol
438 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
439 -idirafter @var{dir} @gol
440 -include @var{file}  -imacros @var{file} @gol
441 -iprefix @var{file}  -iwithprefix @var{dir} @gol
442 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
443 -imultilib @var{dir} -isysroot @var{dir} @gol
444 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
445 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
446 -remap -trigraphs  -undef  -U@var{macro}  @gol
447 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
449 @item Assembler Option
450 @xref{Assembler Options,,Passing Options to the Assembler}.
451 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
453 @item Linker Options
454 @xref{Link Options,,Options for Linking}.
455 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
456 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
457 -s  -static -static-libgcc -static-libstdc++ @gol
458 -static-libasan -static-libtsan @gol
459 -shared -shared-libgcc  -symbolic @gol
460 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
461 -u @var{symbol}}
463 @item Directory Options
464 @xref{Directory Options,,Options for Directory Search}.
465 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
466 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
467 --sysroot=@var{dir} --no-sysroot-suffix}
469 @item Machine Dependent Options
470 @xref{Submodel Options,,Hardware Models and Configurations}.
471 @c This list is ordered alphanumerically by subsection name.
472 @c Try and put the significant identifier (CPU or system) first,
473 @c so users have a clue at guessing where the ones they want will be.
475 @emph{AArch64 Options}
476 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
477 -mgeneral-regs-only @gol
478 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
479 -mstrict-align @gol
480 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
481 -mtls-dialect=desc  -mtls-dialect=traditional @gol
482 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
484 @emph{Adapteva Epiphany Options}
485 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
486 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
487 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
488 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
489 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
490 -msplit-vecmove-early -m1reg-@var{reg}}
492 @emph{ARM Options}
493 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
494 -mabi=@var{name} @gol
495 -mapcs-stack-check  -mno-apcs-stack-check @gol
496 -mapcs-float  -mno-apcs-float @gol
497 -mapcs-reentrant  -mno-apcs-reentrant @gol
498 -msched-prolog  -mno-sched-prolog @gol
499 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
500 -mfloat-abi=@var{name} @gol
501 -mfp16-format=@var{name}
502 -mthumb-interwork  -mno-thumb-interwork @gol
503 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
504 -mstructure-size-boundary=@var{n} @gol
505 -mabort-on-noreturn @gol
506 -mlong-calls  -mno-long-calls @gol
507 -msingle-pic-base  -mno-single-pic-base @gol
508 -mpic-register=@var{reg} @gol
509 -mnop-fun-dllimport @gol
510 -mpoke-function-name @gol
511 -mthumb  -marm @gol
512 -mtpcs-frame  -mtpcs-leaf-frame @gol
513 -mcaller-super-interworking  -mcallee-super-interworking @gol
514 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
515 -mword-relocations @gol
516 -mfix-cortex-m3-ldrd @gol
517 -munaligned-access @gol
518 -mneon-for-64bits @gol
519 -mrestrict-it}
521 @emph{AVR Options}
522 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
523 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
524 -mstrict-X -mtiny-stack -Waddr-space-convert}
526 @emph{Blackfin Options}
527 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
528 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
529 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
530 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
531 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
532 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
533 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
534 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
535 -micplb}
537 @emph{C6X Options}
538 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
539 -msim -msdata=@var{sdata-type}}
541 @emph{CRIS Options}
542 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
543 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
544 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
545 -mstack-align  -mdata-align  -mconst-align @gol
546 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
547 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
548 -mmul-bug-workaround  -mno-mul-bug-workaround}
550 @emph{CR16 Options}
551 @gccoptlist{-mmac @gol
552 -mcr16cplus -mcr16c @gol
553 -msim -mint32 -mbit-ops
554 -mdata-model=@var{model}}
556 @emph{Darwin Options}
557 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
558 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
559 -client_name  -compatibility_version  -current_version @gol
560 -dead_strip @gol
561 -dependency-file  -dylib_file  -dylinker_install_name @gol
562 -dynamic  -dynamiclib  -exported_symbols_list @gol
563 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
564 -force_flat_namespace  -headerpad_max_install_names @gol
565 -iframework @gol
566 -image_base  -init  -install_name  -keep_private_externs @gol
567 -multi_module  -multiply_defined  -multiply_defined_unused @gol
568 -noall_load   -no_dead_strip_inits_and_terms @gol
569 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
570 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
571 -private_bundle  -read_only_relocs  -sectalign @gol
572 -sectobjectsymbols  -whyload  -seg1addr @gol
573 -sectcreate  -sectobjectsymbols  -sectorder @gol
574 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
575 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
576 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
577 -single_module  -static  -sub_library  -sub_umbrella @gol
578 -twolevel_namespace  -umbrella  -undefined @gol
579 -unexported_symbols_list  -weak_reference_mismatches @gol
580 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
581 -mkernel -mone-byte-bool}
583 @emph{DEC Alpha Options}
584 @gccoptlist{-mno-fp-regs  -msoft-float @gol
585 -mieee  -mieee-with-inexact  -mieee-conformant @gol
586 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
587 -mtrap-precision=@var{mode}  -mbuild-constants @gol
588 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
589 -mbwx  -mmax  -mfix  -mcix @gol
590 -mfloat-vax  -mfloat-ieee @gol
591 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
592 -msmall-text  -mlarge-text @gol
593 -mmemory-latency=@var{time}}
595 @emph{FR30 Options}
596 @gccoptlist{-msmall-model -mno-lsim}
598 @emph{FRV Options}
599 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
600 -mhard-float  -msoft-float @gol
601 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
602 -mdouble  -mno-double @gol
603 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
604 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
605 -mlinked-fp  -mlong-calls  -malign-labels @gol
606 -mlibrary-pic  -macc-4  -macc-8 @gol
607 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
608 -moptimize-membar -mno-optimize-membar @gol
609 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
610 -mvliw-branch  -mno-vliw-branch @gol
611 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
612 -mno-nested-cond-exec  -mtomcat-stats @gol
613 -mTLS -mtls @gol
614 -mcpu=@var{cpu}}
616 @emph{GNU/Linux Options}
617 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
618 -tno-android-cc -tno-android-ld}
620 @emph{H8/300 Options}
621 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
623 @emph{HPPA Options}
624 @gccoptlist{-march=@var{architecture-type} @gol
625 -mdisable-fpregs  -mdisable-indexing @gol
626 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
627 -mfixed-range=@var{register-range} @gol
628 -mjump-in-delay -mlinker-opt -mlong-calls @gol
629 -mlong-load-store  -mno-disable-fpregs @gol
630 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
631 -mno-jump-in-delay  -mno-long-load-store @gol
632 -mno-portable-runtime  -mno-soft-float @gol
633 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
634 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
635 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
636 -munix=@var{unix-std}  -nolibdld  -static  -threads}
638 @emph{i386 and x86-64 Options}
639 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
640 -mfpmath=@var{unit} @gol
641 -masm=@var{dialect}  -mno-fancy-math-387 @gol
642 -mno-fp-ret-in-387  -msoft-float @gol
643 -mno-wide-multiply  -mrtd  -malign-double @gol
644 -mpreferred-stack-boundary=@var{num} @gol
645 -mincoming-stack-boundary=@var{num} @gol
646 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
647 -mrecip -mrecip=@var{opt} @gol
648 -mvzeroupper -mprefer-avx128 @gol
649 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
650 -mavx2 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
651 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
652 -mbmi2 -mrtm -mlwp -mthreads @gol
653 -mno-align-stringops  -minline-all-stringops @gol
654 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
655 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy} 
656 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
657 -m96bit-long-double -mlong-double-64 -mlong-double-80 @gol
658 -mregparm=@var{num}  -msseregparm @gol
659 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
660 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
661 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
662 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
663 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
664 -msse2avx -mfentry -m8bit-idiv @gol
665 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
666 -mstack-protector-guard=@var{guard}}
668 @emph{i386 and x86-64 Windows Options}
669 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
670 -mnop-fun-dllimport -mthread @gol
671 -municode -mwin32 -mwindows -fno-set-stack-executable}
673 @emph{IA-64 Options}
674 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
675 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
676 -mconstant-gp  -mauto-pic  -mfused-madd @gol
677 -minline-float-divide-min-latency @gol
678 -minline-float-divide-max-throughput @gol
679 -mno-inline-float-divide @gol
680 -minline-int-divide-min-latency @gol
681 -minline-int-divide-max-throughput  @gol
682 -mno-inline-int-divide @gol
683 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
684 -mno-inline-sqrt @gol
685 -mdwarf2-asm -mearly-stop-bits @gol
686 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
687 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
688 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
689 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
690 -msched-spec-ldc -msched-spec-control-ldc @gol
691 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
692 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
693 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
694 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
696 @emph{LM32 Options}
697 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
698 -msign-extend-enabled -muser-enabled}
700 @emph{M32R/D Options}
701 @gccoptlist{-m32r2 -m32rx -m32r @gol
702 -mdebug @gol
703 -malign-loops -mno-align-loops @gol
704 -missue-rate=@var{number} @gol
705 -mbranch-cost=@var{number} @gol
706 -mmodel=@var{code-size-model-type} @gol
707 -msdata=@var{sdata-type} @gol
708 -mno-flush-func -mflush-func=@var{name} @gol
709 -mno-flush-trap -mflush-trap=@var{number} @gol
710 -G @var{num}}
712 @emph{M32C Options}
713 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
715 @emph{M680x0 Options}
716 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
717 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
718 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
719 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
720 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
721 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
722 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
723 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
724 -mxgot -mno-xgot}
726 @emph{MCore Options}
727 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
728 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
729 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
730 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
731 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
733 @emph{MeP Options}
734 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
735 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
736 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
737 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
738 -mtiny=@var{n}}
740 @emph{MicroBlaze Options}
741 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
742 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
743 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
744 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
745 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
747 @emph{MIPS Options}
748 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
749 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
750 -mips64  -mips64r2 @gol
751 -mips16  -mno-mips16  -mflip-mips16 @gol
752 -minterlink-compressed -mno-interlink-compressed @gol
753 -minterlink-mips16  -mno-interlink-mips16 @gol
754 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
755 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
756 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
757 -mno-float  -msingle-float  -mdouble-float @gol
758 -mabs=@var{mode}  -mnan=@var{encoding} @gol
759 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
760 -mmcu -mmno-mcu @gol
761 -meva -mno-eva @gol
762 -mmicromips -mno-micromips @gol
763 -mfpu=@var{fpu-type} @gol
764 -msmartmips  -mno-smartmips @gol
765 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
766 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
767 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
768 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
769 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
770 -membedded-data  -mno-embedded-data @gol
771 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
772 -mcode-readable=@var{setting} @gol
773 -msplit-addresses  -mno-split-addresses @gol
774 -mexplicit-relocs  -mno-explicit-relocs @gol
775 -mcheck-zero-division  -mno-check-zero-division @gol
776 -mdivide-traps  -mdivide-breaks @gol
777 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
778 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
779 -mfix-24k -mno-fix-24k @gol
780 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
781 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
782 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
783 -mflush-func=@var{func}  -mno-flush-func @gol
784 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
785 -mfp-exceptions -mno-fp-exceptions @gol
786 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
787 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
789 @emph{MMIX Options}
790 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
791 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
792 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
793 -mno-base-addresses  -msingle-exit  -mno-single-exit}
795 @emph{MN10300 Options}
796 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
797 -mno-am33 -mam33 -mam33-2 -mam34 @gol
798 -mtune=@var{cpu-type} @gol
799 -mreturn-pointer-on-d0 @gol
800 -mno-crt0  -mrelax -mliw -msetlb}
802 @emph{Moxie Options}
803 @gccoptlist{-meb -mel -mno-crt0}
805 @emph{PDP-11 Options}
806 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
807 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
808 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
809 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
810 -mbranch-expensive  -mbranch-cheap @gol
811 -munix-asm  -mdec-asm}
813 @emph{picoChip Options}
814 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
815 -msymbol-as-address -mno-inefficient-warnings}
817 @emph{PowerPC Options}
818 See RS/6000 and PowerPC Options.
820 @emph{RL78 Options}
821 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
823 @emph{RS/6000 and PowerPC Options}
824 @gccoptlist{-mcpu=@var{cpu-type} @gol
825 -mtune=@var{cpu-type} @gol
826 -mcmodel=@var{code-model} @gol
827 -mpowerpc64 @gol
828 -maltivec  -mno-altivec @gol
829 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
830 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
831 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
832 -mfprnd  -mno-fprnd @gol
833 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
834 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
835 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
836 -malign-power  -malign-natural @gol
837 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
838 -msingle-float -mdouble-float -msimple-fpu @gol
839 -mstring  -mno-string  -mupdate  -mno-update @gol
840 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
841 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
842 -mstrict-align  -mno-strict-align  -mrelocatable @gol
843 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
844 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
845 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
846 -mprioritize-restricted-insns=@var{priority} @gol
847 -msched-costly-dep=@var{dependence_type} @gol
848 -minsert-sched-nops=@var{scheme} @gol
849 -mcall-sysv  -mcall-netbsd @gol
850 -maix-struct-return  -msvr4-struct-return @gol
851 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
852 -mblock-move-inline-limit=@var{num} @gol
853 -misel -mno-isel @gol
854 -misel=yes  -misel=no @gol
855 -mspe -mno-spe @gol
856 -mspe=yes  -mspe=no @gol
857 -mpaired @gol
858 -mgen-cell-microcode -mwarn-cell-microcode @gol
859 -mvrsave -mno-vrsave @gol
860 -mmulhw -mno-mulhw @gol
861 -mdlmzb -mno-dlmzb @gol
862 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
863 -mprototype  -mno-prototype @gol
864 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
865 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
866 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
867 -mno-recip-precision @gol
868 -mveclibabi=@var{type} -mfriz -mno-friz @gol
869 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
870 -msave-toc-indirect -mno-save-toc-indirect @gol
871 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
872 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
873 -mquad-memory -mno-quad-memory}
875 @emph{RX Options}
876 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
877 -mcpu=@gol
878 -mbig-endian-data -mlittle-endian-data @gol
879 -msmall-data @gol
880 -msim  -mno-sim@gol
881 -mas100-syntax -mno-as100-syntax@gol
882 -mrelax@gol
883 -mmax-constant-size=@gol
884 -mint-register=@gol
885 -mpid@gol
886 -mno-warn-multiple-fast-interrupts@gol
887 -msave-acc-in-interrupts}
889 @emph{S/390 and zSeries Options}
890 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
891 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
892 -mlong-double-64 -mlong-double-128 @gol
893 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
894 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
895 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
896 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
897 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
899 @emph{Score Options}
900 @gccoptlist{-meb -mel @gol
901 -mnhwloop @gol
902 -muls @gol
903 -mmac @gol
904 -mscore5 -mscore5u -mscore7 -mscore7d}
906 @emph{SH Options}
907 @gccoptlist{-m1  -m2  -m2e @gol
908 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
909 -m3  -m3e @gol
910 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
911 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
912 -m5-64media  -m5-64media-nofpu @gol
913 -m5-32media  -m5-32media-nofpu @gol
914 -m5-compact  -m5-compact-nofpu @gol
915 -mb  -ml  -mdalign  -mrelax @gol
916 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
917 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
918 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
919 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
920 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
921 -maccumulate-outgoing-args -minvalid-symbols @gol
922 -matomic-model=@var{atomic-model} @gol
923 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch -mcbranchdi -mcmpeqdi @gol
924 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
925 -mpretend-cmove -mtas}
927 @emph{Solaris 2 Options}
928 @gccoptlist{-mimpure-text  -mno-impure-text @gol
929 -pthreads -pthread}
931 @emph{SPARC Options}
932 @gccoptlist{-mcpu=@var{cpu-type} @gol
933 -mtune=@var{cpu-type} @gol
934 -mcmodel=@var{code-model} @gol
935 -mmemory-model=@var{mem-model} @gol
936 -m32  -m64  -mapp-regs  -mno-app-regs @gol
937 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
938 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
939 -mhard-quad-float  -msoft-quad-float @gol
940 -mstack-bias  -mno-stack-bias @gol
941 -munaligned-doubles  -mno-unaligned-doubles @gol
942 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
943 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
944 -mcbcond -mno-cbcond @gol
945 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
946 -mfix-at697f -mfix-ut699}
948 @emph{SPU Options}
949 @gccoptlist{-mwarn-reloc -merror-reloc @gol
950 -msafe-dma -munsafe-dma @gol
951 -mbranch-hints @gol
952 -msmall-mem -mlarge-mem -mstdmain @gol
953 -mfixed-range=@var{register-range} @gol
954 -mea32 -mea64 @gol
955 -maddress-space-conversion -mno-address-space-conversion @gol
956 -mcache-size=@var{cache-size} @gol
957 -matomic-updates -mno-atomic-updates}
959 @emph{System V Options}
960 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
962 @emph{TILE-Gx Options}
963 @gccoptlist{-mcpu=@var{cpu} -m32 -m64 -mcmodel=@var{code-model}}
965 @emph{TILEPro Options}
966 @gccoptlist{-mcpu=@var{cpu} -m32}
968 @emph{V850 Options}
969 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
970 -mprolog-function  -mno-prolog-function  -mspace @gol
971 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
972 -mapp-regs  -mno-app-regs @gol
973 -mdisable-callt  -mno-disable-callt @gol
974 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
975 -mv850e -mv850 -mv850e3v5 @gol
976 -mloop @gol
977 -mrelax @gol
978 -mlong-jumps @gol
979 -msoft-float @gol
980 -mhard-float @gol
981 -mgcc-abi @gol
982 -mrh850-abi @gol
983 -mbig-switch}
985 @emph{VAX Options}
986 @gccoptlist{-mg  -mgnu  -munix}
988 @emph{VMS Options}
989 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
990 -mpointer-size=@var{size}}
992 @emph{VxWorks Options}
993 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
994 -Xbind-lazy  -Xbind-now}
996 @emph{x86-64 Options}
997 See i386 and x86-64 Options.
999 @emph{Xstormy16 Options}
1000 @gccoptlist{-msim}
1002 @emph{Xtensa Options}
1003 @gccoptlist{-mconst16 -mno-const16 @gol
1004 -mfused-madd  -mno-fused-madd @gol
1005 -mforce-no-pic @gol
1006 -mserialize-volatile  -mno-serialize-volatile @gol
1007 -mtext-section-literals  -mno-text-section-literals @gol
1008 -mtarget-align  -mno-target-align @gol
1009 -mlongcalls  -mno-longcalls}
1011 @emph{zSeries Options}
1012 See S/390 and zSeries Options.
1014 @item Code Generation Options
1015 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1016 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1017 -ffixed-@var{reg}  -fexceptions @gol
1018 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1019 -fasynchronous-unwind-tables @gol
1020 -finhibit-size-directive  -finstrument-functions @gol
1021 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1022 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1023 -fno-common  -fno-ident @gol
1024 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1025 -fno-jump-tables @gol
1026 -frecord-gcc-switches @gol
1027 -freg-struct-return  -fshort-enums @gol
1028 -fshort-double  -fshort-wchar @gol
1029 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1030 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1031 -fno-stack-limit -fsplit-stack @gol
1032 -fleading-underscore  -ftls-model=@var{model} @gol
1033 -fstack-reuse=@var{reuse_level} @gol
1034 -ftrapv  -fwrapv  -fbounds-check @gol
1035 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1036 @end table
1038 @menu
1039 * Overall Options::     Controlling the kind of output:
1040                         an executable, object files, assembler files,
1041                         or preprocessed source.
1042 * C Dialect Options::   Controlling the variant of C language compiled.
1043 * C++ Dialect Options:: Variations on C++.
1044 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
1045                         and Objective-C++.
1046 * Language Independent Options:: Controlling how diagnostics should be
1047                         formatted.
1048 * Warning Options::     How picky should the compiler be?
1049 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
1050 * Optimize Options::    How much optimization?
1051 * Preprocessor Options:: Controlling header files and macro definitions.
1052                          Also, getting dependency information for Make.
1053 * Assembler Options::   Passing options to the assembler.
1054 * Link Options::        Specifying libraries and so on.
1055 * Directory Options::   Where to find header files and libraries.
1056                         Where to find the compiler executable files.
1057 * Spec Files::          How to pass switches to sub-processes.
1058 * Target Options::      Running a cross-compiler, or an old version of GCC.
1059 @end menu
1061 @node Overall Options
1062 @section Options Controlling the Kind of Output
1064 Compilation can involve up to four stages: preprocessing, compilation
1065 proper, assembly and linking, always in that order.  GCC is capable of
1066 preprocessing and compiling several files either into several
1067 assembler input files, or into one assembler input file; then each
1068 assembler input file produces an object file, and linking combines all
1069 the object files (those newly compiled, and those specified as input)
1070 into an executable file.
1072 @cindex file name suffix
1073 For any given input file, the file name suffix determines what kind of
1074 compilation is done:
1076 @table @gcctabopt
1077 @item @var{file}.c
1078 C source code that must be preprocessed.
1080 @item @var{file}.i
1081 C source code that should not be preprocessed.
1083 @item @var{file}.ii
1084 C++ source code that should not be preprocessed.
1086 @item @var{file}.m
1087 Objective-C source code.  Note that you must link with the @file{libobjc}
1088 library to make an Objective-C program work.
1090 @item @var{file}.mi
1091 Objective-C source code that should not be preprocessed.
1093 @item @var{file}.mm
1094 @itemx @var{file}.M
1095 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1096 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1097 to a literal capital M@.
1099 @item @var{file}.mii
1100 Objective-C++ source code that should not be preprocessed.
1102 @item @var{file}.h
1103 C, C++, Objective-C or Objective-C++ header file to be turned into a
1104 precompiled header (default), or C, C++ header file to be turned into an
1105 Ada spec (via the @option{-fdump-ada-spec} switch).
1107 @item @var{file}.cc
1108 @itemx @var{file}.cp
1109 @itemx @var{file}.cxx
1110 @itemx @var{file}.cpp
1111 @itemx @var{file}.CPP
1112 @itemx @var{file}.c++
1113 @itemx @var{file}.C
1114 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1115 the last two letters must both be literally @samp{x}.  Likewise,
1116 @samp{.C} refers to a literal capital C@.
1118 @item @var{file}.mm
1119 @itemx @var{file}.M
1120 Objective-C++ source code that must be preprocessed.
1122 @item @var{file}.mii
1123 Objective-C++ source code that should not be preprocessed.
1125 @item @var{file}.hh
1126 @itemx @var{file}.H
1127 @itemx @var{file}.hp
1128 @itemx @var{file}.hxx
1129 @itemx @var{file}.hpp
1130 @itemx @var{file}.HPP
1131 @itemx @var{file}.h++
1132 @itemx @var{file}.tcc
1133 C++ header file to be turned into a precompiled header or Ada spec.
1135 @item @var{file}.f
1136 @itemx @var{file}.for
1137 @itemx @var{file}.ftn
1138 Fixed form Fortran source code that should not be preprocessed.
1140 @item @var{file}.F
1141 @itemx @var{file}.FOR
1142 @itemx @var{file}.fpp
1143 @itemx @var{file}.FPP
1144 @itemx @var{file}.FTN
1145 Fixed form Fortran source code that must be preprocessed (with the traditional
1146 preprocessor).
1148 @item @var{file}.f90
1149 @itemx @var{file}.f95
1150 @itemx @var{file}.f03
1151 @itemx @var{file}.f08
1152 Free form Fortran source code that should not be preprocessed.
1154 @item @var{file}.F90
1155 @itemx @var{file}.F95
1156 @itemx @var{file}.F03
1157 @itemx @var{file}.F08
1158 Free form Fortran source code that must be preprocessed (with the
1159 traditional preprocessor).
1161 @item @var{file}.go
1162 Go source code.
1164 @c FIXME: Descriptions of Java file types.
1165 @c @var{file}.java
1166 @c @var{file}.class
1167 @c @var{file}.zip
1168 @c @var{file}.jar
1170 @item @var{file}.ads
1171 Ada source code file that contains a library unit declaration (a
1172 declaration of a package, subprogram, or generic, or a generic
1173 instantiation), or a library unit renaming declaration (a package,
1174 generic, or subprogram renaming declaration).  Such files are also
1175 called @dfn{specs}.
1177 @item @var{file}.adb
1178 Ada source code file containing a library unit body (a subprogram or
1179 package body).  Such files are also called @dfn{bodies}.
1181 @c GCC also knows about some suffixes for languages not yet included:
1182 @c Pascal:
1183 @c @var{file}.p
1184 @c @var{file}.pas
1185 @c Ratfor:
1186 @c @var{file}.r
1188 @item @var{file}.s
1189 Assembler code.
1191 @item @var{file}.S
1192 @itemx @var{file}.sx
1193 Assembler code that must be preprocessed.
1195 @item @var{other}
1196 An object file to be fed straight into linking.
1197 Any file name with no recognized suffix is treated this way.
1198 @end table
1200 @opindex x
1201 You can specify the input language explicitly with the @option{-x} option:
1203 @table @gcctabopt
1204 @item -x @var{language}
1205 Specify explicitly the @var{language} for the following input files
1206 (rather than letting the compiler choose a default based on the file
1207 name suffix).  This option applies to all following input files until
1208 the next @option{-x} option.  Possible values for @var{language} are:
1209 @smallexample
1210 c  c-header  cpp-output
1211 c++  c++-header  c++-cpp-output
1212 objective-c  objective-c-header  objective-c-cpp-output
1213 objective-c++ objective-c++-header objective-c++-cpp-output
1214 assembler  assembler-with-cpp
1216 f77  f77-cpp-input f95  f95-cpp-input
1218 java
1219 @end smallexample
1221 @item -x none
1222 Turn off any specification of a language, so that subsequent files are
1223 handled according to their file name suffixes (as they are if @option{-x}
1224 has not been used at all).
1226 @item -pass-exit-codes
1227 @opindex pass-exit-codes
1228 Normally the @command{gcc} program exits with the code of 1 if any
1229 phase of the compiler returns a non-success return code.  If you specify
1230 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1231 the numerically highest error produced by any phase returning an error
1232 indication.  The C, C++, and Fortran front ends return 4 if an internal
1233 compiler error is encountered.
1234 @end table
1236 If you only want some of the stages of compilation, you can use
1237 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1238 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1239 @command{gcc} is to stop.  Note that some combinations (for example,
1240 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1242 @table @gcctabopt
1243 @item -c
1244 @opindex c
1245 Compile or assemble the source files, but do not link.  The linking
1246 stage simply is not done.  The ultimate output is in the form of an
1247 object file for each source file.
1249 By default, the object file name for a source file is made by replacing
1250 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1252 Unrecognized input files, not requiring compilation or assembly, are
1253 ignored.
1255 @item -S
1256 @opindex S
1257 Stop after the stage of compilation proper; do not assemble.  The output
1258 is in the form of an assembler code file for each non-assembler input
1259 file specified.
1261 By default, the assembler file name for a source file is made by
1262 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1264 Input files that don't require compilation are ignored.
1266 @item -E
1267 @opindex E
1268 Stop after the preprocessing stage; do not run the compiler proper.  The
1269 output is in the form of preprocessed source code, which is sent to the
1270 standard output.
1272 Input files that don't require preprocessing are ignored.
1274 @cindex output file option
1275 @item -o @var{file}
1276 @opindex o
1277 Place output in file @var{file}.  This applies to whatever
1278 sort of output is being produced, whether it be an executable file,
1279 an object file, an assembler file or preprocessed C code.
1281 If @option{-o} is not specified, the default is to put an executable
1282 file in @file{a.out}, the object file for
1283 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1284 assembler file in @file{@var{source}.s}, a precompiled header file in
1285 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1286 standard output.
1288 @item -v
1289 @opindex v
1290 Print (on standard error output) the commands executed to run the stages
1291 of compilation.  Also print the version number of the compiler driver
1292 program and of the preprocessor and the compiler proper.
1294 @item -###
1295 @opindex ###
1296 Like @option{-v} except the commands are not executed and arguments
1297 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1298 This is useful for shell scripts to capture the driver-generated command lines.
1300 @item -pipe
1301 @opindex pipe
1302 Use pipes rather than temporary files for communication between the
1303 various stages of compilation.  This fails to work on some systems where
1304 the assembler is unable to read from a pipe; but the GNU assembler has
1305 no trouble.
1307 @item --help
1308 @opindex help
1309 Print (on the standard output) a description of the command-line options
1310 understood by @command{gcc}.  If the @option{-v} option is also specified
1311 then @option{--help} is also passed on to the various processes
1312 invoked by @command{gcc}, so that they can display the command-line options
1313 they accept.  If the @option{-Wextra} option has also been specified
1314 (prior to the @option{--help} option), then command-line options that
1315 have no documentation associated with them are also displayed.
1317 @item --target-help
1318 @opindex target-help
1319 Print (on the standard output) a description of target-specific command-line
1320 options for each tool.  For some targets extra target-specific
1321 information may also be printed.
1323 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1324 Print (on the standard output) a description of the command-line
1325 options understood by the compiler that fit into all specified classes
1326 and qualifiers.  These are the supported classes:
1328 @table @asis
1329 @item @samp{optimizers}
1330 Display all of the optimization options supported by the
1331 compiler.
1333 @item @samp{warnings}
1334 Display all of the options controlling warning messages
1335 produced by the compiler.
1337 @item @samp{target}
1338 Display target-specific options.  Unlike the
1339 @option{--target-help} option however, target-specific options of the
1340 linker and assembler are not displayed.  This is because those
1341 tools do not currently support the extended @option{--help=} syntax.
1343 @item @samp{params}
1344 Display the values recognized by the @option{--param}
1345 option.
1347 @item @var{language}
1348 Display the options supported for @var{language}, where
1349 @var{language} is the name of one of the languages supported in this
1350 version of GCC@.
1352 @item @samp{common}
1353 Display the options that are common to all languages.
1354 @end table
1356 These are the supported qualifiers:
1358 @table @asis
1359 @item @samp{undocumented}
1360 Display only those options that are undocumented.
1362 @item @samp{joined}
1363 Display options taking an argument that appears after an equal
1364 sign in the same continuous piece of text, such as:
1365 @samp{--help=target}.
1367 @item @samp{separate}
1368 Display options taking an argument that appears as a separate word
1369 following the original option, such as: @samp{-o output-file}.
1370 @end table
1372 Thus for example to display all the undocumented target-specific
1373 switches supported by the compiler, use:
1375 @smallexample
1376 --help=target,undocumented
1377 @end smallexample
1379 The sense of a qualifier can be inverted by prefixing it with the
1380 @samp{^} character, so for example to display all binary warning
1381 options (i.e., ones that are either on or off and that do not take an
1382 argument) that have a description, use:
1384 @smallexample
1385 --help=warnings,^joined,^undocumented
1386 @end smallexample
1388 The argument to @option{--help=} should not consist solely of inverted
1389 qualifiers.
1391 Combining several classes is possible, although this usually
1392 restricts the output so much that there is nothing to display.  One
1393 case where it does work, however, is when one of the classes is
1394 @var{target}.  For example, to display all the target-specific
1395 optimization options, use:
1397 @smallexample
1398 --help=target,optimizers
1399 @end smallexample
1401 The @option{--help=} option can be repeated on the command line.  Each
1402 successive use displays its requested class of options, skipping
1403 those that have already been displayed.
1405 If the @option{-Q} option appears on the command line before the
1406 @option{--help=} option, then the descriptive text displayed by
1407 @option{--help=} is changed.  Instead of describing the displayed
1408 options, an indication is given as to whether the option is enabled,
1409 disabled or set to a specific value (assuming that the compiler
1410 knows this at the point where the @option{--help=} option is used).
1412 Here is a truncated example from the ARM port of @command{gcc}:
1414 @smallexample
1415   % gcc -Q -mabi=2 --help=target -c
1416   The following options are target specific:
1417   -mabi=                                2
1418   -mabort-on-noreturn                   [disabled]
1419   -mapcs                                [disabled]
1420 @end smallexample
1422 The output is sensitive to the effects of previous command-line
1423 options, so for example it is possible to find out which optimizations
1424 are enabled at @option{-O2} by using:
1426 @smallexample
1427 -Q -O2 --help=optimizers
1428 @end smallexample
1430 Alternatively you can discover which binary optimizations are enabled
1431 by @option{-O3} by using:
1433 @smallexample
1434 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1435 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1436 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1437 @end smallexample
1439 @item -no-canonical-prefixes
1440 @opindex no-canonical-prefixes
1441 Do not expand any symbolic links, resolve references to @samp{/../}
1442 or @samp{/./}, or make the path absolute when generating a relative
1443 prefix.
1445 @item --version
1446 @opindex version
1447 Display the version number and copyrights of the invoked GCC@.
1449 @item -wrapper
1450 @opindex wrapper
1451 Invoke all subcommands under a wrapper program.  The name of the
1452 wrapper program and its parameters are passed as a comma separated
1453 list.
1455 @smallexample
1456 gcc -c t.c -wrapper gdb,--args
1457 @end smallexample
1459 @noindent
1460 This invokes all subprograms of @command{gcc} under
1461 @samp{gdb --args}, thus the invocation of @command{cc1} is
1462 @samp{gdb --args cc1 @dots{}}.
1464 @item -fplugin=@var{name}.so
1465 Load the plugin code in file @var{name}.so, assumed to be a
1466 shared object to be dlopen'd by the compiler.  The base name of
1467 the shared object file is used to identify the plugin for the
1468 purposes of argument parsing (See
1469 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1470 Each plugin should define the callback functions specified in the
1471 Plugins API.
1473 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1474 Define an argument called @var{key} with a value of @var{value}
1475 for the plugin called @var{name}.
1477 @item -fdump-ada-spec@r{[}-slim@r{]}
1478 For C and C++ source and include files, generate corresponding Ada
1479 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1480 GNAT User's Guide}, which provides detailed documentation on this feature.
1482 @item -fdump-go-spec=@var{file}
1483 For input files in any language, generate corresponding Go
1484 declarations in @var{file}.  This generates Go @code{const},
1485 @code{type}, @code{var}, and @code{func} declarations which may be a
1486 useful way to start writing a Go interface to code written in some
1487 other language.
1489 @include @value{srcdir}/../libiberty/at-file.texi
1490 @end table
1492 @node Invoking G++
1493 @section Compiling C++ Programs
1495 @cindex suffixes for C++ source
1496 @cindex C++ source file suffixes
1497 C++ source files conventionally use one of the suffixes @samp{.C},
1498 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1499 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1500 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1501 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1502 files with these names and compiles them as C++ programs even if you
1503 call the compiler the same way as for compiling C programs (usually
1504 with the name @command{gcc}).
1506 @findex g++
1507 @findex c++
1508 However, the use of @command{gcc} does not add the C++ library.
1509 @command{g++} is a program that calls GCC and automatically specifies linking
1510 against the C++ library.  It treats @samp{.c},
1511 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1512 files unless @option{-x} is used.  This program is also useful when
1513 precompiling a C header file with a @samp{.h} extension for use in C++
1514 compilations.  On many systems, @command{g++} is also installed with
1515 the name @command{c++}.
1517 @cindex invoking @command{g++}
1518 When you compile C++ programs, you may specify many of the same
1519 command-line options that you use for compiling programs in any
1520 language; or command-line options meaningful for C and related
1521 languages; or options that are meaningful only for C++ programs.
1522 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1523 explanations of options for languages related to C@.
1524 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1525 explanations of options that are meaningful only for C++ programs.
1527 @node C Dialect Options
1528 @section Options Controlling C Dialect
1529 @cindex dialect options
1530 @cindex language dialect options
1531 @cindex options, dialect
1533 The following options control the dialect of C (or languages derived
1534 from C, such as C++, Objective-C and Objective-C++) that the compiler
1535 accepts:
1537 @table @gcctabopt
1538 @cindex ANSI support
1539 @cindex ISO support
1540 @item -ansi
1541 @opindex ansi
1542 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1543 equivalent to @option{-std=c++98}.
1545 This turns off certain features of GCC that are incompatible with ISO
1546 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1547 such as the @code{asm} and @code{typeof} keywords, and
1548 predefined macros such as @code{unix} and @code{vax} that identify the
1549 type of system you are using.  It also enables the undesirable and
1550 rarely used ISO trigraph feature.  For the C compiler,
1551 it disables recognition of C++ style @samp{//} comments as well as
1552 the @code{inline} keyword.
1554 The alternate keywords @code{__asm__}, @code{__extension__},
1555 @code{__inline__} and @code{__typeof__} continue to work despite
1556 @option{-ansi}.  You would not want to use them in an ISO C program, of
1557 course, but it is useful to put them in header files that might be included
1558 in compilations done with @option{-ansi}.  Alternate predefined macros
1559 such as @code{__unix__} and @code{__vax__} are also available, with or
1560 without @option{-ansi}.
1562 The @option{-ansi} option does not cause non-ISO programs to be
1563 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1564 addition to @option{-ansi}.  @xref{Warning Options}.
1566 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1567 option is used.  Some header files may notice this macro and refrain
1568 from declaring certain functions or defining certain macros that the
1569 ISO standard doesn't call for; this is to avoid interfering with any
1570 programs that might use these names for other things.
1572 Functions that are normally built in but do not have semantics
1573 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1574 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1575 built-in functions provided by GCC}, for details of the functions
1576 affected.
1578 @item -std=
1579 @opindex std
1580 Determine the language standard. @xref{Standards,,Language Standards
1581 Supported by GCC}, for details of these standard versions.  This option
1582 is currently only supported when compiling C or C++.
1584 The compiler can accept several base standards, such as @samp{c90} or
1585 @samp{c++98}, and GNU dialects of those standards, such as
1586 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1587 compiler accepts all programs following that standard plus those
1588 using GNU extensions that do not contradict it.  For example,
1589 @option{-std=c90} turns off certain features of GCC that are
1590 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1591 keywords, but not other GNU extensions that do not have a meaning in
1592 ISO C90, such as omitting the middle term of a @code{?:}
1593 expression. On the other hand, when a GNU dialect of a standard is
1594 specified, all features supported by the compiler are enabled, even when
1595 those features change the meaning of the base standard.  As a result, some
1596 strict-conforming programs may be rejected.  The particular standard
1597 is used by @option{-Wpedantic} to identify which features are GNU
1598 extensions given that version of the standard. For example
1599 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1600 comments, while @option{-std=gnu99 -Wpedantic} does not.
1602 A value for this option must be provided; possible values are
1604 @table @samp
1605 @item c90
1606 @itemx c89
1607 @itemx iso9899:1990
1608 Support all ISO C90 programs (certain GNU extensions that conflict
1609 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1611 @item iso9899:199409
1612 ISO C90 as modified in amendment 1.
1614 @item c99
1615 @itemx c9x
1616 @itemx iso9899:1999
1617 @itemx iso9899:199x
1618 ISO C99.  Note that this standard is not yet fully supported; see
1619 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1620 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1622 @item c11
1623 @itemx c1x
1624 @itemx iso9899:2011
1625 ISO C11, the 2011 revision of the ISO C standard.
1626 Support is incomplete and experimental.  The name @samp{c1x} is
1627 deprecated.
1629 @item gnu90
1630 @itemx gnu89
1631 GNU dialect of ISO C90 (including some C99 features). This
1632 is the default for C code.
1634 @item gnu99
1635 @itemx gnu9x
1636 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1637 this will become the default.  The name @samp{gnu9x} is deprecated.
1639 @item gnu11
1640 @itemx gnu1x
1641 GNU dialect of ISO C11.  Support is incomplete and experimental.  The
1642 name @samp{gnu1x} is deprecated.
1644 @item c++98
1645 @itemx c++03
1646 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1647 additional defect reports. Same as @option{-ansi} for C++ code.
1649 @item gnu++98
1650 @itemx gnu++03
1651 GNU dialect of @option{-std=c++98}.  This is the default for
1652 C++ code.
1654 @item c++11
1655 @itemx c++0x
1656 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1657 experimental, and may change in incompatible ways in future releases.
1658 The name @samp{c++0x} is deprecated.
1660 @item gnu++11
1661 @itemx gnu++0x
1662 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1663 experimental, and may change in incompatible ways in future releases.
1664 The name @samp{gnu++0x} is deprecated.
1666 @item c++1y
1667 The next revision of the ISO C++ standard, tentatively planned for
1668 2014.  Support is highly experimental, and will almost certainly
1669 change in incompatible ways in future releases.
1671 @item gnu++1y
1672 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1673 and will almost certainly change in incompatible ways in future
1674 releases.
1675 @end table
1677 @item -fgnu89-inline
1678 @opindex fgnu89-inline
1679 The option @option{-fgnu89-inline} tells GCC to use the traditional
1680 GNU semantics for @code{inline} functions when in C99 mode.
1681 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1682 is accepted and ignored by GCC versions 4.1.3 up to but not including
1683 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1684 C99 mode.  Using this option is roughly equivalent to adding the
1685 @code{gnu_inline} function attribute to all inline functions
1686 (@pxref{Function Attributes}).
1688 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1689 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1690 specifies the default behavior).  This option was first supported in
1691 GCC 4.3.  This option is not supported in @option{-std=c90} or
1692 @option{-std=gnu90} mode.
1694 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1695 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1696 in effect for @code{inline} functions.  @xref{Common Predefined
1697 Macros,,,cpp,The C Preprocessor}.
1699 @item -aux-info @var{filename}
1700 @opindex aux-info
1701 Output to the given filename prototyped declarations for all functions
1702 declared and/or defined in a translation unit, including those in header
1703 files.  This option is silently ignored in any language other than C@.
1705 Besides declarations, the file indicates, in comments, the origin of
1706 each declaration (source file and line), whether the declaration was
1707 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1708 @samp{O} for old, respectively, in the first character after the line
1709 number and the colon), and whether it came from a declaration or a
1710 definition (@samp{C} or @samp{F}, respectively, in the following
1711 character).  In the case of function definitions, a K&R-style list of
1712 arguments followed by their declarations is also provided, inside
1713 comments, after the declaration.
1715 @item -fallow-parameterless-variadic-functions
1716 Accept variadic functions without named parameters.
1718 Although it is possible to define such a function, this is not very
1719 useful as it is not possible to read the arguments.  This is only
1720 supported for C as this construct is allowed by C++.
1722 @item -fno-asm
1723 @opindex fno-asm
1724 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1725 keyword, so that code can use these words as identifiers.  You can use
1726 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1727 instead.  @option{-ansi} implies @option{-fno-asm}.
1729 In C++, this switch only affects the @code{typeof} keyword, since
1730 @code{asm} and @code{inline} are standard keywords.  You may want to
1731 use the @option{-fno-gnu-keywords} flag instead, which has the same
1732 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1733 switch only affects the @code{asm} and @code{typeof} keywords, since
1734 @code{inline} is a standard keyword in ISO C99.
1736 @item -fno-builtin
1737 @itemx -fno-builtin-@var{function}
1738 @opindex fno-builtin
1739 @cindex built-in functions
1740 Don't recognize built-in functions that do not begin with
1741 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1742 functions provided by GCC}, for details of the functions affected,
1743 including those which are not built-in functions when @option{-ansi} or
1744 @option{-std} options for strict ISO C conformance are used because they
1745 do not have an ISO standard meaning.
1747 GCC normally generates special code to handle certain built-in functions
1748 more efficiently; for instance, calls to @code{alloca} may become single
1749 instructions which adjust the stack directly, and calls to @code{memcpy}
1750 may become inline copy loops.  The resulting code is often both smaller
1751 and faster, but since the function calls no longer appear as such, you
1752 cannot set a breakpoint on those calls, nor can you change the behavior
1753 of the functions by linking with a different library.  In addition,
1754 when a function is recognized as a built-in function, GCC may use
1755 information about that function to warn about problems with calls to
1756 that function, or to generate more efficient code, even if the
1757 resulting code still contains calls to that function.  For example,
1758 warnings are given with @option{-Wformat} for bad calls to
1759 @code{printf} when @code{printf} is built in and @code{strlen} is
1760 known not to modify global memory.
1762 With the @option{-fno-builtin-@var{function}} option
1763 only the built-in function @var{function} is
1764 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1765 function is named that is not built-in in this version of GCC, this
1766 option is ignored.  There is no corresponding
1767 @option{-fbuiltin-@var{function}} option; if you wish to enable
1768 built-in functions selectively when using @option{-fno-builtin} or
1769 @option{-ffreestanding}, you may define macros such as:
1771 @smallexample
1772 #define abs(n)          __builtin_abs ((n))
1773 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1774 @end smallexample
1776 @item -fhosted
1777 @opindex fhosted
1778 @cindex hosted environment
1780 Assert that compilation targets a hosted environment.  This implies
1781 @option{-fbuiltin}.  A hosted environment is one in which the
1782 entire standard library is available, and in which @code{main} has a return
1783 type of @code{int}.  Examples are nearly everything except a kernel.
1784 This is equivalent to @option{-fno-freestanding}.
1786 @item -ffreestanding
1787 @opindex ffreestanding
1788 @cindex hosted environment
1790 Assert that compilation targets a freestanding environment.  This
1791 implies @option{-fno-builtin}.  A freestanding environment
1792 is one in which the standard library may not exist, and program startup may
1793 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1794 This is equivalent to @option{-fno-hosted}.
1796 @xref{Standards,,Language Standards Supported by GCC}, for details of
1797 freestanding and hosted environments.
1799 @item -fopenmp
1800 @opindex fopenmp
1801 @cindex OpenMP parallel
1802 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1803 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1804 compiler generates parallel code according to the OpenMP Application
1805 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1806 implies @option{-pthread}, and thus is only supported on targets that
1807 have support for @option{-pthread}.
1809 @item -fcilkplus
1810 @opindex fcilkplus
1811 @cindex Enable Cilk Plus
1812 Enable the usage of Cilk Language extension features for C/C++.  When the flag
1813 @option{-fcilkplus} is specified, all the Cilk Plus components are converted 
1814 to the appropriate C/C++ code.  The present implementation follows ABI version 
1815 0.9.  There are four major parts to Cilk Plus language 
1816 extension: Array Notations, Cilk Keywords, SIMD annotations and elemental 
1817 functions.  Detailed information about Cilk Plus can be found at 
1818 @w{@uref{http://www.cilkplus.org}}. 
1820 @item -fgnu-tm
1821 @opindex fgnu-tm
1822 When the option @option{-fgnu-tm} is specified, the compiler
1823 generates code for the Linux variant of Intel's current Transactional
1824 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1825 an experimental feature whose interface may change in future versions
1826 of GCC, as the official specification changes.  Please note that not
1827 all architectures are supported for this feature.
1829 For more information on GCC's support for transactional memory,
1830 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1831 Transactional Memory Library}.
1833 Note that the transactional memory feature is not supported with
1834 non-call exceptions (@option{-fnon-call-exceptions}).
1836 @item -fms-extensions
1837 @opindex fms-extensions
1838 Accept some non-standard constructs used in Microsoft header files.
1840 In C++ code, this allows member names in structures to be similar
1841 to previous types declarations.
1843 @smallexample
1844 typedef int UOW;
1845 struct ABC @{
1846   UOW UOW;
1848 @end smallexample
1850 Some cases of unnamed fields in structures and unions are only
1851 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1852 fields within structs/unions}, for details.
1854 @item -fplan9-extensions
1855 Accept some non-standard constructs used in Plan 9 code.
1857 This enables @option{-fms-extensions}, permits passing pointers to
1858 structures with anonymous fields to functions that expect pointers to
1859 elements of the type of the field, and permits referring to anonymous
1860 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1861 struct/union fields within structs/unions}, for details.  This is only
1862 supported for C, not C++.
1864 @item -trigraphs
1865 @opindex trigraphs
1866 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1867 options for strict ISO C conformance) implies @option{-trigraphs}.
1869 @cindex traditional C language
1870 @cindex C language, traditional
1871 @item -traditional
1872 @itemx -traditional-cpp
1873 @opindex traditional-cpp
1874 @opindex traditional
1875 Formerly, these options caused GCC to attempt to emulate a pre-standard
1876 C compiler.  They are now only supported with the @option{-E} switch.
1877 The preprocessor continues to support a pre-standard mode.  See the GNU
1878 CPP manual for details.
1880 @item -fcond-mismatch
1881 @opindex fcond-mismatch
1882 Allow conditional expressions with mismatched types in the second and
1883 third arguments.  The value of such an expression is void.  This option
1884 is not supported for C++.
1886 @item -flax-vector-conversions
1887 @opindex flax-vector-conversions
1888 Allow implicit conversions between vectors with differing numbers of
1889 elements and/or incompatible element types.  This option should not be
1890 used for new code.
1892 @item -funsigned-char
1893 @opindex funsigned-char
1894 Let the type @code{char} be unsigned, like @code{unsigned char}.
1896 Each kind of machine has a default for what @code{char} should
1897 be.  It is either like @code{unsigned char} by default or like
1898 @code{signed char} by default.
1900 Ideally, a portable program should always use @code{signed char} or
1901 @code{unsigned char} when it depends on the signedness of an object.
1902 But many programs have been written to use plain @code{char} and
1903 expect it to be signed, or expect it to be unsigned, depending on the
1904 machines they were written for.  This option, and its inverse, let you
1905 make such a program work with the opposite default.
1907 The type @code{char} is always a distinct type from each of
1908 @code{signed char} or @code{unsigned char}, even though its behavior
1909 is always just like one of those two.
1911 @item -fsigned-char
1912 @opindex fsigned-char
1913 Let the type @code{char} be signed, like @code{signed char}.
1915 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1916 the negative form of @option{-funsigned-char}.  Likewise, the option
1917 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1919 @item -fsigned-bitfields
1920 @itemx -funsigned-bitfields
1921 @itemx -fno-signed-bitfields
1922 @itemx -fno-unsigned-bitfields
1923 @opindex fsigned-bitfields
1924 @opindex funsigned-bitfields
1925 @opindex fno-signed-bitfields
1926 @opindex fno-unsigned-bitfields
1927 These options control whether a bit-field is signed or unsigned, when the
1928 declaration does not use either @code{signed} or @code{unsigned}.  By
1929 default, such a bit-field is signed, because this is consistent: the
1930 basic integer types such as @code{int} are signed types.
1931 @end table
1933 @node C++ Dialect Options
1934 @section Options Controlling C++ Dialect
1936 @cindex compiler options, C++
1937 @cindex C++ options, command-line
1938 @cindex options, C++
1939 This section describes the command-line options that are only meaningful
1940 for C++ programs.  You can also use most of the GNU compiler options
1941 regardless of what language your program is in.  For example, you
1942 might compile a file @code{firstClass.C} like this:
1944 @smallexample
1945 g++ -g -frepo -O -c firstClass.C
1946 @end smallexample
1948 @noindent
1949 In this example, only @option{-frepo} is an option meant
1950 only for C++ programs; you can use the other options with any
1951 language supported by GCC@.
1953 Here is a list of options that are @emph{only} for compiling C++ programs:
1955 @table @gcctabopt
1957 @item -fabi-version=@var{n}
1958 @opindex fabi-version
1959 Use version @var{n} of the C++ ABI@.  The default is version 2.
1961 Version 0 refers to the version conforming most closely to
1962 the C++ ABI specification.  Therefore, the ABI obtained using version 0
1963 will change in different versions of G++ as ABI bugs are fixed.
1965 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
1967 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.  
1969 Version 3 corrects an error in mangling a constant address as a
1970 template argument.
1972 Version 4, which first appeared in G++ 4.5, implements a standard
1973 mangling for vector types.
1975 Version 5, which first appeared in G++ 4.6, corrects the mangling of
1976 attribute const/volatile on function pointer types, decltype of a
1977 plain decl, and use of a function parameter in the declaration of
1978 another parameter.
1980 Version 6, which first appeared in G++ 4.7, corrects the promotion
1981 behavior of C++11 scoped enums and the mangling of template argument
1982 packs, const/static_cast, prefix ++ and --, and a class scope function
1983 used as a template argument.
1985 See also @option{-Wabi}.
1987 @item -fno-access-control
1988 @opindex fno-access-control
1989 Turn off all access checking.  This switch is mainly useful for working
1990 around bugs in the access control code.
1992 @item -fcheck-new
1993 @opindex fcheck-new
1994 Check that the pointer returned by @code{operator new} is non-null
1995 before attempting to modify the storage allocated.  This check is
1996 normally unnecessary because the C++ standard specifies that
1997 @code{operator new} only returns @code{0} if it is declared
1998 @samp{throw()}, in which case the compiler always checks the
1999 return value even without this option.  In all other cases, when
2000 @code{operator new} has a non-empty exception specification, memory
2001 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2002 @samp{new (nothrow)}.
2004 @item -fconstexpr-depth=@var{n}
2005 @opindex fconstexpr-depth
2006 Set the maximum nested evaluation depth for C++11 constexpr functions
2007 to @var{n}.  A limit is needed to detect endless recursion during
2008 constant expression evaluation.  The minimum specified by the standard
2009 is 512.
2011 @item -fdeduce-init-list
2012 @opindex fdeduce-init-list
2013 Enable deduction of a template type parameter as
2014 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2016 @smallexample
2017 template <class T> auto forward(T t) -> decltype (realfn (t))
2019   return realfn (t);
2022 void f()
2024   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2026 @end smallexample
2028 This deduction was implemented as a possible extension to the
2029 originally proposed semantics for the C++11 standard, but was not part
2030 of the final standard, so it is disabled by default.  This option is
2031 deprecated, and may be removed in a future version of G++.
2033 @item -ffriend-injection
2034 @opindex ffriend-injection
2035 Inject friend functions into the enclosing namespace, so that they are
2036 visible outside the scope of the class in which they are declared.
2037 Friend functions were documented to work this way in the old Annotated
2038 C++ Reference Manual, and versions of G++ before 4.1 always worked
2039 that way.  However, in ISO C++ a friend function that is not declared
2040 in an enclosing scope can only be found using argument dependent
2041 lookup.  This option causes friends to be injected as they were in
2042 earlier releases.
2044 This option is for compatibility, and may be removed in a future
2045 release of G++.
2047 @item -fno-elide-constructors
2048 @opindex fno-elide-constructors
2049 The C++ standard allows an implementation to omit creating a temporary
2050 that is only used to initialize another object of the same type.
2051 Specifying this option disables that optimization, and forces G++ to
2052 call the copy constructor in all cases.
2054 @item -fno-enforce-eh-specs
2055 @opindex fno-enforce-eh-specs
2056 Don't generate code to check for violation of exception specifications
2057 at run time.  This option violates the C++ standard, but may be useful
2058 for reducing code size in production builds, much like defining
2059 @samp{NDEBUG}.  This does not give user code permission to throw
2060 exceptions in violation of the exception specifications; the compiler
2061 still optimizes based on the specifications, so throwing an
2062 unexpected exception results in undefined behavior at run time.
2064 @item -fextern-tls-init
2065 @itemx -fno-extern-tls-init
2066 @opindex fextern-tls-init
2067 @opindex fno-extern-tls-init
2068 The C++11 and OpenMP standards allow @samp{thread_local} and
2069 @samp{threadprivate} variables to have dynamic (runtime)
2070 initialization.  To support this, any use of such a variable goes
2071 through a wrapper function that performs any necessary initialization.
2072 When the use and definition of the variable are in the same
2073 translation unit, this overhead can be optimized away, but when the
2074 use is in a different translation unit there is significant overhead
2075 even if the variable doesn't actually need dynamic initialization.  If
2076 the programmer can be sure that no use of the variable in a
2077 non-defining TU needs to trigger dynamic initialization (either
2078 because the variable is statically initialized, or a use of the
2079 variable in the defining TU will be executed before any uses in
2080 another TU), they can avoid this overhead with the
2081 @option{-fno-extern-tls-init} option.
2083 On targets that support symbol aliases, the default is
2084 @option{-fextern-tls-init}.  On targets that do not support symbol
2085 aliases, the default is @option{-fno-extern-tls-init}.
2087 @item -ffor-scope
2088 @itemx -fno-for-scope
2089 @opindex ffor-scope
2090 @opindex fno-for-scope
2091 If @option{-ffor-scope} is specified, the scope of variables declared in
2092 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2093 as specified by the C++ standard.
2094 If @option{-fno-for-scope} is specified, the scope of variables declared in
2095 a @i{for-init-statement} extends to the end of the enclosing scope,
2096 as was the case in old versions of G++, and other (traditional)
2097 implementations of C++.
2099 If neither flag is given, the default is to follow the standard,
2100 but to allow and give a warning for old-style code that would
2101 otherwise be invalid, or have different behavior.
2103 @item -fno-gnu-keywords
2104 @opindex fno-gnu-keywords
2105 Do not recognize @code{typeof} as a keyword, so that code can use this
2106 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2107 @option{-ansi} implies @option{-fno-gnu-keywords}.
2109 @item -fno-implicit-templates
2110 @opindex fno-implicit-templates
2111 Never emit code for non-inline templates that are instantiated
2112 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2113 @xref{Template Instantiation}, for more information.
2115 @item -fno-implicit-inline-templates
2116 @opindex fno-implicit-inline-templates
2117 Don't emit code for implicit instantiations of inline templates, either.
2118 The default is to handle inlines differently so that compiles with and
2119 without optimization need the same set of explicit instantiations.
2121 @item -fno-implement-inlines
2122 @opindex fno-implement-inlines
2123 To save space, do not emit out-of-line copies of inline functions
2124 controlled by @samp{#pragma implementation}.  This causes linker
2125 errors if these functions are not inlined everywhere they are called.
2127 @item -fms-extensions
2128 @opindex fms-extensions
2129 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2130 int and getting a pointer to member function via non-standard syntax.
2132 @item -fno-nonansi-builtins
2133 @opindex fno-nonansi-builtins
2134 Disable built-in declarations of functions that are not mandated by
2135 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2136 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2138 @item -fnothrow-opt
2139 @opindex fnothrow-opt
2140 Treat a @code{throw()} exception specification as if it were a
2141 @code{noexcept} specification to reduce or eliminate the text size
2142 overhead relative to a function with no exception specification.  If
2143 the function has local variables of types with non-trivial
2144 destructors, the exception specification actually makes the
2145 function smaller because the EH cleanups for those variables can be
2146 optimized away.  The semantic effect is that an exception thrown out of
2147 a function with such an exception specification results in a call
2148 to @code{terminate} rather than @code{unexpected}.
2150 @item -fno-operator-names
2151 @opindex fno-operator-names
2152 Do not treat the operator name keywords @code{and}, @code{bitand},
2153 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2154 synonyms as keywords.
2156 @item -fno-optional-diags
2157 @opindex fno-optional-diags
2158 Disable diagnostics that the standard says a compiler does not need to
2159 issue.  Currently, the only such diagnostic issued by G++ is the one for
2160 a name having multiple meanings within a class.
2162 @item -fpermissive
2163 @opindex fpermissive
2164 Downgrade some diagnostics about nonconformant code from errors to
2165 warnings.  Thus, using @option{-fpermissive} allows some
2166 nonconforming code to compile.
2168 @item -fno-pretty-templates
2169 @opindex fno-pretty-templates
2170 When an error message refers to a specialization of a function
2171 template, the compiler normally prints the signature of the
2172 template followed by the template arguments and any typedefs or
2173 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2174 rather than @code{void f(int)}) so that it's clear which template is
2175 involved.  When an error message refers to a specialization of a class
2176 template, the compiler omits any template arguments that match
2177 the default template arguments for that template.  If either of these
2178 behaviors make it harder to understand the error message rather than
2179 easier, you can use @option{-fno-pretty-templates} to disable them.
2181 @item -frepo
2182 @opindex frepo
2183 Enable automatic template instantiation at link time.  This option also
2184 implies @option{-fno-implicit-templates}.  @xref{Template
2185 Instantiation}, for more information.
2187 @item -fno-rtti
2188 @opindex fno-rtti
2189 Disable generation of information about every class with virtual
2190 functions for use by the C++ run-time type identification features
2191 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2192 of the language, you can save some space by using this flag.  Note that
2193 exception handling uses the same information, but G++ generates it as
2194 needed. The @samp{dynamic_cast} operator can still be used for casts that
2195 do not require run-time type information, i.e.@: casts to @code{void *} or to
2196 unambiguous base classes.
2198 @item -fstats
2199 @opindex fstats
2200 Emit statistics about front-end processing at the end of the compilation.
2201 This information is generally only useful to the G++ development team.
2203 @item -fstrict-enums
2204 @opindex fstrict-enums
2205 Allow the compiler to optimize using the assumption that a value of
2206 enumerated type can only be one of the values of the enumeration (as
2207 defined in the C++ standard; basically, a value that can be
2208 represented in the minimum number of bits needed to represent all the
2209 enumerators).  This assumption may not be valid if the program uses a
2210 cast to convert an arbitrary integer value to the enumerated type.
2212 @item -ftemplate-backtrace-limit=@var{n}
2213 @opindex ftemplate-backtrace-limit
2214 Set the maximum number of template instantiation notes for a single
2215 warning or error to @var{n}.  The default value is 10.
2217 @item -ftemplate-depth=@var{n}
2218 @opindex ftemplate-depth
2219 Set the maximum instantiation depth for template classes to @var{n}.
2220 A limit on the template instantiation depth is needed to detect
2221 endless recursions during template class instantiation.  ANSI/ISO C++
2222 conforming programs must not rely on a maximum depth greater than 17
2223 (changed to 1024 in C++11).  The default value is 900, as the compiler
2224 can run out of stack space before hitting 1024 in some situations.
2226 @item -fno-threadsafe-statics
2227 @opindex fno-threadsafe-statics
2228 Do not emit the extra code to use the routines specified in the C++
2229 ABI for thread-safe initialization of local statics.  You can use this
2230 option to reduce code size slightly in code that doesn't need to be
2231 thread-safe.
2233 @item -fuse-cxa-atexit
2234 @opindex fuse-cxa-atexit
2235 Register destructors for objects with static storage duration with the
2236 @code{__cxa_atexit} function rather than the @code{atexit} function.
2237 This option is required for fully standards-compliant handling of static
2238 destructors, but only works if your C library supports
2239 @code{__cxa_atexit}.
2241 @item -fno-use-cxa-get-exception-ptr
2242 @opindex fno-use-cxa-get-exception-ptr
2243 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2244 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2245 if the runtime routine is not available.
2247 @item -fvisibility-inlines-hidden
2248 @opindex fvisibility-inlines-hidden
2249 This switch declares that the user does not attempt to compare
2250 pointers to inline functions or methods where the addresses of the two functions
2251 are taken in different shared objects.
2253 The effect of this is that GCC may, effectively, mark inline methods with
2254 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2255 appear in the export table of a DSO and do not require a PLT indirection
2256 when used within the DSO@.  Enabling this option can have a dramatic effect
2257 on load and link times of a DSO as it massively reduces the size of the
2258 dynamic export table when the library makes heavy use of templates.
2260 The behavior of this switch is not quite the same as marking the
2261 methods as hidden directly, because it does not affect static variables
2262 local to the function or cause the compiler to deduce that
2263 the function is defined in only one shared object.
2265 You may mark a method as having a visibility explicitly to negate the
2266 effect of the switch for that method.  For example, if you do want to
2267 compare pointers to a particular inline method, you might mark it as
2268 having default visibility.  Marking the enclosing class with explicit
2269 visibility has no effect.
2271 Explicitly instantiated inline methods are unaffected by this option
2272 as their linkage might otherwise cross a shared library boundary.
2273 @xref{Template Instantiation}.
2275 @item -fvisibility-ms-compat
2276 @opindex fvisibility-ms-compat
2277 This flag attempts to use visibility settings to make GCC's C++
2278 linkage model compatible with that of Microsoft Visual Studio.
2280 The flag makes these changes to GCC's linkage model:
2282 @enumerate
2283 @item
2284 It sets the default visibility to @code{hidden}, like
2285 @option{-fvisibility=hidden}.
2287 @item
2288 Types, but not their members, are not hidden by default.
2290 @item
2291 The One Definition Rule is relaxed for types without explicit
2292 visibility specifications that are defined in more than one
2293 shared object: those declarations are permitted if they are
2294 permitted when this option is not used.
2295 @end enumerate
2297 In new code it is better to use @option{-fvisibility=hidden} and
2298 export those classes that are intended to be externally visible.
2299 Unfortunately it is possible for code to rely, perhaps accidentally,
2300 on the Visual Studio behavior.
2302 Among the consequences of these changes are that static data members
2303 of the same type with the same name but defined in different shared
2304 objects are different, so changing one does not change the other;
2305 and that pointers to function members defined in different shared
2306 objects may not compare equal.  When this flag is given, it is a
2307 violation of the ODR to define types with the same name differently.
2309 @item -fvtable-verify=@var{std|preinit|none}
2310 @opindex fvtable-verify
2311 Turn on (or off, if using @option{-fvtable-verify=none}) the security
2312 feature that verifies at runtime, for every virtual call that is made, that
2313 the vtable pointer through which the call is made is valid for the type of
2314 the object, and has not been corrupted or overwritten.  If an invalid vtable
2315 pointer is detected (at runtime), an error is reported and execution of the
2316 program is immediately halted.
2318 This option causes runtime data structures to be built, at program start up,
2319 for verifying the vtable pointers.  The options @code{std} and @code{preinit}
2320 control the timing of when these data structures are built.  In both cases the
2321 data structures are built before execution reaches 'main'.  The
2322 @option{-fvtable-verify=std} causes these data structure to be built after the
2323 shared libraries have been loaded and initialized.
2324 @option{-fvtable-verify=preinit} causes them to be built before the shared
2325 libraries have been loaded and initialized.
2327 If this option appears multiple times in the compiler line, with different
2328 values specified, 'none' will take highest priority over both 'std' and
2329 'preinit'; 'preinit' will take priority over 'std'.
2331 @item -fvtv-debug
2332 @opindex (fvtv-debug)
2333 Causes debug versions of the runtime functions for the vtable verification 
2334 feature to be called.  This assumes the @option{-fvtable-verify=std} or
2335 @option{-fvtable-verify=preinit} has been used.  This flag will also cause the
2336 compiler to keep track of which vtable pointers it found for each class, and
2337 record that information in the file ``vtv_set_ptr_data.log'', in the dump
2338 file directory on the user's machine.
2340 Note:  This feature APPENDS data to the log file. If you want a fresh log
2341 file, be sure to delete any existing one.
2343 @item -fvtv-counts
2344 @opindex (fvtv-counts)
2345 This is a debugging flag.  When used in conjunction with
2346 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
2347 causes the compiler to keep track of the total number of virtual calls
2348 it encountered and the number of verifications it inserted.  It also
2349 counts the number of calls to certain runtime library functions
2350 that it inserts.  This information, for each compilation unit, is written
2351 to a file named ``vtv_count_data.log'', in the dump_file directory on
2352 the user's machine.   It also counts the size of the vtable pointer sets
2353 for each class, and writes this information to ``vtv_class_set_sizes.log''
2354 in the same directory.
2356 Note:  This feature APPENDS data to the log files.  To get a fresh log
2357 files, be sure to delete any existing ones.
2359 @item -fno-weak
2360 @opindex fno-weak
2361 Do not use weak symbol support, even if it is provided by the linker.
2362 By default, G++ uses weak symbols if they are available.  This
2363 option exists only for testing, and should not be used by end-users;
2364 it results in inferior code and has no benefits.  This option may
2365 be removed in a future release of G++.
2367 @item -nostdinc++
2368 @opindex nostdinc++
2369 Do not search for header files in the standard directories specific to
2370 C++, but do still search the other standard directories.  (This option
2371 is used when building the C++ library.)
2372 @end table
2374 In addition, these optimization, warning, and code generation options
2375 have meanings only for C++ programs:
2377 @table @gcctabopt
2378 @item -fno-default-inline
2379 @opindex fno-default-inline
2380 Do not assume @samp{inline} for functions defined inside a class scope.
2381 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2382 functions have linkage like inline functions; they just aren't
2383 inlined by default.
2385 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2386 @opindex Wabi
2387 @opindex Wno-abi
2388 Warn when G++ generates code that is probably not compatible with the
2389 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2390 all such cases, there are probably some cases that are not warned about,
2391 even though G++ is generating incompatible code.  There may also be
2392 cases where warnings are emitted even though the code that is generated
2393 is compatible.
2395 You should rewrite your code to avoid these warnings if you are
2396 concerned about the fact that code generated by G++ may not be binary
2397 compatible with code generated by other compilers.
2399 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2401 @itemize @bullet
2403 @item
2404 A template with a non-type template parameter of reference type is
2405 mangled incorrectly:
2406 @smallexample
2407 extern int N;
2408 template <int &> struct S @{@};
2409 void n (S<N>) @{2@}
2410 @end smallexample
2412 This is fixed in @option{-fabi-version=3}.
2414 @item
2415 SIMD vector types declared using @code{__attribute ((vector_size))} are
2416 mangled in a non-standard way that does not allow for overloading of
2417 functions taking vectors of different sizes.
2419 The mangling is changed in @option{-fabi-version=4}.
2420 @end itemize
2422 The known incompatibilities in @option{-fabi-version=1} include:
2424 @itemize @bullet
2426 @item
2427 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2428 pack data into the same byte as a base class.  For example:
2430 @smallexample
2431 struct A @{ virtual void f(); int f1 : 1; @};
2432 struct B : public A @{ int f2 : 1; @};
2433 @end smallexample
2435 @noindent
2436 In this case, G++ places @code{B::f2} into the same byte
2437 as @code{A::f1}; other compilers do not.  You can avoid this problem
2438 by explicitly padding @code{A} so that its size is a multiple of the
2439 byte size on your platform; that causes G++ and other compilers to
2440 lay out @code{B} identically.
2442 @item
2443 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2444 tail padding when laying out virtual bases.  For example:
2446 @smallexample
2447 struct A @{ virtual void f(); char c1; @};
2448 struct B @{ B(); char c2; @};
2449 struct C : public A, public virtual B @{@};
2450 @end smallexample
2452 @noindent
2453 In this case, G++ does not place @code{B} into the tail-padding for
2454 @code{A}; other compilers do.  You can avoid this problem by
2455 explicitly padding @code{A} so that its size is a multiple of its
2456 alignment (ignoring virtual base classes); that causes G++ and other
2457 compilers to lay out @code{C} identically.
2459 @item
2460 Incorrect handling of bit-fields with declared widths greater than that
2461 of their underlying types, when the bit-fields appear in a union.  For
2462 example:
2464 @smallexample
2465 union U @{ int i : 4096; @};
2466 @end smallexample
2468 @noindent
2469 Assuming that an @code{int} does not have 4096 bits, G++ makes the
2470 union too small by the number of bits in an @code{int}.
2472 @item
2473 Empty classes can be placed at incorrect offsets.  For example:
2475 @smallexample
2476 struct A @{@};
2478 struct B @{
2479   A a;
2480   virtual void f ();
2483 struct C : public B, public A @{@};
2484 @end smallexample
2486 @noindent
2487 G++ places the @code{A} base class of @code{C} at a nonzero offset;
2488 it should be placed at offset zero.  G++ mistakenly believes that the
2489 @code{A} data member of @code{B} is already at offset zero.
2491 @item
2492 Names of template functions whose types involve @code{typename} or
2493 template template parameters can be mangled incorrectly.
2495 @smallexample
2496 template <typename Q>
2497 void f(typename Q::X) @{@}
2499 template <template <typename> class Q>
2500 void f(typename Q<int>::X) @{@}
2501 @end smallexample
2503 @noindent
2504 Instantiations of these templates may be mangled incorrectly.
2506 @end itemize
2508 It also warns about psABI-related changes.  The known psABI changes at this
2509 point include:
2511 @itemize @bullet
2513 @item
2514 For SysV/x86-64, unions with @code{long double} members are 
2515 passed in memory as specified in psABI.  For example:
2517 @smallexample
2518 union U @{
2519   long double ld;
2520   int i;
2522 @end smallexample
2524 @noindent
2525 @code{union U} is always passed in memory.
2527 @end itemize
2529 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2530 @opindex Wctor-dtor-privacy
2531 @opindex Wno-ctor-dtor-privacy
2532 Warn when a class seems unusable because all the constructors or
2533 destructors in that class are private, and it has neither friends nor
2534 public static member functions.  Also warn if there are no non-private
2535 methods, and there's at least one private member function that isn't
2536 a constructor or destructor.
2538 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2539 @opindex Wdelete-non-virtual-dtor
2540 @opindex Wno-delete-non-virtual-dtor
2541 Warn when @samp{delete} is used to destroy an instance of a class that
2542 has virtual functions and non-virtual destructor. It is unsafe to delete
2543 an instance of a derived class through a pointer to a base class if the
2544 base class does not have a virtual destructor.  This warning is enabled
2545 by @option{-Wall}.
2547 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2548 @opindex Wliteral-suffix
2549 @opindex Wno-literal-suffix
2550 Warn when a string or character literal is followed by a ud-suffix which does
2551 not begin with an underscore.  As a conforming extension, GCC treats such
2552 suffixes as separate preprocessing tokens in order to maintain backwards
2553 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2554 For example:
2556 @smallexample
2557 #define __STDC_FORMAT_MACROS
2558 #include <inttypes.h>
2559 #include <stdio.h>
2561 int main() @{
2562   int64_t i64 = 123;
2563   printf("My int64: %"PRId64"\n", i64);
2565 @end smallexample
2567 In this case, @code{PRId64} is treated as a separate preprocessing token.
2569 This warning is enabled by default.
2571 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2572 @opindex Wnarrowing
2573 @opindex Wno-narrowing
2574 Warn when a narrowing conversion prohibited by C++11 occurs within
2575 @samp{@{ @}}, e.g.
2577 @smallexample
2578 int i = @{ 2.2 @}; // error: narrowing from double to int
2579 @end smallexample
2581 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2583 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2584 required by the standard.  Note that this does not affect the meaning
2585 of well-formed code; narrowing conversions are still considered
2586 ill-formed in SFINAE context.
2588 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2589 @opindex Wnoexcept
2590 @opindex Wno-noexcept
2591 Warn when a noexcept-expression evaluates to false because of a call
2592 to a function that does not have a non-throwing exception
2593 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2594 the compiler to never throw an exception.
2596 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2597 @opindex Wnon-virtual-dtor
2598 @opindex Wno-non-virtual-dtor
2599 Warn when a class has virtual functions and an accessible non-virtual
2600 destructor, in which case it is possible but unsafe to delete
2601 an instance of a derived class through a pointer to the base class.
2602 This warning is also enabled if @option{-Weffc++} is specified.
2604 @item -Wreorder @r{(C++ and Objective-C++ only)}
2605 @opindex Wreorder
2606 @opindex Wno-reorder
2607 @cindex reordering, warning
2608 @cindex warning for reordering of member initializers
2609 Warn when the order of member initializers given in the code does not
2610 match the order in which they must be executed.  For instance:
2612 @smallexample
2613 struct A @{
2614   int i;
2615   int j;
2616   A(): j (0), i (1) @{ @}
2618 @end smallexample
2620 @noindent
2621 The compiler rearranges the member initializers for @samp{i}
2622 and @samp{j} to match the declaration order of the members, emitting
2623 a warning to that effect.  This warning is enabled by @option{-Wall}.
2625 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2626 @opindex fext-numeric-literals
2627 @opindex fno-ext-numeric-literals
2628 Accept imaginary, fixed-point, or machine-defined
2629 literal number suffixes as GNU extensions.
2630 When this option is turned off these suffixes are treated
2631 as C++11 user-defined literal numeric suffixes.
2632 This is on by default for all pre-C++11 dialects and all GNU dialects:
2633 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2634 @option{-std=gnu++1y}.
2635 This option is off by default
2636 for ISO C++11 onwards (@option{-std=c++11}, ...).
2637 @end table
2639 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2641 @table @gcctabopt
2642 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2643 @opindex Weffc++
2644 @opindex Wno-effc++
2645 Warn about violations of the following style guidelines from Scott Meyers'
2646 @cite{Effective C++, Second Edition} book:
2648 @itemize @bullet
2649 @item
2650 Item 11:  Define a copy constructor and an assignment operator for classes
2651 with dynamically-allocated memory.
2653 @item
2654 Item 12:  Prefer initialization to assignment in constructors.
2656 @item
2657 Item 14:  Make destructors virtual in base classes.
2659 @item
2660 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2662 @item
2663 Item 23:  Don't try to return a reference when you must return an object.
2665 @end itemize
2667 Also warn about violations of the following style guidelines from
2668 Scott Meyers' @cite{More Effective C++} book:
2670 @itemize @bullet
2671 @item
2672 Item 6:  Distinguish between prefix and postfix forms of increment and
2673 decrement operators.
2675 @item
2676 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2678 @end itemize
2680 When selecting this option, be aware that the standard library
2681 headers do not obey all of these guidelines; use @samp{grep -v}
2682 to filter out those warnings.
2684 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2685 @opindex Wstrict-null-sentinel
2686 @opindex Wno-strict-null-sentinel
2687 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2688 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2689 to @code{__null}.  Although it is a null pointer constant rather than a
2690 null pointer, it is guaranteed to be of the same size as a pointer.
2691 But this use is not portable across different compilers.
2693 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2694 @opindex Wno-non-template-friend
2695 @opindex Wnon-template-friend
2696 Disable warnings when non-templatized friend functions are declared
2697 within a template.  Since the advent of explicit template specification
2698 support in G++, if the name of the friend is an unqualified-id (i.e.,
2699 @samp{friend foo(int)}), the C++ language specification demands that the
2700 friend declare or define an ordinary, nontemplate function.  (Section
2701 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2702 could be interpreted as a particular specialization of a templatized
2703 function.  Because this non-conforming behavior is no longer the default
2704 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2705 check existing code for potential trouble spots and is on by default.
2706 This new compiler behavior can be turned off with
2707 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2708 but disables the helpful warning.
2710 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2711 @opindex Wold-style-cast
2712 @opindex Wno-old-style-cast
2713 Warn if an old-style (C-style) cast to a non-void type is used within
2714 a C++ program.  The new-style casts (@samp{dynamic_cast},
2715 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2716 less vulnerable to unintended effects and much easier to search for.
2718 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2719 @opindex Woverloaded-virtual
2720 @opindex Wno-overloaded-virtual
2721 @cindex overloaded virtual function, warning
2722 @cindex warning for overloaded virtual function
2723 Warn when a function declaration hides virtual functions from a
2724 base class.  For example, in:
2726 @smallexample
2727 struct A @{
2728   virtual void f();
2731 struct B: public A @{
2732   void f(int);
2734 @end smallexample
2736 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2737 like:
2739 @smallexample
2740 B* b;
2741 b->f();
2742 @end smallexample
2744 @noindent
2745 fails to compile.
2747 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2748 @opindex Wno-pmf-conversions
2749 @opindex Wpmf-conversions
2750 Disable the diagnostic for converting a bound pointer to member function
2751 to a plain pointer.
2753 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2754 @opindex Wsign-promo
2755 @opindex Wno-sign-promo
2756 Warn when overload resolution chooses a promotion from unsigned or
2757 enumerated type to a signed type, over a conversion to an unsigned type of
2758 the same size.  Previous versions of G++ tried to preserve
2759 unsignedness, but the standard mandates the current behavior.
2760 @end table
2762 @node Objective-C and Objective-C++ Dialect Options
2763 @section Options Controlling Objective-C and Objective-C++ Dialects
2765 @cindex compiler options, Objective-C and Objective-C++
2766 @cindex Objective-C and Objective-C++ options, command-line
2767 @cindex options, Objective-C and Objective-C++
2768 (NOTE: This manual does not describe the Objective-C and Objective-C++
2769 languages themselves.  @xref{Standards,,Language Standards
2770 Supported by GCC}, for references.)
2772 This section describes the command-line options that are only meaningful
2773 for Objective-C and Objective-C++ programs.  You can also use most of
2774 the language-independent GNU compiler options.
2775 For example, you might compile a file @code{some_class.m} like this:
2777 @smallexample
2778 gcc -g -fgnu-runtime -O -c some_class.m
2779 @end smallexample
2781 @noindent
2782 In this example, @option{-fgnu-runtime} is an option meant only for
2783 Objective-C and Objective-C++ programs; you can use the other options with
2784 any language supported by GCC@.
2786 Note that since Objective-C is an extension of the C language, Objective-C
2787 compilations may also use options specific to the C front-end (e.g.,
2788 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2789 C++-specific options (e.g., @option{-Wabi}).
2791 Here is a list of options that are @emph{only} for compiling Objective-C
2792 and Objective-C++ programs:
2794 @table @gcctabopt
2795 @item -fconstant-string-class=@var{class-name}
2796 @opindex fconstant-string-class
2797 Use @var{class-name} as the name of the class to instantiate for each
2798 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2799 class name is @code{NXConstantString} if the GNU runtime is being used, and
2800 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2801 @option{-fconstant-cfstrings} option, if also present, overrides the
2802 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2803 to be laid out as constant CoreFoundation strings.
2805 @item -fgnu-runtime
2806 @opindex fgnu-runtime
2807 Generate object code compatible with the standard GNU Objective-C
2808 runtime.  This is the default for most types of systems.
2810 @item -fnext-runtime
2811 @opindex fnext-runtime
2812 Generate output compatible with the NeXT runtime.  This is the default
2813 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2814 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2815 used.
2817 @item -fno-nil-receivers
2818 @opindex fno-nil-receivers
2819 Assume that all Objective-C message dispatches (@code{[receiver
2820 message:arg]}) in this translation unit ensure that the receiver is
2821 not @code{nil}.  This allows for more efficient entry points in the
2822 runtime to be used.  This option is only available in conjunction with
2823 the NeXT runtime and ABI version 0 or 1.
2825 @item -fobjc-abi-version=@var{n}
2826 @opindex fobjc-abi-version
2827 Use version @var{n} of the Objective-C ABI for the selected runtime.
2828 This option is currently supported only for the NeXT runtime.  In that
2829 case, Version 0 is the traditional (32-bit) ABI without support for
2830 properties and other Objective-C 2.0 additions.  Version 1 is the
2831 traditional (32-bit) ABI with support for properties and other
2832 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2833 nothing is specified, the default is Version 0 on 32-bit target
2834 machines, and Version 2 on 64-bit target machines.
2836 @item -fobjc-call-cxx-cdtors
2837 @opindex fobjc-call-cxx-cdtors
2838 For each Objective-C class, check if any of its instance variables is a
2839 C++ object with a non-trivial default constructor.  If so, synthesize a
2840 special @code{- (id) .cxx_construct} instance method which runs
2841 non-trivial default constructors on any such instance variables, in order,
2842 and then return @code{self}.  Similarly, check if any instance variable
2843 is a C++ object with a non-trivial destructor, and if so, synthesize a
2844 special @code{- (void) .cxx_destruct} method which runs
2845 all such default destructors, in reverse order.
2847 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2848 methods thusly generated only operate on instance variables
2849 declared in the current Objective-C class, and not those inherited
2850 from superclasses.  It is the responsibility of the Objective-C
2851 runtime to invoke all such methods in an object's inheritance
2852 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2853 by the runtime immediately after a new object instance is allocated;
2854 the @code{- (void) .cxx_destruct} methods are invoked immediately
2855 before the runtime deallocates an object instance.
2857 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2858 support for invoking the @code{- (id) .cxx_construct} and
2859 @code{- (void) .cxx_destruct} methods.
2861 @item -fobjc-direct-dispatch
2862 @opindex fobjc-direct-dispatch
2863 Allow fast jumps to the message dispatcher.  On Darwin this is
2864 accomplished via the comm page.
2866 @item -fobjc-exceptions
2867 @opindex fobjc-exceptions
2868 Enable syntactic support for structured exception handling in
2869 Objective-C, similar to what is offered by C++ and Java.  This option
2870 is required to use the Objective-C keywords @code{@@try},
2871 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2872 @code{@@synchronized}.  This option is available with both the GNU
2873 runtime and the NeXT runtime (but not available in conjunction with
2874 the NeXT runtime on Mac OS X 10.2 and earlier).
2876 @item -fobjc-gc
2877 @opindex fobjc-gc
2878 Enable garbage collection (GC) in Objective-C and Objective-C++
2879 programs.  This option is only available with the NeXT runtime; the
2880 GNU runtime has a different garbage collection implementation that
2881 does not require special compiler flags.
2883 @item -fobjc-nilcheck
2884 @opindex fobjc-nilcheck
2885 For the NeXT runtime with version 2 of the ABI, check for a nil
2886 receiver in method invocations before doing the actual method call.
2887 This is the default and can be disabled using
2888 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2889 checked for nil in this way no matter what this flag is set to.
2890 Currently this flag does nothing when the GNU runtime, or an older
2891 version of the NeXT runtime ABI, is used.
2893 @item -fobjc-std=objc1
2894 @opindex fobjc-std
2895 Conform to the language syntax of Objective-C 1.0, the language
2896 recognized by GCC 4.0.  This only affects the Objective-C additions to
2897 the C/C++ language; it does not affect conformance to C/C++ standards,
2898 which is controlled by the separate C/C++ dialect option flags.  When
2899 this option is used with the Objective-C or Objective-C++ compiler,
2900 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2901 This is useful if you need to make sure that your Objective-C code can
2902 be compiled with older versions of GCC@.
2904 @item -freplace-objc-classes
2905 @opindex freplace-objc-classes
2906 Emit a special marker instructing @command{ld(1)} not to statically link in
2907 the resulting object file, and allow @command{dyld(1)} to load it in at
2908 run time instead.  This is used in conjunction with the Fix-and-Continue
2909 debugging mode, where the object file in question may be recompiled and
2910 dynamically reloaded in the course of program execution, without the need
2911 to restart the program itself.  Currently, Fix-and-Continue functionality
2912 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2913 and later.
2915 @item -fzero-link
2916 @opindex fzero-link
2917 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2918 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2919 compile time) with static class references that get initialized at load time,
2920 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2921 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2922 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2923 for individual class implementations to be modified during program execution.
2924 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2925 regardless of command-line options.
2927 @item -gen-decls
2928 @opindex gen-decls
2929 Dump interface declarations for all classes seen in the source file to a
2930 file named @file{@var{sourcename}.decl}.
2932 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2933 @opindex Wassign-intercept
2934 @opindex Wno-assign-intercept
2935 Warn whenever an Objective-C assignment is being intercepted by the
2936 garbage collector.
2938 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2939 @opindex Wno-protocol
2940 @opindex Wprotocol
2941 If a class is declared to implement a protocol, a warning is issued for
2942 every method in the protocol that is not implemented by the class.  The
2943 default behavior is to issue a warning for every method not explicitly
2944 implemented in the class, even if a method implementation is inherited
2945 from the superclass.  If you use the @option{-Wno-protocol} option, then
2946 methods inherited from the superclass are considered to be implemented,
2947 and no warning is issued for them.
2949 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2950 @opindex Wselector
2951 @opindex Wno-selector
2952 Warn if multiple methods of different types for the same selector are
2953 found during compilation.  The check is performed on the list of methods
2954 in the final stage of compilation.  Additionally, a check is performed
2955 for each selector appearing in a @code{@@selector(@dots{})}
2956 expression, and a corresponding method for that selector has been found
2957 during compilation.  Because these checks scan the method table only at
2958 the end of compilation, these warnings are not produced if the final
2959 stage of compilation is not reached, for example because an error is
2960 found during compilation, or because the @option{-fsyntax-only} option is
2961 being used.
2963 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2964 @opindex Wstrict-selector-match
2965 @opindex Wno-strict-selector-match
2966 Warn if multiple methods with differing argument and/or return types are
2967 found for a given selector when attempting to send a message using this
2968 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2969 is off (which is the default behavior), the compiler omits such warnings
2970 if any differences found are confined to types that share the same size
2971 and alignment.
2973 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2974 @opindex Wundeclared-selector
2975 @opindex Wno-undeclared-selector
2976 Warn if a @code{@@selector(@dots{})} expression referring to an
2977 undeclared selector is found.  A selector is considered undeclared if no
2978 method with that name has been declared before the
2979 @code{@@selector(@dots{})} expression, either explicitly in an
2980 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2981 an @code{@@implementation} section.  This option always performs its
2982 checks as soon as a @code{@@selector(@dots{})} expression is found,
2983 while @option{-Wselector} only performs its checks in the final stage of
2984 compilation.  This also enforces the coding style convention
2985 that methods and selectors must be declared before being used.
2987 @item -print-objc-runtime-info
2988 @opindex print-objc-runtime-info
2989 Generate C header describing the largest structure that is passed by
2990 value, if any.
2992 @end table
2994 @node Language Independent Options
2995 @section Options to Control Diagnostic Messages Formatting
2996 @cindex options to control diagnostics formatting
2997 @cindex diagnostic messages
2998 @cindex message formatting
3000 Traditionally, diagnostic messages have been formatted irrespective of
3001 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3002 options described below
3003 to control the formatting algorithm for diagnostic messages, 
3004 e.g.@: how many characters per line, how often source location
3005 information should be reported.  Note that some language front ends may not
3006 honor these options.
3008 @table @gcctabopt
3009 @item -fmessage-length=@var{n}
3010 @opindex fmessage-length
3011 Try to format error messages so that they fit on lines of about @var{n}
3012 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
3013 the front ends supported by GCC@.  If @var{n} is zero, then no
3014 line-wrapping is done; each error message appears on a single
3015 line.
3017 @item -fdiagnostics-show-location=once
3018 @opindex fdiagnostics-show-location
3019 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3020 reporter to emit source location information @emph{once}; that is, in
3021 case the message is too long to fit on a single physical line and has to
3022 be wrapped, the source location won't be emitted (as prefix) again,
3023 over and over, in subsequent continuation lines.  This is the default
3024 behavior.
3026 @item -fdiagnostics-show-location=every-line
3027 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3028 messages reporter to emit the same source location information (as
3029 prefix) for physical lines that result from the process of breaking
3030 a message which is too long to fit on a single line.
3032 @item -fdiagnostics-color[=@var{WHEN}]
3033 @itemx -fno-diagnostics-color
3034 @opindex fdiagnostics-color
3035 @cindex highlight, color, colour
3036 @vindex GCC_COLORS @r{environment variable}
3037 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3038 or @samp{auto}.  The default is @samp{never} if @env{GCC_COLORS} environment
3039 variable isn't present in the environment, and @samp{auto} otherwise.
3040 @samp{auto} means to use color only when the standard error is a terminal.
3041 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3042 aliases for @option{-fdiagnostics-color=always} and
3043 @option{-fdiagnostics-color=never}, respectively.
3045 The colors are defined by the environment variable @env{GCC_COLORS}.
3046 Its value is a colon-separated list of capabilities and Select Graphic
3047 Rendition (SGR) substrings. SGR commands are interpreted by the
3048 terminal or terminal emulator.  (See the section in the documentation
3049 of your text terminal for permitted values and their meanings as
3050 character attributes.)  These substring values are integers in decimal
3051 representation and can be concatenated with semicolons.
3052 Common values to concatenate include
3053 @samp{1} for bold,
3054 @samp{4} for underline,
3055 @samp{5} for blink,
3056 @samp{7} for inverse,
3057 @samp{39} for default foreground color,
3058 @samp{30} to @samp{37} for foreground colors,
3059 @samp{90} to @samp{97} for 16-color mode foreground colors,
3060 @samp{38;5;0} to @samp{38;5;255}
3061 for 88-color and 256-color modes foreground colors,
3062 @samp{49} for default background color,
3063 @samp{40} to @samp{47} for background colors,
3064 @samp{100} to @samp{107} for 16-color mode background colors,
3065 and @samp{48;5;0} to @samp{48;5;255}
3066 for 88-color and 256-color modes background colors.
3068 The default @env{GCC_COLORS} is
3069 @samp{error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01}
3070 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3071 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3072 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3073 string disables colors.
3074 Supported capabilities are as follows.
3076 @table @code
3077 @item error=
3078 @vindex error GCC_COLORS @r{capability}
3079 SGR substring for error: markers.
3081 @item warning=
3082 @vindex warning GCC_COLORS @r{capability}
3083 SGR substring for warning: markers.
3085 @item note=
3086 @vindex note GCC_COLORS @r{capability}
3087 SGR substring for note: markers.
3089 @item caret=
3090 @vindex caret GCC_COLORS @r{capability}
3091 SGR substring for caret line.
3093 @item locus=
3094 @vindex locus GCC_COLORS @r{capability}
3095 SGR substring for location information, @samp{file:line} or
3096 @samp{file:line:column} etc.
3098 @item quote=
3099 @vindex quote GCC_COLORS @r{capability}
3100 SGR substring for information printed within quotes.
3101 @end table
3103 @item -fno-diagnostics-show-option
3104 @opindex fno-diagnostics-show-option
3105 @opindex fdiagnostics-show-option
3106 By default, each diagnostic emitted includes text indicating the
3107 command-line option that directly controls the diagnostic (if such an
3108 option is known to the diagnostic machinery).  Specifying the
3109 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3111 @item -fno-diagnostics-show-caret
3112 @opindex fno-diagnostics-show-caret
3113 @opindex fdiagnostics-show-caret
3114 By default, each diagnostic emitted includes the original source line
3115 and a caret '^' indicating the column.  This option suppresses this
3116 information.
3118 @end table
3120 @node Warning Options
3121 @section Options to Request or Suppress Warnings
3122 @cindex options to control warnings
3123 @cindex warning messages
3124 @cindex messages, warning
3125 @cindex suppressing warnings
3127 Warnings are diagnostic messages that report constructions that
3128 are not inherently erroneous but that are risky or suggest there
3129 may have been an error.
3131 The following language-independent options do not enable specific
3132 warnings but control the kinds of diagnostics produced by GCC@.
3134 @table @gcctabopt
3135 @cindex syntax checking
3136 @item -fsyntax-only
3137 @opindex fsyntax-only
3138 Check the code for syntax errors, but don't do anything beyond that.
3140 @item -fmax-errors=@var{n}
3141 @opindex fmax-errors
3142 Limits the maximum number of error messages to @var{n}, at which point
3143 GCC bails out rather than attempting to continue processing the source
3144 code.  If @var{n} is 0 (the default), there is no limit on the number
3145 of error messages produced.  If @option{-Wfatal-errors} is also
3146 specified, then @option{-Wfatal-errors} takes precedence over this
3147 option.
3149 @item -w
3150 @opindex w
3151 Inhibit all warning messages.
3153 @item -Werror
3154 @opindex Werror
3155 @opindex Wno-error
3156 Make all warnings into errors.
3158 @item -Werror=
3159 @opindex Werror=
3160 @opindex Wno-error=
3161 Make the specified warning into an error.  The specifier for a warning
3162 is appended; for example @option{-Werror=switch} turns the warnings
3163 controlled by @option{-Wswitch} into errors.  This switch takes a
3164 negative form, to be used to negate @option{-Werror} for specific
3165 warnings; for example @option{-Wno-error=switch} makes
3166 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3167 is in effect.
3169 The warning message for each controllable warning includes the
3170 option that controls the warning.  That option can then be used with
3171 @option{-Werror=} and @option{-Wno-error=} as described above.
3172 (Printing of the option in the warning message can be disabled using the
3173 @option{-fno-diagnostics-show-option} flag.)
3175 Note that specifying @option{-Werror=}@var{foo} automatically implies
3176 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3177 imply anything.
3179 @item -Wfatal-errors
3180 @opindex Wfatal-errors
3181 @opindex Wno-fatal-errors
3182 This option causes the compiler to abort compilation on the first error
3183 occurred rather than trying to keep going and printing further error
3184 messages.
3186 @end table
3188 You can request many specific warnings with options beginning with
3189 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3190 implicit declarations.  Each of these specific warning options also
3191 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3192 example, @option{-Wno-implicit}.  This manual lists only one of the
3193 two forms, whichever is not the default.  For further
3194 language-specific options also refer to @ref{C++ Dialect Options} and
3195 @ref{Objective-C and Objective-C++ Dialect Options}.
3197 When an unrecognized warning option is requested (e.g.,
3198 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3199 that the option is not recognized.  However, if the @option{-Wno-} form
3200 is used, the behavior is slightly different: no diagnostic is
3201 produced for @option{-Wno-unknown-warning} unless other diagnostics
3202 are being produced.  This allows the use of new @option{-Wno-} options
3203 with old compilers, but if something goes wrong, the compiler
3204 warns that an unrecognized option is present.
3206 @table @gcctabopt
3207 @item -Wpedantic
3208 @itemx -pedantic
3209 @opindex pedantic
3210 @opindex Wpedantic
3211 Issue all the warnings demanded by strict ISO C and ISO C++;
3212 reject all programs that use forbidden extensions, and some other
3213 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3214 version of the ISO C standard specified by any @option{-std} option used.
3216 Valid ISO C and ISO C++ programs should compile properly with or without
3217 this option (though a rare few require @option{-ansi} or a
3218 @option{-std} option specifying the required version of ISO C)@.  However,
3219 without this option, certain GNU extensions and traditional C and C++
3220 features are supported as well.  With this option, they are rejected.
3222 @option{-Wpedantic} does not cause warning messages for use of the
3223 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3224 warnings are also disabled in the expression that follows
3225 @code{__extension__}.  However, only system header files should use
3226 these escape routes; application programs should avoid them.
3227 @xref{Alternate Keywords}.
3229 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3230 C conformance.  They soon find that it does not do quite what they want:
3231 it finds some non-ISO practices, but not all---only those for which
3232 ISO C @emph{requires} a diagnostic, and some others for which
3233 diagnostics have been added.
3235 A feature to report any failure to conform to ISO C might be useful in
3236 some instances, but would require considerable additional work and would
3237 be quite different from @option{-Wpedantic}.  We don't have plans to
3238 support such a feature in the near future.
3240 Where the standard specified with @option{-std} represents a GNU
3241 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3242 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3243 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3244 where they are required by the base standard.  (It does not make sense
3245 for such warnings to be given only for features not in the specified GNU
3246 C dialect, since by definition the GNU dialects of C include all
3247 features the compiler supports with the given option, and there would be
3248 nothing to warn about.)
3250 @item -pedantic-errors
3251 @opindex pedantic-errors
3252 Like @option{-Wpedantic}, except that errors are produced rather than
3253 warnings.
3255 @item -Wall
3256 @opindex Wall
3257 @opindex Wno-all
3258 This enables all the warnings about constructions that some users
3259 consider questionable, and that are easy to avoid (or modify to
3260 prevent the warning), even in conjunction with macros.  This also
3261 enables some language-specific warnings described in @ref{C++ Dialect
3262 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3264 @option{-Wall} turns on the following warning flags:
3266 @gccoptlist{-Waddress   @gol
3267 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3268 -Wc++11-compat  @gol
3269 -Wchar-subscripts  @gol
3270 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3271 -Wimplicit-int @r{(C and Objective-C only)} @gol
3272 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3273 -Wcomment  @gol
3274 -Wformat   @gol
3275 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3276 -Wmaybe-uninitialized @gol
3277 -Wmissing-braces @r{(only for C/ObjC)} @gol
3278 -Wnonnull  @gol
3279 -Wparentheses  @gol
3280 -Wpointer-sign  @gol
3281 -Wreorder   @gol
3282 -Wreturn-type  @gol
3283 -Wsequence-point  @gol
3284 -Wsign-compare @r{(only in C++)}  @gol
3285 -Wstrict-aliasing  @gol
3286 -Wstrict-overflow=1  @gol
3287 -Wswitch  @gol
3288 -Wtrigraphs  @gol
3289 -Wuninitialized  @gol
3290 -Wunknown-pragmas  @gol
3291 -Wunused-function  @gol
3292 -Wunused-label     @gol
3293 -Wunused-value     @gol
3294 -Wunused-variable  @gol
3295 -Wvolatile-register-var @gol
3298 Note that some warning flags are not implied by @option{-Wall}.  Some of
3299 them warn about constructions that users generally do not consider
3300 questionable, but which occasionally you might wish to check for;
3301 others warn about constructions that are necessary or hard to avoid in
3302 some cases, and there is no simple way to modify the code to suppress
3303 the warning. Some of them are enabled by @option{-Wextra} but many of
3304 them must be enabled individually.
3306 @item -Wextra
3307 @opindex W
3308 @opindex Wextra
3309 @opindex Wno-extra
3310 This enables some extra warning flags that are not enabled by
3311 @option{-Wall}. (This option used to be called @option{-W}.  The older
3312 name is still supported, but the newer name is more descriptive.)
3314 @gccoptlist{-Wclobbered  @gol
3315 -Wempty-body  @gol
3316 -Wignored-qualifiers @gol
3317 -Wmissing-field-initializers  @gol
3318 -Wmissing-parameter-type @r{(C only)}  @gol
3319 -Wold-style-declaration @r{(C only)}  @gol
3320 -Woverride-init  @gol
3321 -Wsign-compare  @gol
3322 -Wtype-limits  @gol
3323 -Wuninitialized  @gol
3324 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3325 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3328 The option @option{-Wextra} also prints warning messages for the
3329 following cases:
3331 @itemize @bullet
3333 @item
3334 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3335 @samp{>}, or @samp{>=}.
3337 @item
3338 (C++ only) An enumerator and a non-enumerator both appear in a
3339 conditional expression.
3341 @item
3342 (C++ only) Ambiguous virtual bases.
3344 @item
3345 (C++ only) Subscripting an array that has been declared @samp{register}.
3347 @item
3348 (C++ only) Taking the address of a variable that has been declared
3349 @samp{register}.
3351 @item
3352 (C++ only) A base class is not initialized in a derived class's copy
3353 constructor.
3355 @end itemize
3357 @item -Wchar-subscripts
3358 @opindex Wchar-subscripts
3359 @opindex Wno-char-subscripts
3360 Warn if an array subscript has type @code{char}.  This is a common cause
3361 of error, as programmers often forget that this type is signed on some
3362 machines.
3363 This warning is enabled by @option{-Wall}.
3365 @item -Wcomment
3366 @opindex Wcomment
3367 @opindex Wno-comment
3368 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3369 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3370 This warning is enabled by @option{-Wall}.
3372 @item -Wno-coverage-mismatch
3373 @opindex Wno-coverage-mismatch
3374 Warn if feedback profiles do not match when using the
3375 @option{-fprofile-use} option.
3376 If a source file is changed between compiling with @option{-fprofile-gen} and
3377 with @option{-fprofile-use}, the files with the profile feedback can fail
3378 to match the source file and GCC cannot use the profile feedback
3379 information.  By default, this warning is enabled and is treated as an
3380 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3381 warning or @option{-Wno-error=coverage-mismatch} can be used to
3382 disable the error.  Disabling the error for this warning can result in
3383 poorly optimized code and is useful only in the
3384 case of very minor changes such as bug fixes to an existing code-base.
3385 Completely disabling the warning is not recommended.
3387 @item -Wno-cpp
3388 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3390 Suppress warning messages emitted by @code{#warning} directives.
3392 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3393 @opindex Wdouble-promotion
3394 @opindex Wno-double-promotion
3395 Give a warning when a value of type @code{float} is implicitly
3396 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3397 floating-point unit implement @code{float} in hardware, but emulate
3398 @code{double} in software.  On such a machine, doing computations
3399 using @code{double} values is much more expensive because of the
3400 overhead required for software emulation.
3402 It is easy to accidentally do computations with @code{double} because
3403 floating-point literals are implicitly of type @code{double}.  For
3404 example, in:
3405 @smallexample
3406 @group
3407 float area(float radius)
3409    return 3.14159 * radius * radius;
3411 @end group
3412 @end smallexample
3413 the compiler performs the entire computation with @code{double}
3414 because the floating-point literal is a @code{double}.
3416 @item -Wformat
3417 @itemx -Wformat=@var{n}
3418 @opindex Wformat
3419 @opindex Wno-format
3420 @opindex ffreestanding
3421 @opindex fno-builtin
3422 @opindex Wformat=
3423 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3424 the arguments supplied have types appropriate to the format string
3425 specified, and that the conversions specified in the format string make
3426 sense.  This includes standard functions, and others specified by format
3427 attributes (@pxref{Function Attributes}), in the @code{printf},
3428 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3429 not in the C standard) families (or other target-specific families).
3430 Which functions are checked without format attributes having been
3431 specified depends on the standard version selected, and such checks of
3432 functions without the attribute specified are disabled by
3433 @option{-ffreestanding} or @option{-fno-builtin}.
3435 The formats are checked against the format features supported by GNU
3436 libc version 2.2.  These include all ISO C90 and C99 features, as well
3437 as features from the Single Unix Specification and some BSD and GNU
3438 extensions.  Other library implementations may not support all these
3439 features; GCC does not support warning about features that go beyond a
3440 particular library's limitations.  However, if @option{-Wpedantic} is used
3441 with @option{-Wformat}, warnings are given about format features not
3442 in the selected standard version (but not for @code{strfmon} formats,
3443 since those are not in any version of the C standard).  @xref{C Dialect
3444 Options,,Options Controlling C Dialect}.
3446 @table @gcctabopt
3447 @item -Wformat=1
3448 @itemx -Wformat
3449 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3450 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3451 @option{-Wformat} also checks for null format arguments for several
3452 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3453 aspects of this level of format checking can be disabled by the
3454 options: @option{-Wno-format-contains-nul},
3455 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3456 @option{-Wformat} is enabled by @option{-Wall}.
3458 @item -Wno-format-contains-nul
3459 @opindex Wno-format-contains-nul
3460 @opindex Wformat-contains-nul
3461 If @option{-Wformat} is specified, do not warn about format strings that
3462 contain NUL bytes.
3464 @item -Wno-format-extra-args
3465 @opindex Wno-format-extra-args
3466 @opindex Wformat-extra-args
3467 If @option{-Wformat} is specified, do not warn about excess arguments to a
3468 @code{printf} or @code{scanf} format function.  The C standard specifies
3469 that such arguments are ignored.
3471 Where the unused arguments lie between used arguments that are
3472 specified with @samp{$} operand number specifications, normally
3473 warnings are still given, since the implementation could not know what
3474 type to pass to @code{va_arg} to skip the unused arguments.  However,
3475 in the case of @code{scanf} formats, this option suppresses the
3476 warning if the unused arguments are all pointers, since the Single
3477 Unix Specification says that such unused arguments are allowed.
3479 @item -Wno-format-zero-length
3480 @opindex Wno-format-zero-length
3481 @opindex Wformat-zero-length
3482 If @option{-Wformat} is specified, do not warn about zero-length formats.
3483 The C standard specifies that zero-length formats are allowed.
3486 @item -Wformat=2
3487 Enable @option{-Wformat} plus additional format checks.  Currently
3488 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3489 -Wformat-y2k}.
3491 @item -Wformat-nonliteral
3492 @opindex Wformat-nonliteral
3493 @opindex Wno-format-nonliteral
3494 If @option{-Wformat} is specified, also warn if the format string is not a
3495 string literal and so cannot be checked, unless the format function
3496 takes its format arguments as a @code{va_list}.
3498 @item -Wformat-security
3499 @opindex Wformat-security
3500 @opindex Wno-format-security
3501 If @option{-Wformat} is specified, also warn about uses of format
3502 functions that represent possible security problems.  At present, this
3503 warns about calls to @code{printf} and @code{scanf} functions where the
3504 format string is not a string literal and there are no format arguments,
3505 as in @code{printf (foo);}.  This may be a security hole if the format
3506 string came from untrusted input and contains @samp{%n}.  (This is
3507 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3508 in future warnings may be added to @option{-Wformat-security} that are not
3509 included in @option{-Wformat-nonliteral}.)
3511 @item -Wformat-y2k
3512 @opindex Wformat-y2k
3513 @opindex Wno-format-y2k
3514 If @option{-Wformat} is specified, also warn about @code{strftime}
3515 formats that may yield only a two-digit year.
3516 @end table
3518 @item -Wnonnull
3519 @opindex Wnonnull
3520 @opindex Wno-nonnull
3521 Warn about passing a null pointer for arguments marked as
3522 requiring a non-null value by the @code{nonnull} function attribute.
3524 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3525 can be disabled with the @option{-Wno-nonnull} option.
3527 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3528 @opindex Winit-self
3529 @opindex Wno-init-self
3530 Warn about uninitialized variables that are initialized with themselves.
3531 Note this option can only be used with the @option{-Wuninitialized} option.
3533 For example, GCC warns about @code{i} being uninitialized in the
3534 following snippet only when @option{-Winit-self} has been specified:
3535 @smallexample
3536 @group
3537 int f()
3539   int i = i;
3540   return i;
3542 @end group
3543 @end smallexample
3545 This warning is enabled by @option{-Wall} in C++.
3547 @item -Wimplicit-int @r{(C and Objective-C only)}
3548 @opindex Wimplicit-int
3549 @opindex Wno-implicit-int
3550 Warn when a declaration does not specify a type.
3551 This warning is enabled by @option{-Wall}.
3553 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3554 @opindex Wimplicit-function-declaration
3555 @opindex Wno-implicit-function-declaration
3556 Give a warning whenever a function is used before being declared. In
3557 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3558 enabled by default and it is made into an error by
3559 @option{-pedantic-errors}. This warning is also enabled by
3560 @option{-Wall}.
3562 @item -Wimplicit @r{(C and Objective-C only)}
3563 @opindex Wimplicit
3564 @opindex Wno-implicit
3565 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3566 This warning is enabled by @option{-Wall}.
3568 @item -Wignored-qualifiers @r{(C and C++ only)}
3569 @opindex Wignored-qualifiers
3570 @opindex Wno-ignored-qualifiers
3571 Warn if the return type of a function has a type qualifier
3572 such as @code{const}.  For ISO C such a type qualifier has no effect,
3573 since the value returned by a function is not an lvalue.
3574 For C++, the warning is only emitted for scalar types or @code{void}.
3575 ISO C prohibits qualified @code{void} return types on function
3576 definitions, so such return types always receive a warning
3577 even without this option.
3579 This warning is also enabled by @option{-Wextra}.
3581 @item -Wmain
3582 @opindex Wmain
3583 @opindex Wno-main
3584 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3585 a function with external linkage, returning int, taking either zero
3586 arguments, two, or three arguments of appropriate types.  This warning
3587 is enabled by default in C++ and is enabled by either @option{-Wall}
3588 or @option{-Wpedantic}.
3590 @item -Wmissing-braces
3591 @opindex Wmissing-braces
3592 @opindex Wno-missing-braces
3593 Warn if an aggregate or union initializer is not fully bracketed.  In
3594 the following example, the initializer for @samp{a} is not fully
3595 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3596 enabled by @option{-Wall} in C.
3598 @smallexample
3599 int a[2][2] = @{ 0, 1, 2, 3 @};
3600 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3601 @end smallexample
3603 This warning is enabled by @option{-Wall}.
3605 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3606 @opindex Wmissing-include-dirs
3607 @opindex Wno-missing-include-dirs
3608 Warn if a user-supplied include directory does not exist.
3610 @item -Wparentheses
3611 @opindex Wparentheses
3612 @opindex Wno-parentheses
3613 Warn if parentheses are omitted in certain contexts, such
3614 as when there is an assignment in a context where a truth value
3615 is expected, or when operators are nested whose precedence people
3616 often get confused about.
3618 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3619 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3620 interpretation from that of ordinary mathematical notation.
3622 Also warn about constructions where there may be confusion to which
3623 @code{if} statement an @code{else} branch belongs.  Here is an example of
3624 such a case:
3626 @smallexample
3627 @group
3629   if (a)
3630     if (b)
3631       foo ();
3632   else
3633     bar ();
3635 @end group
3636 @end smallexample
3638 In C/C++, every @code{else} branch belongs to the innermost possible
3639 @code{if} statement, which in this example is @code{if (b)}.  This is
3640 often not what the programmer expected, as illustrated in the above
3641 example by indentation the programmer chose.  When there is the
3642 potential for this confusion, GCC issues a warning when this flag
3643 is specified.  To eliminate the warning, add explicit braces around
3644 the innermost @code{if} statement so there is no way the @code{else}
3645 can belong to the enclosing @code{if}.  The resulting code
3646 looks like this:
3648 @smallexample
3649 @group
3651   if (a)
3652     @{
3653       if (b)
3654         foo ();
3655       else
3656         bar ();
3657     @}
3659 @end group
3660 @end smallexample
3662 Also warn for dangerous uses of the GNU extension to
3663 @code{?:} with omitted middle operand. When the condition
3664 in the @code{?}: operator is a boolean expression, the omitted value is
3665 always 1.  Often programmers expect it to be a value computed
3666 inside the conditional expression instead.
3668 This warning is enabled by @option{-Wall}.
3670 @item -Wsequence-point
3671 @opindex Wsequence-point
3672 @opindex Wno-sequence-point
3673 Warn about code that may have undefined semantics because of violations
3674 of sequence point rules in the C and C++ standards.
3676 The C and C++ standards define the order in which expressions in a C/C++
3677 program are evaluated in terms of @dfn{sequence points}, which represent
3678 a partial ordering between the execution of parts of the program: those
3679 executed before the sequence point, and those executed after it.  These
3680 occur after the evaluation of a full expression (one which is not part
3681 of a larger expression), after the evaluation of the first operand of a
3682 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3683 function is called (but after the evaluation of its arguments and the
3684 expression denoting the called function), and in certain other places.
3685 Other than as expressed by the sequence point rules, the order of
3686 evaluation of subexpressions of an expression is not specified.  All
3687 these rules describe only a partial order rather than a total order,
3688 since, for example, if two functions are called within one expression
3689 with no sequence point between them, the order in which the functions
3690 are called is not specified.  However, the standards committee have
3691 ruled that function calls do not overlap.
3693 It is not specified when between sequence points modifications to the
3694 values of objects take effect.  Programs whose behavior depends on this
3695 have undefined behavior; the C and C++ standards specify that ``Between
3696 the previous and next sequence point an object shall have its stored
3697 value modified at most once by the evaluation of an expression.
3698 Furthermore, the prior value shall be read only to determine the value
3699 to be stored.''.  If a program breaks these rules, the results on any
3700 particular implementation are entirely unpredictable.
3702 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3703 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3704 diagnosed by this option, and it may give an occasional false positive
3705 result, but in general it has been found fairly effective at detecting
3706 this sort of problem in programs.
3708 The standard is worded confusingly, therefore there is some debate
3709 over the precise meaning of the sequence point rules in subtle cases.
3710 Links to discussions of the problem, including proposed formal
3711 definitions, may be found on the GCC readings page, at
3712 @uref{http://gcc.gnu.org/@/readings.html}.
3714 This warning is enabled by @option{-Wall} for C and C++.
3716 @item -Wno-return-local-addr
3717 @opindex Wno-return-local-addr
3718 @opindex Wreturn-local-addr
3719 Do not warn about returning a pointer (or in C++, a reference) to a
3720 variable that goes out of scope after the function returns.
3722 @item -Wreturn-type
3723 @opindex Wreturn-type
3724 @opindex Wno-return-type
3725 Warn whenever a function is defined with a return type that defaults
3726 to @code{int}.  Also warn about any @code{return} statement with no
3727 return value in a function whose return type is not @code{void}
3728 (falling off the end of the function body is considered returning
3729 without a value), and about a @code{return} statement with an
3730 expression in a function whose return type is @code{void}.
3732 For C++, a function without return type always produces a diagnostic
3733 message, even when @option{-Wno-return-type} is specified.  The only
3734 exceptions are @samp{main} and functions defined in system headers.
3736 This warning is enabled by @option{-Wall}.
3738 @item -Wswitch
3739 @opindex Wswitch
3740 @opindex Wno-switch
3741 Warn whenever a @code{switch} statement has an index of enumerated type
3742 and lacks a @code{case} for one or more of the named codes of that
3743 enumeration.  (The presence of a @code{default} label prevents this
3744 warning.)  @code{case} labels outside the enumeration range also
3745 provoke warnings when this option is used (even if there is a
3746 @code{default} label).
3747 This warning is enabled by @option{-Wall}.
3749 @item -Wswitch-default
3750 @opindex Wswitch-default
3751 @opindex Wno-switch-default
3752 Warn whenever a @code{switch} statement does not have a @code{default}
3753 case.
3755 @item -Wswitch-enum
3756 @opindex Wswitch-enum
3757 @opindex Wno-switch-enum
3758 Warn whenever a @code{switch} statement has an index of enumerated type
3759 and lacks a @code{case} for one or more of the named codes of that
3760 enumeration.  @code{case} labels outside the enumeration range also
3761 provoke warnings when this option is used.  The only difference
3762 between @option{-Wswitch} and this option is that this option gives a
3763 warning about an omitted enumeration code even if there is a
3764 @code{default} label.
3766 @item -Wsync-nand @r{(C and C++ only)}
3767 @opindex Wsync-nand
3768 @opindex Wno-sync-nand
3769 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3770 built-in functions are used.  These functions changed semantics in GCC 4.4.
3772 @item -Wtrigraphs
3773 @opindex Wtrigraphs
3774 @opindex Wno-trigraphs
3775 Warn if any trigraphs are encountered that might change the meaning of
3776 the program (trigraphs within comments are not warned about).
3777 This warning is enabled by @option{-Wall}.
3779 @item -Wunused-but-set-parameter
3780 @opindex Wunused-but-set-parameter
3781 @opindex Wno-unused-but-set-parameter
3782 Warn whenever a function parameter is assigned to, but otherwise unused
3783 (aside from its declaration).
3785 To suppress this warning use the @samp{unused} attribute
3786 (@pxref{Variable Attributes}).
3788 This warning is also enabled by @option{-Wunused} together with
3789 @option{-Wextra}.
3791 @item -Wunused-but-set-variable
3792 @opindex Wunused-but-set-variable
3793 @opindex Wno-unused-but-set-variable
3794 Warn whenever a local variable is assigned to, but otherwise unused
3795 (aside from its declaration).
3796 This warning is enabled by @option{-Wall}.
3798 To suppress this warning use the @samp{unused} attribute
3799 (@pxref{Variable Attributes}).
3801 This warning is also enabled by @option{-Wunused}, which is enabled
3802 by @option{-Wall}.
3804 @item -Wunused-function
3805 @opindex Wunused-function
3806 @opindex Wno-unused-function
3807 Warn whenever a static function is declared but not defined or a
3808 non-inline static function is unused.
3809 This warning is enabled by @option{-Wall}.
3811 @item -Wunused-label
3812 @opindex Wunused-label
3813 @opindex Wno-unused-label
3814 Warn whenever a label is declared but not used.
3815 This warning is enabled by @option{-Wall}.
3817 To suppress this warning use the @samp{unused} attribute
3818 (@pxref{Variable Attributes}).
3820 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3821 @opindex Wunused-local-typedefs
3822 Warn when a typedef locally defined in a function is not used.
3823 This warning is enabled by @option{-Wall}.
3825 @item -Wunused-parameter
3826 @opindex Wunused-parameter
3827 @opindex Wno-unused-parameter
3828 Warn whenever a function parameter is unused aside from its declaration.
3830 To suppress this warning use the @samp{unused} attribute
3831 (@pxref{Variable Attributes}).
3833 @item -Wno-unused-result
3834 @opindex Wunused-result
3835 @opindex Wno-unused-result
3836 Do not warn if a caller of a function marked with attribute
3837 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3838 its return value. The default is @option{-Wunused-result}.
3840 @item -Wunused-variable
3841 @opindex Wunused-variable
3842 @opindex Wno-unused-variable
3843 Warn whenever a local variable or non-constant static variable is unused
3844 aside from its declaration.
3845 This warning is enabled by @option{-Wall}.
3847 To suppress this warning use the @samp{unused} attribute
3848 (@pxref{Variable Attributes}).
3850 @item -Wunused-value
3851 @opindex Wunused-value
3852 @opindex Wno-unused-value
3853 Warn whenever a statement computes a result that is explicitly not
3854 used. To suppress this warning cast the unused expression to
3855 @samp{void}. This includes an expression-statement or the left-hand
3856 side of a comma expression that contains no side effects. For example,
3857 an expression such as @samp{x[i,j]} causes a warning, while
3858 @samp{x[(void)i,j]} does not.
3860 This warning is enabled by @option{-Wall}.
3862 @item -Wunused
3863 @opindex Wunused
3864 @opindex Wno-unused
3865 All the above @option{-Wunused} options combined.
3867 In order to get a warning about an unused function parameter, you must
3868 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3869 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3871 @item -Wuninitialized
3872 @opindex Wuninitialized
3873 @opindex Wno-uninitialized
3874 Warn if an automatic variable is used without first being initialized
3875 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3876 warn if a non-static reference or non-static @samp{const} member
3877 appears in a class without constructors.
3879 If you want to warn about code that uses the uninitialized value of the
3880 variable in its own initializer, use the @option{-Winit-self} option.
3882 These warnings occur for individual uninitialized or clobbered
3883 elements of structure, union or array variables as well as for
3884 variables that are uninitialized or clobbered as a whole.  They do
3885 not occur for variables or elements declared @code{volatile}.  Because
3886 these warnings depend on optimization, the exact variables or elements
3887 for which there are warnings depends on the precise optimization
3888 options and version of GCC used.
3890 Note that there may be no warning about a variable that is used only
3891 to compute a value that itself is never used, because such
3892 computations may be deleted by data flow analysis before the warnings
3893 are printed.
3895 @item -Wmaybe-uninitialized
3896 @opindex Wmaybe-uninitialized
3897 @opindex Wno-maybe-uninitialized
3898 For an automatic variable, if there exists a path from the function
3899 entry to a use of the variable that is initialized, but there exist
3900 some other paths for which the variable is not initialized, the compiler
3901 emits a warning if it cannot prove the uninitialized paths are not
3902 executed at run time. These warnings are made optional because GCC is
3903 not smart enough to see all the reasons why the code might be correct
3904 in spite of appearing to have an error.  Here is one example of how
3905 this can happen:
3907 @smallexample
3908 @group
3910   int x;
3911   switch (y)
3912     @{
3913     case 1: x = 1;
3914       break;
3915     case 2: x = 4;
3916       break;
3917     case 3: x = 5;
3918     @}
3919   foo (x);
3921 @end group
3922 @end smallexample
3924 @noindent
3925 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3926 always initialized, but GCC doesn't know this. To suppress the
3927 warning, you need to provide a default case with assert(0) or
3928 similar code.
3930 @cindex @code{longjmp} warnings
3931 This option also warns when a non-volatile automatic variable might be
3932 changed by a call to @code{longjmp}.  These warnings as well are possible
3933 only in optimizing compilation.
3935 The compiler sees only the calls to @code{setjmp}.  It cannot know
3936 where @code{longjmp} will be called; in fact, a signal handler could
3937 call it at any point in the code.  As a result, you may get a warning
3938 even when there is in fact no problem because @code{longjmp} cannot
3939 in fact be called at the place that would cause a problem.
3941 Some spurious warnings can be avoided if you declare all the functions
3942 you use that never return as @code{noreturn}.  @xref{Function
3943 Attributes}.
3945 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3947 @item -Wunknown-pragmas
3948 @opindex Wunknown-pragmas
3949 @opindex Wno-unknown-pragmas
3950 @cindex warning for unknown pragmas
3951 @cindex unknown pragmas, warning
3952 @cindex pragmas, warning of unknown
3953 Warn when a @code{#pragma} directive is encountered that is not understood by 
3954 GCC@.  If this command-line option is used, warnings are even issued
3955 for unknown pragmas in system header files.  This is not the case if
3956 the warnings are only enabled by the @option{-Wall} command-line option.
3958 @item -Wno-pragmas
3959 @opindex Wno-pragmas
3960 @opindex Wpragmas
3961 Do not warn about misuses of pragmas, such as incorrect parameters,
3962 invalid syntax, or conflicts between pragmas.  See also
3963 @option{-Wunknown-pragmas}.
3965 @item -Wstrict-aliasing
3966 @opindex Wstrict-aliasing
3967 @opindex Wno-strict-aliasing
3968 This option is only active when @option{-fstrict-aliasing} is active.
3969 It warns about code that might break the strict aliasing rules that the
3970 compiler is using for optimization.  The warning does not catch all
3971 cases, but does attempt to catch the more common pitfalls.  It is
3972 included in @option{-Wall}.
3973 It is equivalent to @option{-Wstrict-aliasing=3}
3975 @item -Wstrict-aliasing=n
3976 @opindex Wstrict-aliasing=n
3977 This option is only active when @option{-fstrict-aliasing} is active.
3978 It warns about code that might break the strict aliasing rules that the
3979 compiler is using for optimization.
3980 Higher levels correspond to higher accuracy (fewer false positives).
3981 Higher levels also correspond to more effort, similar to the way @option{-O} 
3982 works.
3983 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
3985 Level 1: Most aggressive, quick, least accurate.
3986 Possibly useful when higher levels
3987 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
3988 false negatives.  However, it has many false positives.
3989 Warns for all pointer conversions between possibly incompatible types,
3990 even if never dereferenced.  Runs in the front end only.
3992 Level 2: Aggressive, quick, not too precise.
3993 May still have many false positives (not as many as level 1 though),
3994 and few false negatives (but possibly more than level 1).
3995 Unlike level 1, it only warns when an address is taken.  Warns about
3996 incomplete types.  Runs in the front end only.
3998 Level 3 (default for @option{-Wstrict-aliasing}):
3999 Should have very few false positives and few false
4000 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4001 Takes care of the common pun+dereference pattern in the front end:
4002 @code{*(int*)&some_float}.
4003 If optimization is enabled, it also runs in the back end, where it deals
4004 with multiple statement cases using flow-sensitive points-to information.
4005 Only warns when the converted pointer is dereferenced.
4006 Does not warn about incomplete types.
4008 @item -Wstrict-overflow
4009 @itemx -Wstrict-overflow=@var{n}
4010 @opindex Wstrict-overflow
4011 @opindex Wno-strict-overflow
4012 This option is only active when @option{-fstrict-overflow} is active.
4013 It warns about cases where the compiler optimizes based on the
4014 assumption that signed overflow does not occur.  Note that it does not
4015 warn about all cases where the code might overflow: it only warns
4016 about cases where the compiler implements some optimization.  Thus
4017 this warning depends on the optimization level.
4019 An optimization that assumes that signed overflow does not occur is
4020 perfectly safe if the values of the variables involved are such that
4021 overflow never does, in fact, occur.  Therefore this warning can
4022 easily give a false positive: a warning about code that is not
4023 actually a problem.  To help focus on important issues, several
4024 warning levels are defined.  No warnings are issued for the use of
4025 undefined signed overflow when estimating how many iterations a loop
4026 requires, in particular when determining whether a loop will be
4027 executed at all.
4029 @table @gcctabopt
4030 @item -Wstrict-overflow=1
4031 Warn about cases that are both questionable and easy to avoid.  For
4032 example,  with @option{-fstrict-overflow}, the compiler simplifies
4033 @code{x + 1 > x} to @code{1}.  This level of
4034 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4035 are not, and must be explicitly requested.
4037 @item -Wstrict-overflow=2
4038 Also warn about other cases where a comparison is simplified to a
4039 constant.  For example: @code{abs (x) >= 0}.  This can only be
4040 simplified when @option{-fstrict-overflow} is in effect, because
4041 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4042 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4043 @option{-Wstrict-overflow=2}.
4045 @item -Wstrict-overflow=3
4046 Also warn about other cases where a comparison is simplified.  For
4047 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4049 @item -Wstrict-overflow=4
4050 Also warn about other simplifications not covered by the above cases.
4051 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4053 @item -Wstrict-overflow=5
4054 Also warn about cases where the compiler reduces the magnitude of a
4055 constant involved in a comparison.  For example: @code{x + 2 > y} is
4056 simplified to @code{x + 1 >= y}.  This is reported only at the
4057 highest warning level because this simplification applies to many
4058 comparisons, so this warning level gives a very large number of
4059 false positives.
4060 @end table
4062 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4063 @opindex Wsuggest-attribute=
4064 @opindex Wno-suggest-attribute=
4065 Warn for cases where adding an attribute may be beneficial. The
4066 attributes currently supported are listed below.
4068 @table @gcctabopt
4069 @item -Wsuggest-attribute=pure
4070 @itemx -Wsuggest-attribute=const
4071 @itemx -Wsuggest-attribute=noreturn
4072 @opindex Wsuggest-attribute=pure
4073 @opindex Wno-suggest-attribute=pure
4074 @opindex Wsuggest-attribute=const
4075 @opindex Wno-suggest-attribute=const
4076 @opindex Wsuggest-attribute=noreturn
4077 @opindex Wno-suggest-attribute=noreturn
4079 Warn about functions that might be candidates for attributes
4080 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4081 functions visible in other compilation units or (in the case of @code{pure} and
4082 @code{const}) if it cannot prove that the function returns normally. A function
4083 returns normally if it doesn't contain an infinite loop or return abnormally
4084 by throwing, calling @code{abort()} or trapping.  This analysis requires option
4085 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4086 higher.  Higher optimization levels improve the accuracy of the analysis.
4088 @item -Wsuggest-attribute=format
4089 @itemx -Wmissing-format-attribute
4090 @opindex Wsuggest-attribute=format
4091 @opindex Wmissing-format-attribute
4092 @opindex Wno-suggest-attribute=format
4093 @opindex Wno-missing-format-attribute
4094 @opindex Wformat
4095 @opindex Wno-format
4097 Warn about function pointers that might be candidates for @code{format}
4098 attributes.  Note these are only possible candidates, not absolute ones.
4099 GCC guesses that function pointers with @code{format} attributes that
4100 are used in assignment, initialization, parameter passing or return
4101 statements should have a corresponding @code{format} attribute in the
4102 resulting type.  I.e.@: the left-hand side of the assignment or
4103 initialization, the type of the parameter variable, or the return type
4104 of the containing function respectively should also have a @code{format}
4105 attribute to avoid the warning.
4107 GCC also warns about function definitions that might be
4108 candidates for @code{format} attributes.  Again, these are only
4109 possible candidates.  GCC guesses that @code{format} attributes
4110 might be appropriate for any function that calls a function like
4111 @code{vprintf} or @code{vscanf}, but this might not always be the
4112 case, and some functions for which @code{format} attributes are
4113 appropriate may not be detected.
4114 @end table
4116 @item -Warray-bounds
4117 @opindex Wno-array-bounds
4118 @opindex Warray-bounds
4119 This option is only active when @option{-ftree-vrp} is active
4120 (default for @option{-O2} and above). It warns about subscripts to arrays
4121 that are always out of bounds. This warning is enabled by @option{-Wall}.
4123 @item -Wno-div-by-zero
4124 @opindex Wno-div-by-zero
4125 @opindex Wdiv-by-zero
4126 Do not warn about compile-time integer division by zero.  Floating-point
4127 division by zero is not warned about, as it can be a legitimate way of
4128 obtaining infinities and NaNs.
4130 @item -Wsystem-headers
4131 @opindex Wsystem-headers
4132 @opindex Wno-system-headers
4133 @cindex warnings from system headers
4134 @cindex system headers, warnings from
4135 Print warning messages for constructs found in system header files.
4136 Warnings from system headers are normally suppressed, on the assumption
4137 that they usually do not indicate real problems and would only make the
4138 compiler output harder to read.  Using this command-line option tells
4139 GCC to emit warnings from system headers as if they occurred in user
4140 code.  However, note that using @option{-Wall} in conjunction with this
4141 option does @emph{not} warn about unknown pragmas in system
4142 headers---for that, @option{-Wunknown-pragmas} must also be used.
4144 @item -Wtrampolines
4145 @opindex Wtrampolines
4146 @opindex Wno-trampolines
4147  Warn about trampolines generated for pointers to nested functions.
4149  A trampoline is a small piece of data or code that is created at run
4150  time on the stack when the address of a nested function is taken, and
4151  is used to call the nested function indirectly.  For some targets, it
4152  is made up of data only and thus requires no special treatment.  But,
4153  for most targets, it is made up of code and thus requires the stack
4154  to be made executable in order for the program to work properly.
4156 @item -Wfloat-equal
4157 @opindex Wfloat-equal
4158 @opindex Wno-float-equal
4159 Warn if floating-point values are used in equality comparisons.
4161 The idea behind this is that sometimes it is convenient (for the
4162 programmer) to consider floating-point values as approximations to
4163 infinitely precise real numbers.  If you are doing this, then you need
4164 to compute (by analyzing the code, or in some other way) the maximum or
4165 likely maximum error that the computation introduces, and allow for it
4166 when performing comparisons (and when producing output, but that's a
4167 different problem).  In particular, instead of testing for equality, you
4168 should check to see whether the two values have ranges that overlap; and
4169 this is done with the relational operators, so equality comparisons are
4170 probably mistaken.
4172 @item -Wtraditional @r{(C and Objective-C only)}
4173 @opindex Wtraditional
4174 @opindex Wno-traditional
4175 Warn about certain constructs that behave differently in traditional and
4176 ISO C@.  Also warn about ISO C constructs that have no traditional C
4177 equivalent, and/or problematic constructs that should be avoided.
4179 @itemize @bullet
4180 @item
4181 Macro parameters that appear within string literals in the macro body.
4182 In traditional C macro replacement takes place within string literals,
4183 but in ISO C it does not.
4185 @item
4186 In traditional C, some preprocessor directives did not exist.
4187 Traditional preprocessors only considered a line to be a directive
4188 if the @samp{#} appeared in column 1 on the line.  Therefore
4189 @option{-Wtraditional} warns about directives that traditional C
4190 understands but ignores because the @samp{#} does not appear as the
4191 first character on the line.  It also suggests you hide directives like
4192 @samp{#pragma} not understood by traditional C by indenting them.  Some
4193 traditional implementations do not recognize @samp{#elif}, so this option
4194 suggests avoiding it altogether.
4196 @item
4197 A function-like macro that appears without arguments.
4199 @item
4200 The unary plus operator.
4202 @item
4203 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4204 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4205 constants.)  Note, these suffixes appear in macros defined in the system
4206 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4207 Use of these macros in user code might normally lead to spurious
4208 warnings, however GCC's integrated preprocessor has enough context to
4209 avoid warning in these cases.
4211 @item
4212 A function declared external in one block and then used after the end of
4213 the block.
4215 @item
4216 A @code{switch} statement has an operand of type @code{long}.
4218 @item
4219 A non-@code{static} function declaration follows a @code{static} one.
4220 This construct is not accepted by some traditional C compilers.
4222 @item
4223 The ISO type of an integer constant has a different width or
4224 signedness from its traditional type.  This warning is only issued if
4225 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4226 typically represent bit patterns, are not warned about.
4228 @item
4229 Usage of ISO string concatenation is detected.
4231 @item
4232 Initialization of automatic aggregates.
4234 @item
4235 Identifier conflicts with labels.  Traditional C lacks a separate
4236 namespace for labels.
4238 @item
4239 Initialization of unions.  If the initializer is zero, the warning is
4240 omitted.  This is done under the assumption that the zero initializer in
4241 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4242 initializer warnings and relies on default initialization to zero in the
4243 traditional C case.
4245 @item
4246 Conversions by prototypes between fixed/floating-point values and vice
4247 versa.  The absence of these prototypes when compiling with traditional
4248 C causes serious problems.  This is a subset of the possible
4249 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4251 @item
4252 Use of ISO C style function definitions.  This warning intentionally is
4253 @emph{not} issued for prototype declarations or variadic functions
4254 because these ISO C features appear in your code when using
4255 libiberty's traditional C compatibility macros, @code{PARAMS} and
4256 @code{VPARAMS}.  This warning is also bypassed for nested functions
4257 because that feature is already a GCC extension and thus not relevant to
4258 traditional C compatibility.
4259 @end itemize
4261 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4262 @opindex Wtraditional-conversion
4263 @opindex Wno-traditional-conversion
4264 Warn if a prototype causes a type conversion that is different from what
4265 would happen to the same argument in the absence of a prototype.  This
4266 includes conversions of fixed point to floating and vice versa, and
4267 conversions changing the width or signedness of a fixed-point argument
4268 except when the same as the default promotion.
4270 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4271 @opindex Wdeclaration-after-statement
4272 @opindex Wno-declaration-after-statement
4273 Warn when a declaration is found after a statement in a block.  This
4274 construct, known from C++, was introduced with ISO C99 and is by default
4275 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4276 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4278 @item -Wundef
4279 @opindex Wundef
4280 @opindex Wno-undef
4281 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4283 @item -Wno-endif-labels
4284 @opindex Wno-endif-labels
4285 @opindex Wendif-labels
4286 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4288 @item -Wshadow
4289 @opindex Wshadow
4290 @opindex Wno-shadow
4291 Warn whenever a local variable or type declaration shadows another variable,
4292 parameter, type, or class member (in C++), or whenever a built-in function
4293 is shadowed. Note that in C++, the compiler warns if a local variable
4294 shadows an explicit typedef, but not if it shadows a struct/class/enum.
4296 @item -Wlarger-than=@var{len}
4297 @opindex Wlarger-than=@var{len}
4298 @opindex Wlarger-than-@var{len}
4299 Warn whenever an object of larger than @var{len} bytes is defined.
4301 @item -Wframe-larger-than=@var{len}
4302 @opindex Wframe-larger-than
4303 Warn if the size of a function frame is larger than @var{len} bytes.
4304 The computation done to determine the stack frame size is approximate
4305 and not conservative.
4306 The actual requirements may be somewhat greater than @var{len}
4307 even if you do not get a warning.  In addition, any space allocated
4308 via @code{alloca}, variable-length arrays, or related constructs
4309 is not included by the compiler when determining
4310 whether or not to issue a warning.
4312 @item -Wno-free-nonheap-object
4313 @opindex Wno-free-nonheap-object
4314 @opindex Wfree-nonheap-object
4315 Do not warn when attempting to free an object that was not allocated
4316 on the heap.
4318 @item -Wstack-usage=@var{len}
4319 @opindex Wstack-usage
4320 Warn if the stack usage of a function might be larger than @var{len} bytes.
4321 The computation done to determine the stack usage is conservative.
4322 Any space allocated via @code{alloca}, variable-length arrays, or related
4323 constructs is included by the compiler when determining whether or not to
4324 issue a warning.
4326 The message is in keeping with the output of @option{-fstack-usage}.
4328 @itemize
4329 @item
4330 If the stack usage is fully static but exceeds the specified amount, it's:
4332 @smallexample
4333   warning: stack usage is 1120 bytes
4334 @end smallexample
4335 @item
4336 If the stack usage is (partly) dynamic but bounded, it's:
4338 @smallexample
4339   warning: stack usage might be 1648 bytes
4340 @end smallexample
4341 @item
4342 If the stack usage is (partly) dynamic and not bounded, it's:
4344 @smallexample
4345   warning: stack usage might be unbounded
4346 @end smallexample
4347 @end itemize
4349 @item -Wunsafe-loop-optimizations
4350 @opindex Wunsafe-loop-optimizations
4351 @opindex Wno-unsafe-loop-optimizations
4352 Warn if the loop cannot be optimized because the compiler cannot
4353 assume anything on the bounds of the loop indices.  With
4354 @option{-funsafe-loop-optimizations} warn if the compiler makes
4355 such assumptions.
4357 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4358 @opindex Wno-pedantic-ms-format
4359 @opindex Wpedantic-ms-format
4360 When used in combination with @option{-Wformat}
4361 and @option{-pedantic} without GNU extensions, this option
4362 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4363 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4364 which depend on the MS runtime.
4366 @item -Wpointer-arith
4367 @opindex Wpointer-arith
4368 @opindex Wno-pointer-arith
4369 Warn about anything that depends on the ``size of'' a function type or
4370 of @code{void}.  GNU C assigns these types a size of 1, for
4371 convenience in calculations with @code{void *} pointers and pointers
4372 to functions.  In C++, warn also when an arithmetic operation involves
4373 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4375 @item -Wtype-limits
4376 @opindex Wtype-limits
4377 @opindex Wno-type-limits
4378 Warn if a comparison is always true or always false due to the limited
4379 range of the data type, but do not warn for constant expressions.  For
4380 example, warn if an unsigned variable is compared against zero with
4381 @samp{<} or @samp{>=}.  This warning is also enabled by
4382 @option{-Wextra}.
4384 @item -Wbad-function-cast @r{(C and Objective-C only)}
4385 @opindex Wbad-function-cast
4386 @opindex Wno-bad-function-cast
4387 Warn whenever a function call is cast to a non-matching type.
4388 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4390 @item -Wc++-compat @r{(C and Objective-C only)}
4391 Warn about ISO C constructs that are outside of the common subset of
4392 ISO C and ISO C++, e.g.@: request for implicit conversion from
4393 @code{void *} to a pointer to non-@code{void} type.
4395 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4396 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4397 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4398 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4399 enabled by @option{-Wall}.
4401 @item -Wcast-qual
4402 @opindex Wcast-qual
4403 @opindex Wno-cast-qual
4404 Warn whenever a pointer is cast so as to remove a type qualifier from
4405 the target type.  For example, warn if a @code{const char *} is cast
4406 to an ordinary @code{char *}.
4408 Also warn when making a cast that introduces a type qualifier in an
4409 unsafe way.  For example, casting @code{char **} to @code{const char **}
4410 is unsafe, as in this example:
4412 @smallexample
4413   /* p is char ** value.  */
4414   const char **q = (const char **) p;
4415   /* Assignment of readonly string to const char * is OK.  */
4416   *q = "string";
4417   /* Now char** pointer points to read-only memory.  */
4418   **p = 'b';
4419 @end smallexample
4421 @item -Wcast-align
4422 @opindex Wcast-align
4423 @opindex Wno-cast-align
4424 Warn whenever a pointer is cast such that the required alignment of the
4425 target is increased.  For example, warn if a @code{char *} is cast to
4426 an @code{int *} on machines where integers can only be accessed at
4427 two- or four-byte boundaries.
4429 @item -Wwrite-strings
4430 @opindex Wwrite-strings
4431 @opindex Wno-write-strings
4432 When compiling C, give string constants the type @code{const
4433 char[@var{length}]} so that copying the address of one into a
4434 non-@code{const} @code{char *} pointer produces a warning.  These
4435 warnings help you find at compile time code that can try to write
4436 into a string constant, but only if you have been very careful about
4437 using @code{const} in declarations and prototypes.  Otherwise, it is
4438 just a nuisance. This is why we did not make @option{-Wall} request
4439 these warnings.
4441 When compiling C++, warn about the deprecated conversion from string
4442 literals to @code{char *}.  This warning is enabled by default for C++
4443 programs.
4445 @item -Wclobbered
4446 @opindex Wclobbered
4447 @opindex Wno-clobbered
4448 Warn for variables that might be changed by @samp{longjmp} or
4449 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4451 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
4452 @opindex Wconditionally-supported
4453 @opindex Wno-conditionally-supported
4454 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
4456 @item -Wconversion
4457 @opindex Wconversion
4458 @opindex Wno-conversion
4459 Warn for implicit conversions that may alter a value. This includes
4460 conversions between real and integer, like @code{abs (x)} when
4461 @code{x} is @code{double}; conversions between signed and unsigned,
4462 like @code{unsigned ui = -1}; and conversions to smaller types, like
4463 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4464 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4465 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4466 conversions between signed and unsigned integers can be disabled by
4467 using @option{-Wno-sign-conversion}.
4469 For C++, also warn for confusing overload resolution for user-defined
4470 conversions; and conversions that never use a type conversion
4471 operator: conversions to @code{void}, the same type, a base class or a
4472 reference to them. Warnings about conversions between signed and
4473 unsigned integers are disabled by default in C++ unless
4474 @option{-Wsign-conversion} is explicitly enabled.
4476 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4477 @opindex Wconversion-null
4478 @opindex Wno-conversion-null
4479 Do not warn for conversions between @code{NULL} and non-pointer
4480 types. @option{-Wconversion-null} is enabled by default.
4482 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4483 @opindex Wzero-as-null-pointer-constant
4484 @opindex Wno-zero-as-null-pointer-constant
4485 Warn when a literal '0' is used as null pointer constant.  This can
4486 be useful to facilitate the conversion to @code{nullptr} in C++11.
4488 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4489 @opindex Wuseless-cast
4490 @opindex Wno-useless-cast
4491 Warn when an expression is casted to its own type.
4493 @item -Wempty-body
4494 @opindex Wempty-body
4495 @opindex Wno-empty-body
4496 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4497 while} statement.  This warning is also enabled by @option{-Wextra}.
4499 @item -Wenum-compare
4500 @opindex Wenum-compare
4501 @opindex Wno-enum-compare
4502 Warn about a comparison between values of different enumerated types.
4503 In C++ enumeral mismatches in conditional expressions are also
4504 diagnosed and the warning is enabled by default.  In C this warning is 
4505 enabled by @option{-Wall}.
4507 @item -Wjump-misses-init @r{(C, Objective-C only)}
4508 @opindex Wjump-misses-init
4509 @opindex Wno-jump-misses-init
4510 Warn if a @code{goto} statement or a @code{switch} statement jumps
4511 forward across the initialization of a variable, or jumps backward to a
4512 label after the variable has been initialized.  This only warns about
4513 variables that are initialized when they are declared.  This warning is
4514 only supported for C and Objective-C; in C++ this sort of branch is an
4515 error in any case.
4517 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4518 can be disabled with the @option{-Wno-jump-misses-init} option.
4520 @item -Wsign-compare
4521 @opindex Wsign-compare
4522 @opindex Wno-sign-compare
4523 @cindex warning for comparison of signed and unsigned values
4524 @cindex comparison of signed and unsigned values, warning
4525 @cindex signed and unsigned values, comparison warning
4526 Warn when a comparison between signed and unsigned values could produce
4527 an incorrect result when the signed value is converted to unsigned.
4528 This warning is also enabled by @option{-Wextra}; to get the other warnings
4529 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4531 @item -Wsign-conversion
4532 @opindex Wsign-conversion
4533 @opindex Wno-sign-conversion
4534 Warn for implicit conversions that may change the sign of an integer
4535 value, like assigning a signed integer expression to an unsigned
4536 integer variable. An explicit cast silences the warning. In C, this
4537 option is enabled also by @option{-Wconversion}.
4539 @item -Wsizeof-pointer-memaccess
4540 @opindex Wsizeof-pointer-memaccess
4541 @opindex Wno-sizeof-pointer-memaccess
4542 Warn for suspicious length parameters to certain string and memory built-in
4543 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4544 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4545 but a pointer, and suggests a possible fix, or about
4546 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4547 @option{-Wall}.
4549 @item -Waddress
4550 @opindex Waddress
4551 @opindex Wno-address
4552 Warn about suspicious uses of memory addresses. These include using
4553 the address of a function in a conditional expression, such as
4554 @code{void func(void); if (func)}, and comparisons against the memory
4555 address of a string literal, such as @code{if (x == "abc")}.  Such
4556 uses typically indicate a programmer error: the address of a function
4557 always evaluates to true, so their use in a conditional usually
4558 indicate that the programmer forgot the parentheses in a function
4559 call; and comparisons against string literals result in unspecified
4560 behavior and are not portable in C, so they usually indicate that the
4561 programmer intended to use @code{strcmp}.  This warning is enabled by
4562 @option{-Wall}.
4564 @item -Wlogical-op
4565 @opindex Wlogical-op
4566 @opindex Wno-logical-op
4567 Warn about suspicious uses of logical operators in expressions.
4568 This includes using logical operators in contexts where a
4569 bit-wise operator is likely to be expected.
4571 @item -Waggregate-return
4572 @opindex Waggregate-return
4573 @opindex Wno-aggregate-return
4574 Warn if any functions that return structures or unions are defined or
4575 called.  (In languages where you can return an array, this also elicits
4576 a warning.)
4578 @item -Wno-aggressive-loop-optimizations
4579 @opindex Wno-aggressive-loop-optimizations
4580 @opindex Waggressive-loop-optimizations
4581 Warn if in a loop with constant number of iterations the compiler detects
4582 undefined behavior in some statement during one or more of the iterations.
4584 @item -Wno-attributes
4585 @opindex Wno-attributes
4586 @opindex Wattributes
4587 Do not warn if an unexpected @code{__attribute__} is used, such as
4588 unrecognized attributes, function attributes applied to variables,
4589 etc.  This does not stop errors for incorrect use of supported
4590 attributes.
4592 @item -Wno-builtin-macro-redefined
4593 @opindex Wno-builtin-macro-redefined
4594 @opindex Wbuiltin-macro-redefined
4595 Do not warn if certain built-in macros are redefined.  This suppresses
4596 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4597 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4599 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4600 @opindex Wstrict-prototypes
4601 @opindex Wno-strict-prototypes
4602 Warn if a function is declared or defined without specifying the
4603 argument types.  (An old-style function definition is permitted without
4604 a warning if preceded by a declaration that specifies the argument
4605 types.)
4607 @item -Wold-style-declaration @r{(C and Objective-C only)}
4608 @opindex Wold-style-declaration
4609 @opindex Wno-old-style-declaration
4610 Warn for obsolescent usages, according to the C Standard, in a
4611 declaration. For example, warn if storage-class specifiers like
4612 @code{static} are not the first things in a declaration.  This warning
4613 is also enabled by @option{-Wextra}.
4615 @item -Wold-style-definition @r{(C and Objective-C only)}
4616 @opindex Wold-style-definition
4617 @opindex Wno-old-style-definition
4618 Warn if an old-style function definition is used.  A warning is given
4619 even if there is a previous prototype.
4621 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4622 @opindex Wmissing-parameter-type
4623 @opindex Wno-missing-parameter-type
4624 A function parameter is declared without a type specifier in K&R-style
4625 functions:
4627 @smallexample
4628 void foo(bar) @{ @}
4629 @end smallexample
4631 This warning is also enabled by @option{-Wextra}.
4633 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4634 @opindex Wmissing-prototypes
4635 @opindex Wno-missing-prototypes
4636 Warn if a global function is defined without a previous prototype
4637 declaration.  This warning is issued even if the definition itself
4638 provides a prototype.  Use this option to detect global functions
4639 that do not have a matching prototype declaration in a header file.
4640 This option is not valid for C++ because all function declarations
4641 provide prototypes and a non-matching declaration will declare an
4642 overload rather than conflict with an earlier declaration.
4643 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4645 @item -Wmissing-declarations
4646 @opindex Wmissing-declarations
4647 @opindex Wno-missing-declarations
4648 Warn if a global function is defined without a previous declaration.
4649 Do so even if the definition itself provides a prototype.
4650 Use this option to detect global functions that are not declared in
4651 header files.  In C, no warnings are issued for functions with previous
4652 non-prototype declarations; use @option{-Wmissing-prototype} to detect
4653 missing prototypes.  In C++, no warnings are issued for function templates,
4654 or for inline functions, or for functions in anonymous namespaces.
4656 @item -Wmissing-field-initializers
4657 @opindex Wmissing-field-initializers
4658 @opindex Wno-missing-field-initializers
4659 @opindex W
4660 @opindex Wextra
4661 @opindex Wno-extra
4662 Warn if a structure's initializer has some fields missing.  For
4663 example, the following code causes such a warning, because
4664 @code{x.h} is implicitly zero:
4666 @smallexample
4667 struct s @{ int f, g, h; @};
4668 struct s x = @{ 3, 4 @};
4669 @end smallexample
4671 This option does not warn about designated initializers, so the following
4672 modification does not trigger a warning:
4674 @smallexample
4675 struct s @{ int f, g, h; @};
4676 struct s x = @{ .f = 3, .g = 4 @};
4677 @end smallexample
4679 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4680 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4682 @item -Wno-multichar
4683 @opindex Wno-multichar
4684 @opindex Wmultichar
4685 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4686 Usually they indicate a typo in the user's code, as they have
4687 implementation-defined values, and should not be used in portable code.
4689 @item -Wnormalized=<none|id|nfc|nfkc>
4690 @opindex Wnormalized=
4691 @cindex NFC
4692 @cindex NFKC
4693 @cindex character set, input normalization
4694 In ISO C and ISO C++, two identifiers are different if they are
4695 different sequences of characters.  However, sometimes when characters
4696 outside the basic ASCII character set are used, you can have two
4697 different character sequences that look the same.  To avoid confusion,
4698 the ISO 10646 standard sets out some @dfn{normalization rules} which
4699 when applied ensure that two sequences that look the same are turned into
4700 the same sequence.  GCC can warn you if you are using identifiers that
4701 have not been normalized; this option controls that warning.
4703 There are four levels of warning supported by GCC@.  The default is
4704 @option{-Wnormalized=nfc}, which warns about any identifier that is
4705 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4706 recommended form for most uses.
4708 Unfortunately, there are some characters allowed in identifiers by
4709 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4710 identifiers.  That is, there's no way to use these symbols in portable
4711 ISO C or C++ and have all your identifiers in NFC@.
4712 @option{-Wnormalized=id} suppresses the warning for these characters.
4713 It is hoped that future versions of the standards involved will correct
4714 this, which is why this option is not the default.
4716 You can switch the warning off for all characters by writing
4717 @option{-Wnormalized=none}.  You should only do this if you
4718 are using some other normalization scheme (like ``D''), because
4719 otherwise you can easily create bugs that are literally impossible to see.
4721 Some characters in ISO 10646 have distinct meanings but look identical
4722 in some fonts or display methodologies, especially once formatting has
4723 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4724 LETTER N'', displays just like a regular @code{n} that has been
4725 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4726 normalization scheme to convert all these into a standard form as
4727 well, and GCC warns if your code is not in NFKC if you use
4728 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4729 about every identifier that contains the letter O because it might be
4730 confused with the digit 0, and so is not the default, but may be
4731 useful as a local coding convention if the programming environment 
4732 cannot be fixed to display these characters distinctly.
4734 @item -Wno-deprecated
4735 @opindex Wno-deprecated
4736 @opindex Wdeprecated
4737 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4739 @item -Wno-deprecated-declarations
4740 @opindex Wno-deprecated-declarations
4741 @opindex Wdeprecated-declarations
4742 Do not warn about uses of functions (@pxref{Function Attributes}),
4743 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4744 Attributes}) marked as deprecated by using the @code{deprecated}
4745 attribute.
4747 @item -Wno-overflow
4748 @opindex Wno-overflow
4749 @opindex Woverflow
4750 Do not warn about compile-time overflow in constant expressions.
4752 @item -Woverride-init @r{(C and Objective-C only)}
4753 @opindex Woverride-init
4754 @opindex Wno-override-init
4755 @opindex W
4756 @opindex Wextra
4757 @opindex Wno-extra
4758 Warn if an initialized field without side effects is overridden when
4759 using designated initializers (@pxref{Designated Inits, , Designated
4760 Initializers}).
4762 This warning is included in @option{-Wextra}.  To get other
4763 @option{-Wextra} warnings without this one, use @option{-Wextra
4764 -Wno-override-init}.
4766 @item -Wpacked
4767 @opindex Wpacked
4768 @opindex Wno-packed
4769 Warn if a structure is given the packed attribute, but the packed
4770 attribute has no effect on the layout or size of the structure.
4771 Such structures may be mis-aligned for little benefit.  For
4772 instance, in this code, the variable @code{f.x} in @code{struct bar}
4773 is misaligned even though @code{struct bar} does not itself
4774 have the packed attribute:
4776 @smallexample
4777 @group
4778 struct foo @{
4779   int x;
4780   char a, b, c, d;
4781 @} __attribute__((packed));
4782 struct bar @{
4783   char z;
4784   struct foo f;
4786 @end group
4787 @end smallexample
4789 @item -Wpacked-bitfield-compat
4790 @opindex Wpacked-bitfield-compat
4791 @opindex Wno-packed-bitfield-compat
4792 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4793 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4794 the change can lead to differences in the structure layout.  GCC
4795 informs you when the offset of such a field has changed in GCC 4.4.
4796 For example there is no longer a 4-bit padding between field @code{a}
4797 and @code{b} in this structure:
4799 @smallexample
4800 struct foo
4802   char a:4;
4803   char b:8;
4804 @} __attribute__ ((packed));
4805 @end smallexample
4807 This warning is enabled by default.  Use
4808 @option{-Wno-packed-bitfield-compat} to disable this warning.
4810 @item -Wpadded
4811 @opindex Wpadded
4812 @opindex Wno-padded
4813 Warn if padding is included in a structure, either to align an element
4814 of the structure or to align the whole structure.  Sometimes when this
4815 happens it is possible to rearrange the fields of the structure to
4816 reduce the padding and so make the structure smaller.
4818 @item -Wredundant-decls
4819 @opindex Wredundant-decls
4820 @opindex Wno-redundant-decls
4821 Warn if anything is declared more than once in the same scope, even in
4822 cases where multiple declaration is valid and changes nothing.
4824 @item -Wnested-externs @r{(C and Objective-C only)}
4825 @opindex Wnested-externs
4826 @opindex Wno-nested-externs
4827 Warn if an @code{extern} declaration is encountered within a function.
4829 @item -Wno-inherited-variadic-ctor
4830 @opindex Winherited-variadic-ctor
4831 @opindex Wno-inherited-variadic-ctor
4832 Suppress warnings about use of C++11 inheriting constructors when the
4833 base class inherited from has a C variadic constructor; the warning is
4834 on by default because the ellipsis is not inherited.
4836 @item -Winline
4837 @opindex Winline
4838 @opindex Wno-inline
4839 Warn if a function that is declared as inline cannot be inlined.
4840 Even with this option, the compiler does not warn about failures to
4841 inline functions declared in system headers.
4843 The compiler uses a variety of heuristics to determine whether or not
4844 to inline a function.  For example, the compiler takes into account
4845 the size of the function being inlined and the amount of inlining
4846 that has already been done in the current function.  Therefore,
4847 seemingly insignificant changes in the source program can cause the
4848 warnings produced by @option{-Winline} to appear or disappear.
4850 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4851 @opindex Wno-invalid-offsetof
4852 @opindex Winvalid-offsetof
4853 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4854 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4855 to a non-POD type is undefined.  In existing C++ implementations,
4856 however, @samp{offsetof} typically gives meaningful results even when
4857 applied to certain kinds of non-POD types (such as a simple
4858 @samp{struct} that fails to be a POD type only by virtue of having a
4859 constructor).  This flag is for users who are aware that they are
4860 writing nonportable code and who have deliberately chosen to ignore the
4861 warning about it.
4863 The restrictions on @samp{offsetof} may be relaxed in a future version
4864 of the C++ standard.
4866 @item -Wno-int-to-pointer-cast
4867 @opindex Wno-int-to-pointer-cast
4868 @opindex Wint-to-pointer-cast
4869 Suppress warnings from casts to pointer type of an integer of a
4870 different size. In C++, casting to a pointer type of smaller size is
4871 an error. @option{Wint-to-pointer-cast} is enabled by default.
4874 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4875 @opindex Wno-pointer-to-int-cast
4876 @opindex Wpointer-to-int-cast
4877 Suppress warnings from casts from a pointer to an integer type of a
4878 different size.
4880 @item -Winvalid-pch
4881 @opindex Winvalid-pch
4882 @opindex Wno-invalid-pch
4883 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4884 the search path but can't be used.
4886 @item -Wlong-long
4887 @opindex Wlong-long
4888 @opindex Wno-long-long
4889 Warn if @samp{long long} type is used.  This is enabled by either
4890 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
4891 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4893 @item -Wvariadic-macros
4894 @opindex Wvariadic-macros
4895 @opindex Wno-variadic-macros
4896 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4897 alternate syntax when in pedantic ISO C99 mode.  This is default.
4898 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4900 @item -Wvarargs
4901 @opindex Wvarargs
4902 @opindex Wno-varargs
4903 Warn upon questionable usage of the macros used to handle variable
4904 arguments like @samp{va_start}.  This is default.  To inhibit the
4905 warning messages, use @option{-Wno-varargs}.
4907 @item -Wvector-operation-performance
4908 @opindex Wvector-operation-performance
4909 @opindex Wno-vector-operation-performance
4910 Warn if vector operation is not implemented via SIMD capabilities of the
4911 architecture.  Mainly useful for the performance tuning.
4912 Vector operation can be implemented @code{piecewise}, which means that the
4913 scalar operation is performed on every vector element; 
4914 @code{in parallel}, which means that the vector operation is implemented
4915 using scalars of wider type, which normally is more performance efficient;
4916 and @code{as a single scalar}, which means that vector fits into a
4917 scalar type.
4919 @item -Wno-virtual-move-assign
4920 @opindex Wvirtual-move-assign
4921 @opindex Wno-virtual-move-assign
4922 Suppress warnings about inheriting from a virtual base with a
4923 non-trivial C++11 move assignment operator.  This is dangerous because
4924 if the virtual base is reachable along more than one path, it will be
4925 moved multiple times, which can mean both objects end up in the
4926 moved-from state.  If the move assignment operator is written to avoid
4927 moving from a moved-from object, this warning can be disabled.
4929 @item -Wvla
4930 @opindex Wvla
4931 @opindex Wno-vla
4932 Warn if variable length array is used in the code.
4933 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
4934 the variable length array.
4936 @item -Wvolatile-register-var
4937 @opindex Wvolatile-register-var
4938 @opindex Wno-volatile-register-var
4939 Warn if a register variable is declared volatile.  The volatile
4940 modifier does not inhibit all optimizations that may eliminate reads
4941 and/or writes to register variables.  This warning is enabled by
4942 @option{-Wall}.
4944 @item -Wdisabled-optimization
4945 @opindex Wdisabled-optimization
4946 @opindex Wno-disabled-optimization
4947 Warn if a requested optimization pass is disabled.  This warning does
4948 not generally indicate that there is anything wrong with your code; it
4949 merely indicates that GCC's optimizers are unable to handle the code
4950 effectively.  Often, the problem is that your code is too big or too
4951 complex; GCC refuses to optimize programs when the optimization
4952 itself is likely to take inordinate amounts of time.
4954 @item -Wpointer-sign @r{(C and Objective-C only)}
4955 @opindex Wpointer-sign
4956 @opindex Wno-pointer-sign
4957 Warn for pointer argument passing or assignment with different signedness.
4958 This option is only supported for C and Objective-C@.  It is implied by
4959 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
4960 @option{-Wno-pointer-sign}.
4962 @item -Wstack-protector
4963 @opindex Wstack-protector
4964 @opindex Wno-stack-protector
4965 This option is only active when @option{-fstack-protector} is active.  It
4966 warns about functions that are not protected against stack smashing.
4968 @item -Wno-mudflap
4969 @opindex Wno-mudflap
4970 Suppress warnings about constructs that cannot be instrumented by
4971 @option{-fmudflap}.
4973 @item -Woverlength-strings
4974 @opindex Woverlength-strings
4975 @opindex Wno-overlength-strings
4976 Warn about string constants that are longer than the ``minimum
4977 maximum'' length specified in the C standard.  Modern compilers
4978 generally allow string constants that are much longer than the
4979 standard's minimum limit, but very portable programs should avoid
4980 using longer strings.
4982 The limit applies @emph{after} string constant concatenation, and does
4983 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4984 C99, it was raised to 4095.  C++98 does not specify a normative
4985 minimum maximum, so we do not diagnose overlength strings in C++@.
4987 This option is implied by @option{-Wpedantic}, and can be disabled with
4988 @option{-Wno-overlength-strings}.
4990 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4991 @opindex Wunsuffixed-float-constants
4993 Issue a warning for any floating constant that does not have
4994 a suffix.  When used together with @option{-Wsystem-headers} it
4995 warns about such constants in system header files.  This can be useful
4996 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4997 from the decimal floating-point extension to C99.
4998 @end table
5000 @node Debugging Options
5001 @section Options for Debugging Your Program or GCC
5002 @cindex options, debugging
5003 @cindex debugging information options
5005 GCC has various special options that are used for debugging
5006 either your program or GCC:
5008 @table @gcctabopt
5009 @item -g
5010 @opindex g
5011 Produce debugging information in the operating system's native format
5012 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
5013 information.
5015 On most systems that use stabs format, @option{-g} enables use of extra
5016 debugging information that only GDB can use; this extra information
5017 makes debugging work better in GDB but probably makes other debuggers
5018 crash or
5019 refuse to read the program.  If you want to control for certain whether
5020 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5021 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5023 GCC allows you to use @option{-g} with
5024 @option{-O}.  The shortcuts taken by optimized code may occasionally
5025 produce surprising results: some variables you declared may not exist
5026 at all; flow of control may briefly move where you did not expect it;
5027 some statements may not be executed because they compute constant
5028 results or their values are already at hand; some statements may
5029 execute in different places because they have been moved out of loops.
5031 Nevertheless it proves possible to debug optimized output.  This makes
5032 it reasonable to use the optimizer for programs that might have bugs.
5034 The following options are useful when GCC is generated with the
5035 capability for more than one debugging format.
5037 @item -gsplit-dwarf
5038 @opindex gsplit-dwarf
5039 Separate as much dwarf debugging information as possible into a
5040 separate output file with the extension .dwo.  This option allows
5041 the build system to avoid linking files with debug information.  To
5042 be useful, this option requires a debugger capable of reading .dwo
5043 files.
5045 @item -ggdb
5046 @opindex ggdb
5047 Produce debugging information for use by GDB@.  This means to use the
5048 most expressive format available (DWARF 2, stabs, or the native format
5049 if neither of those are supported), including GDB extensions if at all
5050 possible.
5052 @item -gpubnames
5053 @opindex gpubnames
5054 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
5056 @item -gstabs
5057 @opindex gstabs
5058 Produce debugging information in stabs format (if that is supported),
5059 without GDB extensions.  This is the format used by DBX on most BSD
5060 systems.  On MIPS, Alpha and System V Release 4 systems this option
5061 produces stabs debugging output that is not understood by DBX or SDB@.
5062 On System V Release 4 systems this option requires the GNU assembler.
5064 @item -feliminate-unused-debug-symbols
5065 @opindex feliminate-unused-debug-symbols
5066 Produce debugging information in stabs format (if that is supported),
5067 for only symbols that are actually used.
5069 @item -femit-class-debug-always
5070 Instead of emitting debugging information for a C++ class in only one
5071 object file, emit it in all object files using the class.  This option
5072 should be used only with debuggers that are unable to handle the way GCC
5073 normally emits debugging information for classes because using this
5074 option increases the size of debugging information by as much as a
5075 factor of two.
5077 @item -fdebug-types-section
5078 @opindex fdebug-types-section
5079 @opindex fno-debug-types-section
5080 When using DWARF Version 4 or higher, type DIEs can be put into
5081 their own @code{.debug_types} section instead of making them part of the
5082 @code{.debug_info} section.  It is more efficient to put them in a separate
5083 comdat sections since the linker can then remove duplicates.
5084 But not all DWARF consumers support @code{.debug_types} sections yet
5085 and on some objects @code{.debug_types} produces larger instead of smaller
5086 debugging information.
5088 @item -gstabs+
5089 @opindex gstabs+
5090 Produce debugging information in stabs format (if that is supported),
5091 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5092 use of these extensions is likely to make other debuggers crash or
5093 refuse to read the program.
5095 @item -gcoff
5096 @opindex gcoff
5097 Produce debugging information in COFF format (if that is supported).
5098 This is the format used by SDB on most System V systems prior to
5099 System V Release 4.
5101 @item -gxcoff
5102 @opindex gxcoff
5103 Produce debugging information in XCOFF format (if that is supported).
5104 This is the format used by the DBX debugger on IBM RS/6000 systems.
5106 @item -gxcoff+
5107 @opindex gxcoff+
5108 Produce debugging information in XCOFF format (if that is supported),
5109 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5110 use of these extensions is likely to make other debuggers crash or
5111 refuse to read the program, and may cause assemblers other than the GNU
5112 assembler (GAS) to fail with an error.
5114 @item -gdwarf-@var{version}
5115 @opindex gdwarf-@var{version}
5116 Produce debugging information in DWARF format (if that is supported).
5117 The value of @var{version} may be either 2, 3 or 4; the default version
5118 for most targets is 4.
5120 Note that with DWARF Version 2, some ports require and always
5121 use some non-conflicting DWARF 3 extensions in the unwind tables.
5123 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5124 for maximum benefit.
5126 @item -grecord-gcc-switches
5127 @opindex grecord-gcc-switches
5128 This switch causes the command-line options used to invoke the
5129 compiler that may affect code generation to be appended to the
5130 DW_AT_producer attribute in DWARF debugging information.  The options
5131 are concatenated with spaces separating them from each other and from
5132 the compiler version.  See also @option{-frecord-gcc-switches} for another
5133 way of storing compiler options into the object file.  This is the default.
5135 @item -gno-record-gcc-switches
5136 @opindex gno-record-gcc-switches
5137 Disallow appending command-line options to the DW_AT_producer attribute
5138 in DWARF debugging information.
5140 @item -gstrict-dwarf
5141 @opindex gstrict-dwarf
5142 Disallow using extensions of later DWARF standard version than selected
5143 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
5144 DWARF extensions from later standard versions is allowed.
5146 @item -gno-strict-dwarf
5147 @opindex gno-strict-dwarf
5148 Allow using extensions of later DWARF standard version than selected with
5149 @option{-gdwarf-@var{version}}.
5151 @item -gvms
5152 @opindex gvms
5153 Produce debugging information in Alpha/VMS debug format (if that is
5154 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5156 @item -g@var{level}
5157 @itemx -ggdb@var{level}
5158 @itemx -gstabs@var{level}
5159 @itemx -gcoff@var{level}
5160 @itemx -gxcoff@var{level}
5161 @itemx -gvms@var{level}
5162 Request debugging information and also use @var{level} to specify how
5163 much information.  The default level is 2.
5165 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5166 @option{-g}.
5168 Level 1 produces minimal information, enough for making backtraces in
5169 parts of the program that you don't plan to debug.  This includes
5170 descriptions of functions and external variables, but no information
5171 about local variables and no line numbers.
5173 Level 3 includes extra information, such as all the macro definitions
5174 present in the program.  Some debuggers support macro expansion when
5175 you use @option{-g3}.
5177 @option{-gdwarf-2} does not accept a concatenated debug level, because
5178 GCC used to support an option @option{-gdwarf} that meant to generate
5179 debug information in version 1 of the DWARF format (which is very
5180 different from version 2), and it would have been too confusing.  That
5181 debug format is long obsolete, but the option cannot be changed now.
5182 Instead use an additional @option{-g@var{level}} option to change the
5183 debug level for DWARF.
5185 @item -gtoggle
5186 @opindex gtoggle
5187 Turn off generation of debug info, if leaving out this option
5188 generates it, or turn it on at level 2 otherwise.  The position of this
5189 argument in the command line does not matter; it takes effect after all
5190 other options are processed, and it does so only once, no matter how
5191 many times it is given.  This is mainly intended to be used with
5192 @option{-fcompare-debug}.
5194 @item -fsanitize=address
5195 Enable AddressSanitizer, a fast memory error detector.
5196 Memory access instructions will be instrumented to detect
5197 out-of-bounds and use-after-free bugs.
5198 See @uref{http://code.google.com/p/address-sanitizer/} for more details.
5200 @item -fsanitize=thread
5201 Enable ThreadSanitizer, a fast data race detector.
5202 Memory access instructions will be instrumented to detect
5203 data race bugs.
5204 See @uref{http://code.google.com/p/data-race-test/wiki/ThreadSanitizer} for more details.
5206 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5207 @opindex fdump-final-insns
5208 Dump the final internal representation (RTL) to @var{file}.  If the
5209 optional argument is omitted (or if @var{file} is @code{.}), the name
5210 of the dump file is determined by appending @code{.gkd} to the
5211 compilation output file name.
5213 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5214 @opindex fcompare-debug
5215 @opindex fno-compare-debug
5216 If no error occurs during compilation, run the compiler a second time,
5217 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5218 passed to the second compilation.  Dump the final internal
5219 representation in both compilations, and print an error if they differ.
5221 If the equal sign is omitted, the default @option{-gtoggle} is used.
5223 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5224 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5225 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5226 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5227 is used.
5229 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5230 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5231 of the final representation and the second compilation, preventing even
5232 @env{GCC_COMPARE_DEBUG} from taking effect.
5234 To verify full coverage during @option{-fcompare-debug} testing, set
5235 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5236 which GCC rejects as an invalid option in any actual compilation
5237 (rather than preprocessing, assembly or linking).  To get just a
5238 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5239 not overridden} will do.
5241 @item -fcompare-debug-second
5242 @opindex fcompare-debug-second
5243 This option is implicitly passed to the compiler for the second
5244 compilation requested by @option{-fcompare-debug}, along with options to
5245 silence warnings, and omitting other options that would cause
5246 side-effect compiler outputs to files or to the standard output.  Dump
5247 files and preserved temporary files are renamed so as to contain the
5248 @code{.gk} additional extension during the second compilation, to avoid
5249 overwriting those generated by the first.
5251 When this option is passed to the compiler driver, it causes the
5252 @emph{first} compilation to be skipped, which makes it useful for little
5253 other than debugging the compiler proper.
5255 @item -feliminate-dwarf2-dups
5256 @opindex feliminate-dwarf2-dups
5257 Compress DWARF 2 debugging information by eliminating duplicated
5258 information about each symbol.  This option only makes sense when
5259 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5261 @item -femit-struct-debug-baseonly
5262 Emit debug information for struct-like types
5263 only when the base name of the compilation source file
5264 matches the base name of file in which the struct is defined.
5266 This option substantially reduces the size of debugging information,
5267 but at significant potential loss in type information to the debugger.
5268 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5269 See @option{-femit-struct-debug-detailed} for more detailed control.
5271 This option works only with DWARF 2.
5273 @item -femit-struct-debug-reduced
5274 Emit debug information for struct-like types
5275 only when the base name of the compilation source file
5276 matches the base name of file in which the type is defined,
5277 unless the struct is a template or defined in a system header.
5279 This option significantly reduces the size of debugging information,
5280 with some potential loss in type information to the debugger.
5281 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5282 See @option{-femit-struct-debug-detailed} for more detailed control.
5284 This option works only with DWARF 2.
5286 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5287 Specify the struct-like types
5288 for which the compiler generates debug information.
5289 The intent is to reduce duplicate struct debug information
5290 between different object files within the same program.
5292 This option is a detailed version of
5293 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5294 which serves for most needs.
5296 A specification has the syntax@*
5297 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5299 The optional first word limits the specification to
5300 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5301 A struct type is used directly when it is the type of a variable, member.
5302 Indirect uses arise through pointers to structs.
5303 That is, when use of an incomplete struct is valid, the use is indirect.
5304 An example is
5305 @samp{struct one direct; struct two * indirect;}.
5307 The optional second word limits the specification to
5308 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5309 Generic structs are a bit complicated to explain.
5310 For C++, these are non-explicit specializations of template classes,
5311 or non-template classes within the above.
5312 Other programming languages have generics,
5313 but @option{-femit-struct-debug-detailed} does not yet implement them.
5315 The third word specifies the source files for those
5316 structs for which the compiler should emit debug information.
5317 The values @samp{none} and @samp{any} have the normal meaning.
5318 The value @samp{base} means that
5319 the base of name of the file in which the type declaration appears
5320 must match the base of the name of the main compilation file.
5321 In practice, this means that when compiling @file{foo.c}, debug information
5322 is generated for types declared in that file and @file{foo.h},
5323 but not other header files.
5324 The value @samp{sys} means those types satisfying @samp{base}
5325 or declared in system or compiler headers.
5327 You may need to experiment to determine the best settings for your application.
5329 The default is @option{-femit-struct-debug-detailed=all}.
5331 This option works only with DWARF 2.
5333 @item -fno-merge-debug-strings
5334 @opindex fmerge-debug-strings
5335 @opindex fno-merge-debug-strings
5336 Direct the linker to not merge together strings in the debugging
5337 information that are identical in different object files.  Merging is
5338 not supported by all assemblers or linkers.  Merging decreases the size
5339 of the debug information in the output file at the cost of increasing
5340 link processing time.  Merging is enabled by default.
5342 @item -fdebug-prefix-map=@var{old}=@var{new}
5343 @opindex fdebug-prefix-map
5344 When compiling files in directory @file{@var{old}}, record debugging
5345 information describing them as in @file{@var{new}} instead.
5347 @item -fno-dwarf2-cfi-asm
5348 @opindex fdwarf2-cfi-asm
5349 @opindex fno-dwarf2-cfi-asm
5350 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5351 instead of using GAS @code{.cfi_*} directives.
5353 @cindex @command{prof}
5354 @item -p
5355 @opindex p
5356 Generate extra code to write profile information suitable for the
5357 analysis program @command{prof}.  You must use this option when compiling
5358 the source files you want data about, and you must also use it when
5359 linking.
5361 @cindex @command{gprof}
5362 @item -pg
5363 @opindex pg
5364 Generate extra code to write profile information suitable for the
5365 analysis program @command{gprof}.  You must use this option when compiling
5366 the source files you want data about, and you must also use it when
5367 linking.
5369 @item -Q
5370 @opindex Q
5371 Makes the compiler print out each function name as it is compiled, and
5372 print some statistics about each pass when it finishes.
5374 @item -ftime-report
5375 @opindex ftime-report
5376 Makes the compiler print some statistics about the time consumed by each
5377 pass when it finishes.
5379 @item -fmem-report
5380 @opindex fmem-report
5381 Makes the compiler print some statistics about permanent memory
5382 allocation when it finishes.
5384 @item -fmem-report-wpa
5385 @opindex fmem-report-wpa
5386 Makes the compiler print some statistics about permanent memory
5387 allocation for the WPA phase only.
5389 @item -fpre-ipa-mem-report
5390 @opindex fpre-ipa-mem-report
5391 @item -fpost-ipa-mem-report
5392 @opindex fpost-ipa-mem-report
5393 Makes the compiler print some statistics about permanent memory
5394 allocation before or after interprocedural optimization.
5396 @item -fprofile-report
5397 @opindex fprofile-report
5398 Makes the compiler print some statistics about consistency of the
5399 (estimated) profile and effect of individual passes.
5401 @item -fstack-usage
5402 @opindex fstack-usage
5403 Makes the compiler output stack usage information for the program, on a
5404 per-function basis.  The filename for the dump is made by appending
5405 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5406 the output file, if explicitly specified and it is not an executable,
5407 otherwise it is the basename of the source file.  An entry is made up
5408 of three fields:
5410 @itemize
5411 @item
5412 The name of the function.
5413 @item
5414 A number of bytes.
5415 @item
5416 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5417 @end itemize
5419 The qualifier @code{static} means that the function manipulates the stack
5420 statically: a fixed number of bytes are allocated for the frame on function
5421 entry and released on function exit; no stack adjustments are otherwise made
5422 in the function.  The second field is this fixed number of bytes.
5424 The qualifier @code{dynamic} means that the function manipulates the stack
5425 dynamically: in addition to the static allocation described above, stack
5426 adjustments are made in the body of the function, for example to push/pop
5427 arguments around function calls.  If the qualifier @code{bounded} is also
5428 present, the amount of these adjustments is bounded at compile time and
5429 the second field is an upper bound of the total amount of stack used by
5430 the function.  If it is not present, the amount of these adjustments is
5431 not bounded at compile time and the second field only represents the
5432 bounded part.
5434 @item -fprofile-arcs
5435 @opindex fprofile-arcs
5436 Add code so that program flow @dfn{arcs} are instrumented.  During
5437 execution the program records how many times each branch and call is
5438 executed and how many times it is taken or returns.  When the compiled
5439 program exits it saves this data to a file called
5440 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5441 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5442 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5443 @var{auxname} is generated from the name of the output file, if
5444 explicitly specified and it is not the final executable, otherwise it is
5445 the basename of the source file.  In both cases any suffix is removed
5446 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5447 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5448 @xref{Cross-profiling}.
5450 @cindex @command{gcov}
5451 @item --coverage
5452 @opindex coverage
5454 This option is used to compile and link code instrumented for coverage
5455 analysis.  The option is a synonym for @option{-fprofile-arcs}
5456 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5457 linking).  See the documentation for those options for more details.
5459 @itemize
5461 @item
5462 Compile the source files with @option{-fprofile-arcs} plus optimization
5463 and code generation options.  For test coverage analysis, use the
5464 additional @option{-ftest-coverage} option.  You do not need to profile
5465 every source file in a program.
5467 @item
5468 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5469 (the latter implies the former).
5471 @item
5472 Run the program on a representative workload to generate the arc profile
5473 information.  This may be repeated any number of times.  You can run
5474 concurrent instances of your program, and provided that the file system
5475 supports locking, the data files will be correctly updated.  Also
5476 @code{fork} calls are detected and correctly handled (double counting
5477 will not happen).
5479 @item
5480 For profile-directed optimizations, compile the source files again with
5481 the same optimization and code generation options plus
5482 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5483 Control Optimization}).
5485 @item
5486 For test coverage analysis, use @command{gcov} to produce human readable
5487 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5488 @command{gcov} documentation for further information.
5490 @end itemize
5492 With @option{-fprofile-arcs}, for each function of your program GCC
5493 creates a program flow graph, then finds a spanning tree for the graph.
5494 Only arcs that are not on the spanning tree have to be instrumented: the
5495 compiler adds code to count the number of times that these arcs are
5496 executed.  When an arc is the only exit or only entrance to a block, the
5497 instrumentation code can be added to the block; otherwise, a new basic
5498 block must be created to hold the instrumentation code.
5500 @need 2000
5501 @item -ftest-coverage
5502 @opindex ftest-coverage
5503 Produce a notes file that the @command{gcov} code-coverage utility
5504 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5505 show program coverage.  Each source file's note file is called
5506 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5507 above for a description of @var{auxname} and instructions on how to
5508 generate test coverage data.  Coverage data matches the source files
5509 more closely if you do not optimize.
5511 @item -fdbg-cnt-list
5512 @opindex fdbg-cnt-list
5513 Print the name and the counter upper bound for all debug counters.
5516 @item -fdbg-cnt=@var{counter-value-list}
5517 @opindex fdbg-cnt
5518 Set the internal debug counter upper bound.  @var{counter-value-list}
5519 is a comma-separated list of @var{name}:@var{value} pairs
5520 which sets the upper bound of each debug counter @var{name} to @var{value}.
5521 All debug counters have the initial upper bound of @code{UINT_MAX};
5522 thus @code{dbg_cnt()} returns true always unless the upper bound
5523 is set by this option.
5524 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5525 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5527 @item -fenable-@var{kind}-@var{pass}
5528 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5529 @opindex fdisable-
5530 @opindex fenable-
5532 This is a set of options that are used to explicitly disable/enable
5533 optimization passes.  These options are intended for use for debugging GCC.
5534 Compiler users should use regular options for enabling/disabling
5535 passes instead.
5537 @table @gcctabopt
5539 @item -fdisable-ipa-@var{pass}
5540 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5541 statically invoked in the compiler multiple times, the pass name should be
5542 appended with a sequential number starting from 1.
5544 @item -fdisable-rtl-@var{pass}
5545 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5546 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5547 statically invoked in the compiler multiple times, the pass name should be
5548 appended with a sequential number starting from 1.  @var{range-list} is a 
5549 comma-separated list of function ranges or assembler names.  Each range is a number
5550 pair separated by a colon.  The range is inclusive in both ends.  If the range
5551 is trivial, the number pair can be simplified as a single number.  If the
5552 function's call graph node's @var{uid} falls within one of the specified ranges,
5553 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5554 function header of a dump file, and the pass names can be dumped by using
5555 option @option{-fdump-passes}.
5557 @item -fdisable-tree-@var{pass}
5558 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5559 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5560 option arguments.
5562 @item -fenable-ipa-@var{pass}
5563 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5564 statically invoked in the compiler multiple times, the pass name should be
5565 appended with a sequential number starting from 1.
5567 @item -fenable-rtl-@var{pass}
5568 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5569 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5570 description and examples.
5572 @item -fenable-tree-@var{pass}
5573 @itemx -fenable-tree-@var{pass}=@var{range-list}
5574 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5575 of option arguments.
5577 @end table
5579 Here are some examples showing uses of these options.
5581 @smallexample
5583 # disable ccp1 for all functions
5584    -fdisable-tree-ccp1
5585 # disable complete unroll for function whose cgraph node uid is 1
5586    -fenable-tree-cunroll=1
5587 # disable gcse2 for functions at the following ranges [1,1],
5588 # [300,400], and [400,1000]
5589 # disable gcse2 for functions foo and foo2
5590    -fdisable-rtl-gcse2=foo,foo2
5591 # disable early inlining
5592    -fdisable-tree-einline
5593 # disable ipa inlining
5594    -fdisable-ipa-inline
5595 # enable tree full unroll
5596    -fenable-tree-unroll
5598 @end smallexample
5600 @item -d@var{letters}
5601 @itemx -fdump-rtl-@var{pass}
5602 @itemx -fdump-rtl-@var{pass}=@var{filename}
5603 @opindex d
5604 Says to make debugging dumps during compilation at times specified by
5605 @var{letters}.  This is used for debugging the RTL-based passes of the
5606 compiler.  The file names for most of the dumps are made by appending
5607 a pass number and a word to the @var{dumpname}, and the files are
5608 created in the directory of the output file. In case of
5609 @option{=@var{filename}} option, the dump is output on the given file
5610 instead of the pass numbered dump files. Note that the pass number is
5611 computed statically as passes get registered into the pass manager.
5612 Thus the numbering is not related to the dynamic order of execution of
5613 passes.  In particular, a pass installed by a plugin could have a
5614 number over 200 even if it executed quite early.  @var{dumpname} is
5615 generated from the name of the output file, if explicitly specified
5616 and it is not an executable, otherwise it is the basename of the
5617 source file. These switches may have different effects when
5618 @option{-E} is used for preprocessing.
5620 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5621 @option{-d} option @var{letters}.  Here are the possible
5622 letters for use in @var{pass} and @var{letters}, and their meanings:
5624 @table @gcctabopt
5626 @item -fdump-rtl-alignments
5627 @opindex fdump-rtl-alignments
5628 Dump after branch alignments have been computed.
5630 @item -fdump-rtl-asmcons
5631 @opindex fdump-rtl-asmcons
5632 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5634 @item -fdump-rtl-auto_inc_dec
5635 @opindex fdump-rtl-auto_inc_dec
5636 Dump after auto-inc-dec discovery.  This pass is only run on
5637 architectures that have auto inc or auto dec instructions.
5639 @item -fdump-rtl-barriers
5640 @opindex fdump-rtl-barriers
5641 Dump after cleaning up the barrier instructions.
5643 @item -fdump-rtl-bbpart
5644 @opindex fdump-rtl-bbpart
5645 Dump after partitioning hot and cold basic blocks.
5647 @item -fdump-rtl-bbro
5648 @opindex fdump-rtl-bbro
5649 Dump after block reordering.
5651 @item -fdump-rtl-btl1
5652 @itemx -fdump-rtl-btl2
5653 @opindex fdump-rtl-btl2
5654 @opindex fdump-rtl-btl2
5655 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5656 after the two branch
5657 target load optimization passes.
5659 @item -fdump-rtl-bypass
5660 @opindex fdump-rtl-bypass
5661 Dump after jump bypassing and control flow optimizations.
5663 @item -fdump-rtl-combine
5664 @opindex fdump-rtl-combine
5665 Dump after the RTL instruction combination pass.
5667 @item -fdump-rtl-compgotos
5668 @opindex fdump-rtl-compgotos
5669 Dump after duplicating the computed gotos.
5671 @item -fdump-rtl-ce1
5672 @itemx -fdump-rtl-ce2
5673 @itemx -fdump-rtl-ce3
5674 @opindex fdump-rtl-ce1
5675 @opindex fdump-rtl-ce2
5676 @opindex fdump-rtl-ce3
5677 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5678 @option{-fdump-rtl-ce3} enable dumping after the three
5679 if conversion passes.
5681 @item -fdump-rtl-cprop_hardreg
5682 @opindex fdump-rtl-cprop_hardreg
5683 Dump after hard register copy propagation.
5685 @item -fdump-rtl-csa
5686 @opindex fdump-rtl-csa
5687 Dump after combining stack adjustments.
5689 @item -fdump-rtl-cse1
5690 @itemx -fdump-rtl-cse2
5691 @opindex fdump-rtl-cse1
5692 @opindex fdump-rtl-cse2
5693 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5694 the two common subexpression elimination passes.
5696 @item -fdump-rtl-dce
5697 @opindex fdump-rtl-dce
5698 Dump after the standalone dead code elimination passes.
5700 @item -fdump-rtl-dbr
5701 @opindex fdump-rtl-dbr
5702 Dump after delayed branch scheduling.
5704 @item -fdump-rtl-dce1
5705 @itemx -fdump-rtl-dce2
5706 @opindex fdump-rtl-dce1
5707 @opindex fdump-rtl-dce2
5708 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5709 the two dead store elimination passes.
5711 @item -fdump-rtl-eh
5712 @opindex fdump-rtl-eh
5713 Dump after finalization of EH handling code.
5715 @item -fdump-rtl-eh_ranges
5716 @opindex fdump-rtl-eh_ranges
5717 Dump after conversion of EH handling range regions.
5719 @item -fdump-rtl-expand
5720 @opindex fdump-rtl-expand
5721 Dump after RTL generation.
5723 @item -fdump-rtl-fwprop1
5724 @itemx -fdump-rtl-fwprop2
5725 @opindex fdump-rtl-fwprop1
5726 @opindex fdump-rtl-fwprop2
5727 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5728 dumping after the two forward propagation passes.
5730 @item -fdump-rtl-gcse1
5731 @itemx -fdump-rtl-gcse2
5732 @opindex fdump-rtl-gcse1
5733 @opindex fdump-rtl-gcse2
5734 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5735 after global common subexpression elimination.
5737 @item -fdump-rtl-init-regs
5738 @opindex fdump-rtl-init-regs
5739 Dump after the initialization of the registers.
5741 @item -fdump-rtl-initvals
5742 @opindex fdump-rtl-initvals
5743 Dump after the computation of the initial value sets.
5745 @item -fdump-rtl-into_cfglayout
5746 @opindex fdump-rtl-into_cfglayout
5747 Dump after converting to cfglayout mode.
5749 @item -fdump-rtl-ira
5750 @opindex fdump-rtl-ira
5751 Dump after iterated register allocation.
5753 @item -fdump-rtl-jump
5754 @opindex fdump-rtl-jump
5755 Dump after the second jump optimization.
5757 @item -fdump-rtl-loop2
5758 @opindex fdump-rtl-loop2
5759 @option{-fdump-rtl-loop2} enables dumping after the rtl
5760 loop optimization passes.
5762 @item -fdump-rtl-mach
5763 @opindex fdump-rtl-mach
5764 Dump after performing the machine dependent reorganization pass, if that
5765 pass exists.
5767 @item -fdump-rtl-mode_sw
5768 @opindex fdump-rtl-mode_sw
5769 Dump after removing redundant mode switches.
5771 @item -fdump-rtl-rnreg
5772 @opindex fdump-rtl-rnreg
5773 Dump after register renumbering.
5775 @item -fdump-rtl-outof_cfglayout
5776 @opindex fdump-rtl-outof_cfglayout
5777 Dump after converting from cfglayout mode.
5779 @item -fdump-rtl-peephole2
5780 @opindex fdump-rtl-peephole2
5781 Dump after the peephole pass.
5783 @item -fdump-rtl-postreload
5784 @opindex fdump-rtl-postreload
5785 Dump after post-reload optimizations.
5787 @item -fdump-rtl-pro_and_epilogue
5788 @opindex fdump-rtl-pro_and_epilogue
5789 Dump after generating the function prologues and epilogues.
5791 @item -fdump-rtl-regmove
5792 @opindex fdump-rtl-regmove
5793 Dump after the register move pass.
5795 @item -fdump-rtl-sched1
5796 @itemx -fdump-rtl-sched2
5797 @opindex fdump-rtl-sched1
5798 @opindex fdump-rtl-sched2
5799 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5800 after the basic block scheduling passes.
5802 @item -fdump-rtl-see
5803 @opindex fdump-rtl-see
5804 Dump after sign extension elimination.
5806 @item -fdump-rtl-seqabstr
5807 @opindex fdump-rtl-seqabstr
5808 Dump after common sequence discovery.
5810 @item -fdump-rtl-shorten
5811 @opindex fdump-rtl-shorten
5812 Dump after shortening branches.
5814 @item -fdump-rtl-sibling
5815 @opindex fdump-rtl-sibling
5816 Dump after sibling call optimizations.
5818 @item -fdump-rtl-split1
5819 @itemx -fdump-rtl-split2
5820 @itemx -fdump-rtl-split3
5821 @itemx -fdump-rtl-split4
5822 @itemx -fdump-rtl-split5
5823 @opindex fdump-rtl-split1
5824 @opindex fdump-rtl-split2
5825 @opindex fdump-rtl-split3
5826 @opindex fdump-rtl-split4
5827 @opindex fdump-rtl-split5
5828 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5829 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5830 @option{-fdump-rtl-split5} enable dumping after five rounds of
5831 instruction splitting.
5833 @item -fdump-rtl-sms
5834 @opindex fdump-rtl-sms
5835 Dump after modulo scheduling.  This pass is only run on some
5836 architectures.
5838 @item -fdump-rtl-stack
5839 @opindex fdump-rtl-stack
5840 Dump after conversion from GCC's ``flat register file'' registers to the
5841 x87's stack-like registers.  This pass is only run on x86 variants.
5843 @item -fdump-rtl-subreg1
5844 @itemx -fdump-rtl-subreg2
5845 @opindex fdump-rtl-subreg1
5846 @opindex fdump-rtl-subreg2
5847 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5848 the two subreg expansion passes.
5850 @item -fdump-rtl-unshare
5851 @opindex fdump-rtl-unshare
5852 Dump after all rtl has been unshared.
5854 @item -fdump-rtl-vartrack
5855 @opindex fdump-rtl-vartrack
5856 Dump after variable tracking.
5858 @item -fdump-rtl-vregs
5859 @opindex fdump-rtl-vregs
5860 Dump after converting virtual registers to hard registers.
5862 @item -fdump-rtl-web
5863 @opindex fdump-rtl-web
5864 Dump after live range splitting.
5866 @item -fdump-rtl-regclass
5867 @itemx -fdump-rtl-subregs_of_mode_init
5868 @itemx -fdump-rtl-subregs_of_mode_finish
5869 @itemx -fdump-rtl-dfinit
5870 @itemx -fdump-rtl-dfinish
5871 @opindex fdump-rtl-regclass
5872 @opindex fdump-rtl-subregs_of_mode_init
5873 @opindex fdump-rtl-subregs_of_mode_finish
5874 @opindex fdump-rtl-dfinit
5875 @opindex fdump-rtl-dfinish
5876 These dumps are defined but always produce empty files.
5878 @item -da
5879 @itemx -fdump-rtl-all
5880 @opindex da
5881 @opindex fdump-rtl-all
5882 Produce all the dumps listed above.
5884 @item -dA
5885 @opindex dA
5886 Annotate the assembler output with miscellaneous debugging information.
5888 @item -dD
5889 @opindex dD
5890 Dump all macro definitions, at the end of preprocessing, in addition to
5891 normal output.
5893 @item -dH
5894 @opindex dH
5895 Produce a core dump whenever an error occurs.
5897 @item -dp
5898 @opindex dp
5899 Annotate the assembler output with a comment indicating which
5900 pattern and alternative is used.  The length of each instruction is
5901 also printed.
5903 @item -dP
5904 @opindex dP
5905 Dump the RTL in the assembler output as a comment before each instruction.
5906 Also turns on @option{-dp} annotation.
5908 @item -dx
5909 @opindex dx
5910 Just generate RTL for a function instead of compiling it.  Usually used
5911 with @option{-fdump-rtl-expand}.
5912 @end table
5914 @item -fdump-noaddr
5915 @opindex fdump-noaddr
5916 When doing debugging dumps, suppress address output.  This makes it more
5917 feasible to use diff on debugging dumps for compiler invocations with
5918 different compiler binaries and/or different
5919 text / bss / data / heap / stack / dso start locations.
5921 @item -fdump-unnumbered
5922 @opindex fdump-unnumbered
5923 When doing debugging dumps, suppress instruction numbers and address output.
5924 This makes it more feasible to use diff on debugging dumps for compiler
5925 invocations with different options, in particular with and without
5926 @option{-g}.
5928 @item -fdump-unnumbered-links
5929 @opindex fdump-unnumbered-links
5930 When doing debugging dumps (see @option{-d} option above), suppress
5931 instruction numbers for the links to the previous and next instructions
5932 in a sequence.
5934 @item -fdump-translation-unit @r{(C++ only)}
5935 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5936 @opindex fdump-translation-unit
5937 Dump a representation of the tree structure for the entire translation
5938 unit to a file.  The file name is made by appending @file{.tu} to the
5939 source file name, and the file is created in the same directory as the
5940 output file.  If the @samp{-@var{options}} form is used, @var{options}
5941 controls the details of the dump as described for the
5942 @option{-fdump-tree} options.
5944 @item -fdump-class-hierarchy @r{(C++ only)}
5945 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5946 @opindex fdump-class-hierarchy
5947 Dump a representation of each class's hierarchy and virtual function
5948 table layout to a file.  The file name is made by appending
5949 @file{.class} to the source file name, and the file is created in the
5950 same directory as the output file.  If the @samp{-@var{options}} form
5951 is used, @var{options} controls the details of the dump as described
5952 for the @option{-fdump-tree} options.
5954 @item -fdump-ipa-@var{switch}
5955 @opindex fdump-ipa
5956 Control the dumping at various stages of inter-procedural analysis
5957 language tree to a file.  The file name is generated by appending a
5958 switch specific suffix to the source file name, and the file is created
5959 in the same directory as the output file.  The following dumps are
5960 possible:
5962 @table @samp
5963 @item all
5964 Enables all inter-procedural analysis dumps.
5966 @item cgraph
5967 Dumps information about call-graph optimization, unused function removal,
5968 and inlining decisions.
5970 @item inline
5971 Dump after function inlining.
5973 @end table
5975 @item -fdump-passes
5976 @opindex fdump-passes
5977 Dump the list of optimization passes that are turned on and off by
5978 the current command-line options.
5980 @item -fdump-statistics-@var{option}
5981 @opindex fdump-statistics
5982 Enable and control dumping of pass statistics in a separate file.  The
5983 file name is generated by appending a suffix ending in
5984 @samp{.statistics} to the source file name, and the file is created in
5985 the same directory as the output file.  If the @samp{-@var{option}}
5986 form is used, @samp{-stats} causes counters to be summed over the
5987 whole compilation unit while @samp{-details} dumps every event as
5988 the passes generate them.  The default with no option is to sum
5989 counters for each function compiled.
5991 @item -fdump-tree-@var{switch}
5992 @itemx -fdump-tree-@var{switch}-@var{options}
5993 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
5994 @opindex fdump-tree
5995 Control the dumping at various stages of processing the intermediate
5996 language tree to a file.  The file name is generated by appending a
5997 switch-specific suffix to the source file name, and the file is
5998 created in the same directory as the output file. In case of
5999 @option{=@var{filename}} option, the dump is output on the given file
6000 instead of the auto named dump files.  If the @samp{-@var{options}}
6001 form is used, @var{options} is a list of @samp{-} separated options
6002 which control the details of the dump.  Not all options are applicable
6003 to all dumps; those that are not meaningful are ignored.  The
6004 following options are available
6006 @table @samp
6007 @item address
6008 Print the address of each node.  Usually this is not meaningful as it
6009 changes according to the environment and source file.  Its primary use
6010 is for tying up a dump file with a debug environment.
6011 @item asmname
6012 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
6013 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
6014 use working backward from mangled names in the assembly file.
6015 @item slim
6016 When dumping front-end intermediate representations, inhibit dumping
6017 of members of a scope or body of a function merely because that scope
6018 has been reached.  Only dump such items when they are directly reachable
6019 by some other path.
6021 When dumping pretty-printed trees, this option inhibits dumping the
6022 bodies of control structures.
6024 When dumping RTL, print the RTL in slim (condensed) form instead of
6025 the default LISP-like representation.
6026 @item raw
6027 Print a raw representation of the tree.  By default, trees are
6028 pretty-printed into a C-like representation.
6029 @item details
6030 Enable more detailed dumps (not honored by every dump option). Also
6031 include information from the optimization passes.
6032 @item stats
6033 Enable dumping various statistics about the pass (not honored by every dump
6034 option).
6035 @item blocks
6036 Enable showing basic block boundaries (disabled in raw dumps).
6037 @item graph
6038 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
6039 dump a representation of the control flow graph suitable for viewing with
6040 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
6041 the file is pretty-printed as a subgraph, so that GraphViz can render them
6042 all in a single plot.
6044 This option currently only works for RTL dumps, and the RTL is always
6045 dumped in slim form.
6046 @item vops
6047 Enable showing virtual operands for every statement.
6048 @item lineno
6049 Enable showing line numbers for statements.
6050 @item uid
6051 Enable showing the unique ID (@code{DECL_UID}) for each variable.
6052 @item verbose
6053 Enable showing the tree dump for each statement.
6054 @item eh
6055 Enable showing the EH region number holding each statement.
6056 @item scev
6057 Enable showing scalar evolution analysis details.
6058 @item optimized
6059 Enable showing optimization information (only available in certain
6060 passes).
6061 @item missed
6062 Enable showing missed optimization information (only available in certain
6063 passes).
6064 @item notes
6065 Enable other detailed optimization information (only available in
6066 certain passes).
6067 @item =@var{filename}
6068 Instead of an auto named dump file, output into the given file
6069 name. The file names @file{stdout} and @file{stderr} are treated
6070 specially and are considered already open standard streams. For
6071 example,
6073 @smallexample
6074 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
6075      -fdump-tree-pre=stderr file.c
6076 @end smallexample
6078 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
6079 output on to @file{stderr}. If two conflicting dump filenames are
6080 given for the same pass, then the latter option overrides the earlier
6081 one.
6083 @item all
6084 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
6085 and @option{lineno}.
6087 @item optall
6088 Turn on all optimization options, i.e., @option{optimized},
6089 @option{missed}, and @option{note}.
6090 @end table
6092 The following tree dumps are possible:
6093 @table @samp
6095 @item original
6096 @opindex fdump-tree-original
6097 Dump before any tree based optimization, to @file{@var{file}.original}.
6099 @item optimized
6100 @opindex fdump-tree-optimized
6101 Dump after all tree based optimization, to @file{@var{file}.optimized}.
6103 @item gimple
6104 @opindex fdump-tree-gimple
6105 Dump each function before and after the gimplification pass to a file.  The
6106 file name is made by appending @file{.gimple} to the source file name.
6108 @item cfg
6109 @opindex fdump-tree-cfg
6110 Dump the control flow graph of each function to a file.  The file name is
6111 made by appending @file{.cfg} to the source file name.
6113 @item ch
6114 @opindex fdump-tree-ch
6115 Dump each function after copying loop headers.  The file name is made by
6116 appending @file{.ch} to the source file name.
6118 @item ssa
6119 @opindex fdump-tree-ssa
6120 Dump SSA related information to a file.  The file name is made by appending
6121 @file{.ssa} to the source file name.
6123 @item alias
6124 @opindex fdump-tree-alias
6125 Dump aliasing information for each function.  The file name is made by
6126 appending @file{.alias} to the source file name.
6128 @item ccp
6129 @opindex fdump-tree-ccp
6130 Dump each function after CCP@.  The file name is made by appending
6131 @file{.ccp} to the source file name.
6133 @item storeccp
6134 @opindex fdump-tree-storeccp
6135 Dump each function after STORE-CCP@.  The file name is made by appending
6136 @file{.storeccp} to the source file name.
6138 @item pre
6139 @opindex fdump-tree-pre
6140 Dump trees after partial redundancy elimination.  The file name is made
6141 by appending @file{.pre} to the source file name.
6143 @item fre
6144 @opindex fdump-tree-fre
6145 Dump trees after full redundancy elimination.  The file name is made
6146 by appending @file{.fre} to the source file name.
6148 @item copyprop
6149 @opindex fdump-tree-copyprop
6150 Dump trees after copy propagation.  The file name is made
6151 by appending @file{.copyprop} to the source file name.
6153 @item store_copyprop
6154 @opindex fdump-tree-store_copyprop
6155 Dump trees after store copy-propagation.  The file name is made
6156 by appending @file{.store_copyprop} to the source file name.
6158 @item dce
6159 @opindex fdump-tree-dce
6160 Dump each function after dead code elimination.  The file name is made by
6161 appending @file{.dce} to the source file name.
6163 @item mudflap
6164 @opindex fdump-tree-mudflap
6165 Dump each function after adding mudflap instrumentation.  The file name is
6166 made by appending @file{.mudflap} to the source file name.
6168 @item sra
6169 @opindex fdump-tree-sra
6170 Dump each function after performing scalar replacement of aggregates.  The
6171 file name is made by appending @file{.sra} to the source file name.
6173 @item sink
6174 @opindex fdump-tree-sink
6175 Dump each function after performing code sinking.  The file name is made
6176 by appending @file{.sink} to the source file name.
6178 @item dom
6179 @opindex fdump-tree-dom
6180 Dump each function after applying dominator tree optimizations.  The file
6181 name is made by appending @file{.dom} to the source file name.
6183 @item dse
6184 @opindex fdump-tree-dse
6185 Dump each function after applying dead store elimination.  The file
6186 name is made by appending @file{.dse} to the source file name.
6188 @item phiopt
6189 @opindex fdump-tree-phiopt
6190 Dump each function after optimizing PHI nodes into straightline code.  The file
6191 name is made by appending @file{.phiopt} to the source file name.
6193 @item forwprop
6194 @opindex fdump-tree-forwprop
6195 Dump each function after forward propagating single use variables.  The file
6196 name is made by appending @file{.forwprop} to the source file name.
6198 @item copyrename
6199 @opindex fdump-tree-copyrename
6200 Dump each function after applying the copy rename optimization.  The file
6201 name is made by appending @file{.copyrename} to the source file name.
6203 @item nrv
6204 @opindex fdump-tree-nrv
6205 Dump each function after applying the named return value optimization on
6206 generic trees.  The file name is made by appending @file{.nrv} to the source
6207 file name.
6209 @item vect
6210 @opindex fdump-tree-vect
6211 Dump each function after applying vectorization of loops.  The file name is
6212 made by appending @file{.vect} to the source file name.
6214 @item slp
6215 @opindex fdump-tree-slp
6216 Dump each function after applying vectorization of basic blocks.  The file name
6217 is made by appending @file{.slp} to the source file name.
6219 @item vrp
6220 @opindex fdump-tree-vrp
6221 Dump each function after Value Range Propagation (VRP).  The file name
6222 is made by appending @file{.vrp} to the source file name.
6224 @item all
6225 @opindex fdump-tree-all
6226 Enable all the available tree dumps with the flags provided in this option.
6227 @end table
6229 @item -fopt-info
6230 @itemx -fopt-info-@var{options}
6231 @itemx -fopt-info-@var{options}=@var{filename}
6232 @opindex fopt-info
6233 Controls optimization dumps from various optimization passes. If the
6234 @samp{-@var{options}} form is used, @var{options} is a list of
6235 @samp{-} separated options to select the dump details and
6236 optimizations.  If @var{options} is not specified, it defaults to
6237 @option{optimized} for details and @option{optall} for optimization
6238 groups. If the @var{filename} is not specified, it defaults to
6239 @file{stderr}. Note that the output @var{filename} will be overwritten
6240 in case of multiple translation units. If a combined output from
6241 multiple translation units is desired, @file{stderr} should be used
6242 instead.
6244 The options can be divided into two groups, 1) options describing the
6245 verbosity of the dump, and 2) options describing which optimizations
6246 should be included. The options from both the groups can be freely
6247 mixed as they are non-overlapping. However, in case of any conflicts,
6248 the latter options override the earlier options on the command
6249 line. Though multiple -fopt-info options are accepted, only one of
6250 them can have @option{=filename}. If other filenames are provided then
6251 all but the first one are ignored.
6253 The dump verbosity has the following options
6255 @table @samp
6256 @item optimized
6257 Print information when an optimization is successfully applied. It is
6258 up to a pass to decide which information is relevant. For example, the
6259 vectorizer passes print the source location of loops which got
6260 successfully vectorized.
6261 @item missed
6262 Print information about missed optimizations. Individual passes
6263 control which information to include in the output. For example,
6265 @smallexample
6266 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6267 @end smallexample
6269 will print information about missed optimization opportunities from
6270 vectorization passes on stderr.
6271 @item note
6272 Print verbose information about optimizations, such as certain
6273 transformations, more detailed messages about decisions etc.
6274 @item all
6275 Print detailed optimization information. This includes
6276 @var{optimized}, @var{missed}, and @var{note}.
6277 @end table
6279 The second set of options describes a group of optimizations and may
6280 include one or more of the following.
6282 @table @samp
6283 @item ipa
6284 Enable dumps from all interprocedural optimizations.
6285 @item loop
6286 Enable dumps from all loop optimizations.
6287 @item inline
6288 Enable dumps from all inlining optimizations.
6289 @item vec
6290 Enable dumps from all vectorization optimizations.
6291 @end table
6293 For example,
6294 @smallexample
6295 gcc -O3 -fopt-info-missed=missed.all
6296 @end smallexample
6298 outputs missed optimization report from all the passes into
6299 @file{missed.all}.
6301 As another example,
6302 @smallexample
6303 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6304 @end smallexample
6306 will output information about missed optimizations as well as
6307 optimized locations from all the inlining passes into
6308 @file{inline.txt}.
6310 If the @var{filename} is provided, then the dumps from all the
6311 applicable optimizations are concatenated into the @file{filename}.
6312 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6313 omitted, it defaults to @option{all-optall}, which means dump all
6314 available optimization info from all the passes. In the following
6315 example, all optimization info is output on to @file{stderr}.
6317 @smallexample
6318 gcc -O3 -fopt-info
6319 @end smallexample
6321 Note that @option{-fopt-info-vec-missed} behaves the same as
6322 @option{-fopt-info-missed-vec}.
6324 As another example, consider
6326 @smallexample
6327 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6328 @end smallexample
6330 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6331 in conflict since only one output file is allowed. In this case, only
6332 the first option takes effect and the subsequent options are
6333 ignored. Thus only the @file{vec.miss} is produced which cotaints
6334 dumps from the vectorizer about missed opportunities.
6336 @item -ftree-vectorizer-verbose=@var{n}
6337 @opindex ftree-vectorizer-verbose
6338 This option is deprecated and is implemented in terms of
6339 @option{-fopt-info}. Please use @option{-fopt-info-@var{kind}} form
6340 instead, where @var{kind} is one of the valid opt-info options. It
6341 prints additional optimization information.  For @var{n}=0 no
6342 diagnostic information is reported.  If @var{n}=1 the vectorizer
6343 reports each loop that got vectorized, and the total number of loops
6344 that got vectorized.  If @var{n}=2 the vectorizer reports locations
6345 which could not be vectorized and the reasons for those. For any
6346 higher verbosity levels all the analysis and transformation
6347 information from the vectorizer is reported.
6349 Note that the information output by @option{-ftree-vectorizer-verbose}
6350 option is sent to @file{stderr}. If the equivalent form
6351 @option{-fopt-info-@var{options}=@var{filename}} is used then the
6352 output is sent into @var{filename} instead.
6354 @item -frandom-seed=@var{string}
6355 @opindex frandom-seed
6356 This option provides a seed that GCC uses in place of
6357 random numbers in generating certain symbol names
6358 that have to be different in every compiled file.  It is also used to
6359 place unique stamps in coverage data files and the object files that
6360 produce them.  You can use the @option{-frandom-seed} option to produce
6361 reproducibly identical object files.
6363 The @var{string} should be different for every file you compile.
6365 @item -fsched-verbose=@var{n}
6366 @opindex fsched-verbose
6367 On targets that use instruction scheduling, this option controls the
6368 amount of debugging output the scheduler prints.  This information is
6369 written to standard error, unless @option{-fdump-rtl-sched1} or
6370 @option{-fdump-rtl-sched2} is specified, in which case it is output
6371 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6372 respectively.  However for @var{n} greater than nine, the output is
6373 always printed to standard error.
6375 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6376 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6377 For @var{n} greater than one, it also output basic block probabilities,
6378 detailed ready list information and unit/insn info.  For @var{n} greater
6379 than two, it includes RTL at abort point, control-flow and regions info.
6380 And for @var{n} over four, @option{-fsched-verbose} also includes
6381 dependence info.
6383 @item -save-temps
6384 @itemx -save-temps=cwd
6385 @opindex save-temps
6386 Store the usual ``temporary'' intermediate files permanently; place them
6387 in the current directory and name them based on the source file.  Thus,
6388 compiling @file{foo.c} with @option{-c -save-temps} produces files
6389 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6390 preprocessed @file{foo.i} output file even though the compiler now
6391 normally uses an integrated preprocessor.
6393 When used in combination with the @option{-x} command-line option,
6394 @option{-save-temps} is sensible enough to avoid over writing an
6395 input source file with the same extension as an intermediate file.
6396 The corresponding intermediate file may be obtained by renaming the
6397 source file before using @option{-save-temps}.
6399 If you invoke GCC in parallel, compiling several different source
6400 files that share a common base name in different subdirectories or the
6401 same source file compiled for multiple output destinations, it is
6402 likely that the different parallel compilers will interfere with each
6403 other, and overwrite the temporary files.  For instance:
6405 @smallexample
6406 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6407 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6408 @end smallexample
6410 may result in @file{foo.i} and @file{foo.o} being written to
6411 simultaneously by both compilers.
6413 @item -save-temps=obj
6414 @opindex save-temps=obj
6415 Store the usual ``temporary'' intermediate files permanently.  If the
6416 @option{-o} option is used, the temporary files are based on the
6417 object file.  If the @option{-o} option is not used, the
6418 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6420 For example:
6422 @smallexample
6423 gcc -save-temps=obj -c foo.c
6424 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6425 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6426 @end smallexample
6428 @noindent
6429 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6430 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6431 @file{dir2/yfoobar.o}.
6433 @item -time@r{[}=@var{file}@r{]}
6434 @opindex time
6435 Report the CPU time taken by each subprocess in the compilation
6436 sequence.  For C source files, this is the compiler proper and assembler
6437 (plus the linker if linking is done).
6439 Without the specification of an output file, the output looks like this:
6441 @smallexample
6442 # cc1 0.12 0.01
6443 # as 0.00 0.01
6444 @end smallexample
6446 The first number on each line is the ``user time'', that is time spent
6447 executing the program itself.  The second number is ``system time'',
6448 time spent executing operating system routines on behalf of the program.
6449 Both numbers are in seconds.
6451 With the specification of an output file, the output is appended to the
6452 named file, and it looks like this:
6454 @smallexample
6455 0.12 0.01 cc1 @var{options}
6456 0.00 0.01 as @var{options}
6457 @end smallexample
6459 The ``user time'' and the ``system time'' are moved before the program
6460 name, and the options passed to the program are displayed, so that one
6461 can later tell what file was being compiled, and with which options.
6463 @item -fvar-tracking
6464 @opindex fvar-tracking
6465 Run variable tracking pass.  It computes where variables are stored at each
6466 position in code.  Better debugging information is then generated
6467 (if the debugging information format supports this information).
6469 It is enabled by default when compiling with optimization (@option{-Os},
6470 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6471 the debug info format supports it.
6473 @item -fvar-tracking-assignments
6474 @opindex fvar-tracking-assignments
6475 @opindex fno-var-tracking-assignments
6476 Annotate assignments to user variables early in the compilation and
6477 attempt to carry the annotations over throughout the compilation all the
6478 way to the end, in an attempt to improve debug information while
6479 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6481 It can be enabled even if var-tracking is disabled, in which case
6482 annotations are created and maintained, but discarded at the end.
6484 @item -fvar-tracking-assignments-toggle
6485 @opindex fvar-tracking-assignments-toggle
6486 @opindex fno-var-tracking-assignments-toggle
6487 Toggle @option{-fvar-tracking-assignments}, in the same way that
6488 @option{-gtoggle} toggles @option{-g}.
6490 @item -print-file-name=@var{library}
6491 @opindex print-file-name
6492 Print the full absolute name of the library file @var{library} that
6493 would be used when linking---and don't do anything else.  With this
6494 option, GCC does not compile or link anything; it just prints the
6495 file name.
6497 @item -print-multi-directory
6498 @opindex print-multi-directory
6499 Print the directory name corresponding to the multilib selected by any
6500 other switches present in the command line.  This directory is supposed
6501 to exist in @env{GCC_EXEC_PREFIX}.
6503 @item -print-multi-lib
6504 @opindex print-multi-lib
6505 Print the mapping from multilib directory names to compiler switches
6506 that enable them.  The directory name is separated from the switches by
6507 @samp{;}, and each switch starts with an @samp{@@} instead of the
6508 @samp{-}, without spaces between multiple switches.  This is supposed to
6509 ease shell processing.
6511 @item -print-multi-os-directory
6512 @opindex print-multi-os-directory
6513 Print the path to OS libraries for the selected
6514 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6515 present in the @file{lib} subdirectory and no multilibs are used, this is
6516 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6517 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6518 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6519 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6521 @item -print-multiarch
6522 @opindex print-multiarch
6523 Print the path to OS libraries for the selected multiarch,
6524 relative to some @file{lib} subdirectory.
6526 @item -print-prog-name=@var{program}
6527 @opindex print-prog-name
6528 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6530 @item -print-libgcc-file-name
6531 @opindex print-libgcc-file-name
6532 Same as @option{-print-file-name=libgcc.a}.
6534 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6535 but you do want to link with @file{libgcc.a}.  You can do:
6537 @smallexample
6538 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6539 @end smallexample
6541 @item -print-search-dirs
6542 @opindex print-search-dirs
6543 Print the name of the configured installation directory and a list of
6544 program and library directories @command{gcc} searches---and don't do anything else.
6546 This is useful when @command{gcc} prints the error message
6547 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6548 To resolve this you either need to put @file{cpp0} and the other compiler
6549 components where @command{gcc} expects to find them, or you can set the environment
6550 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6551 Don't forget the trailing @samp{/}.
6552 @xref{Environment Variables}.
6554 @item -print-sysroot
6555 @opindex print-sysroot
6556 Print the target sysroot directory that is used during
6557 compilation.  This is the target sysroot specified either at configure
6558 time or using the @option{--sysroot} option, possibly with an extra
6559 suffix that depends on compilation options.  If no target sysroot is
6560 specified, the option prints nothing.
6562 @item -print-sysroot-headers-suffix
6563 @opindex print-sysroot-headers-suffix
6564 Print the suffix added to the target sysroot when searching for
6565 headers, or give an error if the compiler is not configured with such
6566 a suffix---and don't do anything else.
6568 @item -dumpmachine
6569 @opindex dumpmachine
6570 Print the compiler's target machine (for example,
6571 @samp{i686-pc-linux-gnu})---and don't do anything else.
6573 @item -dumpversion
6574 @opindex dumpversion
6575 Print the compiler version (for example, @samp{3.0})---and don't do
6576 anything else.
6578 @item -dumpspecs
6579 @opindex dumpspecs
6580 Print the compiler's built-in specs---and don't do anything else.  (This
6581 is used when GCC itself is being built.)  @xref{Spec Files}.
6583 @item -fno-eliminate-unused-debug-types
6584 @opindex feliminate-unused-debug-types
6585 @opindex fno-eliminate-unused-debug-types
6586 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
6587 output for types that are nowhere used in the source file being compiled.
6588 Sometimes it is useful to have GCC emit debugging
6589 information for all types declared in a compilation
6590 unit, regardless of whether or not they are actually used
6591 in that compilation unit, for example 
6592 if, in the debugger, you want to cast a value to a type that is
6593 not actually used in your program (but is declared).  More often,
6594 however, this results in a significant amount of wasted space.
6595 @end table
6597 @node Optimize Options
6598 @section Options That Control Optimization
6599 @cindex optimize options
6600 @cindex options, optimization
6602 These options control various sorts of optimizations.
6604 Without any optimization option, the compiler's goal is to reduce the
6605 cost of compilation and to make debugging produce the expected
6606 results.  Statements are independent: if you stop the program with a
6607 breakpoint between statements, you can then assign a new value to any
6608 variable or change the program counter to any other statement in the
6609 function and get exactly the results you expect from the source
6610 code.
6612 Turning on optimization flags makes the compiler attempt to improve
6613 the performance and/or code size at the expense of compilation time
6614 and possibly the ability to debug the program.
6616 The compiler performs optimization based on the knowledge it has of the
6617 program.  Compiling multiple files at once to a single output file mode allows
6618 the compiler to use information gained from all of the files when compiling
6619 each of them.
6621 Not all optimizations are controlled directly by a flag.  Only
6622 optimizations that have a flag are listed in this section.
6624 Most optimizations are only enabled if an @option{-O} level is set on
6625 the command line.  Otherwise they are disabled, even if individual
6626 optimization flags are specified.
6628 Depending on the target and how GCC was configured, a slightly different
6629 set of optimizations may be enabled at each @option{-O} level than
6630 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6631 to find out the exact set of optimizations that are enabled at each level.
6632 @xref{Overall Options}, for examples.
6634 @table @gcctabopt
6635 @item -O
6636 @itemx -O1
6637 @opindex O
6638 @opindex O1
6639 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6640 more memory for a large function.
6642 With @option{-O}, the compiler tries to reduce code size and execution
6643 time, without performing any optimizations that take a great deal of
6644 compilation time.
6646 @option{-O} turns on the following optimization flags:
6647 @gccoptlist{
6648 -fauto-inc-dec @gol
6649 -fcompare-elim @gol
6650 -fcprop-registers @gol
6651 -fdce @gol
6652 -fdefer-pop @gol
6653 -fdelayed-branch @gol
6654 -fdse @gol
6655 -fguess-branch-probability @gol
6656 -fif-conversion2 @gol
6657 -fif-conversion @gol
6658 -fipa-pure-const @gol
6659 -fipa-profile @gol
6660 -fipa-reference @gol
6661 -fmerge-constants
6662 -fsplit-wide-types @gol
6663 -ftree-bit-ccp @gol
6664 -ftree-builtin-call-dce @gol
6665 -ftree-ccp @gol
6666 -ftree-ch @gol
6667 -ftree-copyrename @gol
6668 -ftree-dce @gol
6669 -ftree-dominator-opts @gol
6670 -ftree-dse @gol
6671 -ftree-forwprop @gol
6672 -ftree-fre @gol
6673 -ftree-phiprop @gol
6674 -ftree-slsr @gol
6675 -ftree-sra @gol
6676 -ftree-pta @gol
6677 -ftree-ter @gol
6678 -funit-at-a-time}
6680 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6681 where doing so does not interfere with debugging.
6683 @item -O2
6684 @opindex O2
6685 Optimize even more.  GCC performs nearly all supported optimizations
6686 that do not involve a space-speed tradeoff.
6687 As compared to @option{-O}, this option increases both compilation time
6688 and the performance of the generated code.
6690 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6691 also turns on the following optimization flags:
6692 @gccoptlist{-fthread-jumps @gol
6693 -falign-functions  -falign-jumps @gol
6694 -falign-loops  -falign-labels @gol
6695 -fcaller-saves @gol
6696 -fcrossjumping @gol
6697 -fcse-follow-jumps  -fcse-skip-blocks @gol
6698 -fdelete-null-pointer-checks @gol
6699 -fdevirtualize @gol
6700 -fexpensive-optimizations @gol
6701 -fgcse  -fgcse-lm  @gol
6702 -fhoist-adjacent-loads @gol
6703 -finline-small-functions @gol
6704 -findirect-inlining @gol
6705 -fipa-sra @gol
6706 -foptimize-sibling-calls @gol
6707 -fpartial-inlining @gol
6708 -fpeephole2 @gol
6709 -fregmove @gol
6710 -freorder-blocks  -freorder-functions @gol
6711 -frerun-cse-after-loop  @gol
6712 -fsched-interblock  -fsched-spec @gol
6713 -fschedule-insns  -fschedule-insns2 @gol
6714 -fstrict-aliasing -fstrict-overflow @gol
6715 -ftree-switch-conversion -ftree-tail-merge @gol
6716 -ftree-pre @gol
6717 -ftree-vrp}
6719 Please note the warning under @option{-fgcse} about
6720 invoking @option{-O2} on programs that use computed gotos.
6722 @item -O3
6723 @opindex O3
6724 Optimize yet more.  @option{-O3} turns on all optimizations specified
6725 by @option{-O2} and also turns on the @option{-finline-functions},
6726 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6727 @option{-fgcse-after-reload}, @option{-ftree-vectorize},
6728 @option{-fvect-cost-model},
6729 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
6731 @item -O0
6732 @opindex O0
6733 Reduce compilation time and make debugging produce the expected
6734 results.  This is the default.
6736 @item -Os
6737 @opindex Os
6738 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6739 do not typically increase code size.  It also performs further
6740 optimizations designed to reduce code size.
6742 @option{-Os} disables the following optimization flags:
6743 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6744 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6745 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6747 @item -Ofast
6748 @opindex Ofast
6749 Disregard strict standards compliance.  @option{-Ofast} enables all
6750 @option{-O3} optimizations.  It also enables optimizations that are not
6751 valid for all standard-compliant programs.
6752 It turns on @option{-ffast-math} and the Fortran-specific
6753 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6755 @item -Og
6756 @opindex Og
6757 Optimize debugging experience.  @option{-Og} enables optimizations
6758 that do not interfere with debugging. It should be the optimization
6759 level of choice for the standard edit-compile-debug cycle, offering
6760 a reasonable level of optimization while maintaining fast compilation
6761 and a good debugging experience.
6763 If you use multiple @option{-O} options, with or without level numbers,
6764 the last such option is the one that is effective.
6765 @end table
6767 Options of the form @option{-f@var{flag}} specify machine-independent
6768 flags.  Most flags have both positive and negative forms; the negative
6769 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6770 below, only one of the forms is listed---the one you typically 
6771 use.  You can figure out the other form by either removing @samp{no-}
6772 or adding it.
6774 The following options control specific optimizations.  They are either
6775 activated by @option{-O} options or are related to ones that are.  You
6776 can use the following flags in the rare cases when ``fine-tuning'' of
6777 optimizations to be performed is desired.
6779 @table @gcctabopt
6780 @item -fno-default-inline
6781 @opindex fno-default-inline
6782 Do not make member functions inline by default merely because they are
6783 defined inside the class scope (C++ only).  Otherwise, when you specify
6784 @w{@option{-O}}, member functions defined inside class scope are compiled
6785 inline by default; i.e., you don't need to add @samp{inline} in front of
6786 the member function name.
6788 @item -fno-defer-pop
6789 @opindex fno-defer-pop
6790 Always pop the arguments to each function call as soon as that function
6791 returns.  For machines that must pop arguments after a function call,
6792 the compiler normally lets arguments accumulate on the stack for several
6793 function calls and pops them all at once.
6795 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6797 @item -fforward-propagate
6798 @opindex fforward-propagate
6799 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6800 instructions and checks if the result can be simplified.  If loop unrolling
6801 is active, two passes are performed and the second is scheduled after
6802 loop unrolling.
6804 This option is enabled by default at optimization levels @option{-O},
6805 @option{-O2}, @option{-O3}, @option{-Os}.
6807 @item -ffp-contract=@var{style}
6808 @opindex ffp-contract
6809 @option{-ffp-contract=off} disables floating-point expression contraction.
6810 @option{-ffp-contract=fast} enables floating-point expression contraction
6811 such as forming of fused multiply-add operations if the target has
6812 native support for them.
6813 @option{-ffp-contract=on} enables floating-point expression contraction
6814 if allowed by the language standard.  This is currently not implemented
6815 and treated equal to @option{-ffp-contract=off}.
6817 The default is @option{-ffp-contract=fast}.
6819 @item -fomit-frame-pointer
6820 @opindex fomit-frame-pointer
6821 Don't keep the frame pointer in a register for functions that
6822 don't need one.  This avoids the instructions to save, set up and
6823 restore frame pointers; it also makes an extra register available
6824 in many functions.  @strong{It also makes debugging impossible on
6825 some machines.}
6827 On some machines, such as the VAX, this flag has no effect, because
6828 the standard calling sequence automatically handles the frame pointer
6829 and nothing is saved by pretending it doesn't exist.  The
6830 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6831 whether a target machine supports this flag.  @xref{Registers,,Register
6832 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6834 Starting with GCC version 4.6, the default setting (when not optimizing for
6835 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
6836 @option{-fomit-frame-pointer}.  The default can be reverted to
6837 @option{-fno-omit-frame-pointer} by configuring GCC with the
6838 @option{--enable-frame-pointer} configure option.
6840 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6842 @item -foptimize-sibling-calls
6843 @opindex foptimize-sibling-calls
6844 Optimize sibling and tail recursive calls.
6846 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6848 @item -fno-inline
6849 @opindex fno-inline
6850 Do not expand any functions inline apart from those marked with
6851 the @code{always_inline} attribute.  This is the default when not
6852 optimizing.
6854 Single functions can be exempted from inlining by marking them
6855 with the @code{noinline} attribute.
6857 @item -finline-small-functions
6858 @opindex finline-small-functions
6859 Integrate functions into their callers when their body is smaller than expected
6860 function call code (so overall size of program gets smaller).  The compiler
6861 heuristically decides which functions are simple enough to be worth integrating
6862 in this way.  This inlining applies to all functions, even those not declared
6863 inline.
6865 Enabled at level @option{-O2}.
6867 @item -findirect-inlining
6868 @opindex findirect-inlining
6869 Inline also indirect calls that are discovered to be known at compile
6870 time thanks to previous inlining.  This option has any effect only
6871 when inlining itself is turned on by the @option{-finline-functions}
6872 or @option{-finline-small-functions} options.
6874 Enabled at level @option{-O2}.
6876 @item -finline-functions
6877 @opindex finline-functions
6878 Consider all functions for inlining, even if they are not declared inline.
6879 The compiler heuristically decides which functions are worth integrating
6880 in this way.
6882 If all calls to a given function are integrated, and the function is
6883 declared @code{static}, then the function is normally not output as
6884 assembler code in its own right.
6886 Enabled at level @option{-O3}.
6888 @item -finline-functions-called-once
6889 @opindex finline-functions-called-once
6890 Consider all @code{static} functions called once for inlining into their
6891 caller even if they are not marked @code{inline}.  If a call to a given
6892 function is integrated, then the function is not output as assembler code
6893 in its own right.
6895 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6897 @item -fearly-inlining
6898 @opindex fearly-inlining
6899 Inline functions marked by @code{always_inline} and functions whose body seems
6900 smaller than the function call overhead early before doing
6901 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6902 makes profiling significantly cheaper and usually inlining faster on programs
6903 having large chains of nested wrapper functions.
6905 Enabled by default.
6907 @item -fipa-sra
6908 @opindex fipa-sra
6909 Perform interprocedural scalar replacement of aggregates, removal of
6910 unused parameters and replacement of parameters passed by reference
6911 by parameters passed by value.
6913 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6915 @item -finline-limit=@var{n}
6916 @opindex finline-limit
6917 By default, GCC limits the size of functions that can be inlined.  This flag
6918 allows coarse control of this limit.  @var{n} is the size of functions that
6919 can be inlined in number of pseudo instructions.
6921 Inlining is actually controlled by a number of parameters, which may be
6922 specified individually by using @option{--param @var{name}=@var{value}}.
6923 The @option{-finline-limit=@var{n}} option sets some of these parameters
6924 as follows:
6926 @table @gcctabopt
6927 @item max-inline-insns-single
6928 is set to @var{n}/2.
6929 @item max-inline-insns-auto
6930 is set to @var{n}/2.
6931 @end table
6933 See below for a documentation of the individual
6934 parameters controlling inlining and for the defaults of these parameters.
6936 @emph{Note:} there may be no value to @option{-finline-limit} that results
6937 in default behavior.
6939 @emph{Note:} pseudo instruction represents, in this particular context, an
6940 abstract measurement of function's size.  In no way does it represent a count
6941 of assembly instructions and as such its exact meaning might change from one
6942 release to an another.
6944 @item -fno-keep-inline-dllexport
6945 @opindex -fno-keep-inline-dllexport
6946 This is a more fine-grained version of @option{-fkeep-inline-functions},
6947 which applies only to functions that are declared using the @code{dllexport}
6948 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6949 Functions}.)
6951 @item -fkeep-inline-functions
6952 @opindex fkeep-inline-functions
6953 In C, emit @code{static} functions that are declared @code{inline}
6954 into the object file, even if the function has been inlined into all
6955 of its callers.  This switch does not affect functions using the
6956 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6957 inline functions into the object file.
6959 @item -fkeep-static-consts
6960 @opindex fkeep-static-consts
6961 Emit variables declared @code{static const} when optimization isn't turned
6962 on, even if the variables aren't referenced.
6964 GCC enables this option by default.  If you want to force the compiler to
6965 check if a variable is referenced, regardless of whether or not
6966 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6968 @item -fmerge-constants
6969 @opindex fmerge-constants
6970 Attempt to merge identical constants (string constants and floating-point
6971 constants) across compilation units.
6973 This option is the default for optimized compilation if the assembler and
6974 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6975 behavior.
6977 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6979 @item -fmerge-all-constants
6980 @opindex fmerge-all-constants
6981 Attempt to merge identical constants and identical variables.
6983 This option implies @option{-fmerge-constants}.  In addition to
6984 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6985 arrays or initialized constant variables with integral or floating-point
6986 types.  Languages like C or C++ require each variable, including multiple
6987 instances of the same variable in recursive calls, to have distinct locations,
6988 so using this option results in non-conforming
6989 behavior.
6991 @item -fmodulo-sched
6992 @opindex fmodulo-sched
6993 Perform swing modulo scheduling immediately before the first scheduling
6994 pass.  This pass looks at innermost loops and reorders their
6995 instructions by overlapping different iterations.
6997 @item -fmodulo-sched-allow-regmoves
6998 @opindex fmodulo-sched-allow-regmoves
6999 Perform more aggressive SMS-based modulo scheduling with register moves
7000 allowed.  By setting this flag certain anti-dependences edges are
7001 deleted, which triggers the generation of reg-moves based on the
7002 life-range analysis.  This option is effective only with
7003 @option{-fmodulo-sched} enabled.
7005 @item -fno-branch-count-reg
7006 @opindex fno-branch-count-reg
7007 Do not use ``decrement and branch'' instructions on a count register,
7008 but instead generate a sequence of instructions that decrement a
7009 register, compare it against zero, then branch based upon the result.
7010 This option is only meaningful on architectures that support such
7011 instructions, which include x86, PowerPC, IA-64 and S/390.
7013 The default is @option{-fbranch-count-reg}.
7015 @item -fno-function-cse
7016 @opindex fno-function-cse
7017 Do not put function addresses in registers; make each instruction that
7018 calls a constant function contain the function's address explicitly.
7020 This option results in less efficient code, but some strange hacks
7021 that alter the assembler output may be confused by the optimizations
7022 performed when this option is not used.
7024 The default is @option{-ffunction-cse}
7026 @item -fno-zero-initialized-in-bss
7027 @opindex fno-zero-initialized-in-bss
7028 If the target supports a BSS section, GCC by default puts variables that
7029 are initialized to zero into BSS@.  This can save space in the resulting
7030 code.
7032 This option turns off this behavior because some programs explicitly
7033 rely on variables going to the data section---e.g., so that the
7034 resulting executable can find the beginning of that section and/or make
7035 assumptions based on that.
7037 The default is @option{-fzero-initialized-in-bss}.
7039 @item -fmudflap -fmudflapth -fmudflapir
7040 @opindex fmudflap
7041 @opindex fmudflapth
7042 @opindex fmudflapir
7043 @cindex bounds checking
7044 @cindex mudflap
7045 For front-ends that support it (C and C++), instrument all risky
7046 pointer/array dereferencing operations, some standard library
7047 string/heap functions, and some other associated constructs with
7048 range/validity tests.  Modules so instrumented should be immune to
7049 buffer overflows, invalid heap use, and some other classes of C/C++
7050 programming errors.  The instrumentation relies on a separate runtime
7051 library (@file{libmudflap}), which is linked into a program if
7052 @option{-fmudflap} is given at link time.  Run-time behavior of the
7053 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
7054 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
7055 for its options.
7057 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
7058 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
7059 addition to @option{-fmudflap} or @option{-fmudflapth}, if
7060 instrumentation should ignore pointer reads.  This produces less
7061 instrumentation (and therefore faster execution) and still provides
7062 some protection against outright memory corrupting writes, but allows
7063 erroneously read data to propagate within a program.
7065 @item -fthread-jumps
7066 @opindex fthread-jumps
7067 Perform optimizations that check to see if a jump branches to a
7068 location where another comparison subsumed by the first is found.  If
7069 so, the first branch is redirected to either the destination of the
7070 second branch or a point immediately following it, depending on whether
7071 the condition is known to be true or false.
7073 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7075 @item -fsplit-wide-types
7076 @opindex fsplit-wide-types
7077 When using a type that occupies multiple registers, such as @code{long
7078 long} on a 32-bit system, split the registers apart and allocate them
7079 independently.  This normally generates better code for those types,
7080 but may make debugging more difficult.
7082 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7083 @option{-Os}.
7085 @item -fcse-follow-jumps
7086 @opindex fcse-follow-jumps
7087 In common subexpression elimination (CSE), scan through jump instructions
7088 when the target of the jump is not reached by any other path.  For
7089 example, when CSE encounters an @code{if} statement with an
7090 @code{else} clause, CSE follows the jump when the condition
7091 tested is false.
7093 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7095 @item -fcse-skip-blocks
7096 @opindex fcse-skip-blocks
7097 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7098 follow jumps that conditionally skip over blocks.  When CSE
7099 encounters a simple @code{if} statement with no else clause,
7100 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7101 body of the @code{if}.
7103 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7105 @item -frerun-cse-after-loop
7106 @opindex frerun-cse-after-loop
7107 Re-run common subexpression elimination after loop optimizations are
7108 performed.
7110 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7112 @item -fgcse
7113 @opindex fgcse
7114 Perform a global common subexpression elimination pass.
7115 This pass also performs global constant and copy propagation.
7117 @emph{Note:} When compiling a program using computed gotos, a GCC
7118 extension, you may get better run-time performance if you disable
7119 the global common subexpression elimination pass by adding
7120 @option{-fno-gcse} to the command line.
7122 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7124 @item -fgcse-lm
7125 @opindex fgcse-lm
7126 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7127 attempts to move loads that are only killed by stores into themselves.  This
7128 allows a loop containing a load/store sequence to be changed to a load outside
7129 the loop, and a copy/store within the loop.
7131 Enabled by default when @option{-fgcse} is enabled.
7133 @item -fgcse-sm
7134 @opindex fgcse-sm
7135 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7136 global common subexpression elimination.  This pass attempts to move
7137 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7138 loops containing a load/store sequence can be changed to a load before
7139 the loop and a store after the loop.
7141 Not enabled at any optimization level.
7143 @item -fgcse-las
7144 @opindex fgcse-las
7145 When @option{-fgcse-las} is enabled, the global common subexpression
7146 elimination pass eliminates redundant loads that come after stores to the
7147 same memory location (both partial and full redundancies).
7149 Not enabled at any optimization level.
7151 @item -fgcse-after-reload
7152 @opindex fgcse-after-reload
7153 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7154 pass is performed after reload.  The purpose of this pass is to clean up
7155 redundant spilling.
7157 @item -faggressive-loop-optimizations
7158 @opindex faggressive-loop-optimizations
7159 This option tells the loop optimizer to use language constraints to
7160 derive bounds for the number of iterations of a loop.  This assumes that
7161 loop code does not invoke undefined behavior by for example causing signed
7162 integer overflows or out-of-bound array accesses.  The bounds for the
7163 number of iterations of a loop are used to guide loop unrolling and peeling
7164 and loop exit test optimizations.
7165 This option is enabled by default.
7167 @item -funsafe-loop-optimizations
7168 @opindex funsafe-loop-optimizations
7169 This option tells the loop optimizer to assume that loop indices do not
7170 overflow, and that loops with nontrivial exit condition are not
7171 infinite.  This enables a wider range of loop optimizations even if
7172 the loop optimizer itself cannot prove that these assumptions are valid.
7173 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7174 if it finds this kind of loop.
7176 @item -fcrossjumping
7177 @opindex fcrossjumping
7178 Perform cross-jumping transformation.
7179 This transformation unifies equivalent code and saves code size.  The
7180 resulting code may or may not perform better than without cross-jumping.
7182 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7184 @item -fauto-inc-dec
7185 @opindex fauto-inc-dec
7186 Combine increments or decrements of addresses with memory accesses.
7187 This pass is always skipped on architectures that do not have
7188 instructions to support this.  Enabled by default at @option{-O} and
7189 higher on architectures that support this.
7191 @item -fdce
7192 @opindex fdce
7193 Perform dead code elimination (DCE) on RTL@.
7194 Enabled by default at @option{-O} and higher.
7196 @item -fdse
7197 @opindex fdse
7198 Perform dead store elimination (DSE) on RTL@.
7199 Enabled by default at @option{-O} and higher.
7201 @item -fif-conversion
7202 @opindex fif-conversion
7203 Attempt to transform conditional jumps into branch-less equivalents.  This
7204 includes use of conditional moves, min, max, set flags and abs instructions, and
7205 some tricks doable by standard arithmetics.  The use of conditional execution
7206 on chips where it is available is controlled by @code{if-conversion2}.
7208 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7210 @item -fif-conversion2
7211 @opindex fif-conversion2
7212 Use conditional execution (where available) to transform conditional jumps into
7213 branch-less equivalents.
7215 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7217 @item -fdelete-null-pointer-checks
7218 @opindex fdelete-null-pointer-checks
7219 Assume that programs cannot safely dereference null pointers, and that
7220 no code or data element resides there.  This enables simple constant
7221 folding optimizations at all optimization levels.  In addition, other
7222 optimization passes in GCC use this flag to control global dataflow
7223 analyses that eliminate useless checks for null pointers; these assume
7224 that if a pointer is checked after it has already been dereferenced,
7225 it cannot be null.
7227 Note however that in some environments this assumption is not true.
7228 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7229 for programs that depend on that behavior.
7231 Some targets, especially embedded ones, disable this option at all levels.
7232 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7233 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7234 are enabled independently at different optimization levels.
7236 @item -fdevirtualize
7237 @opindex fdevirtualize
7238 Attempt to convert calls to virtual functions to direct calls.  This
7239 is done both within a procedure and interprocedurally as part of
7240 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7241 propagation (@option{-fipa-cp}).
7242 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7244 @item -fexpensive-optimizations
7245 @opindex fexpensive-optimizations
7246 Perform a number of minor optimizations that are relatively expensive.
7248 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7250 @item -free
7251 @opindex free
7252 Attempt to remove redundant extension instructions.  This is especially
7253 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7254 registers after writing to their lower 32-bit half.
7256 Enabled for x86 at levels @option{-O2}, @option{-O3}.
7258 @item -foptimize-register-move
7259 @itemx -fregmove
7260 @opindex foptimize-register-move
7261 @opindex fregmove
7262 Attempt to reassign register numbers in move instructions and as
7263 operands of other simple instructions in order to maximize the amount of
7264 register tying.  This is especially helpful on machines with two-operand
7265 instructions.
7267 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
7268 optimization.
7270 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7272 @item -fira-algorithm=@var{algorithm}
7273 Use the specified coloring algorithm for the integrated register
7274 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7275 specifies Chow's priority coloring, or @samp{CB}, which specifies
7276 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7277 for all architectures, but for those targets that do support it, it is
7278 the default because it generates better code.
7280 @item -fira-region=@var{region}
7281 Use specified regions for the integrated register allocator.  The
7282 @var{region} argument should be one of the following:
7284 @table @samp
7286 @item all
7287 Use all loops as register allocation regions.
7288 This can give the best results for machines with a small and/or
7289 irregular register set.
7291 @item mixed
7292 Use all loops except for loops with small register pressure 
7293 as the regions.  This value usually gives
7294 the best results in most cases and for most architectures,
7295 and is enabled by default when compiling with optimization for speed
7296 (@option{-O}, @option{-O2}, @dots{}).
7298 @item one
7299 Use all functions as a single region.  
7300 This typically results in the smallest code size, and is enabled by default for
7301 @option{-Os} or @option{-O0}.
7303 @end table
7305 @item -fira-hoist-pressure
7306 @opindex fira-hoist-pressure
7307 Use IRA to evaluate register pressure in the code hoisting pass for
7308 decisions to hoist expressions.  This option usually results in smaller
7309 code, but it can slow the compiler down.
7311 This option is enabled at level @option{-Os} for all targets.
7313 @item -fira-loop-pressure
7314 @opindex fira-loop-pressure
7315 Use IRA to evaluate register pressure in loops for decisions to move
7316 loop invariants.  This option usually results in generation
7317 of faster and smaller code on machines with large register files (>= 32
7318 registers), but it can slow the compiler down.
7320 This option is enabled at level @option{-O3} for some targets.
7322 @item -fno-ira-share-save-slots
7323 @opindex fno-ira-share-save-slots
7324 Disable sharing of stack slots used for saving call-used hard
7325 registers living through a call.  Each hard register gets a
7326 separate stack slot, and as a result function stack frames are
7327 larger.
7329 @item -fno-ira-share-spill-slots
7330 @opindex fno-ira-share-spill-slots
7331 Disable sharing of stack slots allocated for pseudo-registers.  Each
7332 pseudo-register that does not get a hard register gets a separate
7333 stack slot, and as a result function stack frames are larger.
7335 @item -fira-verbose=@var{n}
7336 @opindex fira-verbose
7337 Control the verbosity of the dump file for the integrated register allocator.
7338 The default value is 5.  If the value @var{n} is greater or equal to 10,
7339 the dump output is sent to stderr using the same format as @var{n} minus 10.
7341 @item -fdelayed-branch
7342 @opindex fdelayed-branch
7343 If supported for the target machine, attempt to reorder instructions
7344 to exploit instruction slots available after delayed branch
7345 instructions.
7347 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7349 @item -fschedule-insns
7350 @opindex fschedule-insns
7351 If supported for the target machine, attempt to reorder instructions to
7352 eliminate execution stalls due to required data being unavailable.  This
7353 helps machines that have slow floating point or memory load instructions
7354 by allowing other instructions to be issued until the result of the load
7355 or floating-point instruction is required.
7357 Enabled at levels @option{-O2}, @option{-O3}.
7359 @item -fschedule-insns2
7360 @opindex fschedule-insns2
7361 Similar to @option{-fschedule-insns}, but requests an additional pass of
7362 instruction scheduling after register allocation has been done.  This is
7363 especially useful on machines with a relatively small number of
7364 registers and where memory load instructions take more than one cycle.
7366 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7368 @item -fno-sched-interblock
7369 @opindex fno-sched-interblock
7370 Don't schedule instructions across basic blocks.  This is normally
7371 enabled by default when scheduling before register allocation, i.e.@:
7372 with @option{-fschedule-insns} or at @option{-O2} or higher.
7374 @item -fno-sched-spec
7375 @opindex fno-sched-spec
7376 Don't allow speculative motion of non-load instructions.  This is normally
7377 enabled by default when scheduling before register allocation, i.e.@:
7378 with @option{-fschedule-insns} or at @option{-O2} or higher.
7380 @item -fsched-pressure
7381 @opindex fsched-pressure
7382 Enable register pressure sensitive insn scheduling before register
7383 allocation.  This only makes sense when scheduling before register
7384 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7385 @option{-O2} or higher.  Usage of this option can improve the
7386 generated code and decrease its size by preventing register pressure
7387 increase above the number of available hard registers and subsequent
7388 spills in register allocation.
7390 @item -fsched-spec-load
7391 @opindex fsched-spec-load
7392 Allow speculative motion of some load instructions.  This only makes
7393 sense when scheduling before register allocation, i.e.@: with
7394 @option{-fschedule-insns} or at @option{-O2} or higher.
7396 @item -fsched-spec-load-dangerous
7397 @opindex fsched-spec-load-dangerous
7398 Allow speculative motion of more load instructions.  This only makes
7399 sense when scheduling before register allocation, i.e.@: with
7400 @option{-fschedule-insns} or at @option{-O2} or higher.
7402 @item -fsched-stalled-insns
7403 @itemx -fsched-stalled-insns=@var{n}
7404 @opindex fsched-stalled-insns
7405 Define how many insns (if any) can be moved prematurely from the queue
7406 of stalled insns into the ready list during the second scheduling pass.
7407 @option{-fno-sched-stalled-insns} means that no insns are moved
7408 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7409 on how many queued insns can be moved prematurely.
7410 @option{-fsched-stalled-insns} without a value is equivalent to
7411 @option{-fsched-stalled-insns=1}.
7413 @item -fsched-stalled-insns-dep
7414 @itemx -fsched-stalled-insns-dep=@var{n}
7415 @opindex fsched-stalled-insns-dep
7416 Define how many insn groups (cycles) are examined for a dependency
7417 on a stalled insn that is a candidate for premature removal from the queue
7418 of stalled insns.  This has an effect only during the second scheduling pass,
7419 and only if @option{-fsched-stalled-insns} is used.
7420 @option{-fno-sched-stalled-insns-dep} is equivalent to
7421 @option{-fsched-stalled-insns-dep=0}.
7422 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7423 @option{-fsched-stalled-insns-dep=1}.
7425 @item -fsched2-use-superblocks
7426 @opindex fsched2-use-superblocks
7427 When scheduling after register allocation, use superblock scheduling.
7428 This allows motion across basic block boundaries,
7429 resulting in faster schedules.  This option is experimental, as not all machine
7430 descriptions used by GCC model the CPU closely enough to avoid unreliable
7431 results from the algorithm.
7433 This only makes sense when scheduling after register allocation, i.e.@: with
7434 @option{-fschedule-insns2} or at @option{-O2} or higher.
7436 @item -fsched-group-heuristic
7437 @opindex fsched-group-heuristic
7438 Enable the group heuristic in the scheduler.  This heuristic favors
7439 the instruction that belongs to a schedule group.  This is enabled
7440 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7441 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7443 @item -fsched-critical-path-heuristic
7444 @opindex fsched-critical-path-heuristic
7445 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7446 instructions on the critical path.  This is enabled by default when
7447 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7448 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7450 @item -fsched-spec-insn-heuristic
7451 @opindex fsched-spec-insn-heuristic
7452 Enable the speculative instruction heuristic in the scheduler.  This
7453 heuristic favors speculative instructions with greater dependency weakness.
7454 This is enabled by default when scheduling is enabled, i.e.@:
7455 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7456 or at @option{-O2} or higher.
7458 @item -fsched-rank-heuristic
7459 @opindex fsched-rank-heuristic
7460 Enable the rank heuristic in the scheduler.  This heuristic favors
7461 the instruction belonging to a basic block with greater size or frequency.
7462 This is enabled by default when scheduling is enabled, i.e.@:
7463 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7464 at @option{-O2} or higher.
7466 @item -fsched-last-insn-heuristic
7467 @opindex fsched-last-insn-heuristic
7468 Enable the last-instruction heuristic in the scheduler.  This heuristic
7469 favors the instruction that is less dependent on the last instruction
7470 scheduled.  This is enabled by default when scheduling is enabled,
7471 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7472 at @option{-O2} or higher.
7474 @item -fsched-dep-count-heuristic
7475 @opindex fsched-dep-count-heuristic
7476 Enable the dependent-count heuristic in the scheduler.  This heuristic
7477 favors the instruction that has more instructions depending on it.
7478 This is enabled by default when scheduling is enabled, i.e.@:
7479 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7480 at @option{-O2} or higher.
7482 @item -freschedule-modulo-scheduled-loops
7483 @opindex freschedule-modulo-scheduled-loops
7484 Modulo scheduling is performed before traditional scheduling.  If a loop
7485 is modulo scheduled, later scheduling passes may change its schedule.  
7486 Use this option to control that behavior.
7488 @item -fselective-scheduling
7489 @opindex fselective-scheduling
7490 Schedule instructions using selective scheduling algorithm.  Selective
7491 scheduling runs instead of the first scheduler pass.
7493 @item -fselective-scheduling2
7494 @opindex fselective-scheduling2
7495 Schedule instructions using selective scheduling algorithm.  Selective
7496 scheduling runs instead of the second scheduler pass.
7498 @item -fsel-sched-pipelining
7499 @opindex fsel-sched-pipelining
7500 Enable software pipelining of innermost loops during selective scheduling.
7501 This option has no effect unless one of @option{-fselective-scheduling} or
7502 @option{-fselective-scheduling2} is turned on.
7504 @item -fsel-sched-pipelining-outer-loops
7505 @opindex fsel-sched-pipelining-outer-loops
7506 When pipelining loops during selective scheduling, also pipeline outer loops.
7507 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7509 @item -fshrink-wrap
7510 @opindex fshrink-wrap
7511 Emit function prologues only before parts of the function that need it,
7512 rather than at the top of the function.  This flag is enabled by default at
7513 @option{-O} and higher.
7515 @item -fcaller-saves
7516 @opindex fcaller-saves
7517 Enable allocation of values to registers that are clobbered by
7518 function calls, by emitting extra instructions to save and restore the
7519 registers around such calls.  Such allocation is done only when it
7520 seems to result in better code.
7522 This option is always enabled by default on certain machines, usually
7523 those which have no call-preserved registers to use instead.
7525 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7527 @item -fcombine-stack-adjustments
7528 @opindex fcombine-stack-adjustments
7529 Tracks stack adjustments (pushes and pops) and stack memory references
7530 and then tries to find ways to combine them.
7532 Enabled by default at @option{-O1} and higher.
7534 @item -fconserve-stack
7535 @opindex fconserve-stack
7536 Attempt to minimize stack usage.  The compiler attempts to use less
7537 stack space, even if that makes the program slower.  This option
7538 implies setting the @option{large-stack-frame} parameter to 100
7539 and the @option{large-stack-frame-growth} parameter to 400.
7541 @item -ftree-reassoc
7542 @opindex ftree-reassoc
7543 Perform reassociation on trees.  This flag is enabled by default
7544 at @option{-O} and higher.
7546 @item -ftree-pre
7547 @opindex ftree-pre
7548 Perform partial redundancy elimination (PRE) on trees.  This flag is
7549 enabled by default at @option{-O2} and @option{-O3}.
7551 @item -ftree-partial-pre
7552 @opindex ftree-partial-pre
7553 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7554 enabled by default at @option{-O3}.
7556 @item -ftree-forwprop
7557 @opindex ftree-forwprop
7558 Perform forward propagation on trees.  This flag is enabled by default
7559 at @option{-O} and higher.
7561 @item -ftree-fre
7562 @opindex ftree-fre
7563 Perform full redundancy elimination (FRE) on trees.  The difference
7564 between FRE and PRE is that FRE only considers expressions
7565 that are computed on all paths leading to the redundant computation.
7566 This analysis is faster than PRE, though it exposes fewer redundancies.
7567 This flag is enabled by default at @option{-O} and higher.
7569 @item -ftree-phiprop
7570 @opindex ftree-phiprop
7571 Perform hoisting of loads from conditional pointers on trees.  This
7572 pass is enabled by default at @option{-O} and higher.
7574 @item -fhoist-adjacent-loads
7575 @opindex hoist-adjacent-loads
7576 Speculatively hoist loads from both branches of an if-then-else if the
7577 loads are from adjacent locations in the same structure and the target
7578 architecture has a conditional move instruction.  This flag is enabled
7579 by default at @option{-O2} and higher.
7581 @item -ftree-copy-prop
7582 @opindex ftree-copy-prop
7583 Perform copy propagation on trees.  This pass eliminates unnecessary
7584 copy operations.  This flag is enabled by default at @option{-O} and
7585 higher.
7587 @item -fipa-pure-const
7588 @opindex fipa-pure-const
7589 Discover which functions are pure or constant.
7590 Enabled by default at @option{-O} and higher.
7592 @item -fipa-reference
7593 @opindex fipa-reference
7594 Discover which static variables do not escape the
7595 compilation unit.
7596 Enabled by default at @option{-O} and higher.
7598 @item -fipa-pta
7599 @opindex fipa-pta
7600 Perform interprocedural pointer analysis and interprocedural modification
7601 and reference analysis.  This option can cause excessive memory and
7602 compile-time usage on large compilation units.  It is not enabled by
7603 default at any optimization level.
7605 @item -fipa-profile
7606 @opindex fipa-profile
7607 Perform interprocedural profile propagation.  The functions called only from
7608 cold functions are marked as cold. Also functions executed once (such as
7609 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7610 functions and loop less parts of functions executed once are then optimized for
7611 size.
7612 Enabled by default at @option{-O} and higher.
7614 @item -fipa-cp
7615 @opindex fipa-cp
7616 Perform interprocedural constant propagation.
7617 This optimization analyzes the program to determine when values passed
7618 to functions are constants and then optimizes accordingly.
7619 This optimization can substantially increase performance
7620 if the application has constants passed to functions.
7621 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7623 @item -fipa-cp-clone
7624 @opindex fipa-cp-clone
7625 Perform function cloning to make interprocedural constant propagation stronger.
7626 When enabled, interprocedural constant propagation performs function cloning
7627 when externally visible function can be called with constant arguments.
7628 Because this optimization can create multiple copies of functions,
7629 it may significantly increase code size
7630 (see @option{--param ipcp-unit-growth=@var{value}}).
7631 This flag is enabled by default at @option{-O3}.
7633 @item -ftree-sink
7634 @opindex ftree-sink
7635 Perform forward store motion  on trees.  This flag is
7636 enabled by default at @option{-O} and higher.
7638 @item -ftree-bit-ccp
7639 @opindex ftree-bit-ccp
7640 Perform sparse conditional bit constant propagation on trees and propagate
7641 pointer alignment information.
7642 This pass only operates on local scalar variables and is enabled by default
7643 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7645 @item -ftree-ccp
7646 @opindex ftree-ccp
7647 Perform sparse conditional constant propagation (CCP) on trees.  This
7648 pass only operates on local scalar variables and is enabled by default
7649 at @option{-O} and higher.
7651 @item -ftree-switch-conversion
7652 Perform conversion of simple initializations in a switch to
7653 initializations from a scalar array.  This flag is enabled by default
7654 at @option{-O2} and higher.
7656 @item -ftree-tail-merge
7657 Look for identical code sequences.  When found, replace one with a jump to the
7658 other.  This optimization is known as tail merging or cross jumping.  This flag
7659 is enabled by default at @option{-O2} and higher.  The compilation time
7660 in this pass can
7661 be limited using @option{max-tail-merge-comparisons} parameter and
7662 @option{max-tail-merge-iterations} parameter.
7664 @item -ftree-dce
7665 @opindex ftree-dce
7666 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7667 default at @option{-O} and higher.
7669 @item -ftree-builtin-call-dce
7670 @opindex ftree-builtin-call-dce
7671 Perform conditional dead code elimination (DCE) for calls to built-in functions
7672 that may set @code{errno} but are otherwise side-effect free.  This flag is
7673 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7674 specified.
7676 @item -ftree-dominator-opts
7677 @opindex ftree-dominator-opts
7678 Perform a variety of simple scalar cleanups (constant/copy
7679 propagation, redundancy elimination, range propagation and expression
7680 simplification) based on a dominator tree traversal.  This also
7681 performs jump threading (to reduce jumps to jumps). This flag is
7682 enabled by default at @option{-O} and higher.
7684 @item -ftree-dse
7685 @opindex ftree-dse
7686 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7687 a memory location that is later overwritten by another store without
7688 any intervening loads.  In this case the earlier store can be deleted.  This
7689 flag is enabled by default at @option{-O} and higher.
7691 @item -ftree-ch
7692 @opindex ftree-ch
7693 Perform loop header copying on trees.  This is beneficial since it increases
7694 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7695 is enabled by default at @option{-O} and higher.  It is not enabled
7696 for @option{-Os}, since it usually increases code size.
7698 @item -ftree-loop-optimize
7699 @opindex ftree-loop-optimize
7700 Perform loop optimizations on trees.  This flag is enabled by default
7701 at @option{-O} and higher.
7703 @item -ftree-loop-linear
7704 @opindex ftree-loop-linear
7705 Perform loop interchange transformations on tree.  Same as
7706 @option{-floop-interchange}.  To use this code transformation, GCC has
7707 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7708 enable the Graphite loop transformation infrastructure.
7710 @item -floop-interchange
7711 @opindex floop-interchange
7712 Perform loop interchange transformations on loops.  Interchanging two
7713 nested loops switches the inner and outer loops.  For example, given a
7714 loop like:
7715 @smallexample
7716 DO J = 1, M
7717   DO I = 1, N
7718     A(J, I) = A(J, I) * C
7719   ENDDO
7720 ENDDO
7721 @end smallexample
7722 loop interchange transforms the loop as if it were written:
7723 @smallexample
7724 DO I = 1, N
7725   DO J = 1, M
7726     A(J, I) = A(J, I) * C
7727   ENDDO
7728 ENDDO
7729 @end smallexample
7730 which can be beneficial when @code{N} is larger than the caches,
7731 because in Fortran, the elements of an array are stored in memory
7732 contiguously by column, and the original loop iterates over rows,
7733 potentially creating at each access a cache miss.  This optimization
7734 applies to all the languages supported by GCC and is not limited to
7735 Fortran.  To use this code transformation, GCC has to be configured
7736 with @option{--with-ppl} and @option{--with-cloog} to enable the
7737 Graphite loop transformation infrastructure.
7739 @item -floop-strip-mine
7740 @opindex floop-strip-mine
7741 Perform loop strip mining transformations on loops.  Strip mining
7742 splits a loop into two nested loops.  The outer loop has strides
7743 equal to the strip size and the inner loop has strides of the
7744 original loop within a strip.  The strip length can be changed
7745 using the @option{loop-block-tile-size} parameter.  For example,
7746 given a loop like:
7747 @smallexample
7748 DO I = 1, N
7749   A(I) = A(I) + C
7750 ENDDO
7751 @end smallexample
7752 loop strip mining transforms the loop as if it were written:
7753 @smallexample
7754 DO II = 1, N, 51
7755   DO I = II, min (II + 50, N)
7756     A(I) = A(I) + C
7757   ENDDO
7758 ENDDO
7759 @end smallexample
7760 This optimization applies to all the languages supported by GCC and is
7761 not limited to Fortran.  To use this code transformation, GCC has to
7762 be configured with @option{--with-ppl} and @option{--with-cloog} to
7763 enable the Graphite loop transformation infrastructure.
7765 @item -floop-block
7766 @opindex floop-block
7767 Perform loop blocking transformations on loops.  Blocking strip mines
7768 each loop in the loop nest such that the memory accesses of the
7769 element loops fit inside caches.  The strip length can be changed
7770 using the @option{loop-block-tile-size} parameter.  For example, given
7771 a loop like:
7772 @smallexample
7773 DO I = 1, N
7774   DO J = 1, M
7775     A(J, I) = B(I) + C(J)
7776   ENDDO
7777 ENDDO
7778 @end smallexample
7779 loop blocking transforms the loop as if it were written:
7780 @smallexample
7781 DO II = 1, N, 51
7782   DO JJ = 1, M, 51
7783     DO I = II, min (II + 50, N)
7784       DO J = JJ, min (JJ + 50, M)
7785         A(J, I) = B(I) + C(J)
7786       ENDDO
7787     ENDDO
7788   ENDDO
7789 ENDDO
7790 @end smallexample
7791 which can be beneficial when @code{M} is larger than the caches,
7792 because the innermost loop iterates over a smaller amount of data
7793 which can be kept in the caches.  This optimization applies to all the
7794 languages supported by GCC and is not limited to Fortran.  To use this
7795 code transformation, GCC has to be configured with @option{--with-ppl}
7796 and @option{--with-cloog} to enable the Graphite loop transformation
7797 infrastructure.
7799 @item -fgraphite-identity
7800 @opindex fgraphite-identity
7801 Enable the identity transformation for graphite.  For every SCoP we generate
7802 the polyhedral representation and transform it back to gimple.  Using
7803 @option{-fgraphite-identity} we can check the costs or benefits of the
7804 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7805 are also performed by the code generator CLooG, like index splitting and
7806 dead code elimination in loops.
7808 @item -floop-nest-optimize
7809 @opindex floop-nest-optimize
7810 Enable the ISL based loop nest optimizer.  This is a generic loop nest
7811 optimizer based on the Pluto optimization algorithms.  It calculates a loop
7812 structure optimized for data-locality and parallelism.  This option
7813 is experimental.
7815 @item -floop-parallelize-all
7816 @opindex floop-parallelize-all
7817 Use the Graphite data dependence analysis to identify loops that can
7818 be parallelized.  Parallelize all the loops that can be analyzed to
7819 not contain loop carried dependences without checking that it is
7820 profitable to parallelize the loops.
7822 @item -fcheck-data-deps
7823 @opindex fcheck-data-deps
7824 Compare the results of several data dependence analyzers.  This option
7825 is used for debugging the data dependence analyzers.
7827 @item -ftree-loop-if-convert
7828 Attempt to transform conditional jumps in the innermost loops to
7829 branch-less equivalents.  The intent is to remove control-flow from
7830 the innermost loops in order to improve the ability of the
7831 vectorization pass to handle these loops.  This is enabled by default
7832 if vectorization is enabled.
7834 @item -ftree-loop-if-convert-stores
7835 Attempt to also if-convert conditional jumps containing memory writes.
7836 This transformation can be unsafe for multi-threaded programs as it
7837 transforms conditional memory writes into unconditional memory writes.
7838 For example,
7839 @smallexample
7840 for (i = 0; i < N; i++)
7841   if (cond)
7842     A[i] = expr;
7843 @end smallexample
7844 is transformed to
7845 @smallexample
7846 for (i = 0; i < N; i++)
7847   A[i] = cond ? expr : A[i];
7848 @end smallexample
7849 potentially producing data races.
7851 @item -ftree-loop-distribution
7852 Perform loop distribution.  This flag can improve cache performance on
7853 big loop bodies and allow further loop optimizations, like
7854 parallelization or vectorization, to take place.  For example, the loop
7855 @smallexample
7856 DO I = 1, N
7857   A(I) = B(I) + C
7858   D(I) = E(I) * F
7859 ENDDO
7860 @end smallexample
7861 is transformed to
7862 @smallexample
7863 DO I = 1, N
7864    A(I) = B(I) + C
7865 ENDDO
7866 DO I = 1, N
7867    D(I) = E(I) * F
7868 ENDDO
7869 @end smallexample
7871 @item -ftree-loop-distribute-patterns
7872 Perform loop distribution of patterns that can be code generated with
7873 calls to a library.  This flag is enabled by default at @option{-O3}.
7875 This pass distributes the initialization loops and generates a call to
7876 memset zero.  For example, the loop
7877 @smallexample
7878 DO I = 1, N
7879   A(I) = 0
7880   B(I) = A(I) + I
7881 ENDDO
7882 @end smallexample
7883 is transformed to
7884 @smallexample
7885 DO I = 1, N
7886    A(I) = 0
7887 ENDDO
7888 DO I = 1, N
7889    B(I) = A(I) + I
7890 ENDDO
7891 @end smallexample
7892 and the initialization loop is transformed into a call to memset zero.
7894 @item -ftree-loop-im
7895 @opindex ftree-loop-im
7896 Perform loop invariant motion on trees.  This pass moves only invariants that
7897 are hard to handle at RTL level (function calls, operations that expand to
7898 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7899 operands of conditions that are invariant out of the loop, so that we can use
7900 just trivial invariantness analysis in loop unswitching.  The pass also includes
7901 store motion.
7903 @item -ftree-loop-ivcanon
7904 @opindex ftree-loop-ivcanon
7905 Create a canonical counter for number of iterations in loops for which
7906 determining number of iterations requires complicated analysis.  Later
7907 optimizations then may determine the number easily.  Useful especially
7908 in connection with unrolling.
7910 @item -fivopts
7911 @opindex fivopts
7912 Perform induction variable optimizations (strength reduction, induction
7913 variable merging and induction variable elimination) on trees.
7915 @item -ftree-parallelize-loops=n
7916 @opindex ftree-parallelize-loops
7917 Parallelize loops, i.e., split their iteration space to run in n threads.
7918 This is only possible for loops whose iterations are independent
7919 and can be arbitrarily reordered.  The optimization is only
7920 profitable on multiprocessor machines, for loops that are CPU-intensive,
7921 rather than constrained e.g.@: by memory bandwidth.  This option
7922 implies @option{-pthread}, and thus is only supported on targets
7923 that have support for @option{-pthread}.
7925 @item -ftree-pta
7926 @opindex ftree-pta
7927 Perform function-local points-to analysis on trees.  This flag is
7928 enabled by default at @option{-O} and higher.
7930 @item -ftree-sra
7931 @opindex ftree-sra
7932 Perform scalar replacement of aggregates.  This pass replaces structure
7933 references with scalars to prevent committing structures to memory too
7934 early.  This flag is enabled by default at @option{-O} and higher.
7936 @item -ftree-copyrename
7937 @opindex ftree-copyrename
7938 Perform copy renaming on trees.  This pass attempts to rename compiler
7939 temporaries to other variables at copy locations, usually resulting in
7940 variable names which more closely resemble the original variables.  This flag
7941 is enabled by default at @option{-O} and higher.
7943 @item -ftree-coalesce-inlined-vars
7944 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7945 combine small user-defined variables too, but only if they were inlined
7946 from other functions.  It is a more limited form of
7947 @option{-ftree-coalesce-vars}.  This may harm debug information of such
7948 inlined variables, but it will keep variables of the inlined-into
7949 function apart from each other, such that they are more likely to
7950 contain the expected values in a debugging session.  This was the
7951 default in GCC versions older than 4.7.
7953 @item -ftree-coalesce-vars
7954 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7955 combine small user-defined variables too, instead of just compiler
7956 temporaries.  This may severely limit the ability to debug an optimized
7957 program compiled with @option{-fno-var-tracking-assignments}.  In the
7958 negated form, this flag prevents SSA coalescing of user variables,
7959 including inlined ones.  This option is enabled by default.
7961 @item -ftree-ter
7962 @opindex ftree-ter
7963 Perform temporary expression replacement during the SSA->normal phase.  Single
7964 use/single def temporaries are replaced at their use location with their
7965 defining expression.  This results in non-GIMPLE code, but gives the expanders
7966 much more complex trees to work on resulting in better RTL generation.  This is
7967 enabled by default at @option{-O} and higher.
7969 @item -ftree-slsr
7970 @opindex ftree-slsr
7971 Perform straight-line strength reduction on trees.  This recognizes related
7972 expressions involving multiplications and replaces them by less expensive
7973 calculations when possible.  This is enabled by default at @option{-O} and
7974 higher.
7976 @item -ftree-vectorize
7977 @opindex ftree-vectorize
7978 Perform loop vectorization on trees. This flag is enabled by default at
7979 @option{-O3}.
7981 @item -ftree-slp-vectorize
7982 @opindex ftree-slp-vectorize
7983 Perform basic block vectorization on trees. This flag is enabled by default at
7984 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7986 @item -ftree-vect-loop-version
7987 @opindex ftree-vect-loop-version
7988 Perform loop versioning when doing loop vectorization on trees.  When a loop
7989 appears to be vectorizable except that data alignment or data dependence cannot
7990 be determined at compile time, then vectorized and non-vectorized versions of
7991 the loop are generated along with run-time checks for alignment or dependence
7992 to control which version is executed.  This option is enabled by default
7993 except at level @option{-Os} where it is disabled.
7995 @item -fvect-cost-model
7996 @opindex fvect-cost-model
7997 Enable cost model for vectorization.  This option is enabled by default at
7998 @option{-O3}.
8000 @item -ftree-vrp
8001 @opindex ftree-vrp
8002 Perform Value Range Propagation on trees.  This is similar to the
8003 constant propagation pass, but instead of values, ranges of values are
8004 propagated.  This allows the optimizers to remove unnecessary range
8005 checks like array bound checks and null pointer checks.  This is
8006 enabled by default at @option{-O2} and higher.  Null pointer check
8007 elimination is only done if @option{-fdelete-null-pointer-checks} is
8008 enabled.
8010 @item -ftracer
8011 @opindex ftracer
8012 Perform tail duplication to enlarge superblock size.  This transformation
8013 simplifies the control flow of the function allowing other optimizations to do
8014 a better job.
8016 @item -funroll-loops
8017 @opindex funroll-loops
8018 Unroll loops whose number of iterations can be determined at compile
8019 time or upon entry to the loop.  @option{-funroll-loops} implies
8020 @option{-frerun-cse-after-loop}.  This option makes code larger,
8021 and may or may not make it run faster.
8023 @item -funroll-all-loops
8024 @opindex funroll-all-loops
8025 Unroll all loops, even if their number of iterations is uncertain when
8026 the loop is entered.  This usually makes programs run more slowly.
8027 @option{-funroll-all-loops} implies the same options as
8028 @option{-funroll-loops},
8030 @item -fsplit-ivs-in-unroller
8031 @opindex fsplit-ivs-in-unroller
8032 Enables expression of values of induction variables in later iterations
8033 of the unrolled loop using the value in the first iteration.  This breaks
8034 long dependency chains, thus improving efficiency of the scheduling passes.
8036 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8037 same effect.  However, that is not reliable in cases where the loop body
8038 is more complicated than a single basic block.  It also does not work at all
8039 on some architectures due to restrictions in the CSE pass.
8041 This optimization is enabled by default.
8043 @item -fvariable-expansion-in-unroller
8044 @opindex fvariable-expansion-in-unroller
8045 With this option, the compiler creates multiple copies of some
8046 local variables when unrolling a loop, which can result in superior code.
8048 @item -fpartial-inlining
8049 @opindex fpartial-inlining
8050 Inline parts of functions.  This option has any effect only
8051 when inlining itself is turned on by the @option{-finline-functions}
8052 or @option{-finline-small-functions} options.
8054 Enabled at level @option{-O2}.
8056 @item -fpredictive-commoning
8057 @opindex fpredictive-commoning
8058 Perform predictive commoning optimization, i.e., reusing computations
8059 (especially memory loads and stores) performed in previous
8060 iterations of loops.
8062 This option is enabled at level @option{-O3}.
8064 @item -fprefetch-loop-arrays
8065 @opindex fprefetch-loop-arrays
8066 If supported by the target machine, generate instructions to prefetch
8067 memory to improve the performance of loops that access large arrays.
8069 This option may generate better or worse code; results are highly
8070 dependent on the structure of loops within the source code.
8072 Disabled at level @option{-Os}.
8074 @item -fno-peephole
8075 @itemx -fno-peephole2
8076 @opindex fno-peephole
8077 @opindex fno-peephole2
8078 Disable any machine-specific peephole optimizations.  The difference
8079 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8080 are implemented in the compiler; some targets use one, some use the
8081 other, a few use both.
8083 @option{-fpeephole} is enabled by default.
8084 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8086 @item -fno-guess-branch-probability
8087 @opindex fno-guess-branch-probability
8088 Do not guess branch probabilities using heuristics.
8090 GCC uses heuristics to guess branch probabilities if they are
8091 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8092 heuristics are based on the control flow graph.  If some branch probabilities
8093 are specified by @samp{__builtin_expect}, then the heuristics are
8094 used to guess branch probabilities for the rest of the control flow graph,
8095 taking the @samp{__builtin_expect} info into account.  The interactions
8096 between the heuristics and @samp{__builtin_expect} can be complex, and in
8097 some cases, it may be useful to disable the heuristics so that the effects
8098 of @samp{__builtin_expect} are easier to understand.
8100 The default is @option{-fguess-branch-probability} at levels
8101 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8103 @item -freorder-blocks
8104 @opindex freorder-blocks
8105 Reorder basic blocks in the compiled function in order to reduce number of
8106 taken branches and improve code locality.
8108 Enabled at levels @option{-O2}, @option{-O3}.
8110 @item -freorder-blocks-and-partition
8111 @opindex freorder-blocks-and-partition
8112 In addition to reordering basic blocks in the compiled function, in order
8113 to reduce number of taken branches, partitions hot and cold basic blocks
8114 into separate sections of the assembly and .o files, to improve
8115 paging and cache locality performance.
8117 This optimization is automatically turned off in the presence of
8118 exception handling, for linkonce sections, for functions with a user-defined
8119 section attribute and on any architecture that does not support named
8120 sections.
8122 @item -freorder-functions
8123 @opindex freorder-functions
8124 Reorder functions in the object file in order to
8125 improve code locality.  This is implemented by using special
8126 subsections @code{.text.hot} for most frequently executed functions and
8127 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8128 the linker so object file format must support named sections and linker must
8129 place them in a reasonable way.
8131 Also profile feedback must be available to make this option effective.  See
8132 @option{-fprofile-arcs} for details.
8134 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8136 @item -fstrict-aliasing
8137 @opindex fstrict-aliasing
8138 Allow the compiler to assume the strictest aliasing rules applicable to
8139 the language being compiled.  For C (and C++), this activates
8140 optimizations based on the type of expressions.  In particular, an
8141 object of one type is assumed never to reside at the same address as an
8142 object of a different type, unless the types are almost the same.  For
8143 example, an @code{unsigned int} can alias an @code{int}, but not a
8144 @code{void*} or a @code{double}.  A character type may alias any other
8145 type.
8147 @anchor{Type-punning}Pay special attention to code like this:
8148 @smallexample
8149 union a_union @{
8150   int i;
8151   double d;
8154 int f() @{
8155   union a_union t;
8156   t.d = 3.0;
8157   return t.i;
8159 @end smallexample
8160 The practice of reading from a different union member than the one most
8161 recently written to (called ``type-punning'') is common.  Even with
8162 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8163 is accessed through the union type.  So, the code above works as
8164 expected.  @xref{Structures unions enumerations and bit-fields
8165 implementation}.  However, this code might not:
8166 @smallexample
8167 int f() @{
8168   union a_union t;
8169   int* ip;
8170   t.d = 3.0;
8171   ip = &t.i;
8172   return *ip;
8174 @end smallexample
8176 Similarly, access by taking the address, casting the resulting pointer
8177 and dereferencing the result has undefined behavior, even if the cast
8178 uses a union type, e.g.:
8179 @smallexample
8180 int f() @{
8181   double d = 3.0;
8182   return ((union a_union *) &d)->i;
8184 @end smallexample
8186 The @option{-fstrict-aliasing} option is enabled at levels
8187 @option{-O2}, @option{-O3}, @option{-Os}.
8189 @item -fstrict-overflow
8190 @opindex fstrict-overflow
8191 Allow the compiler to assume strict signed overflow rules, depending
8192 on the language being compiled.  For C (and C++) this means that
8193 overflow when doing arithmetic with signed numbers is undefined, which
8194 means that the compiler may assume that it does not happen.  This
8195 permits various optimizations.  For example, the compiler assumes
8196 that an expression like @code{i + 10 > i} is always true for
8197 signed @code{i}.  This assumption is only valid if signed overflow is
8198 undefined, as the expression is false if @code{i + 10} overflows when
8199 using twos complement arithmetic.  When this option is in effect any
8200 attempt to determine whether an operation on signed numbers 
8201 overflows must be written carefully to not actually involve overflow.
8203 This option also allows the compiler to assume strict pointer
8204 semantics: given a pointer to an object, if adding an offset to that
8205 pointer does not produce a pointer to the same object, the addition is
8206 undefined.  This permits the compiler to conclude that @code{p + u >
8207 p} is always true for a pointer @code{p} and unsigned integer
8208 @code{u}.  This assumption is only valid because pointer wraparound is
8209 undefined, as the expression is false if @code{p + u} overflows using
8210 twos complement arithmetic.
8212 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8213 that integer signed overflow is fully defined: it wraps.  When
8214 @option{-fwrapv} is used, there is no difference between
8215 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8216 integers.  With @option{-fwrapv} certain types of overflow are
8217 permitted.  For example, if the compiler gets an overflow when doing
8218 arithmetic on constants, the overflowed value can still be used with
8219 @option{-fwrapv}, but not otherwise.
8221 The @option{-fstrict-overflow} option is enabled at levels
8222 @option{-O2}, @option{-O3}, @option{-Os}.
8224 @item -falign-functions
8225 @itemx -falign-functions=@var{n}
8226 @opindex falign-functions
8227 Align the start of functions to the next power-of-two greater than
8228 @var{n}, skipping up to @var{n} bytes.  For instance,
8229 @option{-falign-functions=32} aligns functions to the next 32-byte
8230 boundary, but @option{-falign-functions=24} aligns to the next
8231 32-byte boundary only if this can be done by skipping 23 bytes or less.
8233 @option{-fno-align-functions} and @option{-falign-functions=1} are
8234 equivalent and mean that functions are not aligned.
8236 Some assemblers only support this flag when @var{n} is a power of two;
8237 in that case, it is rounded up.
8239 If @var{n} is not specified or is zero, use a machine-dependent default.
8241 Enabled at levels @option{-O2}, @option{-O3}.
8243 @item -falign-labels
8244 @itemx -falign-labels=@var{n}
8245 @opindex falign-labels
8246 Align all branch targets to a power-of-two boundary, skipping up to
8247 @var{n} bytes like @option{-falign-functions}.  This option can easily
8248 make code slower, because it must insert dummy operations for when the
8249 branch target is reached in the usual flow of the code.
8251 @option{-fno-align-labels} and @option{-falign-labels=1} are
8252 equivalent and mean that labels are not aligned.
8254 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8255 are greater than this value, then their values are used instead.
8257 If @var{n} is not specified or is zero, use a machine-dependent default
8258 which is very likely to be @samp{1}, meaning no alignment.
8260 Enabled at levels @option{-O2}, @option{-O3}.
8262 @item -falign-loops
8263 @itemx -falign-loops=@var{n}
8264 @opindex falign-loops
8265 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8266 like @option{-falign-functions}.  If the loops are
8267 executed many times, this makes up for any execution of the dummy
8268 operations.
8270 @option{-fno-align-loops} and @option{-falign-loops=1} are
8271 equivalent and mean that loops are not aligned.
8273 If @var{n} is not specified or is zero, use a machine-dependent default.
8275 Enabled at levels @option{-O2}, @option{-O3}.
8277 @item -falign-jumps
8278 @itemx -falign-jumps=@var{n}
8279 @opindex falign-jumps
8280 Align branch targets to a power-of-two boundary, for branch targets
8281 where the targets can only be reached by jumping, skipping up to @var{n}
8282 bytes like @option{-falign-functions}.  In this case, no dummy operations
8283 need be executed.
8285 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8286 equivalent and mean that loops are not aligned.
8288 If @var{n} is not specified or is zero, use a machine-dependent default.
8290 Enabled at levels @option{-O2}, @option{-O3}.
8292 @item -funit-at-a-time
8293 @opindex funit-at-a-time
8294 This option is left for compatibility reasons. @option{-funit-at-a-time}
8295 has no effect, while @option{-fno-unit-at-a-time} implies
8296 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8298 Enabled by default.
8300 @item -fno-toplevel-reorder
8301 @opindex fno-toplevel-reorder
8302 Do not reorder top-level functions, variables, and @code{asm}
8303 statements.  Output them in the same order that they appear in the
8304 input file.  When this option is used, unreferenced static variables
8305 are not removed.  This option is intended to support existing code
8306 that relies on a particular ordering.  For new code, it is better to
8307 use attributes.
8309 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8310 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8311 targets.
8313 @item -fweb
8314 @opindex fweb
8315 Constructs webs as commonly used for register allocation purposes and assign
8316 each web individual pseudo register.  This allows the register allocation pass
8317 to operate on pseudos directly, but also strengthens several other optimization
8318 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8319 however, make debugging impossible, since variables no longer stay in a
8320 ``home register''.
8322 Enabled by default with @option{-funroll-loops}.
8324 @item -fwhole-program
8325 @opindex fwhole-program
8326 Assume that the current compilation unit represents the whole program being
8327 compiled.  All public functions and variables with the exception of @code{main}
8328 and those merged by attribute @code{externally_visible} become static functions
8329 and in effect are optimized more aggressively by interprocedural optimizers.
8331 This option should not be used in combination with @code{-flto}.
8332 Instead relying on a linker plugin should provide safer and more precise
8333 information.
8335 @item -flto[=@var{n}]
8336 @opindex flto
8337 This option runs the standard link-time optimizer.  When invoked
8338 with source code, it generates GIMPLE (one of GCC's internal
8339 representations) and writes it to special ELF sections in the object
8340 file.  When the object files are linked together, all the function
8341 bodies are read from these ELF sections and instantiated as if they
8342 had been part of the same translation unit.
8344 To use the link-time optimizer, @option{-flto} needs to be specified at
8345 compile time and during the final link.  For example:
8347 @smallexample
8348 gcc -c -O2 -flto foo.c
8349 gcc -c -O2 -flto bar.c
8350 gcc -o myprog -flto -O2 foo.o bar.o
8351 @end smallexample
8353 The first two invocations to GCC save a bytecode representation
8354 of GIMPLE into special ELF sections inside @file{foo.o} and
8355 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8356 @file{foo.o} and @file{bar.o}, merges the two files into a single
8357 internal image, and compiles the result as usual.  Since both
8358 @file{foo.o} and @file{bar.o} are merged into a single image, this
8359 causes all the interprocedural analyses and optimizations in GCC to
8360 work across the two files as if they were a single one.  This means,
8361 for example, that the inliner is able to inline functions in
8362 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8364 Another (simpler) way to enable link-time optimization is:
8366 @smallexample
8367 gcc -o myprog -flto -O2 foo.c bar.c
8368 @end smallexample
8370 The above generates bytecode for @file{foo.c} and @file{bar.c},
8371 merges them together into a single GIMPLE representation and optimizes
8372 them as usual to produce @file{myprog}.
8374 The only important thing to keep in mind is that to enable link-time
8375 optimizations the @option{-flto} flag needs to be passed to both the
8376 compile and the link commands.
8378 To make whole program optimization effective, it is necessary to make
8379 certain whole program assumptions.  The compiler needs to know
8380 what functions and variables can be accessed by libraries and runtime
8381 outside of the link-time optimized unit.  When supported by the linker,
8382 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8383 to the compiler about used and externally visible symbols.  When
8384 the linker plugin is not available, @option{-fwhole-program} should be
8385 used to allow the compiler to make these assumptions, which leads
8386 to more aggressive optimization decisions.
8388 Note that when a file is compiled with @option{-flto}, the generated
8389 object file is larger than a regular object file because it 
8390 contains GIMPLE bytecodes and the usual final code.  This means that
8391 object files with LTO information can be linked as normal object
8392 files; if @option{-flto} is not passed to the linker, no
8393 interprocedural optimizations are applied.
8395 Additionally, the optimization flags used to compile individual files
8396 are not necessarily related to those used at link time.  For instance,
8398 @smallexample
8399 gcc -c -O0 -flto foo.c
8400 gcc -c -O0 -flto bar.c
8401 gcc -o myprog -flto -O3 foo.o bar.o
8402 @end smallexample
8404 This produces individual object files with unoptimized assembler
8405 code, but the resulting binary @file{myprog} is optimized at
8406 @option{-O3}.  If, instead, the final binary is generated without
8407 @option{-flto}, then @file{myprog} is not optimized.
8409 When producing the final binary with @option{-flto}, GCC only
8410 applies link-time optimizations to those files that contain bytecode.
8411 Therefore, you can mix and match object files and libraries with
8412 GIMPLE bytecodes and final object code.  GCC automatically selects
8413 which files to optimize in LTO mode and which files to link without
8414 further processing.
8416 There are some code generation flags preserved by GCC when
8417 generating bytecodes, as they need to be used during the final link
8418 stage.  Currently, the following options are saved into the GIMPLE
8419 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
8420 @option{-m} target flags.
8422 At link time, these options are read in and reapplied.  Note that the
8423 current implementation makes no attempt to recognize conflicting
8424 values for these options.  If different files have conflicting option
8425 values (e.g., one file is compiled with @option{-fPIC} and another
8426 isn't), the compiler simply uses the last value read from the
8427 bytecode files.  It is recommended, then, that you compile all the files
8428 participating in the same link with the same options.
8430 If LTO encounters objects with C linkage declared with incompatible
8431 types in separate translation units to be linked together (undefined
8432 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8433 issued.  The behavior is still undefined at run time.
8435 Another feature of LTO is that it is possible to apply interprocedural
8436 optimizations on files written in different languages.  This requires
8437 support in the language front end.  Currently, the C, C++ and
8438 Fortran front ends are capable of emitting GIMPLE bytecodes, so
8439 something like this should work:
8441 @smallexample
8442 gcc -c -flto foo.c
8443 g++ -c -flto bar.cc
8444 gfortran -c -flto baz.f90
8445 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8446 @end smallexample
8448 Notice that the final link is done with @command{g++} to get the C++
8449 runtime libraries and @option{-lgfortran} is added to get the Fortran
8450 runtime libraries.  In general, when mixing languages in LTO mode, you
8451 should use the same link command options as when mixing languages in a
8452 regular (non-LTO) compilation; all you need to add is @option{-flto} to
8453 all the compile and link commands.
8455 If object files containing GIMPLE bytecode are stored in a library archive, say
8456 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8457 are using a linker with plugin support.  To enable this feature, use
8458 the flag @option{-fuse-linker-plugin} at link time:
8460 @smallexample
8461 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8462 @end smallexample
8464 With the linker plugin enabled, the linker extracts the needed
8465 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8466 to make them part of the aggregated GIMPLE image to be optimized.
8468 If you are not using a linker with plugin support and/or do not
8469 enable the linker plugin, then the objects inside @file{libfoo.a}
8470 are extracted and linked as usual, but they do not participate
8471 in the LTO optimization process.
8473 Link-time optimizations do not require the presence of the whole program to
8474 operate.  If the program does not require any symbols to be exported, it is
8475 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8476 the interprocedural optimizers to use more aggressive assumptions which may
8477 lead to improved optimization opportunities.
8478 Use of @option{-fwhole-program} is not needed when linker plugin is
8479 active (see @option{-fuse-linker-plugin}).
8481 The current implementation of LTO makes no
8482 attempt to generate bytecode that is portable between different
8483 types of hosts.  The bytecode files are versioned and there is a
8484 strict version check, so bytecode files generated in one version of
8485 GCC will not work with an older/newer version of GCC@.
8487 Link-time optimization does not work well with generation of debugging
8488 information.  Combining @option{-flto} with
8489 @option{-g} is currently experimental and expected to produce wrong
8490 results.
8492 If you specify the optional @var{n}, the optimization and code
8493 generation done at link time is executed in parallel using @var{n}
8494 parallel jobs by utilizing an installed @command{make} program.  The
8495 environment variable @env{MAKE} may be used to override the program
8496 used.  The default value for @var{n} is 1.
8498 You can also specify @option{-flto=jobserver} to use GNU make's
8499 job server mode to determine the number of parallel jobs. This
8500 is useful when the Makefile calling GCC is already executing in parallel.
8501 You must prepend a @samp{+} to the command recipe in the parent Makefile
8502 for this to work.  This option likely only works if @env{MAKE} is
8503 GNU make.
8505 This option is disabled by default.
8507 @item -flto-partition=@var{alg}
8508 @opindex flto-partition
8509 Specify the partitioning algorithm used by the link-time optimizer.
8510 The value is either @code{1to1} to specify a partitioning mirroring
8511 the original source files or @code{balanced} to specify partitioning
8512 into equally sized chunks (whenever possible) or @code{max} to create
8513 new partition for every symbol where possible.  Specifying @code{none}
8514 as an algorithm disables partitioning and streaming completely. 
8515 The default value is @code{balanced}. While @code{1to1} can be used
8516 as an workaround for various code ordering issues, the @code{max}
8517 partitioning is intended for internal testing only.
8519 @item -flto-compression-level=@var{n}
8520 This option specifies the level of compression used for intermediate
8521 language written to LTO object files, and is only meaningful in
8522 conjunction with LTO mode (@option{-flto}).  Valid
8523 values are 0 (no compression) to 9 (maximum compression).  Values
8524 outside this range are clamped to either 0 or 9.  If the option is not
8525 given, a default balanced compression setting is used.
8527 @item -flto-report
8528 Prints a report with internal details on the workings of the link-time
8529 optimizer.  The contents of this report vary from version to version.
8530 It is meant to be useful to GCC developers when processing object
8531 files in LTO mode (via @option{-flto}).
8533 Disabled by default.
8535 @item -flto-report-wpa
8536 Like @option{-flto-report}, but only print for the WPA phase of Link
8537 Time Optimization.
8539 @item -fuse-linker-plugin
8540 Enables the use of a linker plugin during link-time optimization.  This
8541 option relies on plugin support in the linker, which is available in gold
8542 or in GNU ld 2.21 or newer.
8544 This option enables the extraction of object files with GIMPLE bytecode out
8545 of library archives. This improves the quality of optimization by exposing
8546 more code to the link-time optimizer.  This information specifies what
8547 symbols can be accessed externally (by non-LTO object or during dynamic
8548 linking).  Resulting code quality improvements on binaries (and shared
8549 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8550 See @option{-flto} for a description of the effect of this flag and how to
8551 use it.
8553 This option is enabled by default when LTO support in GCC is enabled
8554 and GCC was configured for use with
8555 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8557 @item -ffat-lto-objects
8558 @opindex ffat-lto-objects
8559 Fat LTO objects are object files that contain both the intermediate language
8560 and the object code. This makes them usable for both LTO linking and normal
8561 linking. This option is effective only when compiling with @option{-flto}
8562 and is ignored at link time.
8564 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8565 requires the complete toolchain to be aware of LTO. It requires a linker with
8566 linker plugin support for basic functionality.  Additionally,
8567 @command{nm}, @command{ar} and @command{ranlib}
8568 need to support linker plugins to allow a full-featured build environment
8569 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8570 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8571 to these tools. With non fat LTO makefiles need to be modified to use them.
8573 The default is @option{-ffat-lto-objects} but this default is intended to
8574 change in future releases when linker plugin enabled environments become more
8575 common.
8577 @item -fcompare-elim
8578 @opindex fcompare-elim
8579 After register allocation and post-register allocation instruction splitting,
8580 identify arithmetic instructions that compute processor flags similar to a
8581 comparison operation based on that arithmetic.  If possible, eliminate the
8582 explicit comparison operation.
8584 This pass only applies to certain targets that cannot explicitly represent
8585 the comparison operation before register allocation is complete.
8587 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8589 @item -fuse-ld=bfd
8590 Use the @command{bfd} linker instead of the default linker.
8592 @item -fuse-ld=gold
8593 Use the @command{gold} linker instead of the default linker.
8595 @item -fcprop-registers
8596 @opindex fcprop-registers
8597 After register allocation and post-register allocation instruction splitting,
8598 perform a copy-propagation pass to try to reduce scheduling dependencies
8599 and occasionally eliminate the copy.
8601 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8603 @item -fprofile-correction
8604 @opindex fprofile-correction
8605 Profiles collected using an instrumented binary for multi-threaded programs may
8606 be inconsistent due to missed counter updates. When this option is specified,
8607 GCC uses heuristics to correct or smooth out such inconsistencies. By
8608 default, GCC emits an error message when an inconsistent profile is detected.
8610 @item -fprofile-dir=@var{path}
8611 @opindex fprofile-dir
8613 Set the directory to search for the profile data files in to @var{path}.
8614 This option affects only the profile data generated by
8615 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8616 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8617 and its related options.  Both absolute and relative paths can be used.
8618 By default, GCC uses the current directory as @var{path}, thus the
8619 profile data file appears in the same directory as the object file.
8621 @item -fprofile-generate
8622 @itemx -fprofile-generate=@var{path}
8623 @opindex fprofile-generate
8625 Enable options usually used for instrumenting application to produce
8626 profile useful for later recompilation with profile feedback based
8627 optimization.  You must use @option{-fprofile-generate} both when
8628 compiling and when linking your program.
8630 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8632 If @var{path} is specified, GCC looks at the @var{path} to find
8633 the profile feedback data files. See @option{-fprofile-dir}.
8635 @item -fprofile-use
8636 @itemx -fprofile-use=@var{path}
8637 @opindex fprofile-use
8638 Enable profile feedback directed optimizations, and optimizations
8639 generally profitable only with profile feedback available.
8641 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8642 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
8643 @code{ftree-loop-distribute-patterns}
8645 By default, GCC emits an error message if the feedback profiles do not
8646 match the source code.  This error can be turned into a warning by using
8647 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8648 code.
8650 If @var{path} is specified, GCC looks at the @var{path} to find
8651 the profile feedback data files. See @option{-fprofile-dir}.
8652 @end table
8654 The following options control compiler behavior regarding floating-point 
8655 arithmetic.  These options trade off between speed and
8656 correctness.  All must be specifically enabled.
8658 @table @gcctabopt
8659 @item -ffloat-store
8660 @opindex ffloat-store
8661 Do not store floating-point variables in registers, and inhibit other
8662 options that might change whether a floating-point value is taken from a
8663 register or memory.
8665 @cindex floating-point precision
8666 This option prevents undesirable excess precision on machines such as
8667 the 68000 where the floating registers (of the 68881) keep more
8668 precision than a @code{double} is supposed to have.  Similarly for the
8669 x86 architecture.  For most programs, the excess precision does only
8670 good, but a few programs rely on the precise definition of IEEE floating
8671 point.  Use @option{-ffloat-store} for such programs, after modifying
8672 them to store all pertinent intermediate computations into variables.
8674 @item -fexcess-precision=@var{style}
8675 @opindex fexcess-precision
8676 This option allows further control over excess precision on machines
8677 where floating-point registers have more precision than the IEEE
8678 @code{float} and @code{double} types and the processor does not
8679 support operations rounding to those types.  By default,
8680 @option{-fexcess-precision=fast} is in effect; this means that
8681 operations are carried out in the precision of the registers and that
8682 it is unpredictable when rounding to the types specified in the source
8683 code takes place.  When compiling C, if
8684 @option{-fexcess-precision=standard} is specified then excess
8685 precision follows the rules specified in ISO C99; in particular,
8686 both casts and assignments cause values to be rounded to their
8687 semantic types (whereas @option{-ffloat-store} only affects
8688 assignments).  This option is enabled by default for C if a strict
8689 conformance option such as @option{-std=c99} is used.
8691 @opindex mfpmath
8692 @option{-fexcess-precision=standard} is not implemented for languages
8693 other than C, and has no effect if
8694 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8695 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8696 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8697 semantics apply without excess precision, and in the latter, rounding
8698 is unpredictable.
8700 @item -ffast-math
8701 @opindex ffast-math
8702 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8703 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8704 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8706 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8708 This option is not turned on by any @option{-O} option besides
8709 @option{-Ofast} since it can result in incorrect output for programs
8710 that depend on an exact implementation of IEEE or ISO rules/specifications
8711 for math functions. It may, however, yield faster code for programs
8712 that do not require the guarantees of these specifications.
8714 @item -fno-math-errno
8715 @opindex fno-math-errno
8716 Do not set @code{errno} after calling math functions that are executed
8717 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8718 IEEE exceptions for math error handling may want to use this flag
8719 for speed while maintaining IEEE arithmetic compatibility.
8721 This option is not turned on by any @option{-O} option since
8722 it can result in incorrect output for programs that depend on
8723 an exact implementation of IEEE or ISO rules/specifications for
8724 math functions. It may, however, yield faster code for programs
8725 that do not require the guarantees of these specifications.
8727 The default is @option{-fmath-errno}.
8729 On Darwin systems, the math library never sets @code{errno}.  There is
8730 therefore no reason for the compiler to consider the possibility that
8731 it might, and @option{-fno-math-errno} is the default.
8733 @item -funsafe-math-optimizations
8734 @opindex funsafe-math-optimizations
8736 Allow optimizations for floating-point arithmetic that (a) assume
8737 that arguments and results are valid and (b) may violate IEEE or
8738 ANSI standards.  When used at link-time, it may include libraries
8739 or startup files that change the default FPU control word or other
8740 similar optimizations.
8742 This option is not turned on by any @option{-O} option since
8743 it can result in incorrect output for programs that depend on
8744 an exact implementation of IEEE or ISO rules/specifications for
8745 math functions. It may, however, yield faster code for programs
8746 that do not require the guarantees of these specifications.
8747 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8748 @option{-fassociative-math} and @option{-freciprocal-math}.
8750 The default is @option{-fno-unsafe-math-optimizations}.
8752 @item -fassociative-math
8753 @opindex fassociative-math
8755 Allow re-association of operands in series of floating-point operations.
8756 This violates the ISO C and C++ language standard by possibly changing
8757 computation result.  NOTE: re-ordering may change the sign of zero as
8758 well as ignore NaNs and inhibit or create underflow or overflow (and
8759 thus cannot be used on code that relies on rounding behavior like
8760 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8761 and thus may not be used when ordered comparisons are required.
8762 This option requires that both @option{-fno-signed-zeros} and
8763 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8764 much sense with @option{-frounding-math}. For Fortran the option
8765 is automatically enabled when both @option{-fno-signed-zeros} and
8766 @option{-fno-trapping-math} are in effect.
8768 The default is @option{-fno-associative-math}.
8770 @item -freciprocal-math
8771 @opindex freciprocal-math
8773 Allow the reciprocal of a value to be used instead of dividing by
8774 the value if this enables optimizations.  For example @code{x / y}
8775 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8776 is subject to common subexpression elimination.  Note that this loses
8777 precision and increases the number of flops operating on the value.
8779 The default is @option{-fno-reciprocal-math}.
8781 @item -ffinite-math-only
8782 @opindex ffinite-math-only
8783 Allow optimizations for floating-point arithmetic that assume
8784 that arguments and results are not NaNs or +-Infs.
8786 This option is not turned on by any @option{-O} option since
8787 it can result in incorrect output for programs that depend on
8788 an exact implementation of IEEE or ISO rules/specifications for
8789 math functions. It may, however, yield faster code for programs
8790 that do not require the guarantees of these specifications.
8792 The default is @option{-fno-finite-math-only}.
8794 @item -fno-signed-zeros
8795 @opindex fno-signed-zeros
8796 Allow optimizations for floating-point arithmetic that ignore the
8797 signedness of zero.  IEEE arithmetic specifies the behavior of
8798 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8799 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8800 This option implies that the sign of a zero result isn't significant.
8802 The default is @option{-fsigned-zeros}.
8804 @item -fno-trapping-math
8805 @opindex fno-trapping-math
8806 Compile code assuming that floating-point operations cannot generate
8807 user-visible traps.  These traps include division by zero, overflow,
8808 underflow, inexact result and invalid operation.  This option requires
8809 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8810 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8812 This option should never be turned on by any @option{-O} option since
8813 it can result in incorrect output for programs that depend on
8814 an exact implementation of IEEE or ISO rules/specifications for
8815 math functions.
8817 The default is @option{-ftrapping-math}.
8819 @item -frounding-math
8820 @opindex frounding-math
8821 Disable transformations and optimizations that assume default floating-point
8822 rounding behavior.  This is round-to-zero for all floating point
8823 to integer conversions, and round-to-nearest for all other arithmetic
8824 truncations.  This option should be specified for programs that change
8825 the FP rounding mode dynamically, or that may be executed with a
8826 non-default rounding mode.  This option disables constant folding of
8827 floating-point expressions at compile time (which may be affected by
8828 rounding mode) and arithmetic transformations that are unsafe in the
8829 presence of sign-dependent rounding modes.
8831 The default is @option{-fno-rounding-math}.
8833 This option is experimental and does not currently guarantee to
8834 disable all GCC optimizations that are affected by rounding mode.
8835 Future versions of GCC may provide finer control of this setting
8836 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8837 will be used to specify the default state for @code{FENV_ACCESS}.
8839 @item -fsignaling-nans
8840 @opindex fsignaling-nans
8841 Compile code assuming that IEEE signaling NaNs may generate user-visible
8842 traps during floating-point operations.  Setting this option disables
8843 optimizations that may change the number of exceptions visible with
8844 signaling NaNs.  This option implies @option{-ftrapping-math}.
8846 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8847 be defined.
8849 The default is @option{-fno-signaling-nans}.
8851 This option is experimental and does not currently guarantee to
8852 disable all GCC optimizations that affect signaling NaN behavior.
8854 @item -fsingle-precision-constant
8855 @opindex fsingle-precision-constant
8856 Treat floating-point constants as single precision instead of
8857 implicitly converting them to double-precision constants.
8859 @item -fcx-limited-range
8860 @opindex fcx-limited-range
8861 When enabled, this option states that a range reduction step is not
8862 needed when performing complex division.  Also, there is no checking
8863 whether the result of a complex multiplication or division is @code{NaN
8864 + I*NaN}, with an attempt to rescue the situation in that case.  The
8865 default is @option{-fno-cx-limited-range}, but is enabled by
8866 @option{-ffast-math}.
8868 This option controls the default setting of the ISO C99
8869 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8870 all languages.
8872 @item -fcx-fortran-rules
8873 @opindex fcx-fortran-rules
8874 Complex multiplication and division follow Fortran rules.  Range
8875 reduction is done as part of complex division, but there is no checking
8876 whether the result of a complex multiplication or division is @code{NaN
8877 + I*NaN}, with an attempt to rescue the situation in that case.
8879 The default is @option{-fno-cx-fortran-rules}.
8881 @end table
8883 The following options control optimizations that may improve
8884 performance, but are not enabled by any @option{-O} options.  This
8885 section includes experimental options that may produce broken code.
8887 @table @gcctabopt
8888 @item -fbranch-probabilities
8889 @opindex fbranch-probabilities
8890 After running a program compiled with @option{-fprofile-arcs}
8891 (@pxref{Debugging Options,, Options for Debugging Your Program or
8892 @command{gcc}}), you can compile it a second time using
8893 @option{-fbranch-probabilities}, to improve optimizations based on
8894 the number of times each branch was taken.  When a program
8895 compiled with @option{-fprofile-arcs} exits, it saves arc execution
8896 counts to a file called @file{@var{sourcename}.gcda} for each source
8897 file.  The information in this data file is very dependent on the
8898 structure of the generated code, so you must use the same source code
8899 and the same optimization options for both compilations.
8901 With @option{-fbranch-probabilities}, GCC puts a
8902 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8903 These can be used to improve optimization.  Currently, they are only
8904 used in one place: in @file{reorg.c}, instead of guessing which path a
8905 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8906 exactly determine which path is taken more often.
8908 @item -fprofile-values
8909 @opindex fprofile-values
8910 If combined with @option{-fprofile-arcs}, it adds code so that some
8911 data about values of expressions in the program is gathered.
8913 With @option{-fbranch-probabilities}, it reads back the data gathered
8914 from profiling values of expressions for usage in optimizations.
8916 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8918 @item -fvpt
8919 @opindex fvpt
8920 If combined with @option{-fprofile-arcs}, this option instructs the compiler
8921 to add code to gather information about values of expressions.
8923 With @option{-fbranch-probabilities}, it reads back the data gathered
8924 and actually performs the optimizations based on them.
8925 Currently the optimizations include specialization of division operations
8926 using the knowledge about the value of the denominator.
8928 @item -frename-registers
8929 @opindex frename-registers
8930 Attempt to avoid false dependencies in scheduled code by making use
8931 of registers left over after register allocation.  This optimization
8932 most benefits processors with lots of registers.  Depending on the
8933 debug information format adopted by the target, however, it can
8934 make debugging impossible, since variables no longer stay in
8935 a ``home register''.
8937 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8939 @item -ftracer
8940 @opindex ftracer
8941 Perform tail duplication to enlarge superblock size.  This transformation
8942 simplifies the control flow of the function allowing other optimizations to do
8943 a better job.
8945 Enabled with @option{-fprofile-use}.
8947 @item -funroll-loops
8948 @opindex funroll-loops
8949 Unroll loops whose number of iterations can be determined at compile time or
8950 upon entry to the loop.  @option{-funroll-loops} implies
8951 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8952 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8953 a small constant number of iterations).  This option makes code larger, and may
8954 or may not make it run faster.
8956 Enabled with @option{-fprofile-use}.
8958 @item -funroll-all-loops
8959 @opindex funroll-all-loops
8960 Unroll all loops, even if their number of iterations is uncertain when
8961 the loop is entered.  This usually makes programs run more slowly.
8962 @option{-funroll-all-loops} implies the same options as
8963 @option{-funroll-loops}.
8965 @item -fpeel-loops
8966 @opindex fpeel-loops
8967 Peels loops for which there is enough information that they do not
8968 roll much (from profile feedback).  It also turns on complete loop peeling
8969 (i.e.@: complete removal of loops with small constant number of iterations).
8971 Enabled with @option{-fprofile-use}.
8973 @item -fmove-loop-invariants
8974 @opindex fmove-loop-invariants
8975 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8976 at level @option{-O1}
8978 @item -funswitch-loops
8979 @opindex funswitch-loops
8980 Move branches with loop invariant conditions out of the loop, with duplicates
8981 of the loop on both branches (modified according to result of the condition).
8983 @item -ffunction-sections
8984 @itemx -fdata-sections
8985 @opindex ffunction-sections
8986 @opindex fdata-sections
8987 Place each function or data item into its own section in the output
8988 file if the target supports arbitrary sections.  The name of the
8989 function or the name of the data item determines the section's name
8990 in the output file.
8992 Use these options on systems where the linker can perform optimizations
8993 to improve locality of reference in the instruction space.  Most systems
8994 using the ELF object format and SPARC processors running Solaris 2 have
8995 linkers with such optimizations.  AIX may have these optimizations in
8996 the future.
8998 Only use these options when there are significant benefits from doing
8999 so.  When you specify these options, the assembler and linker
9000 create larger object and executable files and are also slower.
9001 You cannot use @code{gprof} on all systems if you
9002 specify this option, and you may have problems with debugging if
9003 you specify both this option and @option{-g}.
9005 @item -fbranch-target-load-optimize
9006 @opindex fbranch-target-load-optimize
9007 Perform branch target register load optimization before prologue / epilogue
9008 threading.
9009 The use of target registers can typically be exposed only during reload,
9010 thus hoisting loads out of loops and doing inter-block scheduling needs
9011 a separate optimization pass.
9013 @item -fbranch-target-load-optimize2
9014 @opindex fbranch-target-load-optimize2
9015 Perform branch target register load optimization after prologue / epilogue
9016 threading.
9018 @item -fbtr-bb-exclusive
9019 @opindex fbtr-bb-exclusive
9020 When performing branch target register load optimization, don't reuse
9021 branch target registers within any basic block.
9023 @item -fstack-protector
9024 @opindex fstack-protector
9025 Emit extra code to check for buffer overflows, such as stack smashing
9026 attacks.  This is done by adding a guard variable to functions with
9027 vulnerable objects.  This includes functions that call @code{alloca}, and
9028 functions with buffers larger than 8 bytes.  The guards are initialized
9029 when a function is entered and then checked when the function exits.
9030 If a guard check fails, an error message is printed and the program exits.
9032 @item -fstack-protector-all
9033 @opindex fstack-protector-all
9034 Like @option{-fstack-protector} except that all functions are protected.
9036 @item -fstack-protector-strong
9037 @opindex fstack-protector-strong
9038 Like @option{-fstack-protector} but includes additional functions to
9039 be protected --- those that have local array definitions, or have
9040 references to local frame addresses.
9042 @item -fsection-anchors
9043 @opindex fsection-anchors
9044 Try to reduce the number of symbolic address calculations by using
9045 shared ``anchor'' symbols to address nearby objects.  This transformation
9046 can help to reduce the number of GOT entries and GOT accesses on some
9047 targets.
9049 For example, the implementation of the following function @code{foo}:
9051 @smallexample
9052 static int a, b, c;
9053 int foo (void) @{ return a + b + c; @}
9054 @end smallexample
9056 @noindent
9057 usually calculates the addresses of all three variables, but if you
9058 compile it with @option{-fsection-anchors}, it accesses the variables
9059 from a common anchor point instead.  The effect is similar to the
9060 following pseudocode (which isn't valid C):
9062 @smallexample
9063 int foo (void)
9065   register int *xr = &x;
9066   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9068 @end smallexample
9070 Not all targets support this option.
9072 @item --param @var{name}=@var{value}
9073 @opindex param
9074 In some places, GCC uses various constants to control the amount of
9075 optimization that is done.  For example, GCC does not inline functions
9076 that contain more than a certain number of instructions.  You can
9077 control some of these constants on the command line using the
9078 @option{--param} option.
9080 The names of specific parameters, and the meaning of the values, are
9081 tied to the internals of the compiler, and are subject to change
9082 without notice in future releases.
9084 In each case, the @var{value} is an integer.  The allowable choices for
9085 @var{name} are:
9087 @table @gcctabopt
9088 @item predictable-branch-outcome
9089 When branch is predicted to be taken with probability lower than this threshold
9090 (in percent), then it is considered well predictable. The default is 10.
9092 @item max-crossjump-edges
9093 The maximum number of incoming edges to consider for cross-jumping.
9094 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9095 the number of edges incoming to each block.  Increasing values mean
9096 more aggressive optimization, making the compilation time increase with
9097 probably small improvement in executable size.
9099 @item min-crossjump-insns
9100 The minimum number of instructions that must be matched at the end
9101 of two blocks before cross-jumping is performed on them.  This
9102 value is ignored in the case where all instructions in the block being
9103 cross-jumped from are matched.  The default value is 5.
9105 @item max-grow-copy-bb-insns
9106 The maximum code size expansion factor when copying basic blocks
9107 instead of jumping.  The expansion is relative to a jump instruction.
9108 The default value is 8.
9110 @item max-goto-duplication-insns
9111 The maximum number of instructions to duplicate to a block that jumps
9112 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9113 passes, GCC factors computed gotos early in the compilation process,
9114 and unfactors them as late as possible.  Only computed jumps at the
9115 end of a basic blocks with no more than max-goto-duplication-insns are
9116 unfactored.  The default value is 8.
9118 @item max-delay-slot-insn-search
9119 The maximum number of instructions to consider when looking for an
9120 instruction to fill a delay slot.  If more than this arbitrary number of
9121 instructions are searched, the time savings from filling the delay slot
9122 are minimal, so stop searching.  Increasing values mean more
9123 aggressive optimization, making the compilation time increase with probably
9124 small improvement in execution time.
9126 @item max-delay-slot-live-search
9127 When trying to fill delay slots, the maximum number of instructions to
9128 consider when searching for a block with valid live register
9129 information.  Increasing this arbitrarily chosen value means more
9130 aggressive optimization, increasing the compilation time.  This parameter
9131 should be removed when the delay slot code is rewritten to maintain the
9132 control-flow graph.
9134 @item max-gcse-memory
9135 The approximate maximum amount of memory that can be allocated in
9136 order to perform the global common subexpression elimination
9137 optimization.  If more memory than specified is required, the
9138 optimization is not done.
9140 @item max-gcse-insertion-ratio
9141 If the ratio of expression insertions to deletions is larger than this value
9142 for any expression, then RTL PRE inserts or removes the expression and thus
9143 leaves partially redundant computations in the instruction stream.  The default value is 20.
9145 @item max-pending-list-length
9146 The maximum number of pending dependencies scheduling allows
9147 before flushing the current state and starting over.  Large functions
9148 with few branches or calls can create excessively large lists which
9149 needlessly consume memory and resources.
9151 @item max-modulo-backtrack-attempts
9152 The maximum number of backtrack attempts the scheduler should make
9153 when modulo scheduling a loop.  Larger values can exponentially increase
9154 compilation time.
9156 @item max-inline-insns-single
9157 Several parameters control the tree inliner used in GCC@.
9158 This number sets the maximum number of instructions (counted in GCC's
9159 internal representation) in a single function that the tree inliner
9160 considers for inlining.  This only affects functions declared
9161 inline and methods implemented in a class declaration (C++).
9162 The default value is 400.
9164 @item max-inline-insns-auto
9165 When you use @option{-finline-functions} (included in @option{-O3}),
9166 a lot of functions that would otherwise not be considered for inlining
9167 by the compiler are investigated.  To those functions, a different
9168 (more restrictive) limit compared to functions declared inline can
9169 be applied.
9170 The default value is 40.
9172 @item inline-min-speedup
9173 When estimated performance improvement of caller + callee runtime exceeds this
9174 threshold (in precent), the function can be inlined regardless the limit on
9175 @option{--param max-inline-insns-single} and @option{--param
9176 max-inline-insns-auto}.
9178 @item large-function-insns
9179 The limit specifying really large functions.  For functions larger than this
9180 limit after inlining, inlining is constrained by
9181 @option{--param large-function-growth}.  This parameter is useful primarily
9182 to avoid extreme compilation time caused by non-linear algorithms used by the
9183 back end.
9184 The default value is 2700.
9186 @item large-function-growth
9187 Specifies maximal growth of large function caused by inlining in percents.
9188 The default value is 100 which limits large function growth to 2.0 times
9189 the original size.
9191 @item large-unit-insns
9192 The limit specifying large translation unit.  Growth caused by inlining of
9193 units larger than this limit is limited by @option{--param inline-unit-growth}.
9194 For small units this might be too tight.
9195 For example, consider a unit consisting of function A
9196 that is inline and B that just calls A three times.  If B is small relative to
9197 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9198 large units consisting of small inlineable functions, however, the overall unit
9199 growth limit is needed to avoid exponential explosion of code size.  Thus for
9200 smaller units, the size is increased to @option{--param large-unit-insns}
9201 before applying @option{--param inline-unit-growth}.  The default is 10000.
9203 @item inline-unit-growth
9204 Specifies maximal overall growth of the compilation unit caused by inlining.
9205 The default value is 30 which limits unit growth to 1.3 times the original
9206 size.
9208 @item ipcp-unit-growth
9209 Specifies maximal overall growth of the compilation unit caused by
9210 interprocedural constant propagation.  The default value is 10 which limits
9211 unit growth to 1.1 times the original size.
9213 @item large-stack-frame
9214 The limit specifying large stack frames.  While inlining the algorithm is trying
9215 to not grow past this limit too much.  The default value is 256 bytes.
9217 @item large-stack-frame-growth
9218 Specifies maximal growth of large stack frames caused by inlining in percents.
9219 The default value is 1000 which limits large stack frame growth to 11 times
9220 the original size.
9222 @item max-inline-insns-recursive
9223 @itemx max-inline-insns-recursive-auto
9224 Specifies the maximum number of instructions an out-of-line copy of a
9225 self-recursive inline
9226 function can grow into by performing recursive inlining.
9228 For functions declared inline, @option{--param max-inline-insns-recursive} is
9229 taken into account.  For functions not declared inline, recursive inlining
9230 happens only when @option{-finline-functions} (included in @option{-O3}) is
9231 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
9232 default value is 450.
9234 @item max-inline-recursive-depth
9235 @itemx max-inline-recursive-depth-auto
9236 Specifies the maximum recursion depth used for recursive inlining.
9238 For functions declared inline, @option{--param max-inline-recursive-depth} is
9239 taken into account.  For functions not declared inline, recursive inlining
9240 happens only when @option{-finline-functions} (included in @option{-O3}) is
9241 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9242 default value is 8.
9244 @item min-inline-recursive-probability
9245 Recursive inlining is profitable only for function having deep recursion
9246 in average and can hurt for function having little recursion depth by
9247 increasing the prologue size or complexity of function body to other
9248 optimizers.
9250 When profile feedback is available (see @option{-fprofile-generate}) the actual
9251 recursion depth can be guessed from probability that function recurses via a
9252 given call expression.  This parameter limits inlining only to call expressions
9253 whose probability exceeds the given threshold (in percents).
9254 The default value is 10.
9256 @item early-inlining-insns
9257 Specify growth that the early inliner can make.  In effect it increases
9258 the amount of inlining for code having a large abstraction penalty.
9259 The default value is 10.
9261 @item max-early-inliner-iterations
9262 @itemx max-early-inliner-iterations
9263 Limit of iterations of the early inliner.  This basically bounds
9264 the number of nested indirect calls the early inliner can resolve.
9265 Deeper chains are still handled by late inlining.
9267 @item comdat-sharing-probability
9268 @itemx comdat-sharing-probability
9269 Probability (in percent) that C++ inline function with comdat visibility
9270 are shared across multiple compilation units.  The default value is 20.
9272 @item min-vect-loop-bound
9273 The minimum number of iterations under which loops are not vectorized
9274 when @option{-ftree-vectorize} is used.  The number of iterations after
9275 vectorization needs to be greater than the value specified by this option
9276 to allow vectorization.  The default value is 0.
9278 @item gcse-cost-distance-ratio
9279 Scaling factor in calculation of maximum distance an expression
9280 can be moved by GCSE optimizations.  This is currently supported only in the
9281 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9282 is with simple expressions, i.e., the expressions that have cost
9283 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9284 hoisting of simple expressions.  The default value is 10.
9286 @item gcse-unrestricted-cost
9287 Cost, roughly measured as the cost of a single typical machine
9288 instruction, at which GCSE optimizations do not constrain
9289 the distance an expression can travel.  This is currently
9290 supported only in the code hoisting pass.  The lesser the cost,
9291 the more aggressive code hoisting is.  Specifying 0 
9292 allows all expressions to travel unrestricted distances.
9293 The default value is 3.
9295 @item max-hoist-depth
9296 The depth of search in the dominator tree for expressions to hoist.
9297 This is used to avoid quadratic behavior in hoisting algorithm.
9298 The value of 0 does not limit on the search, but may slow down compilation
9299 of huge functions.  The default value is 30.
9301 @item max-tail-merge-comparisons
9302 The maximum amount of similar bbs to compare a bb with.  This is used to
9303 avoid quadratic behavior in tree tail merging.  The default value is 10.
9305 @item max-tail-merge-iterations
9306 The maximum amount of iterations of the pass over the function.  This is used to
9307 limit compilation time in tree tail merging.  The default value is 2.
9309 @item max-unrolled-insns
9310 The maximum number of instructions that a loop may have to be unrolled.
9311 If a loop is unrolled, this parameter also determines how many times
9312 the loop code is unrolled.
9314 @item max-average-unrolled-insns
9315 The maximum number of instructions biased by probabilities of their execution
9316 that a loop may have to be unrolled.  If a loop is unrolled,
9317 this parameter also determines how many times the loop code is unrolled.
9319 @item max-unroll-times
9320 The maximum number of unrollings of a single loop.
9322 @item max-peeled-insns
9323 The maximum number of instructions that a loop may have to be peeled.
9324 If a loop is peeled, this parameter also determines how many times
9325 the loop code is peeled.
9327 @item max-peel-times
9328 The maximum number of peelings of a single loop.
9330 @item max-peel-branches
9331 The maximum number of branches on the hot path through the peeled sequence.
9333 @item max-completely-peeled-insns
9334 The maximum number of insns of a completely peeled loop.
9336 @item max-completely-peel-times
9337 The maximum number of iterations of a loop to be suitable for complete peeling.
9339 @item max-completely-peel-loop-nest-depth
9340 The maximum depth of a loop nest suitable for complete peeling.
9342 @item max-unswitch-insns
9343 The maximum number of insns of an unswitched loop.
9345 @item max-unswitch-level
9346 The maximum number of branches unswitched in a single loop.
9348 @item lim-expensive
9349 The minimum cost of an expensive expression in the loop invariant motion.
9351 @item iv-consider-all-candidates-bound
9352 Bound on number of candidates for induction variables, below which
9353 all candidates are considered for each use in induction variable
9354 optimizations.  If there are more candidates than this,
9355 only the most relevant ones are considered to avoid quadratic time complexity.
9357 @item iv-max-considered-uses
9358 The induction variable optimizations give up on loops that contain more
9359 induction variable uses.
9361 @item iv-always-prune-cand-set-bound
9362 If the number of candidates in the set is smaller than this value,
9363 always try to remove unnecessary ivs from the set
9364 when adding a new one.
9366 @item scev-max-expr-size
9367 Bound on size of expressions used in the scalar evolutions analyzer.
9368 Large expressions slow the analyzer.
9370 @item scev-max-expr-complexity
9371 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9372 Complex expressions slow the analyzer.
9374 @item omega-max-vars
9375 The maximum number of variables in an Omega constraint system.
9376 The default value is 128.
9378 @item omega-max-geqs
9379 The maximum number of inequalities in an Omega constraint system.
9380 The default value is 256.
9382 @item omega-max-eqs
9383 The maximum number of equalities in an Omega constraint system.
9384 The default value is 128.
9386 @item omega-max-wild-cards
9387 The maximum number of wildcard variables that the Omega solver is
9388 able to insert.  The default value is 18.
9390 @item omega-hash-table-size
9391 The size of the hash table in the Omega solver.  The default value is
9392 550.
9394 @item omega-max-keys
9395 The maximal number of keys used by the Omega solver.  The default
9396 value is 500.
9398 @item omega-eliminate-redundant-constraints
9399 When set to 1, use expensive methods to eliminate all redundant
9400 constraints.  The default value is 0.
9402 @item vect-max-version-for-alignment-checks
9403 The maximum number of run-time checks that can be performed when
9404 doing loop versioning for alignment in the vectorizer.  See option
9405 @option{-ftree-vect-loop-version} for more information.
9407 @item vect-max-version-for-alias-checks
9408 The maximum number of run-time checks that can be performed when
9409 doing loop versioning for alias in the vectorizer.  See option
9410 @option{-ftree-vect-loop-version} for more information.
9412 @item max-iterations-to-track
9413 The maximum number of iterations of a loop the brute-force algorithm
9414 for analysis of the number of iterations of the loop tries to evaluate.
9416 @item hot-bb-count-ws-permille
9417 A basic block profile count is considered hot if it contributes to 
9418 the given permillage (i.e. 0...1000) of the entire profiled execution.
9420 @item hot-bb-frequency-fraction
9421 Select fraction of the entry block frequency of executions of basic block in
9422 function given basic block needs to have to be considered hot.
9424 @item max-predicted-iterations
9425 The maximum number of loop iterations we predict statically.  This is useful
9426 in cases where a function contains a single loop with known bound and
9427 another loop with unknown bound.
9428 The known number of iterations is predicted correctly, while
9429 the unknown number of iterations average to roughly 10.  This means that the
9430 loop without bounds appears artificially cold relative to the other one.
9432 @item align-threshold
9434 Select fraction of the maximal frequency of executions of a basic block in
9435 a function to align the basic block.
9437 @item align-loop-iterations
9439 A loop expected to iterate at least the selected number of iterations is
9440 aligned.
9442 @item tracer-dynamic-coverage
9443 @itemx tracer-dynamic-coverage-feedback
9445 This value is used to limit superblock formation once the given percentage of
9446 executed instructions is covered.  This limits unnecessary code size
9447 expansion.
9449 The @option{tracer-dynamic-coverage-feedback} is used only when profile
9450 feedback is available.  The real profiles (as opposed to statically estimated
9451 ones) are much less balanced allowing the threshold to be larger value.
9453 @item tracer-max-code-growth
9454 Stop tail duplication once code growth has reached given percentage.  This is
9455 a rather artificial limit, as most of the duplicates are eliminated later in
9456 cross jumping, so it may be set to much higher values than is the desired code
9457 growth.
9459 @item tracer-min-branch-ratio
9461 Stop reverse growth when the reverse probability of best edge is less than this
9462 threshold (in percent).
9464 @item tracer-min-branch-ratio
9465 @itemx tracer-min-branch-ratio-feedback
9467 Stop forward growth if the best edge has probability lower than this
9468 threshold.
9470 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
9471 compilation for profile feedback and one for compilation without.  The value
9472 for compilation with profile feedback needs to be more conservative (higher) in
9473 order to make tracer effective.
9475 @item max-cse-path-length
9477 The maximum number of basic blocks on path that CSE considers.
9478 The default is 10.
9480 @item max-cse-insns
9481 The maximum number of instructions CSE processes before flushing.
9482 The default is 1000.
9484 @item ggc-min-expand
9486 GCC uses a garbage collector to manage its own memory allocation.  This
9487 parameter specifies the minimum percentage by which the garbage
9488 collector's heap should be allowed to expand between collections.
9489 Tuning this may improve compilation speed; it has no effect on code
9490 generation.
9492 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9493 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9494 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9495 GCC is not able to calculate RAM on a particular platform, the lower
9496 bound of 30% is used.  Setting this parameter and
9497 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9498 every opportunity.  This is extremely slow, but can be useful for
9499 debugging.
9501 @item ggc-min-heapsize
9503 Minimum size of the garbage collector's heap before it begins bothering
9504 to collect garbage.  The first collection occurs after the heap expands
9505 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9506 tuning this may improve compilation speed, and has no effect on code
9507 generation.
9509 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9510 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9511 with a lower bound of 4096 (four megabytes) and an upper bound of
9512 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9513 particular platform, the lower bound is used.  Setting this parameter
9514 very large effectively disables garbage collection.  Setting this
9515 parameter and @option{ggc-min-expand} to zero causes a full collection
9516 to occur at every opportunity.
9518 @item max-reload-search-insns
9519 The maximum number of instruction reload should look backward for equivalent
9520 register.  Increasing values mean more aggressive optimization, making the
9521 compilation time increase with probably slightly better performance.
9522 The default value is 100.
9524 @item max-cselib-memory-locations
9525 The maximum number of memory locations cselib should take into account.
9526 Increasing values mean more aggressive optimization, making the compilation time
9527 increase with probably slightly better performance.  The default value is 500.
9529 @item reorder-blocks-duplicate
9530 @itemx reorder-blocks-duplicate-feedback
9532 Used by the basic block reordering pass to decide whether to use unconditional
9533 branch or duplicate the code on its destination.  Code is duplicated when its
9534 estimated size is smaller than this value multiplied by the estimated size of
9535 unconditional jump in the hot spots of the program.
9537 The @option{reorder-block-duplicate-feedback} is used only when profile
9538 feedback is available.  It may be set to higher values than
9539 @option{reorder-block-duplicate} since information about the hot spots is more
9540 accurate.
9542 @item max-sched-ready-insns
9543 The maximum number of instructions ready to be issued the scheduler should
9544 consider at any given time during the first scheduling pass.  Increasing
9545 values mean more thorough searches, making the compilation time increase
9546 with probably little benefit.  The default value is 100.
9548 @item max-sched-region-blocks
9549 The maximum number of blocks in a region to be considered for
9550 interblock scheduling.  The default value is 10.
9552 @item max-pipeline-region-blocks
9553 The maximum number of blocks in a region to be considered for
9554 pipelining in the selective scheduler.  The default value is 15.
9556 @item max-sched-region-insns
9557 The maximum number of insns in a region to be considered for
9558 interblock scheduling.  The default value is 100.
9560 @item max-pipeline-region-insns
9561 The maximum number of insns in a region to be considered for
9562 pipelining in the selective scheduler.  The default value is 200.
9564 @item min-spec-prob
9565 The minimum probability (in percents) of reaching a source block
9566 for interblock speculative scheduling.  The default value is 40.
9568 @item max-sched-extend-regions-iters
9569 The maximum number of iterations through CFG to extend regions.
9570 A value of 0 (the default) disables region extensions.
9572 @item max-sched-insn-conflict-delay
9573 The maximum conflict delay for an insn to be considered for speculative motion.
9574 The default value is 3.
9576 @item sched-spec-prob-cutoff
9577 The minimal probability of speculation success (in percents), so that
9578 speculative insns are scheduled.
9579 The default value is 40.
9581 @item sched-spec-state-edge-prob-cutoff
9582 The minimum probability an edge must have for the scheduler to save its
9583 state across it.
9584 The default value is 10.
9586 @item sched-mem-true-dep-cost
9587 Minimal distance (in CPU cycles) between store and load targeting same
9588 memory locations.  The default value is 1.
9590 @item selsched-max-lookahead
9591 The maximum size of the lookahead window of selective scheduling.  It is a
9592 depth of search for available instructions.
9593 The default value is 50.
9595 @item selsched-max-sched-times
9596 The maximum number of times that an instruction is scheduled during
9597 selective scheduling.  This is the limit on the number of iterations
9598 through which the instruction may be pipelined.  The default value is 2.
9600 @item selsched-max-insns-to-rename
9601 The maximum number of best instructions in the ready list that are considered
9602 for renaming in the selective scheduler.  The default value is 2.
9604 @item sms-min-sc
9605 The minimum value of stage count that swing modulo scheduler
9606 generates.  The default value is 2.
9608 @item max-last-value-rtl
9609 The maximum size measured as number of RTLs that can be recorded in an expression
9610 in combiner for a pseudo register as last known value of that register.  The default
9611 is 10000.
9613 @item integer-share-limit
9614 Small integer constants can use a shared data structure, reducing the
9615 compiler's memory usage and increasing its speed.  This sets the maximum
9616 value of a shared integer constant.  The default value is 256.
9618 @item ssp-buffer-size
9619 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9620 protection when @option{-fstack-protection} is used.
9622 @item max-jump-thread-duplication-stmts
9623 Maximum number of statements allowed in a block that needs to be
9624 duplicated when threading jumps.
9626 @item max-fields-for-field-sensitive
9627 Maximum number of fields in a structure treated in
9628 a field sensitive manner during pointer analysis.  The default is zero
9629 for @option{-O0} and @option{-O1},
9630 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9632 @item prefetch-latency
9633 Estimate on average number of instructions that are executed before
9634 prefetch finishes.  The distance prefetched ahead is proportional
9635 to this constant.  Increasing this number may also lead to less
9636 streams being prefetched (see @option{simultaneous-prefetches}).
9638 @item simultaneous-prefetches
9639 Maximum number of prefetches that can run at the same time.
9641 @item l1-cache-line-size
9642 The size of cache line in L1 cache, in bytes.
9644 @item l1-cache-size
9645 The size of L1 cache, in kilobytes.
9647 @item l2-cache-size
9648 The size of L2 cache, in kilobytes.
9650 @item min-insn-to-prefetch-ratio
9651 The minimum ratio between the number of instructions and the
9652 number of prefetches to enable prefetching in a loop.
9654 @item prefetch-min-insn-to-mem-ratio
9655 The minimum ratio between the number of instructions and the
9656 number of memory references to enable prefetching in a loop.
9658 @item use-canonical-types
9659 Whether the compiler should use the ``canonical'' type system.  By
9660 default, this should always be 1, which uses a more efficient internal
9661 mechanism for comparing types in C++ and Objective-C++.  However, if
9662 bugs in the canonical type system are causing compilation failures,
9663 set this value to 0 to disable canonical types.
9665 @item switch-conversion-max-branch-ratio
9666 Switch initialization conversion refuses to create arrays that are
9667 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9668 branches in the switch.
9670 @item max-partial-antic-length
9671 Maximum length of the partial antic set computed during the tree
9672 partial redundancy elimination optimization (@option{-ftree-pre}) when
9673 optimizing at @option{-O3} and above.  For some sorts of source code
9674 the enhanced partial redundancy elimination optimization can run away,
9675 consuming all of the memory available on the host machine.  This
9676 parameter sets a limit on the length of the sets that are computed,
9677 which prevents the runaway behavior.  Setting a value of 0 for
9678 this parameter allows an unlimited set length.
9680 @item sccvn-max-scc-size
9681 Maximum size of a strongly connected component (SCC) during SCCVN
9682 processing.  If this limit is hit, SCCVN processing for the whole
9683 function is not done and optimizations depending on it are
9684 disabled.  The default maximum SCC size is 10000.
9686 @item sccvn-max-alias-queries-per-access
9687 Maximum number of alias-oracle queries we perform when looking for
9688 redundancies for loads and stores.  If this limit is hit the search
9689 is aborted and the load or store is not considered redundant.  The
9690 number of queries is algorithmically limited to the number of
9691 stores on all paths from the load to the function entry.
9692 The default maxmimum number of queries is 1000.
9694 @item ira-max-loops-num
9695 IRA uses regional register allocation by default.  If a function
9696 contains more loops than the number given by this parameter, only at most
9697 the given number of the most frequently-executed loops form regions
9698 for regional register allocation.  The default value of the
9699 parameter is 100.
9701 @item ira-max-conflict-table-size 
9702 Although IRA uses a sophisticated algorithm to compress the conflict
9703 table, the table can still require excessive amounts of memory for
9704 huge functions.  If the conflict table for a function could be more
9705 than the size in MB given by this parameter, the register allocator
9706 instead uses a faster, simpler, and lower-quality
9707 algorithm that does not require building a pseudo-register conflict table.  
9708 The default value of the parameter is 2000.
9710 @item ira-loop-reserved-regs
9711 IRA can be used to evaluate more accurate register pressure in loops
9712 for decisions to move loop invariants (see @option{-O3}).  The number
9713 of available registers reserved for some other purposes is given
9714 by this parameter.  The default value of the parameter is 2, which is
9715 the minimal number of registers needed by typical instructions.
9716 This value is the best found from numerous experiments.
9718 @item loop-invariant-max-bbs-in-loop
9719 Loop invariant motion can be very expensive, both in compilation time and
9720 in amount of needed compile-time memory, with very large loops.  Loops
9721 with more basic blocks than this parameter won't have loop invariant
9722 motion optimization performed on them.  The default value of the
9723 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9725 @item loop-max-datarefs-for-datadeps
9726 Building data dapendencies is expensive for very large loops.  This
9727 parameter limits the number of data references in loops that are
9728 considered for data dependence analysis.  These large loops are no
9729 handled by the optimizations using loop data dependencies.
9730 The default value is 1000.
9732 @item max-vartrack-size
9733 Sets a maximum number of hash table slots to use during variable
9734 tracking dataflow analysis of any function.  If this limit is exceeded
9735 with variable tracking at assignments enabled, analysis for that
9736 function is retried without it, after removing all debug insns from
9737 the function.  If the limit is exceeded even without debug insns, var
9738 tracking analysis is completely disabled for the function.  Setting
9739 the parameter to zero makes it unlimited.
9741 @item max-vartrack-expr-depth
9742 Sets a maximum number of recursion levels when attempting to map
9743 variable names or debug temporaries to value expressions.  This trades
9744 compilation time for more complete debug information.  If this is set too
9745 low, value expressions that are available and could be represented in
9746 debug information may end up not being used; setting this higher may
9747 enable the compiler to find more complex debug expressions, but compile
9748 time and memory use may grow.  The default is 12.
9750 @item min-nondebug-insn-uid
9751 Use uids starting at this parameter for nondebug insns.  The range below
9752 the parameter is reserved exclusively for debug insns created by
9753 @option{-fvar-tracking-assignments}, but debug insns may get
9754 (non-overlapping) uids above it if the reserved range is exhausted.
9756 @item ipa-sra-ptr-growth-factor
9757 IPA-SRA replaces a pointer to an aggregate with one or more new
9758 parameters only when their cumulative size is less or equal to
9759 @option{ipa-sra-ptr-growth-factor} times the size of the original
9760 pointer parameter.
9762 @item tm-max-aggregate-size
9763 When making copies of thread-local variables in a transaction, this
9764 parameter specifies the size in bytes after which variables are
9765 saved with the logging functions as opposed to save/restore code
9766 sequence pairs.  This option only applies when using
9767 @option{-fgnu-tm}.
9769 @item graphite-max-nb-scop-params
9770 To avoid exponential effects in the Graphite loop transforms, the
9771 number of parameters in a Static Control Part (SCoP) is bounded.  The
9772 default value is 10 parameters.  A variable whose value is unknown at
9773 compilation time and defined outside a SCoP is a parameter of the SCoP.
9775 @item graphite-max-bbs-per-function
9776 To avoid exponential effects in the detection of SCoPs, the size of
9777 the functions analyzed by Graphite is bounded.  The default value is
9778 100 basic blocks.
9780 @item loop-block-tile-size
9781 Loop blocking or strip mining transforms, enabled with
9782 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9783 loop in the loop nest by a given number of iterations.  The strip
9784 length can be changed using the @option{loop-block-tile-size}
9785 parameter.  The default value is 51 iterations.
9787 @item ipa-cp-value-list-size
9788 IPA-CP attempts to track all possible values and types passed to a function's
9789 parameter in order to propagate them and perform devirtualization.
9790 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9791 stores per one formal parameter of a function.
9793 @item lto-partitions
9794 Specify desired number of partitions produced during WHOPR compilation.
9795 The number of partitions should exceed the number of CPUs used for compilation.
9796 The default value is 32.
9798 @item lto-minpartition
9799 Size of minimal partition for WHOPR (in estimated instructions).
9800 This prevents expenses of splitting very small programs into too many
9801 partitions.
9803 @item cxx-max-namespaces-for-diagnostic-help
9804 The maximum number of namespaces to consult for suggestions when C++
9805 name lookup fails for an identifier.  The default is 1000.
9807 @item sink-frequency-threshold
9808 The maximum relative execution frequency (in percents) of the target block
9809 relative to a statement's original block to allow statement sinking of a
9810 statement.  Larger numbers result in more aggressive statement sinking.
9811 The default value is 75.  A small positive adjustment is applied for
9812 statements with memory operands as those are even more profitable so sink.
9814 @item max-stores-to-sink
9815 The maximum number of conditional stores paires that can be sunk.  Set to 0
9816 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9817 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9819 @item allow-load-data-races
9820 Allow optimizers to introduce new data races on loads.
9821 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9822 unless implicitly set by the @option{-fmemory-model=} option.
9824 @item allow-store-data-races
9825 Allow optimizers to introduce new data races on stores.
9826 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9827 unless implicitly set by the @option{-fmemory-model=} option.
9829 @item allow-packed-load-data-races
9830 Allow optimizers to introduce new data races on packed data loads.
9831 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9832 unless implicitly set by the @option{-fmemory-model=} option.
9834 @item allow-packed-store-data-races
9835 Allow optimizers to introduce new data races on packed data stores.
9836 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9837 unless implicitly set by the @option{-fmemory-model=} option.
9839 @item case-values-threshold
9840 The smallest number of different values for which it is best to use a
9841 jump-table instead of a tree of conditional branches.  If the value is
9842 0, use the default for the machine.  The default is 0.
9844 @item tree-reassoc-width
9845 Set the maximum number of instructions executed in parallel in
9846 reassociated tree. This parameter overrides target dependent
9847 heuristics used by default if has non zero value.
9849 @item sched-pressure-algorithm
9850 Choose between the two available implementations of
9851 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
9852 and is the more likely to prevent instructions from being reordered.
9853 Algorithm 2 was designed to be a compromise between the relatively
9854 conservative approach taken by algorithm 1 and the rather aggressive
9855 approach taken by the default scheduler.  It relies more heavily on
9856 having a regular register file and accurate register pressure classes.
9857 See @file{haifa-sched.c} in the GCC sources for more details.
9859 The default choice depends on the target.
9861 @item max-slsr-cand-scan
9862 Set the maximum number of existing candidates that will be considered when
9863 seeking a basis for a new straight-line strength reduction candidate.
9865 @end table
9866 @end table
9868 @node Preprocessor Options
9869 @section Options Controlling the Preprocessor
9870 @cindex preprocessor options
9871 @cindex options, preprocessor
9873 These options control the C preprocessor, which is run on each C source
9874 file before actual compilation.
9876 If you use the @option{-E} option, nothing is done except preprocessing.
9877 Some of these options make sense only together with @option{-E} because
9878 they cause the preprocessor output to be unsuitable for actual
9879 compilation.
9881 @table @gcctabopt
9882 @item -Wp,@var{option}
9883 @opindex Wp
9884 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9885 and pass @var{option} directly through to the preprocessor.  If
9886 @var{option} contains commas, it is split into multiple options at the
9887 commas.  However, many options are modified, translated or interpreted
9888 by the compiler driver before being passed to the preprocessor, and
9889 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9890 interface is undocumented and subject to change, so whenever possible
9891 you should avoid using @option{-Wp} and let the driver handle the
9892 options instead.
9894 @item -Xpreprocessor @var{option}
9895 @opindex Xpreprocessor
9896 Pass @var{option} as an option to the preprocessor.  You can use this to
9897 supply system-specific preprocessor options that GCC does not 
9898 recognize.
9900 If you want to pass an option that takes an argument, you must use
9901 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9903 @item -no-integrated-cpp
9904 @opindex no-integrated-cpp
9905 Perform preprocessing as a separate pass before compilation.
9906 By default, GCC performs preprocessing as an integrated part of
9907 input tokenization and parsing.
9908 If this option is provided, the appropriate language front end
9909 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
9910 and Objective-C, respectively) is instead invoked twice,
9911 once for preprocessing only and once for actual compilation
9912 of the preprocessed input.
9913 This option may be useful in conjunction with the @option{-B} or
9914 @option{-wrapper} options to specify an alternate preprocessor or
9915 perform additional processing of the program source between
9916 normal preprocessing and compilation.
9917 @end table
9919 @include cppopts.texi
9921 @node Assembler Options
9922 @section Passing Options to the Assembler
9924 @c prevent bad page break with this line
9925 You can pass options to the assembler.
9927 @table @gcctabopt
9928 @item -Wa,@var{option}
9929 @opindex Wa
9930 Pass @var{option} as an option to the assembler.  If @var{option}
9931 contains commas, it is split into multiple options at the commas.
9933 @item -Xassembler @var{option}
9934 @opindex Xassembler
9935 Pass @var{option} as an option to the assembler.  You can use this to
9936 supply system-specific assembler options that GCC does not
9937 recognize.
9939 If you want to pass an option that takes an argument, you must use
9940 @option{-Xassembler} twice, once for the option and once for the argument.
9942 @end table
9944 @node Link Options
9945 @section Options for Linking
9946 @cindex link options
9947 @cindex options, linking
9949 These options come into play when the compiler links object files into
9950 an executable output file.  They are meaningless if the compiler is
9951 not doing a link step.
9953 @table @gcctabopt
9954 @cindex file names
9955 @item @var{object-file-name}
9956 A file name that does not end in a special recognized suffix is
9957 considered to name an object file or library.  (Object files are
9958 distinguished from libraries by the linker according to the file
9959 contents.)  If linking is done, these object files are used as input
9960 to the linker.
9962 @item -c
9963 @itemx -S
9964 @itemx -E
9965 @opindex c
9966 @opindex S
9967 @opindex E
9968 If any of these options is used, then the linker is not run, and
9969 object file names should not be used as arguments.  @xref{Overall
9970 Options}.
9972 @cindex Libraries
9973 @item -l@var{library}
9974 @itemx -l @var{library}
9975 @opindex l
9976 Search the library named @var{library} when linking.  (The second
9977 alternative with the library as a separate argument is only for
9978 POSIX compliance and is not recommended.)
9980 It makes a difference where in the command you write this option; the
9981 linker searches and processes libraries and object files in the order they
9982 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9983 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9984 to functions in @samp{z}, those functions may not be loaded.
9986 The linker searches a standard list of directories for the library,
9987 which is actually a file named @file{lib@var{library}.a}.  The linker
9988 then uses this file as if it had been specified precisely by name.
9990 The directories searched include several standard system directories
9991 plus any that you specify with @option{-L}.
9993 Normally the files found this way are library files---archive files
9994 whose members are object files.  The linker handles an archive file by
9995 scanning through it for members which define symbols that have so far
9996 been referenced but not defined.  But if the file that is found is an
9997 ordinary object file, it is linked in the usual fashion.  The only
9998 difference between using an @option{-l} option and specifying a file name
9999 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
10000 and searches several directories.
10002 @item -lobjc
10003 @opindex lobjc
10004 You need this special case of the @option{-l} option in order to
10005 link an Objective-C or Objective-C++ program.
10007 @item -nostartfiles
10008 @opindex nostartfiles
10009 Do not use the standard system startup files when linking.
10010 The standard system libraries are used normally, unless @option{-nostdlib}
10011 or @option{-nodefaultlibs} is used.
10013 @item -nodefaultlibs
10014 @opindex nodefaultlibs
10015 Do not use the standard system libraries when linking.
10016 Only the libraries you specify are passed to the linker, and options
10017 specifying linkage of the system libraries, such as @code{-static-libgcc}
10018 or @code{-shared-libgcc}, are ignored.  
10019 The standard startup files are used normally, unless @option{-nostartfiles}
10020 is used.  
10022 The compiler may generate calls to @code{memcmp},
10023 @code{memset}, @code{memcpy} and @code{memmove}.
10024 These entries are usually resolved by entries in
10025 libc.  These entry points should be supplied through some other
10026 mechanism when this option is specified.
10028 @item -nostdlib
10029 @opindex nostdlib
10030 Do not use the standard system startup files or libraries when linking.
10031 No startup files and only the libraries you specify are passed to
10032 the linker, and options specifying linkage of the system libraries, such as
10033 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
10035 The compiler may generate calls to @code{memcmp}, @code{memset},
10036 @code{memcpy} and @code{memmove}.
10037 These entries are usually resolved by entries in
10038 libc.  These entry points should be supplied through some other
10039 mechanism when this option is specified.
10041 @cindex @option{-lgcc}, use with @option{-nostdlib}
10042 @cindex @option{-nostdlib} and unresolved references
10043 @cindex unresolved references and @option{-nostdlib}
10044 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
10045 @cindex @option{-nodefaultlibs} and unresolved references
10046 @cindex unresolved references and @option{-nodefaultlibs}
10047 One of the standard libraries bypassed by @option{-nostdlib} and
10048 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
10049 which GCC uses to overcome shortcomings of particular machines, or special
10050 needs for some languages.
10051 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
10052 Collection (GCC) Internals},
10053 for more discussion of @file{libgcc.a}.)
10054 In most cases, you need @file{libgcc.a} even when you want to avoid
10055 other standard libraries.  In other words, when you specify @option{-nostdlib}
10056 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
10057 This ensures that you have no unresolved references to internal GCC
10058 library subroutines.
10059 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
10060 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
10061 GNU Compiler Collection (GCC) Internals}.)
10063 @item -pie
10064 @opindex pie
10065 Produce a position independent executable on targets that support it.
10066 For predictable results, you must also specify the same set of options
10067 used for compilation (@option{-fpie}, @option{-fPIE},
10068 or model suboptions) when you specify this linker option.
10070 @item -rdynamic
10071 @opindex rdynamic
10072 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10073 that support it. This instructs the linker to add all symbols, not
10074 only used ones, to the dynamic symbol table. This option is needed
10075 for some uses of @code{dlopen} or to allow obtaining backtraces
10076 from within a program.
10078 @item -s
10079 @opindex s
10080 Remove all symbol table and relocation information from the executable.
10082 @item -static
10083 @opindex static
10084 On systems that support dynamic linking, this prevents linking with the shared
10085 libraries.  On other systems, this option has no effect.
10087 @item -shared
10088 @opindex shared
10089 Produce a shared object which can then be linked with other objects to
10090 form an executable.  Not all systems support this option.  For predictable
10091 results, you must also specify the same set of options used for compilation
10092 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10093 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10094 needs to build supplementary stub code for constructors to work.  On
10095 multi-libbed systems, @samp{gcc -shared} must select the correct support
10096 libraries to link against.  Failing to supply the correct flags may lead
10097 to subtle defects.  Supplying them in cases where they are not necessary
10098 is innocuous.}
10100 @item -shared-libgcc
10101 @itemx -static-libgcc
10102 @opindex shared-libgcc
10103 @opindex static-libgcc
10104 On systems that provide @file{libgcc} as a shared library, these options
10105 force the use of either the shared or static version, respectively.
10106 If no shared version of @file{libgcc} was built when the compiler was
10107 configured, these options have no effect.
10109 There are several situations in which an application should use the
10110 shared @file{libgcc} instead of the static version.  The most common
10111 of these is when the application wishes to throw and catch exceptions
10112 across different shared libraries.  In that case, each of the libraries
10113 as well as the application itself should use the shared @file{libgcc}.
10115 Therefore, the G++ and GCJ drivers automatically add
10116 @option{-shared-libgcc} whenever you build a shared library or a main
10117 executable, because C++ and Java programs typically use exceptions, so
10118 this is the right thing to do.
10120 If, instead, you use the GCC driver to create shared libraries, you may
10121 find that they are not always linked with the shared @file{libgcc}.
10122 If GCC finds, at its configuration time, that you have a non-GNU linker
10123 or a GNU linker that does not support option @option{--eh-frame-hdr},
10124 it links the shared version of @file{libgcc} into shared libraries
10125 by default.  Otherwise, it takes advantage of the linker and optimizes
10126 away the linking with the shared version of @file{libgcc}, linking with
10127 the static version of libgcc by default.  This allows exceptions to
10128 propagate through such shared libraries, without incurring relocation
10129 costs at library load time.
10131 However, if a library or main executable is supposed to throw or catch
10132 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10133 for the languages used in the program, or using the option
10134 @option{-shared-libgcc}, such that it is linked with the shared
10135 @file{libgcc}.
10137 @item -static-libasan
10138 When the @option{-fsanitize=address} option is used to link a program,
10139 the GCC driver automatically links against @option{libasan}.  If
10140 @file{libasan} is available as a shared library, and the @option{-static}
10141 option is not used, then this links against the shared version of
10142 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10143 driver to link @file{libasan} statically, without necessarily linking
10144 other libraries statically.
10146 @item -static-libtsan
10147 When the @option{-fsanitize=thread} option is used to link a program,
10148 the GCC driver automatically links against @option{libtsan}.  If
10149 @file{libtsan} is available as a shared library, and the @option{-static}
10150 option is not used, then this links against the shared version of
10151 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10152 driver to link @file{libtsan} statically, without necessarily linking
10153 other libraries statically.
10155 @item -static-libstdc++
10156 When the @command{g++} program is used to link a C++ program, it
10157 normally automatically links against @option{libstdc++}.  If
10158 @file{libstdc++} is available as a shared library, and the
10159 @option{-static} option is not used, then this links against the
10160 shared version of @file{libstdc++}.  That is normally fine.  However, it
10161 is sometimes useful to freeze the version of @file{libstdc++} used by
10162 the program without going all the way to a fully static link.  The
10163 @option{-static-libstdc++} option directs the @command{g++} driver to
10164 link @file{libstdc++} statically, without necessarily linking other
10165 libraries statically.
10167 @item -symbolic
10168 @opindex symbolic
10169 Bind references to global symbols when building a shared object.  Warn
10170 about any unresolved references (unless overridden by the link editor
10171 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10172 this option.
10174 @item -T @var{script}
10175 @opindex T
10176 @cindex linker script
10177 Use @var{script} as the linker script.  This option is supported by most
10178 systems using the GNU linker.  On some targets, such as bare-board
10179 targets without an operating system, the @option{-T} option may be required
10180 when linking to avoid references to undefined symbols.
10182 @item -Xlinker @var{option}
10183 @opindex Xlinker
10184 Pass @var{option} as an option to the linker.  You can use this to
10185 supply system-specific linker options that GCC does not recognize.
10187 If you want to pass an option that takes a separate argument, you must use
10188 @option{-Xlinker} twice, once for the option and once for the argument.
10189 For example, to pass @option{-assert definitions}, you must write
10190 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10191 @option{-Xlinker "-assert definitions"}, because this passes the entire
10192 string as a single argument, which is not what the linker expects.
10194 When using the GNU linker, it is usually more convenient to pass
10195 arguments to linker options using the @option{@var{option}=@var{value}}
10196 syntax than as separate arguments.  For example, you can specify
10197 @option{-Xlinker -Map=output.map} rather than
10198 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10199 this syntax for command-line options.
10201 @item -Wl,@var{option}
10202 @opindex Wl
10203 Pass @var{option} as an option to the linker.  If @var{option} contains
10204 commas, it is split into multiple options at the commas.  You can use this
10205 syntax to pass an argument to the option.
10206 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10207 linker.  When using the GNU linker, you can also get the same effect with
10208 @option{-Wl,-Map=output.map}.
10210 @item -u @var{symbol}
10211 @opindex u
10212 Pretend the symbol @var{symbol} is undefined, to force linking of
10213 library modules to define it.  You can use @option{-u} multiple times with
10214 different symbols to force loading of additional library modules.
10215 @end table
10217 @node Directory Options
10218 @section Options for Directory Search
10219 @cindex directory options
10220 @cindex options, directory search
10221 @cindex search path
10223 These options specify directories to search for header files, for
10224 libraries and for parts of the compiler:
10226 @table @gcctabopt
10227 @item -I@var{dir}
10228 @opindex I
10229 Add the directory @var{dir} to the head of the list of directories to be
10230 searched for header files.  This can be used to override a system header
10231 file, substituting your own version, since these directories are
10232 searched before the system header file directories.  However, you should
10233 not use this option to add directories that contain vendor-supplied
10234 system header files (use @option{-isystem} for that).  If you use more than
10235 one @option{-I} option, the directories are scanned in left-to-right
10236 order; the standard system directories come after.
10238 If a standard system include directory, or a directory specified with
10239 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10240 option is ignored.  The directory is still searched but as a
10241 system directory at its normal position in the system include chain.
10242 This is to ensure that GCC's procedure to fix buggy system headers and
10243 the ordering for the @code{include_next} directive are not inadvertently changed.
10244 If you really need to change the search order for system directories,
10245 use the @option{-nostdinc} and/or @option{-isystem} options.
10247 @item -iplugindir=@var{dir}
10248 Set the directory to search for plugins that are passed
10249 by @option{-fplugin=@var{name}} instead of
10250 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10251 to be used by the user, but only passed by the driver.
10253 @item -iquote@var{dir}
10254 @opindex iquote
10255 Add the directory @var{dir} to the head of the list of directories to
10256 be searched for header files only for the case of @samp{#include
10257 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
10258 otherwise just like @option{-I}.
10260 @item -L@var{dir}
10261 @opindex L
10262 Add directory @var{dir} to the list of directories to be searched
10263 for @option{-l}.
10265 @item -B@var{prefix}
10266 @opindex B
10267 This option specifies where to find the executables, libraries,
10268 include files, and data files of the compiler itself.
10270 The compiler driver program runs one or more of the subprograms
10271 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10272 @var{prefix} as a prefix for each program it tries to run, both with and
10273 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
10275 For each subprogram to be run, the compiler driver first tries the
10276 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10277 is not specified, the driver tries two standard prefixes, 
10278 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10279 those results in a file name that is found, the unmodified program
10280 name is searched for using the directories specified in your
10281 @env{PATH} environment variable.
10283 The compiler checks to see if the path provided by the @option{-B}
10284 refers to a directory, and if necessary it adds a directory
10285 separator character at the end of the path.
10287 @option{-B} prefixes that effectively specify directory names also apply
10288 to libraries in the linker, because the compiler translates these
10289 options into @option{-L} options for the linker.  They also apply to
10290 includes files in the preprocessor, because the compiler translates these
10291 options into @option{-isystem} options for the preprocessor.  In this case,
10292 the compiler appends @samp{include} to the prefix.
10294 The runtime support file @file{libgcc.a} can also be searched for using
10295 the @option{-B} prefix, if needed.  If it is not found there, the two
10296 standard prefixes above are tried, and that is all.  The file is left
10297 out of the link if it is not found by those means.
10299 Another way to specify a prefix much like the @option{-B} prefix is to use
10300 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10301 Variables}.
10303 As a special kludge, if the path provided by @option{-B} is
10304 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10305 9, then it is replaced by @file{[dir/]include}.  This is to help
10306 with boot-strapping the compiler.
10308 @item -specs=@var{file}
10309 @opindex specs
10310 Process @var{file} after the compiler reads in the standard @file{specs}
10311 file, in order to override the defaults which the @command{gcc} driver
10312 program uses when determining what switches to pass to @command{cc1},
10313 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
10314 @option{-specs=@var{file}} can be specified on the command line, and they
10315 are processed in order, from left to right.
10317 @item --sysroot=@var{dir}
10318 @opindex sysroot
10319 Use @var{dir} as the logical root directory for headers and libraries.
10320 For example, if the compiler normally searches for headers in
10321 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
10322 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
10324 If you use both this option and the @option{-isysroot} option, then
10325 the @option{--sysroot} option applies to libraries, but the
10326 @option{-isysroot} option applies to header files.
10328 The GNU linker (beginning with version 2.16) has the necessary support
10329 for this option.  If your linker does not support this option, the
10330 header file aspect of @option{--sysroot} still works, but the
10331 library aspect does not.
10333 @item --no-sysroot-suffix
10334 @opindex no-sysroot-suffix
10335 For some targets, a suffix is added to the root directory specified
10336 with @option{--sysroot}, depending on the other options used, so that
10337 headers may for example be found in
10338 @file{@var{dir}/@var{suffix}/usr/include} instead of
10339 @file{@var{dir}/usr/include}.  This option disables the addition of
10340 such a suffix.
10342 @item -I-
10343 @opindex I-
10344 This option has been deprecated.  Please use @option{-iquote} instead for
10345 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
10346 Any directories you specify with @option{-I} options before the @option{-I-}
10347 option are searched only for the case of @samp{#include "@var{file}"};
10348 they are not searched for @samp{#include <@var{file}>}.
10350 If additional directories are specified with @option{-I} options after
10351 the @option{-I-}, these directories are searched for all @samp{#include}
10352 directives.  (Ordinarily @emph{all} @option{-I} directories are used
10353 this way.)
10355 In addition, the @option{-I-} option inhibits the use of the current
10356 directory (where the current input file came from) as the first search
10357 directory for @samp{#include "@var{file}"}.  There is no way to
10358 override this effect of @option{-I-}.  With @option{-I.} you can specify
10359 searching the directory that is current when the compiler is
10360 invoked.  That is not exactly the same as what the preprocessor does
10361 by default, but it is often satisfactory.
10363 @option{-I-} does not inhibit the use of the standard system directories
10364 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
10365 independent.
10366 @end table
10368 @c man end
10370 @node Spec Files
10371 @section Specifying subprocesses and the switches to pass to them
10372 @cindex Spec Files
10374 @command{gcc} is a driver program.  It performs its job by invoking a
10375 sequence of other programs to do the work of compiling, assembling and
10376 linking.  GCC interprets its command-line parameters and uses these to
10377 deduce which programs it should invoke, and which command-line options
10378 it ought to place on their command lines.  This behavior is controlled
10379 by @dfn{spec strings}.  In most cases there is one spec string for each
10380 program that GCC can invoke, but a few programs have multiple spec
10381 strings to control their behavior.  The spec strings built into GCC can
10382 be overridden by using the @option{-specs=} command-line switch to specify
10383 a spec file.
10385 @dfn{Spec files} are plaintext files that are used to construct spec
10386 strings.  They consist of a sequence of directives separated by blank
10387 lines.  The type of directive is determined by the first non-whitespace
10388 character on the line, which can be one of the following:
10390 @table @code
10391 @item %@var{command}
10392 Issues a @var{command} to the spec file processor.  The commands that can
10393 appear here are:
10395 @table @code
10396 @item %include <@var{file}>
10397 @cindex @code{%include}
10398 Search for @var{file} and insert its text at the current point in the
10399 specs file.
10401 @item %include_noerr <@var{file}>
10402 @cindex @code{%include_noerr}
10403 Just like @samp{%include}, but do not generate an error message if the include
10404 file cannot be found.
10406 @item %rename @var{old_name} @var{new_name}
10407 @cindex @code{%rename}
10408 Rename the spec string @var{old_name} to @var{new_name}.
10410 @end table
10412 @item *[@var{spec_name}]:
10413 This tells the compiler to create, override or delete the named spec
10414 string.  All lines after this directive up to the next directive or
10415 blank line are considered to be the text for the spec string.  If this
10416 results in an empty string then the spec is deleted.  (Or, if the
10417 spec did not exist, then nothing happens.)  Otherwise, if the spec
10418 does not currently exist a new spec is created.  If the spec does
10419 exist then its contents are overridden by the text of this
10420 directive, unless the first character of that text is the @samp{+}
10421 character, in which case the text is appended to the spec.
10423 @item [@var{suffix}]:
10424 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
10425 and up to the next directive or blank line are considered to make up the
10426 spec string for the indicated suffix.  When the compiler encounters an
10427 input file with the named suffix, it processes the spec string in
10428 order to work out how to compile that file.  For example:
10430 @smallexample
10431 .ZZ:
10432 z-compile -input %i
10433 @end smallexample
10435 This says that any input file whose name ends in @samp{.ZZ} should be
10436 passed to the program @samp{z-compile}, which should be invoked with the
10437 command-line switch @option{-input} and with the result of performing the
10438 @samp{%i} substitution.  (See below.)
10440 As an alternative to providing a spec string, the text following a
10441 suffix directive can be one of the following:
10443 @table @code
10444 @item @@@var{language}
10445 This says that the suffix is an alias for a known @var{language}.  This is
10446 similar to using the @option{-x} command-line switch to GCC to specify a
10447 language explicitly.  For example:
10449 @smallexample
10450 .ZZ:
10451 @@c++
10452 @end smallexample
10454 Says that .ZZ files are, in fact, C++ source files.
10456 @item #@var{name}
10457 This causes an error messages saying:
10459 @smallexample
10460 @var{name} compiler not installed on this system.
10461 @end smallexample
10462 @end table
10464 GCC already has an extensive list of suffixes built into it.
10465 This directive adds an entry to the end of the list of suffixes, but
10466 since the list is searched from the end backwards, it is effectively
10467 possible to override earlier entries using this technique.
10469 @end table
10471 GCC has the following spec strings built into it.  Spec files can
10472 override these strings or create their own.  Note that individual
10473 targets can also add their own spec strings to this list.
10475 @smallexample
10476 asm          Options to pass to the assembler
10477 asm_final    Options to pass to the assembler post-processor
10478 cpp          Options to pass to the C preprocessor
10479 cc1          Options to pass to the C compiler
10480 cc1plus      Options to pass to the C++ compiler
10481 endfile      Object files to include at the end of the link
10482 link         Options to pass to the linker
10483 lib          Libraries to include on the command line to the linker
10484 libgcc       Decides which GCC support library to pass to the linker
10485 linker       Sets the name of the linker
10486 predefines   Defines to be passed to the C preprocessor
10487 signed_char  Defines to pass to CPP to say whether @code{char} is signed
10488              by default
10489 startfile    Object files to include at the start of the link
10490 @end smallexample
10492 Here is a small example of a spec file:
10494 @smallexample
10495 %rename lib                 old_lib
10497 *lib:
10498 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
10499 @end smallexample
10501 This example renames the spec called @samp{lib} to @samp{old_lib} and
10502 then overrides the previous definition of @samp{lib} with a new one.
10503 The new definition adds in some extra command-line options before
10504 including the text of the old definition.
10506 @dfn{Spec strings} are a list of command-line options to be passed to their
10507 corresponding program.  In addition, the spec strings can contain
10508 @samp{%}-prefixed sequences to substitute variable text or to
10509 conditionally insert text into the command line.  Using these constructs
10510 it is possible to generate quite complex command lines.
10512 Here is a table of all defined @samp{%}-sequences for spec
10513 strings.  Note that spaces are not generated automatically around the
10514 results of expanding these sequences.  Therefore you can concatenate them
10515 together or combine them with constant text in a single argument.
10517 @table @code
10518 @item %%
10519 Substitute one @samp{%} into the program name or argument.
10521 @item %i
10522 Substitute the name of the input file being processed.
10524 @item %b
10525 Substitute the basename of the input file being processed.
10526 This is the substring up to (and not including) the last period
10527 and not including the directory.
10529 @item %B
10530 This is the same as @samp{%b}, but include the file suffix (text after
10531 the last period).
10533 @item %d
10534 Marks the argument containing or following the @samp{%d} as a
10535 temporary file name, so that that file is deleted if GCC exits
10536 successfully.  Unlike @samp{%g}, this contributes no text to the
10537 argument.
10539 @item %g@var{suffix}
10540 Substitute a file name that has suffix @var{suffix} and is chosen
10541 once per compilation, and mark the argument in the same way as
10542 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
10543 name is now chosen in a way that is hard to predict even when previously
10544 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
10545 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
10546 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
10547 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
10548 was simply substituted with a file name chosen once per compilation,
10549 without regard to any appended suffix (which was therefore treated
10550 just like ordinary text), making such attacks more likely to succeed.
10552 @item %u@var{suffix}
10553 Like @samp{%g}, but generates a new temporary file name
10554 each time it appears instead of once per compilation.
10556 @item %U@var{suffix}
10557 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
10558 new one if there is no such last file name.  In the absence of any
10559 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
10560 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
10561 involves the generation of two distinct file names, one
10562 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
10563 simply substituted with a file name chosen for the previous @samp{%u},
10564 without regard to any appended suffix.
10566 @item %j@var{suffix}
10567 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
10568 writable, and if @option{-save-temps} is not used; 
10569 otherwise, substitute the name
10570 of a temporary file, just like @samp{%u}.  This temporary file is not
10571 meant for communication between processes, but rather as a junk
10572 disposal mechanism.
10574 @item %|@var{suffix}
10575 @itemx %m@var{suffix}
10576 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
10577 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
10578 all.  These are the two most common ways to instruct a program that it
10579 should read from standard input or write to standard output.  If you
10580 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
10581 construct: see for example @file{f/lang-specs.h}.
10583 @item %.@var{SUFFIX}
10584 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
10585 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
10586 terminated by the next space or %.
10588 @item %w
10589 Marks the argument containing or following the @samp{%w} as the
10590 designated output file of this compilation.  This puts the argument
10591 into the sequence of arguments that @samp{%o} substitutes.
10593 @item %o
10594 Substitutes the names of all the output files, with spaces
10595 automatically placed around them.  You should write spaces
10596 around the @samp{%o} as well or the results are undefined.
10597 @samp{%o} is for use in the specs for running the linker.
10598 Input files whose names have no recognized suffix are not compiled
10599 at all, but they are included among the output files, so they are
10600 linked.
10602 @item %O
10603 Substitutes the suffix for object files.  Note that this is
10604 handled specially when it immediately follows @samp{%g, %u, or %U},
10605 because of the need for those to form complete file names.  The
10606 handling is such that @samp{%O} is treated exactly as if it had already
10607 been substituted, except that @samp{%g, %u, and %U} do not currently
10608 support additional @var{suffix} characters following @samp{%O} as they do
10609 following, for example, @samp{.o}.
10611 @item %p
10612 Substitutes the standard macro predefinitions for the
10613 current target machine.  Use this when running @code{cpp}.
10615 @item %P
10616 Like @samp{%p}, but puts @samp{__} before and after the name of each
10617 predefined macro, except for macros that start with @samp{__} or with
10618 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
10621 @item %I
10622 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
10623 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
10624 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
10625 and @option{-imultilib} as necessary.
10627 @item %s
10628 Current argument is the name of a library or startup file of some sort.
10629 Search for that file in a standard list of directories and substitute
10630 the full name found.  The current working directory is included in the
10631 list of directories scanned.
10633 @item %T
10634 Current argument is the name of a linker script.  Search for that file
10635 in the current list of directories to scan for libraries. If the file
10636 is located insert a @option{--script} option into the command line
10637 followed by the full path name found.  If the file is not found then
10638 generate an error message.  Note: the current working directory is not
10639 searched.
10641 @item %e@var{str}
10642 Print @var{str} as an error message.  @var{str} is terminated by a newline.
10643 Use this when inconsistent options are detected.
10645 @item %(@var{name})
10646 Substitute the contents of spec string @var{name} at this point.
10648 @item %x@{@var{option}@}
10649 Accumulate an option for @samp{%X}.
10651 @item %X
10652 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
10653 spec string.
10655 @item %Y
10656 Output the accumulated assembler options specified by @option{-Wa}.
10658 @item %Z
10659 Output the accumulated preprocessor options specified by @option{-Wp}.
10661 @item %a
10662 Process the @code{asm} spec.  This is used to compute the
10663 switches to be passed to the assembler.
10665 @item %A
10666 Process the @code{asm_final} spec.  This is a spec string for
10667 passing switches to an assembler post-processor, if such a program is
10668 needed.
10670 @item %l
10671 Process the @code{link} spec.  This is the spec for computing the
10672 command line passed to the linker.  Typically it makes use of the
10673 @samp{%L %G %S %D and %E} sequences.
10675 @item %D
10676 Dump out a @option{-L} option for each directory that GCC believes might
10677 contain startup files.  If the target supports multilibs then the
10678 current multilib directory is prepended to each of these paths.
10680 @item %L
10681 Process the @code{lib} spec.  This is a spec string for deciding which
10682 libraries are included on the command line to the linker.
10684 @item %G
10685 Process the @code{libgcc} spec.  This is a spec string for deciding
10686 which GCC support library is included on the command line to the linker.
10688 @item %S
10689 Process the @code{startfile} spec.  This is a spec for deciding which
10690 object files are the first ones passed to the linker.  Typically
10691 this might be a file named @file{crt0.o}.
10693 @item %E
10694 Process the @code{endfile} spec.  This is a spec string that specifies
10695 the last object files that are passed to the linker.
10697 @item %C
10698 Process the @code{cpp} spec.  This is used to construct the arguments
10699 to be passed to the C preprocessor.
10701 @item %1
10702 Process the @code{cc1} spec.  This is used to construct the options to be
10703 passed to the actual C compiler (@samp{cc1}).
10705 @item %2
10706 Process the @code{cc1plus} spec.  This is used to construct the options to be
10707 passed to the actual C++ compiler (@samp{cc1plus}).
10709 @item %*
10710 Substitute the variable part of a matched option.  See below.
10711 Note that each comma in the substituted string is replaced by
10712 a single space.
10714 @item %<@code{S}
10715 Remove all occurrences of @code{-S} from the command line.  Note---this
10716 command is position dependent.  @samp{%} commands in the spec string
10717 before this one see @code{-S}, @samp{%} commands in the spec string
10718 after this one do not.
10720 @item %:@var{function}(@var{args})
10721 Call the named function @var{function}, passing it @var{args}.
10722 @var{args} is first processed as a nested spec string, then split
10723 into an argument vector in the usual fashion.  The function returns
10724 a string which is processed as if it had appeared literally as part
10725 of the current spec.
10727 The following built-in spec functions are provided:
10729 @table @code
10730 @item @code{getenv}
10731 The @code{getenv} spec function takes two arguments: an environment
10732 variable name and a string.  If the environment variable is not
10733 defined, a fatal error is issued.  Otherwise, the return value is the
10734 value of the environment variable concatenated with the string.  For
10735 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
10737 @smallexample
10738 %:getenv(TOPDIR /include)
10739 @end smallexample
10741 expands to @file{/path/to/top/include}.
10743 @item @code{if-exists}
10744 The @code{if-exists} spec function takes one argument, an absolute
10745 pathname to a file.  If the file exists, @code{if-exists} returns the
10746 pathname.  Here is a small example of its usage:
10748 @smallexample
10749 *startfile:
10750 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10751 @end smallexample
10753 @item @code{if-exists-else}
10754 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10755 spec function, except that it takes two arguments.  The first argument is
10756 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10757 returns the pathname.  If it does not exist, it returns the second argument.
10758 This way, @code{if-exists-else} can be used to select one file or another,
10759 based on the existence of the first.  Here is a small example of its usage:
10761 @smallexample
10762 *startfile:
10763 crt0%O%s %:if-exists(crti%O%s) \
10764 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10765 @end smallexample
10767 @item @code{replace-outfile}
10768 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10769 first argument in the outfiles array and replaces it with the second argument.  Here
10770 is a small example of its usage:
10772 @smallexample
10773 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10774 @end smallexample
10776 @item @code{remove-outfile}
10777 The @code{remove-outfile} spec function takes one argument.  It looks for the
10778 first argument in the outfiles array and removes it.  Here is a small example
10779 its usage:
10781 @smallexample
10782 %:remove-outfile(-lm)
10783 @end smallexample
10785 @item @code{pass-through-libs}
10786 The @code{pass-through-libs} spec function takes any number of arguments.  It
10787 finds any @option{-l} options and any non-options ending in @file{.a} (which it
10788 assumes are the names of linker input library archive files) and returns a
10789 result containing all the found arguments each prepended by
10790 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10791 intended to be passed to the LTO linker plugin.
10793 @smallexample
10794 %:pass-through-libs(%G %L %G)
10795 @end smallexample
10797 @item @code{print-asm-header}
10798 The @code{print-asm-header} function takes no arguments and simply
10799 prints a banner like:
10801 @smallexample
10802 Assembler options
10803 =================
10805 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10806 @end smallexample
10808 It is used to separate compiler options from assembler options
10809 in the @option{--target-help} output.
10810 @end table
10812 @item %@{@code{S}@}
10813 Substitutes the @code{-S} switch, if that switch is given to GCC@.
10814 If that switch is not specified, this substitutes nothing.  Note that
10815 the leading dash is omitted when specifying this option, and it is
10816 automatically inserted if the substitution is performed.  Thus the spec
10817 string @samp{%@{foo@}} matches the command-line option @option{-foo}
10818 and outputs the command-line option @option{-foo}.
10820 @item %W@{@code{S}@}
10821 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10822 deleted on failure.
10824 @item %@{@code{S}*@}
10825 Substitutes all the switches specified to GCC whose names start
10826 with @code{-S}, but which also take an argument.  This is used for
10827 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10828 GCC considers @option{-o foo} as being
10829 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
10830 text, including the space.  Thus two arguments are generated.
10832 @item %@{@code{S}*&@code{T}*@}
10833 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10834 (the order of @code{S} and @code{T} in the spec is not significant).
10835 There can be any number of ampersand-separated variables; for each the
10836 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10838 @item %@{@code{S}:@code{X}@}
10839 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
10841 @item %@{!@code{S}:@code{X}@}
10842 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
10844 @item %@{@code{S}*:@code{X}@}
10845 Substitutes @code{X} if one or more switches whose names start with
10846 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10847 once, no matter how many such switches appeared.  However, if @code{%*}
10848 appears somewhere in @code{X}, then @code{X} is substituted once
10849 for each matching switch, with the @code{%*} replaced by the part of
10850 that switch matching the @code{*}.
10852 @item %@{.@code{S}:@code{X}@}
10853 Substitutes @code{X}, if processing a file with suffix @code{S}.
10855 @item %@{!.@code{S}:@code{X}@}
10856 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10858 @item %@{,@code{S}:@code{X}@}
10859 Substitutes @code{X}, if processing a file for language @code{S}.
10861 @item %@{!,@code{S}:@code{X}@}
10862 Substitutes @code{X}, if not processing a file for language @code{S}.
10864 @item %@{@code{S}|@code{P}:@code{X}@}
10865 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
10866 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10867 @code{*} sequences as well, although they have a stronger binding than
10868 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10869 alternatives must be starred, and only the first matching alternative
10870 is substituted.
10872 For example, a spec string like this:
10874 @smallexample
10875 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10876 @end smallexample
10878 @noindent
10879 outputs the following command-line options from the following input
10880 command-line options:
10882 @smallexample
10883 fred.c        -foo -baz
10884 jim.d         -bar -boggle
10885 -d fred.c     -foo -baz -boggle
10886 -d jim.d      -bar -baz -boggle
10887 @end smallexample
10889 @item %@{S:X; T:Y; :D@}
10891 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
10892 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10893 be as many clauses as you need.  This may be combined with @code{.},
10894 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10897 @end table
10899 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10900 construct may contain other nested @samp{%} constructs or spaces, or
10901 even newlines.  They are processed as usual, as described above.
10902 Trailing white space in @code{X} is ignored.  White space may also
10903 appear anywhere on the left side of the colon in these constructs,
10904 except between @code{.} or @code{*} and the corresponding word.
10906 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10907 handled specifically in these constructs.  If another value of
10908 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10909 @option{-W} switch is found later in the command line, the earlier
10910 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10911 just one letter, which passes all matching options.
10913 The character @samp{|} at the beginning of the predicate text is used to
10914 indicate that a command should be piped to the following command, but
10915 only if @option{-pipe} is specified.
10917 It is built into GCC which switches take arguments and which do not.
10918 (You might think it would be useful to generalize this to allow each
10919 compiler's spec to say which switches take arguments.  But this cannot
10920 be done in a consistent fashion.  GCC cannot even decide which input
10921 files have been specified without knowing which switches take arguments,
10922 and it must know which input files to compile in order to tell which
10923 compilers to run).
10925 GCC also knows implicitly that arguments starting in @option{-l} are to be
10926 treated as compiler output files, and passed to the linker in their
10927 proper position among the other output files.
10929 @c man begin OPTIONS
10931 @node Target Options
10932 @section Specifying Target Machine and Compiler Version
10933 @cindex target options
10934 @cindex cross compiling
10935 @cindex specifying machine version
10936 @cindex specifying compiler version and target machine
10937 @cindex compiler version, specifying
10938 @cindex target machine, specifying
10940 The usual way to run GCC is to run the executable called @command{gcc}, or
10941 @command{@var{machine}-gcc} when cross-compiling, or
10942 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10943 one that was installed last.
10945 @node Submodel Options
10946 @section Hardware Models and Configurations
10947 @cindex submodel options
10948 @cindex specifying hardware config
10949 @cindex hardware models and configurations, specifying
10950 @cindex machine dependent options
10952 Each target machine types can have its own
10953 special options, starting with @samp{-m}, to choose among various
10954 hardware models or configurations---for example, 68010 vs 68020,
10955 floating coprocessor or none.  A single installed version of the
10956 compiler can compile for any model or configuration, according to the
10957 options specified.
10959 Some configurations of the compiler also support additional special
10960 options, usually for compatibility with other compilers on the same
10961 platform.
10963 @c This list is ordered alphanumerically by subsection name.
10964 @c It should be the same order and spelling as these options are listed
10965 @c in Machine Dependent Options
10967 @menu
10968 * AArch64 Options::
10969 * Adapteva Epiphany Options::
10970 * ARM Options::
10971 * AVR Options::
10972 * Blackfin Options::
10973 * C6X Options::
10974 * CRIS Options::
10975 * CR16 Options::
10976 * Darwin Options::
10977 * DEC Alpha Options::
10978 * FR30 Options::
10979 * FRV Options::
10980 * GNU/Linux Options::
10981 * H8/300 Options::
10982 * HPPA Options::
10983 * i386 and x86-64 Options::
10984 * i386 and x86-64 Windows Options::
10985 * IA-64 Options::
10986 * LM32 Options::
10987 * M32C Options::
10988 * M32R/D Options::
10989 * M680x0 Options::
10990 * MCore Options::
10991 * MeP Options::
10992 * MicroBlaze Options::
10993 * MIPS Options::
10994 * MMIX Options::
10995 * MN10300 Options::
10996 * Moxie Options::
10997 * PDP-11 Options::
10998 * picoChip Options::
10999 * PowerPC Options::
11000 * RL78 Options::
11001 * RS/6000 and PowerPC Options::
11002 * RX Options::
11003 * S/390 and zSeries Options::
11004 * Score Options::
11005 * SH Options::
11006 * Solaris 2 Options::
11007 * SPARC Options::
11008 * SPU Options::
11009 * System V Options::
11010 * TILE-Gx Options::
11011 * TILEPro Options::
11012 * V850 Options::
11013 * VAX Options::
11014 * VMS Options::
11015 * VxWorks Options::
11016 * x86-64 Options::
11017 * Xstormy16 Options::
11018 * Xtensa Options::
11019 * zSeries Options::
11020 @end menu
11022 @node AArch64 Options
11023 @subsection AArch64 Options
11024 @cindex AArch64 Options
11026 These options are defined for AArch64 implementations:
11028 @table @gcctabopt
11030 @item -mabi=@var{name}
11031 @opindex mabi
11032 Generate code for the specified data model.  Permissible values
11033 are @samp{ilp32} for SysV-like data model where int, long int and pointer
11034 are 32-bit, and @samp{lp64} for SysV-like data model where int is 32-bit,
11035 but long int and pointer are 64-bit.
11037 The default depends on the specific target configuration.  Note that
11038 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
11039 entire program with the same ABI, and link with a compatible set of libraries.
11041 @item -mbig-endian
11042 @opindex mbig-endian
11043 Generate big-endian code.  This is the default when GCC is configured for an
11044 @samp{aarch64_be-*-*} target.
11046 @item -mgeneral-regs-only
11047 @opindex mgeneral-regs-only
11048 Generate code which uses only the general registers.
11050 @item -mlittle-endian
11051 @opindex mlittle-endian
11052 Generate little-endian code.  This is the default when GCC is configured for an
11053 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
11055 @item -mcmodel=tiny
11056 @opindex mcmodel=tiny
11057 Generate code for the tiny code model.  The program and its statically defined
11058 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
11059 be statically or dynamically linked.  This model is not fully implemented and
11060 mostly treated as @samp{small}.
11062 @item -mcmodel=small
11063 @opindex mcmodel=small
11064 Generate code for the small code model.  The program and its statically defined
11065 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
11066 be statically or dynamically linked.  This is the default code model.
11068 @item -mcmodel=large
11069 @opindex mcmodel=large
11070 Generate code for the large code model.  This makes no assumptions about
11071 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
11072 statically linked only.
11074 @item -mstrict-align
11075 @opindex mstrict-align
11076 Do not assume that unaligned memory references will be handled by the system.
11078 @item -momit-leaf-frame-pointer
11079 @itemx -mno-omit-leaf-frame-pointer
11080 @opindex momit-leaf-frame-pointer
11081 @opindex mno-omit-leaf-frame-pointer
11082 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
11083 default.
11085 @item -mtls-dialect=desc
11086 @opindex mtls-dialect=desc
11087 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
11088 of TLS variables.  This is the default.
11090 @item -mtls-dialect=traditional
11091 @opindex mtls-dialect=traditional
11092 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
11093 of TLS variables.
11095 @item -march=@var{name}
11096 @opindex march
11097 Specify the name of the target architecture, optionally suffixed by one or
11098 more feature modifiers.  This option has the form
11099 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11100 only value for @var{arch} is @samp{armv8-a}.  The possible values for
11101 @var{feature} are documented in the sub-section below.
11103 Where conflicting feature modifiers are specified, the right-most feature is
11104 used.
11106 GCC uses this name to determine what kind of instructions it can emit when
11107 generating assembly code.  This option can be used in conjunction with or
11108 instead of the @option{-mcpu=} option.
11110 @item -mcpu=@var{name}
11111 @opindex mcpu
11112 Specify the name of the target processor, optionally suffixed by one or more
11113 feature modifiers.  This option has the form
11114 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
11115 possible values for @var{cpu} are @samp{generic}, @samp{large}.  The
11116 possible values for @var{feature} are documented in the sub-section
11117 below.
11119 Where conflicting feature modifiers are specified, the right-most feature is
11120 used.
11122 GCC uses this name to determine what kind of instructions it can emit when
11123 generating assembly code.
11125 @item -mtune=@var{name}
11126 @opindex mtune
11127 Specify the name of the processor to tune the performance for.  The code will
11128 be tuned as if the target processor were of the type specified in this option,
11129 but still using instructions compatible with the target processor specified
11130 by a @option{-mcpu=} option.  This option cannot be suffixed by feature
11131 modifiers.
11133 @end table
11135 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
11136 @cindex @option{-march} feature modifiers
11137 @cindex @option{-mcpu} feature modifiers
11138 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
11139 the following:
11141 @table @samp
11142 @item crypto
11143 Enable Crypto extension.  This implies Advanced SIMD is enabled.
11144 @item fp
11145 Enable floating-point instructions.
11146 @item simd
11147 Enable Advanced SIMD instructions.  This implies floating-point instructions
11148 are enabled.  This is the default for all current possible values for options
11149 @option{-march} and @option{-mcpu=}.
11150 @end table
11152 @node Adapteva Epiphany Options
11153 @subsection Adapteva Epiphany Options
11155 These @samp{-m} options are defined for Adapteva Epiphany:
11157 @table @gcctabopt
11158 @item -mhalf-reg-file
11159 @opindex mhalf-reg-file
11160 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
11161 That allows code to run on hardware variants that lack these registers.
11163 @item -mprefer-short-insn-regs
11164 @opindex mprefer-short-insn-regs
11165 Preferrentially allocate registers that allow short instruction generation.
11166 This can result in increased instruction count, so this may either reduce or
11167 increase overall code size.
11169 @item -mbranch-cost=@var{num}
11170 @opindex mbranch-cost
11171 Set the cost of branches to roughly @var{num} ``simple'' instructions.
11172 This cost is only a heuristic and is not guaranteed to produce
11173 consistent results across releases.
11175 @item -mcmove
11176 @opindex mcmove
11177 Enable the generation of conditional moves.
11179 @item -mnops=@var{num}
11180 @opindex mnops
11181 Emit @var{num} NOPs before every other generated instruction.
11183 @item -mno-soft-cmpsf
11184 @opindex mno-soft-cmpsf
11185 For single-precision floating-point comparisons, emit an @code{fsub} instruction
11186 and test the flags.  This is faster than a software comparison, but can
11187 get incorrect results in the presence of NaNs, or when two different small
11188 numbers are compared such that their difference is calculated as zero.
11189 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
11190 software comparisons.
11192 @item -mstack-offset=@var{num}
11193 @opindex mstack-offset
11194 Set the offset between the top of the stack and the stack pointer.
11195 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
11196 can be used by leaf functions without stack allocation.
11197 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
11198 Note also that this option changes the ABI; compiling a program with a
11199 different stack offset than the libraries have been compiled with
11200 generally does not work.
11201 This option can be useful if you want to evaluate if a different stack
11202 offset would give you better code, but to actually use a different stack
11203 offset to build working programs, it is recommended to configure the
11204 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
11206 @item -mno-round-nearest
11207 @opindex mno-round-nearest
11208 Make the scheduler assume that the rounding mode has been set to
11209 truncating.  The default is @option{-mround-nearest}.
11211 @item -mlong-calls
11212 @opindex mlong-calls
11213 If not otherwise specified by an attribute, assume all calls might be beyond
11214 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
11215 function address into a register before performing a (otherwise direct) call.
11216 This is the default.
11218 @item -mshort-calls
11219 @opindex short-calls
11220 If not otherwise specified by an attribute, assume all direct calls are
11221 in the range of the @code{b} / @code{bl} instructions, so use these instructions
11222 for direct calls.  The default is @option{-mlong-calls}.
11224 @item -msmall16
11225 @opindex msmall16
11226 Assume addresses can be loaded as 16-bit unsigned values.  This does not
11227 apply to function addresses for which @option{-mlong-calls} semantics
11228 are in effect.
11230 @item -mfp-mode=@var{mode}
11231 @opindex mfp-mode
11232 Set the prevailing mode of the floating-point unit.
11233 This determines the floating-point mode that is provided and expected
11234 at function call and return time.  Making this mode match the mode you
11235 predominantly need at function start can make your programs smaller and
11236 faster by avoiding unnecessary mode switches.
11238 @var{mode} can be set to one the following values:
11240 @table @samp
11241 @item caller
11242 Any mode at function entry is valid, and retained or restored when
11243 the function returns, and when it calls other functions.
11244 This mode is useful for compiling libraries or other compilation units
11245 you might want to incorporate into different programs with different
11246 prevailing FPU modes, and the convenience of being able to use a single
11247 object file outweighs the size and speed overhead for any extra
11248 mode switching that might be needed, compared with what would be needed
11249 with a more specific choice of prevailing FPU mode.
11251 @item truncate
11252 This is the mode used for floating-point calculations with
11253 truncating (i.e.@: round towards zero) rounding mode.  That includes
11254 conversion from floating point to integer.
11256 @item round-nearest
11257 This is the mode used for floating-point calculations with
11258 round-to-nearest-or-even rounding mode.
11260 @item int
11261 This is the mode used to perform integer calculations in the FPU, e.g.@:
11262 integer multiply, or integer multiply-and-accumulate.
11263 @end table
11265 The default is @option{-mfp-mode=caller}
11267 @item -mnosplit-lohi
11268 @itemx -mno-postinc
11269 @itemx -mno-postmodify
11270 @opindex mnosplit-lohi
11271 @opindex mno-postinc
11272 @opindex mno-postmodify
11273 Code generation tweaks that disable, respectively, splitting of 32-bit
11274 loads, generation of post-increment addresses, and generation of
11275 post-modify addresses.  The defaults are @option{msplit-lohi},
11276 @option{-mpost-inc}, and @option{-mpost-modify}.
11278 @item -mnovect-double
11279 @opindex mno-vect-double
11280 Change the preferred SIMD mode to SImode.  The default is
11281 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
11283 @item -max-vect-align=@var{num}
11284 @opindex max-vect-align
11285 The maximum alignment for SIMD vector mode types.
11286 @var{num} may be 4 or 8.  The default is 8.
11287 Note that this is an ABI change, even though many library function
11288 interfaces are unaffected if they don't use SIMD vector modes
11289 in places that affect size and/or alignment of relevant types.
11291 @item -msplit-vecmove-early
11292 @opindex msplit-vecmove-early
11293 Split vector moves into single word moves before reload.  In theory this
11294 can give better register allocation, but so far the reverse seems to be
11295 generally the case.
11297 @item -m1reg-@var{reg}
11298 @opindex m1reg-
11299 Specify a register to hold the constant @minus{}1, which makes loading small negative
11300 constants and certain bitmasks faster.
11301 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
11302 which specify use of that register as a fixed register,
11303 and @samp{none}, which means that no register is used for this
11304 purpose.  The default is @option{-m1reg-none}.
11306 @end table
11308 @node ARM Options
11309 @subsection ARM Options
11310 @cindex ARM options
11312 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
11313 architectures:
11315 @table @gcctabopt
11316 @item -mabi=@var{name}
11317 @opindex mabi
11318 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
11319 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
11321 @item -mapcs-frame
11322 @opindex mapcs-frame
11323 Generate a stack frame that is compliant with the ARM Procedure Call
11324 Standard for all functions, even if this is not strictly necessary for
11325 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
11326 with this option causes the stack frames not to be generated for
11327 leaf functions.  The default is @option{-mno-apcs-frame}.
11329 @item -mapcs
11330 @opindex mapcs
11331 This is a synonym for @option{-mapcs-frame}.
11333 @ignore
11334 @c not currently implemented
11335 @item -mapcs-stack-check
11336 @opindex mapcs-stack-check
11337 Generate code to check the amount of stack space available upon entry to
11338 every function (that actually uses some stack space).  If there is
11339 insufficient space available then either the function
11340 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
11341 called, depending upon the amount of stack space required.  The runtime
11342 system is required to provide these functions.  The default is
11343 @option{-mno-apcs-stack-check}, since this produces smaller code.
11345 @c not currently implemented
11346 @item -mapcs-float
11347 @opindex mapcs-float
11348 Pass floating-point arguments using the floating-point registers.  This is
11349 one of the variants of the APCS@.  This option is recommended if the
11350 target hardware has a floating-point unit or if a lot of floating-point
11351 arithmetic is going to be performed by the code.  The default is
11352 @option{-mno-apcs-float}, since the size of integer-only code is 
11353 slightly increased if @option{-mapcs-float} is used.
11355 @c not currently implemented
11356 @item -mapcs-reentrant
11357 @opindex mapcs-reentrant
11358 Generate reentrant, position-independent code.  The default is
11359 @option{-mno-apcs-reentrant}.
11360 @end ignore
11362 @item -mthumb-interwork
11363 @opindex mthumb-interwork
11364 Generate code that supports calling between the ARM and Thumb
11365 instruction sets.  Without this option, on pre-v5 architectures, the
11366 two instruction sets cannot be reliably used inside one program.  The
11367 default is @option{-mno-thumb-interwork}, since slightly larger code
11368 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
11369 configurations this option is meaningless.
11371 @item -mno-sched-prolog
11372 @opindex mno-sched-prolog
11373 Prevent the reordering of instructions in the function prologue, or the
11374 merging of those instruction with the instructions in the function's
11375 body.  This means that all functions start with a recognizable set
11376 of instructions (or in fact one of a choice from a small set of
11377 different function prologues), and this information can be used to
11378 locate the start of functions inside an executable piece of code.  The
11379 default is @option{-msched-prolog}.
11381 @item -mfloat-abi=@var{name}
11382 @opindex mfloat-abi
11383 Specifies which floating-point ABI to use.  Permissible values
11384 are: @samp{soft}, @samp{softfp} and @samp{hard}.
11386 Specifying @samp{soft} causes GCC to generate output containing
11387 library calls for floating-point operations.
11388 @samp{softfp} allows the generation of code using hardware floating-point
11389 instructions, but still uses the soft-float calling conventions.
11390 @samp{hard} allows generation of floating-point instructions
11391 and uses FPU-specific calling conventions.
11393 The default depends on the specific target configuration.  Note that
11394 the hard-float and soft-float ABIs are not link-compatible; you must
11395 compile your entire program with the same ABI, and link with a
11396 compatible set of libraries.
11398 @item -mlittle-endian
11399 @opindex mlittle-endian
11400 Generate code for a processor running in little-endian mode.  This is
11401 the default for all standard configurations.
11403 @item -mbig-endian
11404 @opindex mbig-endian
11405 Generate code for a processor running in big-endian mode; the default is
11406 to compile code for a little-endian processor.
11408 @item -mwords-little-endian
11409 @opindex mwords-little-endian
11410 This option only applies when generating code for big-endian processors.
11411 Generate code for a little-endian word order but a big-endian byte
11412 order.  That is, a byte order of the form @samp{32107654}.  Note: this
11413 option should only be used if you require compatibility with code for
11414 big-endian ARM processors generated by versions of the compiler prior to
11415 2.8.  This option is now deprecated.
11417 @item -mcpu=@var{name}
11418 @opindex mcpu
11419 This specifies the name of the target ARM processor.  GCC uses this name
11420 to determine what kind of instructions it can emit when generating
11421 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
11422 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
11423 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
11424 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
11425 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
11426 @samp{arm720},
11427 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
11428 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
11429 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
11430 @samp{strongarm1110},
11431 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
11432 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
11433 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
11434 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
11435 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
11436 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
11437 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
11438 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
11439 @samp{cortex-a15}, @samp{cortex-a53}, @samp{cortex-r4}, @samp{cortex-r4f},
11440 @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-m4}, @samp{cortex-m3},
11441 @samp{cortex-m1},
11442 @samp{cortex-m0},
11443 @samp{cortex-m0plus},
11444 @samp{marvell-pj4},
11445 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
11446 @samp{fa526}, @samp{fa626},
11447 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
11450 @option{-mcpu=generic-@var{arch}} is also permissible, and is
11451 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
11452 See @option{-mtune} for more information.
11454 @option{-mcpu=native} causes the compiler to auto-detect the CPU
11455 of the build computer.  At present, this feature is only supported on
11456 Linux, and not all architectures are recognized.  If the auto-detect is
11457 unsuccessful the option has no effect.
11459 @item -mtune=@var{name}
11460 @opindex mtune
11461 This option is very similar to the @option{-mcpu=} option, except that
11462 instead of specifying the actual target processor type, and hence
11463 restricting which instructions can be used, it specifies that GCC should
11464 tune the performance of the code as if the target were of the type
11465 specified in this option, but still choosing the instructions it
11466 generates based on the CPU specified by a @option{-mcpu=} option.
11467 For some ARM implementations better performance can be obtained by using
11468 this option.
11470 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
11471 performance for a blend of processors within architecture @var{arch}.
11472 The aim is to generate code that run well on the current most popular
11473 processors, balancing between optimizations that benefit some CPUs in the
11474 range, and avoiding performance pitfalls of other CPUs.  The effects of
11475 this option may change in future GCC versions as CPU models come and go.
11477 @option{-mtune=native} causes the compiler to auto-detect the CPU
11478 of the build computer.  At present, this feature is only supported on
11479 Linux, and not all architectures are recognized.  If the auto-detect is
11480 unsuccessful the option has no effect.
11482 @item -march=@var{name}
11483 @opindex march
11484 This specifies the name of the target ARM architecture.  GCC uses this
11485 name to determine what kind of instructions it can emit when generating
11486 assembly code.  This option can be used in conjunction with or instead
11487 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
11488 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
11489 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
11490 @samp{armv6}, @samp{armv6j},
11491 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
11492 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
11493 @samp{armv8-a},
11494 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
11496 @option{-march=native} causes the compiler to auto-detect the architecture
11497 of the build computer.  At present, this feature is only supported on
11498 Linux, and not all architectures are recognized.  If the auto-detect is
11499 unsuccessful the option has no effect.
11501 @item -mfpu=@var{name}
11502 @opindex mfpu
11503 This specifies what floating-point hardware (or hardware emulation) is
11504 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
11505 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
11506 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
11507 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
11508 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
11510 If @option{-msoft-float} is specified this specifies the format of
11511 floating-point values.
11513 If the selected floating-point hardware includes the NEON extension
11514 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
11515 operations are not generated by GCC's auto-vectorization pass unless
11516 @option{-funsafe-math-optimizations} is also specified.  This is
11517 because NEON hardware does not fully implement the IEEE 754 standard for
11518 floating-point arithmetic (in particular denormal values are treated as
11519 zero), so the use of NEON instructions may lead to a loss of precision.
11521 @item -mfp16-format=@var{name}
11522 @opindex mfp16-format
11523 Specify the format of the @code{__fp16} half-precision floating-point type.
11524 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
11525 the default is @samp{none}, in which case the @code{__fp16} type is not
11526 defined.  @xref{Half-Precision}, for more information.
11528 @item -mstructure-size-boundary=@var{n}
11529 @opindex mstructure-size-boundary
11530 The sizes of all structures and unions are rounded up to a multiple
11531 of the number of bits set by this option.  Permissible values are 8, 32
11532 and 64.  The default value varies for different toolchains.  For the COFF
11533 targeted toolchain the default value is 8.  A value of 64 is only allowed
11534 if the underlying ABI supports it.
11536 Specifying a larger number can produce faster, more efficient code, but
11537 can also increase the size of the program.  Different values are potentially
11538 incompatible.  Code compiled with one value cannot necessarily expect to
11539 work with code or libraries compiled with another value, if they exchange
11540 information using structures or unions.
11542 @item -mabort-on-noreturn
11543 @opindex mabort-on-noreturn
11544 Generate a call to the function @code{abort} at the end of a
11545 @code{noreturn} function.  It is executed if the function tries to
11546 return.
11548 @item -mlong-calls
11549 @itemx -mno-long-calls
11550 @opindex mlong-calls
11551 @opindex mno-long-calls
11552 Tells the compiler to perform function calls by first loading the
11553 address of the function into a register and then performing a subroutine
11554 call on this register.  This switch is needed if the target function
11555 lies outside of the 64-megabyte addressing range of the offset-based
11556 version of subroutine call instruction.
11558 Even if this switch is enabled, not all function calls are turned
11559 into long calls.  The heuristic is that static functions, functions
11560 that have the @samp{short-call} attribute, functions that are inside
11561 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
11562 definitions have already been compiled within the current compilation
11563 unit are not turned into long calls.  The exceptions to this rule are
11564 that weak function definitions, functions with the @samp{long-call}
11565 attribute or the @samp{section} attribute, and functions that are within
11566 the scope of a @samp{#pragma long_calls} directive are always
11567 turned into long calls.
11569 This feature is not enabled by default.  Specifying
11570 @option{-mno-long-calls} restores the default behavior, as does
11571 placing the function calls within the scope of a @samp{#pragma
11572 long_calls_off} directive.  Note these switches have no effect on how
11573 the compiler generates code to handle function calls via function
11574 pointers.
11576 @item -msingle-pic-base
11577 @opindex msingle-pic-base
11578 Treat the register used for PIC addressing as read-only, rather than
11579 loading it in the prologue for each function.  The runtime system is
11580 responsible for initializing this register with an appropriate value
11581 before execution begins.
11583 @item -mpic-register=@var{reg}
11584 @opindex mpic-register
11585 Specify the register to be used for PIC addressing.  The default is R10
11586 unless stack-checking is enabled, when R9 is used.
11588 @item -mpoke-function-name
11589 @opindex mpoke-function-name
11590 Write the name of each function into the text section, directly
11591 preceding the function prologue.  The generated code is similar to this:
11593 @smallexample
11594      t0
11595          .ascii "arm_poke_function_name", 0
11596          .align
11597      t1
11598          .word 0xff000000 + (t1 - t0)
11599      arm_poke_function_name
11600          mov     ip, sp
11601          stmfd   sp!, @{fp, ip, lr, pc@}
11602          sub     fp, ip, #4
11603 @end smallexample
11605 When performing a stack backtrace, code can inspect the value of
11606 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
11607 location @code{pc - 12} and the top 8 bits are set, then we know that
11608 there is a function name embedded immediately preceding this location
11609 and has length @code{((pc[-3]) & 0xff000000)}.
11611 @item -mthumb
11612 @itemx -marm
11613 @opindex marm
11614 @opindex mthumb
11616 Select between generating code that executes in ARM and Thumb
11617 states.  The default for most configurations is to generate code
11618 that executes in ARM state, but the default can be changed by
11619 configuring GCC with the @option{--with-mode=}@var{state}
11620 configure option.
11622 @item -mtpcs-frame
11623 @opindex mtpcs-frame
11624 Generate a stack frame that is compliant with the Thumb Procedure Call
11625 Standard for all non-leaf functions.  (A leaf function is one that does
11626 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
11628 @item -mtpcs-leaf-frame
11629 @opindex mtpcs-leaf-frame
11630 Generate a stack frame that is compliant with the Thumb Procedure Call
11631 Standard for all leaf functions.  (A leaf function is one that does
11632 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
11634 @item -mcallee-super-interworking
11635 @opindex mcallee-super-interworking
11636 Gives all externally visible functions in the file being compiled an ARM
11637 instruction set header which switches to Thumb mode before executing the
11638 rest of the function.  This allows these functions to be called from
11639 non-interworking code.  This option is not valid in AAPCS configurations
11640 because interworking is enabled by default.
11642 @item -mcaller-super-interworking
11643 @opindex mcaller-super-interworking
11644 Allows calls via function pointers (including virtual functions) to
11645 execute correctly regardless of whether the target code has been
11646 compiled for interworking or not.  There is a small overhead in the cost
11647 of executing a function pointer if this option is enabled.  This option
11648 is not valid in AAPCS configurations because interworking is enabled
11649 by default.
11651 @item -mtp=@var{name}
11652 @opindex mtp
11653 Specify the access model for the thread local storage pointer.  The valid
11654 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
11655 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
11656 (supported in the arm6k architecture), and @option{auto}, which uses the
11657 best available method for the selected processor.  The default setting is
11658 @option{auto}.
11660 @item -mtls-dialect=@var{dialect}
11661 @opindex mtls-dialect
11662 Specify the dialect to use for accessing thread local storage.  Two
11663 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
11664 @samp{gnu} dialect selects the original GNU scheme for supporting
11665 local and global dynamic TLS models.  The @samp{gnu2} dialect
11666 selects the GNU descriptor scheme, which provides better performance
11667 for shared libraries.  The GNU descriptor scheme is compatible with
11668 the original scheme, but does require new assembler, linker and
11669 library support.  Initial and local exec TLS models are unaffected by
11670 this option and always use the original scheme.
11672 @item -mword-relocations
11673 @opindex mword-relocations
11674 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
11675 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
11676 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
11677 is specified.
11679 @item -mfix-cortex-m3-ldrd
11680 @opindex mfix-cortex-m3-ldrd
11681 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
11682 with overlapping destination and base registers are used.  This option avoids
11683 generating these instructions.  This option is enabled by default when
11684 @option{-mcpu=cortex-m3} is specified.
11686 @item -munaligned-access
11687 @itemx -mno-unaligned-access
11688 @opindex munaligned-access
11689 @opindex mno-unaligned-access
11690 Enables (or disables) reading and writing of 16- and 32- bit values
11691 from addresses that are not 16- or 32- bit aligned.  By default
11692 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
11693 architectures, and enabled for all other architectures.  If unaligned
11694 access is not enabled then words in packed data structures will be
11695 accessed a byte at a time.
11697 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
11698 generated object file to either true or false, depending upon the
11699 setting of this option.  If unaligned access is enabled then the
11700 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
11701 defined.
11703 @item -mneon-for-64bits
11704 @opindex mneon-for-64bits
11705 Enables using Neon to handle scalar 64-bits operations. This is
11706 disabled by default since the cost of moving data from core registers
11707 to Neon is high.
11709 @item -mrestrict-it
11710 @opindex mrestrict-it
11711 Restricts generation of IT blocks to conform to the rules of ARMv8.
11712 IT blocks can only contain a single 16-bit instruction from a select
11713 set of instructions. This option is on by default for ARMv8 Thumb mode.
11714 @end table
11716 @node AVR Options
11717 @subsection AVR Options
11718 @cindex AVR Options
11720 These options are defined for AVR implementations:
11722 @table @gcctabopt
11723 @item -mmcu=@var{mcu}
11724 @opindex mmcu
11725 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
11727 The default for this option is@tie{}@code{avr2}.
11729 GCC supports the following AVR devices and ISAs:
11731 @include avr-mmcu.texi
11733 @item -maccumulate-args
11734 @opindex maccumulate-args
11735 Accumulate outgoing function arguments and acquire/release the needed
11736 stack space for outgoing function arguments once in function
11737 prologue/epilogue.  Without this option, outgoing arguments are pushed
11738 before calling a function and popped afterwards.
11740 Popping the arguments after the function call can be expensive on
11741 AVR so that accumulating the stack space might lead to smaller
11742 executables because arguments need not to be removed from the
11743 stack after such a function call.
11745 This option can lead to reduced code size for functions that perform
11746 several calls to functions that get their arguments on the stack like
11747 calls to printf-like functions.
11749 @item -mbranch-cost=@var{cost}
11750 @opindex mbranch-cost
11751 Set the branch costs for conditional branch instructions to
11752 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
11753 integers. The default branch cost is 0.
11755 @item -mcall-prologues
11756 @opindex mcall-prologues
11757 Functions prologues/epilogues are expanded as calls to appropriate
11758 subroutines.  Code size is smaller.
11760 @item -mint8
11761 @opindex mint8
11762 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
11763 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
11764 and @code{long long} is 4 bytes.  Please note that this option does not
11765 conform to the C standards, but it results in smaller code
11766 size.
11768 @item -mno-interrupts
11769 @opindex mno-interrupts
11770 Generated code is not compatible with hardware interrupts.
11771 Code size is smaller.
11773 @item -mrelax
11774 @opindex mrelax
11775 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
11776 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
11777 Setting @code{-mrelax} just adds the @code{--relax} option to the
11778 linker command line when the linker is called.
11780 Jump relaxing is performed by the linker because jump offsets are not
11781 known before code is located. Therefore, the assembler code generated by the
11782 compiler is the same, but the instructions in the executable may
11783 differ from instructions in the assembler code.
11785 Relaxing must be turned on if linker stubs are needed, see the
11786 section on @code{EIND} and linker stubs below.
11788 @item -msp8
11789 @opindex msp8
11790 Treat the stack pointer register as an 8-bit register,
11791 i.e.@: assume the high byte of the stack pointer is zero.
11792 In general, you don't need to set this option by hand.
11794 This option is used internally by the compiler to select and
11795 build multilibs for architectures @code{avr2} and @code{avr25}.
11796 These architectures mix devices with and without @code{SPH}.
11797 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
11798 the compiler driver will add or remove this option from the compiler
11799 proper's command line, because the compiler then knows if the device
11800 or architecture has an 8-bit stack pointer and thus no @code{SPH}
11801 register or not.
11803 @item -mstrict-X
11804 @opindex mstrict-X
11805 Use address register @code{X} in a way proposed by the hardware.  This means
11806 that @code{X} is only used in indirect, post-increment or
11807 pre-decrement addressing.
11809 Without this option, the @code{X} register may be used in the same way
11810 as @code{Y} or @code{Z} which then is emulated by additional
11811 instructions.  
11812 For example, loading a value with @code{X+const} addressing with a
11813 small non-negative @code{const < 64} to a register @var{Rn} is
11814 performed as
11816 @example
11817 adiw r26, const   ; X += const
11818 ld   @var{Rn}, X        ; @var{Rn} = *X
11819 sbiw r26, const   ; X -= const
11820 @end example
11822 @item -mtiny-stack
11823 @opindex mtiny-stack
11824 Only change the lower 8@tie{}bits of the stack pointer.
11826 @item -Waddr-space-convert
11827 @opindex Waddr-space-convert
11828 Warn about conversions between address spaces in the case where the
11829 resulting address space is not contained in the incoming address space.
11830 @end table
11832 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
11833 @cindex @code{EIND}
11834 Pointers in the implementation are 16@tie{}bits wide.
11835 The address of a function or label is represented as word address so
11836 that indirect jumps and calls can target any code address in the
11837 range of 64@tie{}Ki words.
11839 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
11840 bytes of program memory space, there is a special function register called
11841 @code{EIND} that serves as most significant part of the target address
11842 when @code{EICALL} or @code{EIJMP} instructions are used.
11844 Indirect jumps and calls on these devices are handled as follows by
11845 the compiler and are subject to some limitations:
11847 @itemize @bullet
11849 @item
11850 The compiler never sets @code{EIND}.
11852 @item
11853 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
11854 instructions or might read @code{EIND} directly in order to emulate an
11855 indirect call/jump by means of a @code{RET} instruction.
11857 @item
11858 The compiler assumes that @code{EIND} never changes during the startup
11859 code or during the application. In particular, @code{EIND} is not
11860 saved/restored in function or interrupt service routine
11861 prologue/epilogue.
11863 @item
11864 For indirect calls to functions and computed goto, the linker
11865 generates @emph{stubs}. Stubs are jump pads sometimes also called
11866 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
11867 The stub contains a direct jump to the desired address.
11869 @item
11870 Linker relaxation must be turned on so that the linker will generate
11871 the stubs correctly an all situaltion. See the compiler option
11872 @code{-mrelax} and the linler option @code{--relax}.
11873 There are corner cases where the linker is supposed to generate stubs
11874 but aborts without relaxation and without a helpful error message.
11876 @item
11877 The default linker script is arranged for code with @code{EIND = 0}.
11878 If code is supposed to work for a setup with @code{EIND != 0}, a custom
11879 linker script has to be used in order to place the sections whose
11880 name start with @code{.trampolines} into the segment where @code{EIND}
11881 points to.
11883 @item
11884 The startup code from libgcc never sets @code{EIND}.
11885 Notice that startup code is a blend of code from libgcc and AVR-LibC.
11886 For the impact of AVR-LibC on @code{EIND}, see the
11887 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
11889 @item
11890 It is legitimate for user-specific startup code to set up @code{EIND}
11891 early, for example by means of initialization code located in
11892 section @code{.init3}. Such code runs prior to general startup code
11893 that initializes RAM and calls constructors, but after the bit
11894 of startup code from AVR-LibC that sets @code{EIND} to the segment
11895 where the vector table is located.
11896 @example
11897 #include <avr/io.h>
11899 static void
11900 __attribute__((section(".init3"),naked,used,no_instrument_function))
11901 init3_set_eind (void)
11903   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
11904                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
11906 @end example
11908 @noindent
11909 The @code{__trampolines_start} symbol is defined in the linker script.
11911 @item
11912 Stubs are generated automatically by the linker if
11913 the following two conditions are met:
11914 @itemize @minus
11916 @item The address of a label is taken by means of the @code{gs} modifier
11917 (short for @emph{generate stubs}) like so:
11918 @example
11919 LDI r24, lo8(gs(@var{func}))
11920 LDI r25, hi8(gs(@var{func}))
11921 @end example
11922 @item The final location of that label is in a code segment
11923 @emph{outside} the segment where the stubs are located.
11924 @end itemize
11926 @item
11927 The compiler emits such @code{gs} modifiers for code labels in the
11928 following situations:
11929 @itemize @minus
11930 @item Taking address of a function or code label.
11931 @item Computed goto.
11932 @item If prologue-save function is used, see @option{-mcall-prologues}
11933 command-line option.
11934 @item Switch/case dispatch tables. If you do not want such dispatch
11935 tables you can specify the @option{-fno-jump-tables} command-line option.
11936 @item C and C++ constructors/destructors called during startup/shutdown.
11937 @item If the tools hit a @code{gs()} modifier explained above.
11938 @end itemize
11940 @item
11941 Jumping to non-symbolic addresses like so is @emph{not} supported:
11943 @example
11944 int main (void)
11946     /* Call function at word address 0x2 */
11947     return ((int(*)(void)) 0x2)();
11949 @end example
11951 Instead, a stub has to be set up, i.e.@: the function has to be called
11952 through a symbol (@code{func_4} in the example):
11954 @example
11955 int main (void)
11957     extern int func_4 (void);
11959     /* Call function at byte address 0x4 */
11960     return func_4();
11962 @end example
11964 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
11965 Alternatively, @code{func_4} can be defined in the linker script.
11966 @end itemize
11968 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
11969 @cindex @code{RAMPD}
11970 @cindex @code{RAMPX}
11971 @cindex @code{RAMPY}
11972 @cindex @code{RAMPZ}
11973 Some AVR devices support memories larger than the 64@tie{}KiB range
11974 that can be accessed with 16-bit pointers.  To access memory locations
11975 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
11976 register is used as high part of the address:
11977 The @code{X}, @code{Y}, @code{Z} address register is concatenated
11978 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
11979 register, respectively, to get a wide address. Similarly,
11980 @code{RAMPD} is used together with direct addressing.
11982 @itemize
11983 @item
11984 The startup code initializes the @code{RAMP} special function
11985 registers with zero.
11987 @item
11988 If a @ref{AVR Named Address Spaces,named address space} other than
11989 generic or @code{__flash} is used, then @code{RAMPZ} is set
11990 as needed before the operation.
11992 @item
11993 If the device supports RAM larger than 64@tie{KiB} and the compiler
11994 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
11995 is reset to zero after the operation.
11997 @item
11998 If the device comes with a specific @code{RAMP} register, the ISR
11999 prologue/epilogue saves/restores that SFR and initializes it with
12000 zero in case the ISR code might (implicitly) use it.
12002 @item
12003 RAM larger than 64@tie{KiB} is not supported by GCC for AVR targets.
12004 If you use inline assembler to read from locations outside the
12005 16-bit address range and change one of the @code{RAMP} registers,
12006 you must reset it to zero after the access.
12008 @end itemize
12010 @subsubsection AVR Built-in Macros
12012 GCC defines several built-in macros so that the user code can test
12013 for the presence or absence of features.  Almost any of the following
12014 built-in macros are deduced from device capabilities and thus
12015 triggered by the @code{-mmcu=} command-line option.
12017 For even more AVR-specific built-in macros see
12018 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
12020 @table @code
12022 @item __AVR_ARCH__
12023 Build-in macro that resolves to a decimal number that identifies the
12024 architecture and depends on the @code{-mmcu=@var{mcu}} option.
12025 Possible values are:
12027 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
12028 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
12029 @code{105}, @code{106}, @code{107}
12031 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
12032 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
12033 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
12034 @code{avrxmega6}, @code{avrxmega7}, respectively.
12035 If @var{mcu} specifies a device, this built-in macro is set
12036 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
12037 defined to @code{4}.
12039 @item __AVR_@var{Device}__
12040 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
12041 the device's name. For example, @code{-mmcu=atmega8} defines the
12042 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
12043 @code{__AVR_ATtiny261A__}, etc.
12045 The built-in macros' names follow
12046 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
12047 the device name as from the AVR user manual. The difference between
12048 @var{Device} in the built-in macro and @var{device} in
12049 @code{-mmcu=@var{device}} is that the latter is always lowercase.
12051 If @var{device} is not a device but only a core architecture like
12052 @code{avr51}, this macro will not be defined.
12054 @item __AVR_XMEGA__
12055 The device / architecture belongs to the XMEGA family of devices.
12057 @item __AVR_HAVE_ELPM__
12058 The device has the the @code{ELPM} instruction.
12060 @item __AVR_HAVE_ELPMX__
12061 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
12062 R@var{n},Z+} instructions.
12064 @item __AVR_HAVE_MOVW__
12065 The device has the @code{MOVW} instruction to perform 16-bit
12066 register-register moves.
12068 @item __AVR_HAVE_LPMX__
12069 The device has the @code{LPM R@var{n},Z} and
12070 @code{LPM R@var{n},Z+} instructions.
12072 @item __AVR_HAVE_MUL__
12073 The device has a hardware multiplier. 
12075 @item __AVR_HAVE_JMP_CALL__
12076 The device has the @code{JMP} and @code{CALL} instructions.
12077 This is the case for devices with at least 16@tie{}KiB of program
12078 memory.
12080 @item __AVR_HAVE_EIJMP_EICALL__
12081 @itemx __AVR_3_BYTE_PC__
12082 The device has the @code{EIJMP} and @code{EICALL} instructions.
12083 This is the case for devices with more than 128@tie{}KiB of program memory.
12084 This also means that the program counter
12085 (PC) is 3@tie{}bytes wide.
12087 @item __AVR_2_BYTE_PC__
12088 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
12089 with up to 128@tie{}KiB of program memory.
12091 @item __AVR_HAVE_8BIT_SP__
12092 @itemx __AVR_HAVE_16BIT_SP__
12093 The stack pointer (SP) register is treated as 8-bit respectively
12094 16-bit register by the compiler.
12095 The definition of these macros is affected by @code{-mtiny-stack}.
12097 @item __AVR_HAVE_SPH__
12098 @itemx __AVR_SP8__
12099 The device has the SPH (high part of stack pointer) special function
12100 register or has an 8-bit stack pointer, respectively.
12101 The definition of these macros is affected by @code{-mmcu=} and
12102 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
12103 by @code{-msp8}.
12105 @item __AVR_HAVE_RAMPD__
12106 @itemx __AVR_HAVE_RAMPX__
12107 @itemx __AVR_HAVE_RAMPY__
12108 @itemx __AVR_HAVE_RAMPZ__
12109 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
12110 @code{RAMPZ} special function register, respectively.
12112 @item __NO_INTERRUPTS__
12113 This macro reflects the @code{-mno-interrupts} command line option.
12115 @item __AVR_ERRATA_SKIP__
12116 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
12117 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
12118 instructions because of a hardware erratum.  Skip instructions are
12119 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
12120 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
12121 set.
12123 @item __AVR_SFR_OFFSET__=@var{offset}
12124 Instructions that can address I/O special function registers directly
12125 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
12126 address as if addressed by an instruction to access RAM like @code{LD}
12127 or @code{STS}. This offset depends on the device architecture and has
12128 to be subtracted from the RAM address in order to get the
12129 respective I/O@tie{}address.
12131 @item __WITH_AVRLIBC__
12132 The compiler is configured to be used together with AVR-Libc.
12133 See the @code{--with-avrlibc} configure option.
12135 @end table
12137 @node Blackfin Options
12138 @subsection Blackfin Options
12139 @cindex Blackfin Options
12141 @table @gcctabopt
12142 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
12143 @opindex mcpu=
12144 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
12145 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
12146 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
12147 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
12148 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
12149 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
12150 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
12151 @samp{bf561}, @samp{bf592}.
12153 The optional @var{sirevision} specifies the silicon revision of the target
12154 Blackfin processor.  Any workarounds available for the targeted silicon revision
12155 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
12156 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
12157 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
12158 hexadecimal digits representing the major and minor numbers in the silicon
12159 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
12160 is not defined.  If @var{sirevision} is @samp{any}, the
12161 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
12162 If this optional @var{sirevision} is not used, GCC assumes the latest known
12163 silicon revision of the targeted Blackfin processor.
12165 GCC defines a preprocessor macro for the specified @var{cpu}.
12166 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
12167 provided by libgloss to be linked in if @option{-msim} is not given.
12169 Without this option, @samp{bf532} is used as the processor by default.
12171 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
12172 only the preprocessor macro is defined.
12174 @item -msim
12175 @opindex msim
12176 Specifies that the program will be run on the simulator.  This causes
12177 the simulator BSP provided by libgloss to be linked in.  This option
12178 has effect only for @samp{bfin-elf} toolchain.
12179 Certain other options, such as @option{-mid-shared-library} and
12180 @option{-mfdpic}, imply @option{-msim}.
12182 @item -momit-leaf-frame-pointer
12183 @opindex momit-leaf-frame-pointer
12184 Don't keep the frame pointer in a register for leaf functions.  This
12185 avoids the instructions to save, set up and restore frame pointers and
12186 makes an extra register available in leaf functions.  The option
12187 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
12188 which might make debugging harder.
12190 @item -mspecld-anomaly
12191 @opindex mspecld-anomaly
12192 When enabled, the compiler ensures that the generated code does not
12193 contain speculative loads after jump instructions. If this option is used,
12194 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
12196 @item -mno-specld-anomaly
12197 @opindex mno-specld-anomaly
12198 Don't generate extra code to prevent speculative loads from occurring.
12200 @item -mcsync-anomaly
12201 @opindex mcsync-anomaly
12202 When enabled, the compiler ensures that the generated code does not
12203 contain CSYNC or SSYNC instructions too soon after conditional branches.
12204 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
12206 @item -mno-csync-anomaly
12207 @opindex mno-csync-anomaly
12208 Don't generate extra code to prevent CSYNC or SSYNC instructions from
12209 occurring too soon after a conditional branch.
12211 @item -mlow-64k
12212 @opindex mlow-64k
12213 When enabled, the compiler is free to take advantage of the knowledge that
12214 the entire program fits into the low 64k of memory.
12216 @item -mno-low-64k
12217 @opindex mno-low-64k
12218 Assume that the program is arbitrarily large.  This is the default.
12220 @item -mstack-check-l1
12221 @opindex mstack-check-l1
12222 Do stack checking using information placed into L1 scratchpad memory by the
12223 uClinux kernel.
12225 @item -mid-shared-library
12226 @opindex mid-shared-library
12227 Generate code that supports shared libraries via the library ID method.
12228 This allows for execute in place and shared libraries in an environment
12229 without virtual memory management.  This option implies @option{-fPIC}.
12230 With a @samp{bfin-elf} target, this option implies @option{-msim}.
12232 @item -mno-id-shared-library
12233 @opindex mno-id-shared-library
12234 Generate code that doesn't assume ID-based shared libraries are being used.
12235 This is the default.
12237 @item -mleaf-id-shared-library
12238 @opindex mleaf-id-shared-library
12239 Generate code that supports shared libraries via the library ID method,
12240 but assumes that this library or executable won't link against any other
12241 ID shared libraries.  That allows the compiler to use faster code for jumps
12242 and calls.
12244 @item -mno-leaf-id-shared-library
12245 @opindex mno-leaf-id-shared-library
12246 Do not assume that the code being compiled won't link against any ID shared
12247 libraries.  Slower code is generated for jump and call insns.
12249 @item -mshared-library-id=n
12250 @opindex mshared-library-id
12251 Specifies the identification number of the ID-based shared library being
12252 compiled.  Specifying a value of 0 generates more compact code; specifying
12253 other values forces the allocation of that number to the current
12254 library but is no more space- or time-efficient than omitting this option.
12256 @item -msep-data
12257 @opindex msep-data
12258 Generate code that allows the data segment to be located in a different
12259 area of memory from the text segment.  This allows for execute in place in
12260 an environment without virtual memory management by eliminating relocations
12261 against the text section.
12263 @item -mno-sep-data
12264 @opindex mno-sep-data
12265 Generate code that assumes that the data segment follows the text segment.
12266 This is the default.
12268 @item -mlong-calls
12269 @itemx -mno-long-calls
12270 @opindex mlong-calls
12271 @opindex mno-long-calls
12272 Tells the compiler to perform function calls by first loading the
12273 address of the function into a register and then performing a subroutine
12274 call on this register.  This switch is needed if the target function
12275 lies outside of the 24-bit addressing range of the offset-based
12276 version of subroutine call instruction.
12278 This feature is not enabled by default.  Specifying
12279 @option{-mno-long-calls} restores the default behavior.  Note these
12280 switches have no effect on how the compiler generates code to handle
12281 function calls via function pointers.
12283 @item -mfast-fp
12284 @opindex mfast-fp
12285 Link with the fast floating-point library. This library relaxes some of
12286 the IEEE floating-point standard's rules for checking inputs against
12287 Not-a-Number (NAN), in the interest of performance.
12289 @item -minline-plt
12290 @opindex minline-plt
12291 Enable inlining of PLT entries in function calls to functions that are
12292 not known to bind locally.  It has no effect without @option{-mfdpic}.
12294 @item -mmulticore
12295 @opindex mmulticore
12296 Build a standalone application for multicore Blackfin processors. 
12297 This option causes proper start files and link scripts supporting 
12298 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
12299 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
12301 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
12302 selects the one-application-per-core programming model.  Without
12303 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
12304 programming model is used. In this model, the main function of Core B
12305 should be named as @code{coreb_main}.
12307 If this option is not used, the single-core application programming
12308 model is used.
12310 @item -mcorea
12311 @opindex mcorea
12312 Build a standalone application for Core A of BF561 when using
12313 the one-application-per-core programming model. Proper start files
12314 and link scripts are used to support Core A, and the macro
12315 @code{__BFIN_COREA} is defined.
12316 This option can only be used in conjunction with @option{-mmulticore}.
12318 @item -mcoreb
12319 @opindex mcoreb
12320 Build a standalone application for Core B of BF561 when using
12321 the one-application-per-core programming model. Proper start files
12322 and link scripts are used to support Core B, and the macro
12323 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
12324 should be used instead of @code{main}. 
12325 This option can only be used in conjunction with @option{-mmulticore}.
12327 @item -msdram
12328 @opindex msdram
12329 Build a standalone application for SDRAM. Proper start files and
12330 link scripts are used to put the application into SDRAM, and the macro
12331 @code{__BFIN_SDRAM} is defined.
12332 The loader should initialize SDRAM before loading the application.
12334 @item -micplb
12335 @opindex micplb
12336 Assume that ICPLBs are enabled at run time.  This has an effect on certain
12337 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
12338 are enabled; for standalone applications the default is off.
12339 @end table
12341 @node C6X Options
12342 @subsection C6X Options
12343 @cindex C6X Options
12345 @table @gcctabopt
12346 @item -march=@var{name}
12347 @opindex march
12348 This specifies the name of the target architecture.  GCC uses this
12349 name to determine what kind of instructions it can emit when generating
12350 assembly code.  Permissible names are: @samp{c62x},
12351 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
12353 @item -mbig-endian
12354 @opindex mbig-endian
12355 Generate code for a big-endian target.
12357 @item -mlittle-endian
12358 @opindex mlittle-endian
12359 Generate code for a little-endian target.  This is the default.
12361 @item -msim
12362 @opindex msim
12363 Choose startup files and linker script suitable for the simulator.
12365 @item -msdata=default
12366 @opindex msdata=default
12367 Put small global and static data in the @samp{.neardata} section,
12368 which is pointed to by register @code{B14}.  Put small uninitialized
12369 global and static data in the @samp{.bss} section, which is adjacent
12370 to the @samp{.neardata} section.  Put small read-only data into the
12371 @samp{.rodata} section.  The corresponding sections used for large
12372 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
12374 @item -msdata=all
12375 @opindex msdata=all
12376 Put all data, not just small objects, into the sections reserved for
12377 small data, and use addressing relative to the @code{B14} register to
12378 access them.
12380 @item -msdata=none
12381 @opindex msdata=none
12382 Make no use of the sections reserved for small data, and use absolute
12383 addresses to access all data.  Put all initialized global and static
12384 data in the @samp{.fardata} section, and all uninitialized data in the
12385 @samp{.far} section.  Put all constant data into the @samp{.const}
12386 section.
12387 @end table
12389 @node CRIS Options
12390 @subsection CRIS Options
12391 @cindex CRIS Options
12393 These options are defined specifically for the CRIS ports.
12395 @table @gcctabopt
12396 @item -march=@var{architecture-type}
12397 @itemx -mcpu=@var{architecture-type}
12398 @opindex march
12399 @opindex mcpu
12400 Generate code for the specified architecture.  The choices for
12401 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
12402 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
12403 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
12404 @samp{v10}.
12406 @item -mtune=@var{architecture-type}
12407 @opindex mtune
12408 Tune to @var{architecture-type} everything applicable about the generated
12409 code, except for the ABI and the set of available instructions.  The
12410 choices for @var{architecture-type} are the same as for
12411 @option{-march=@var{architecture-type}}.
12413 @item -mmax-stack-frame=@var{n}
12414 @opindex mmax-stack-frame
12415 Warn when the stack frame of a function exceeds @var{n} bytes.
12417 @item -metrax4
12418 @itemx -metrax100
12419 @opindex metrax4
12420 @opindex metrax100
12421 The options @option{-metrax4} and @option{-metrax100} are synonyms for
12422 @option{-march=v3} and @option{-march=v8} respectively.
12424 @item -mmul-bug-workaround
12425 @itemx -mno-mul-bug-workaround
12426 @opindex mmul-bug-workaround
12427 @opindex mno-mul-bug-workaround
12428 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
12429 models where it applies.  This option is active by default.
12431 @item -mpdebug
12432 @opindex mpdebug
12433 Enable CRIS-specific verbose debug-related information in the assembly
12434 code.  This option also has the effect of turning off the @samp{#NO_APP}
12435 formatted-code indicator to the assembler at the beginning of the
12436 assembly file.
12438 @item -mcc-init
12439 @opindex mcc-init
12440 Do not use condition-code results from previous instruction; always emit
12441 compare and test instructions before use of condition codes.
12443 @item -mno-side-effects
12444 @opindex mno-side-effects
12445 Do not emit instructions with side effects in addressing modes other than
12446 post-increment.
12448 @item -mstack-align
12449 @itemx -mno-stack-align
12450 @itemx -mdata-align
12451 @itemx -mno-data-align
12452 @itemx -mconst-align
12453 @itemx -mno-const-align
12454 @opindex mstack-align
12455 @opindex mno-stack-align
12456 @opindex mdata-align
12457 @opindex mno-data-align
12458 @opindex mconst-align
12459 @opindex mno-const-align
12460 These options (@samp{no-} options) arrange (eliminate arrangements) for the
12461 stack frame, individual data and constants to be aligned for the maximum
12462 single data access size for the chosen CPU model.  The default is to
12463 arrange for 32-bit alignment.  ABI details such as structure layout are
12464 not affected by these options.
12466 @item -m32-bit
12467 @itemx -m16-bit
12468 @itemx -m8-bit
12469 @opindex m32-bit
12470 @opindex m16-bit
12471 @opindex m8-bit
12472 Similar to the stack- data- and const-align options above, these options
12473 arrange for stack frame, writable data and constants to all be 32-bit,
12474 16-bit or 8-bit aligned.  The default is 32-bit alignment.
12476 @item -mno-prologue-epilogue
12477 @itemx -mprologue-epilogue
12478 @opindex mno-prologue-epilogue
12479 @opindex mprologue-epilogue
12480 With @option{-mno-prologue-epilogue}, the normal function prologue and
12481 epilogue which set up the stack frame are omitted and no return
12482 instructions or return sequences are generated in the code.  Use this
12483 option only together with visual inspection of the compiled code: no
12484 warnings or errors are generated when call-saved registers must be saved,
12485 or storage for local variables needs to be allocated.
12487 @item -mno-gotplt
12488 @itemx -mgotplt
12489 @opindex mno-gotplt
12490 @opindex mgotplt
12491 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
12492 instruction sequences that load addresses for functions from the PLT part
12493 of the GOT rather than (traditional on other architectures) calls to the
12494 PLT@.  The default is @option{-mgotplt}.
12496 @item -melf
12497 @opindex melf
12498 Legacy no-op option only recognized with the cris-axis-elf and
12499 cris-axis-linux-gnu targets.
12501 @item -mlinux
12502 @opindex mlinux
12503 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
12505 @item -sim
12506 @opindex sim
12507 This option, recognized for the cris-axis-elf, arranges
12508 to link with input-output functions from a simulator library.  Code,
12509 initialized data and zero-initialized data are allocated consecutively.
12511 @item -sim2
12512 @opindex sim2
12513 Like @option{-sim}, but pass linker options to locate initialized data at
12514 0x40000000 and zero-initialized data at 0x80000000.
12515 @end table
12517 @node CR16 Options
12518 @subsection CR16 Options
12519 @cindex CR16 Options
12521 These options are defined specifically for the CR16 ports.
12523 @table @gcctabopt
12525 @item -mmac
12526 @opindex mmac
12527 Enable the use of multiply-accumulate instructions. Disabled by default.
12529 @item -mcr16cplus
12530 @itemx -mcr16c
12531 @opindex mcr16cplus
12532 @opindex mcr16c
12533 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
12534 is default.
12536 @item -msim
12537 @opindex msim
12538 Links the library libsim.a which is in compatible with simulator. Applicable
12539 to ELF compiler only.
12541 @item -mint32
12542 @opindex mint32
12543 Choose integer type as 32-bit wide.
12545 @item -mbit-ops
12546 @opindex mbit-ops
12547 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
12549 @item -mdata-model=@var{model}
12550 @opindex mdata-model
12551 Choose a data model. The choices for @var{model} are @samp{near},
12552 @samp{far} or @samp{medium}. @samp{medium} is default.
12553 However, @samp{far} is not valid with @option{-mcr16c}, as the
12554 CR16C architecture does not support the far data model.
12555 @end table
12557 @node Darwin Options
12558 @subsection Darwin Options
12559 @cindex Darwin options
12561 These options are defined for all architectures running the Darwin operating
12562 system.
12564 FSF GCC on Darwin does not create ``fat'' object files; it creates
12565 an object file for the single architecture that GCC was built to
12566 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
12567 @option{-arch} options are used; it does so by running the compiler or
12568 linker multiple times and joining the results together with
12569 @file{lipo}.
12571 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
12572 @samp{i686}) is determined by the flags that specify the ISA
12573 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
12574 @option{-force_cpusubtype_ALL} option can be used to override this.
12576 The Darwin tools vary in their behavior when presented with an ISA
12577 mismatch.  The assembler, @file{as}, only permits instructions to
12578 be used that are valid for the subtype of the file it is generating,
12579 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
12580 The linker for shared libraries, @file{/usr/bin/libtool}, fails
12581 and prints an error if asked to create a shared library with a less
12582 restrictive subtype than its input files (for instance, trying to put
12583 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
12584 for executables, @command{ld}, quietly gives the executable the most
12585 restrictive subtype of any of its input files.
12587 @table @gcctabopt
12588 @item -F@var{dir}
12589 @opindex F
12590 Add the framework directory @var{dir} to the head of the list of
12591 directories to be searched for header files.  These directories are
12592 interleaved with those specified by @option{-I} options and are
12593 scanned in a left-to-right order.
12595 A framework directory is a directory with frameworks in it.  A
12596 framework is a directory with a @file{Headers} and/or
12597 @file{PrivateHeaders} directory contained directly in it that ends
12598 in @file{.framework}.  The name of a framework is the name of this
12599 directory excluding the @file{.framework}.  Headers associated with
12600 the framework are found in one of those two directories, with
12601 @file{Headers} being searched first.  A subframework is a framework
12602 directory that is in a framework's @file{Frameworks} directory.
12603 Includes of subframework headers can only appear in a header of a
12604 framework that contains the subframework, or in a sibling subframework
12605 header.  Two subframeworks are siblings if they occur in the same
12606 framework.  A subframework should not have the same name as a
12607 framework; a warning is issued if this is violated.  Currently a
12608 subframework cannot have subframeworks; in the future, the mechanism
12609 may be extended to support this.  The standard frameworks can be found
12610 in @file{/System/Library/Frameworks} and
12611 @file{/Library/Frameworks}.  An example include looks like
12612 @code{#include <Framework/header.h>}, where @file{Framework} denotes
12613 the name of the framework and @file{header.h} is found in the
12614 @file{PrivateHeaders} or @file{Headers} directory.
12616 @item -iframework@var{dir}
12617 @opindex iframework
12618 Like @option{-F} except the directory is a treated as a system
12619 directory.  The main difference between this @option{-iframework} and
12620 @option{-F} is that with @option{-iframework} the compiler does not
12621 warn about constructs contained within header files found via
12622 @var{dir}.  This option is valid only for the C family of languages.
12624 @item -gused
12625 @opindex gused
12626 Emit debugging information for symbols that are used.  For stabs
12627 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
12628 This is by default ON@.
12630 @item -gfull
12631 @opindex gfull
12632 Emit debugging information for all symbols and types.
12634 @item -mmacosx-version-min=@var{version}
12635 The earliest version of MacOS X that this executable will run on
12636 is @var{version}.  Typical values of @var{version} include @code{10.1},
12637 @code{10.2}, and @code{10.3.9}.
12639 If the compiler was built to use the system's headers by default,
12640 then the default for this option is the system version on which the
12641 compiler is running, otherwise the default is to make choices that
12642 are compatible with as many systems and code bases as possible.
12644 @item -mkernel
12645 @opindex mkernel
12646 Enable kernel development mode.  The @option{-mkernel} option sets
12647 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
12648 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
12649 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
12650 applicable.  This mode also sets @option{-mno-altivec},
12651 @option{-msoft-float}, @option{-fno-builtin} and
12652 @option{-mlong-branch} for PowerPC targets.
12654 @item -mone-byte-bool
12655 @opindex mone-byte-bool
12656 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
12657 By default @samp{sizeof(bool)} is @samp{4} when compiling for
12658 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
12659 option has no effect on x86.
12661 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
12662 to generate code that is not binary compatible with code generated
12663 without that switch.  Using this switch may require recompiling all
12664 other modules in a program, including system libraries.  Use this
12665 switch to conform to a non-default data model.
12667 @item -mfix-and-continue
12668 @itemx -ffix-and-continue
12669 @itemx -findirect-data
12670 @opindex mfix-and-continue
12671 @opindex ffix-and-continue
12672 @opindex findirect-data
12673 Generate code suitable for fast turnaround development, such as to
12674 allow GDB to dynamically load @code{.o} files into already-running
12675 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
12676 are provided for backwards compatibility.
12678 @item -all_load
12679 @opindex all_load
12680 Loads all members of static archive libraries.
12681 See man ld(1) for more information.
12683 @item -arch_errors_fatal
12684 @opindex arch_errors_fatal
12685 Cause the errors having to do with files that have the wrong architecture
12686 to be fatal.
12688 @item -bind_at_load
12689 @opindex bind_at_load
12690 Causes the output file to be marked such that the dynamic linker will
12691 bind all undefined references when the file is loaded or launched.
12693 @item -bundle
12694 @opindex bundle
12695 Produce a Mach-o bundle format file.
12696 See man ld(1) for more information.
12698 @item -bundle_loader @var{executable}
12699 @opindex bundle_loader
12700 This option specifies the @var{executable} that will load the build
12701 output file being linked.  See man ld(1) for more information.
12703 @item -dynamiclib
12704 @opindex dynamiclib
12705 When passed this option, GCC produces a dynamic library instead of
12706 an executable when linking, using the Darwin @file{libtool} command.
12708 @item -force_cpusubtype_ALL
12709 @opindex force_cpusubtype_ALL
12710 This causes GCC's output file to have the @var{ALL} subtype, instead of
12711 one controlled by the @option{-mcpu} or @option{-march} option.
12713 @item -allowable_client  @var{client_name}
12714 @itemx -client_name
12715 @itemx -compatibility_version
12716 @itemx -current_version
12717 @itemx -dead_strip
12718 @itemx -dependency-file
12719 @itemx -dylib_file
12720 @itemx -dylinker_install_name
12721 @itemx -dynamic
12722 @itemx -exported_symbols_list
12723 @itemx -filelist
12724 @need 800
12725 @itemx -flat_namespace
12726 @itemx -force_flat_namespace
12727 @itemx -headerpad_max_install_names
12728 @itemx -image_base
12729 @itemx -init
12730 @itemx -install_name
12731 @itemx -keep_private_externs
12732 @itemx -multi_module
12733 @itemx -multiply_defined
12734 @itemx -multiply_defined_unused
12735 @need 800
12736 @itemx -noall_load
12737 @itemx -no_dead_strip_inits_and_terms
12738 @itemx -nofixprebinding
12739 @itemx -nomultidefs
12740 @itemx -noprebind
12741 @itemx -noseglinkedit
12742 @itemx -pagezero_size
12743 @itemx -prebind
12744 @itemx -prebind_all_twolevel_modules
12745 @itemx -private_bundle
12746 @need 800
12747 @itemx -read_only_relocs
12748 @itemx -sectalign
12749 @itemx -sectobjectsymbols
12750 @itemx -whyload
12751 @itemx -seg1addr
12752 @itemx -sectcreate
12753 @itemx -sectobjectsymbols
12754 @itemx -sectorder
12755 @itemx -segaddr
12756 @itemx -segs_read_only_addr
12757 @need 800
12758 @itemx -segs_read_write_addr
12759 @itemx -seg_addr_table
12760 @itemx -seg_addr_table_filename
12761 @itemx -seglinkedit
12762 @itemx -segprot
12763 @itemx -segs_read_only_addr
12764 @itemx -segs_read_write_addr
12765 @itemx -single_module
12766 @itemx -static
12767 @itemx -sub_library
12768 @need 800
12769 @itemx -sub_umbrella
12770 @itemx -twolevel_namespace
12771 @itemx -umbrella
12772 @itemx -undefined
12773 @itemx -unexported_symbols_list
12774 @itemx -weak_reference_mismatches
12775 @itemx -whatsloaded
12776 @opindex allowable_client
12777 @opindex client_name
12778 @opindex compatibility_version
12779 @opindex current_version
12780 @opindex dead_strip
12781 @opindex dependency-file
12782 @opindex dylib_file
12783 @opindex dylinker_install_name
12784 @opindex dynamic
12785 @opindex exported_symbols_list
12786 @opindex filelist
12787 @opindex flat_namespace
12788 @opindex force_flat_namespace
12789 @opindex headerpad_max_install_names
12790 @opindex image_base
12791 @opindex init
12792 @opindex install_name
12793 @opindex keep_private_externs
12794 @opindex multi_module
12795 @opindex multiply_defined
12796 @opindex multiply_defined_unused
12797 @opindex noall_load
12798 @opindex no_dead_strip_inits_and_terms
12799 @opindex nofixprebinding
12800 @opindex nomultidefs
12801 @opindex noprebind
12802 @opindex noseglinkedit
12803 @opindex pagezero_size
12804 @opindex prebind
12805 @opindex prebind_all_twolevel_modules
12806 @opindex private_bundle
12807 @opindex read_only_relocs
12808 @opindex sectalign
12809 @opindex sectobjectsymbols
12810 @opindex whyload
12811 @opindex seg1addr
12812 @opindex sectcreate
12813 @opindex sectobjectsymbols
12814 @opindex sectorder
12815 @opindex segaddr
12816 @opindex segs_read_only_addr
12817 @opindex segs_read_write_addr
12818 @opindex seg_addr_table
12819 @opindex seg_addr_table_filename
12820 @opindex seglinkedit
12821 @opindex segprot
12822 @opindex segs_read_only_addr
12823 @opindex segs_read_write_addr
12824 @opindex single_module
12825 @opindex static
12826 @opindex sub_library
12827 @opindex sub_umbrella
12828 @opindex twolevel_namespace
12829 @opindex umbrella
12830 @opindex undefined
12831 @opindex unexported_symbols_list
12832 @opindex weak_reference_mismatches
12833 @opindex whatsloaded
12834 These options are passed to the Darwin linker.  The Darwin linker man page
12835 describes them in detail.
12836 @end table
12838 @node DEC Alpha Options
12839 @subsection DEC Alpha Options
12841 These @samp{-m} options are defined for the DEC Alpha implementations:
12843 @table @gcctabopt
12844 @item -mno-soft-float
12845 @itemx -msoft-float
12846 @opindex mno-soft-float
12847 @opindex msoft-float
12848 Use (do not use) the hardware floating-point instructions for
12849 floating-point operations.  When @option{-msoft-float} is specified,
12850 functions in @file{libgcc.a} are used to perform floating-point
12851 operations.  Unless they are replaced by routines that emulate the
12852 floating-point operations, or compiled in such a way as to call such
12853 emulations routines, these routines issue floating-point
12854 operations.   If you are compiling for an Alpha without floating-point
12855 operations, you must ensure that the library is built so as not to call
12856 them.
12858 Note that Alpha implementations without floating-point operations are
12859 required to have floating-point registers.
12861 @item -mfp-reg
12862 @itemx -mno-fp-regs
12863 @opindex mfp-reg
12864 @opindex mno-fp-regs
12865 Generate code that uses (does not use) the floating-point register set.
12866 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
12867 register set is not used, floating-point operands are passed in integer
12868 registers as if they were integers and floating-point results are passed
12869 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
12870 so any function with a floating-point argument or return value called by code
12871 compiled with @option{-mno-fp-regs} must also be compiled with that
12872 option.
12874 A typical use of this option is building a kernel that does not use,
12875 and hence need not save and restore, any floating-point registers.
12877 @item -mieee
12878 @opindex mieee
12879 The Alpha architecture implements floating-point hardware optimized for
12880 maximum performance.  It is mostly compliant with the IEEE floating-point
12881 standard.  However, for full compliance, software assistance is
12882 required.  This option generates code fully IEEE-compliant code
12883 @emph{except} that the @var{inexact-flag} is not maintained (see below).
12884 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
12885 defined during compilation.  The resulting code is less efficient but is
12886 able to correctly support denormalized numbers and exceptional IEEE
12887 values such as not-a-number and plus/minus infinity.  Other Alpha
12888 compilers call this option @option{-ieee_with_no_inexact}.
12890 @item -mieee-with-inexact
12891 @opindex mieee-with-inexact
12892 This is like @option{-mieee} except the generated code also maintains
12893 the IEEE @var{inexact-flag}.  Turning on this option causes the
12894 generated code to implement fully-compliant IEEE math.  In addition to
12895 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
12896 macro.  On some Alpha implementations the resulting code may execute
12897 significantly slower than the code generated by default.  Since there is
12898 very little code that depends on the @var{inexact-flag}, you should
12899 normally not specify this option.  Other Alpha compilers call this
12900 option @option{-ieee_with_inexact}.
12902 @item -mfp-trap-mode=@var{trap-mode}
12903 @opindex mfp-trap-mode
12904 This option controls what floating-point related traps are enabled.
12905 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
12906 The trap mode can be set to one of four values:
12908 @table @samp
12909 @item n
12910 This is the default (normal) setting.  The only traps that are enabled
12911 are the ones that cannot be disabled in software (e.g., division by zero
12912 trap).
12914 @item u
12915 In addition to the traps enabled by @samp{n}, underflow traps are enabled
12916 as well.
12918 @item su
12919 Like @samp{u}, but the instructions are marked to be safe for software
12920 completion (see Alpha architecture manual for details).
12922 @item sui
12923 Like @samp{su}, but inexact traps are enabled as well.
12924 @end table
12926 @item -mfp-rounding-mode=@var{rounding-mode}
12927 @opindex mfp-rounding-mode
12928 Selects the IEEE rounding mode.  Other Alpha compilers call this option
12929 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
12932 @table @samp
12933 @item n
12934 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
12935 the nearest machine number or towards the even machine number in case
12936 of a tie.
12938 @item m
12939 Round towards minus infinity.
12941 @item c
12942 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
12944 @item d
12945 Dynamic rounding mode.  A field in the floating-point control register
12946 (@var{fpcr}, see Alpha architecture reference manual) controls the
12947 rounding mode in effect.  The C library initializes this register for
12948 rounding towards plus infinity.  Thus, unless your program modifies the
12949 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
12950 @end table
12952 @item -mtrap-precision=@var{trap-precision}
12953 @opindex mtrap-precision
12954 In the Alpha architecture, floating-point traps are imprecise.  This
12955 means without software assistance it is impossible to recover from a
12956 floating trap and program execution normally needs to be terminated.
12957 GCC can generate code that can assist operating system trap handlers
12958 in determining the exact location that caused a floating-point trap.
12959 Depending on the requirements of an application, different levels of
12960 precisions can be selected:
12962 @table @samp
12963 @item p
12964 Program precision.  This option is the default and means a trap handler
12965 can only identify which program caused a floating-point exception.
12967 @item f
12968 Function precision.  The trap handler can determine the function that
12969 caused a floating-point exception.
12971 @item i
12972 Instruction precision.  The trap handler can determine the exact
12973 instruction that caused a floating-point exception.
12974 @end table
12976 Other Alpha compilers provide the equivalent options called
12977 @option{-scope_safe} and @option{-resumption_safe}.
12979 @item -mieee-conformant
12980 @opindex mieee-conformant
12981 This option marks the generated code as IEEE conformant.  You must not
12982 use this option unless you also specify @option{-mtrap-precision=i} and either
12983 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
12984 is to emit the line @samp{.eflag 48} in the function prologue of the
12985 generated assembly file.
12987 @item -mbuild-constants
12988 @opindex mbuild-constants
12989 Normally GCC examines a 32- or 64-bit integer constant to
12990 see if it can construct it from smaller constants in two or three
12991 instructions.  If it cannot, it outputs the constant as a literal and
12992 generates code to load it from the data segment at run time.
12994 Use this option to require GCC to construct @emph{all} integer constants
12995 using code, even if it takes more instructions (the maximum is six).
12997 You typically use this option to build a shared library dynamic
12998 loader.  Itself a shared library, it must relocate itself in memory
12999 before it can find the variables and constants in its own data segment.
13001 @item -mbwx
13002 @itemx -mno-bwx
13003 @itemx -mcix
13004 @itemx -mno-cix
13005 @itemx -mfix
13006 @itemx -mno-fix
13007 @itemx -mmax
13008 @itemx -mno-max
13009 @opindex mbwx
13010 @opindex mno-bwx
13011 @opindex mcix
13012 @opindex mno-cix
13013 @opindex mfix
13014 @opindex mno-fix
13015 @opindex mmax
13016 @opindex mno-max
13017 Indicate whether GCC should generate code to use the optional BWX,
13018 CIX, FIX and MAX instruction sets.  The default is to use the instruction
13019 sets supported by the CPU type specified via @option{-mcpu=} option or that
13020 of the CPU on which GCC was built if none is specified.
13022 @item -mfloat-vax
13023 @itemx -mfloat-ieee
13024 @opindex mfloat-vax
13025 @opindex mfloat-ieee
13026 Generate code that uses (does not use) VAX F and G floating-point
13027 arithmetic instead of IEEE single and double precision.
13029 @item -mexplicit-relocs
13030 @itemx -mno-explicit-relocs
13031 @opindex mexplicit-relocs
13032 @opindex mno-explicit-relocs
13033 Older Alpha assemblers provided no way to generate symbol relocations
13034 except via assembler macros.  Use of these macros does not allow
13035 optimal instruction scheduling.  GNU binutils as of version 2.12
13036 supports a new syntax that allows the compiler to explicitly mark
13037 which relocations should apply to which instructions.  This option
13038 is mostly useful for debugging, as GCC detects the capabilities of
13039 the assembler when it is built and sets the default accordingly.
13041 @item -msmall-data
13042 @itemx -mlarge-data
13043 @opindex msmall-data
13044 @opindex mlarge-data
13045 When @option{-mexplicit-relocs} is in effect, static data is
13046 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
13047 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
13048 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
13049 16-bit relocations off of the @code{$gp} register.  This limits the
13050 size of the small data area to 64KB, but allows the variables to be
13051 directly accessed via a single instruction.
13053 The default is @option{-mlarge-data}.  With this option the data area
13054 is limited to just below 2GB@.  Programs that require more than 2GB of
13055 data must use @code{malloc} or @code{mmap} to allocate the data in the
13056 heap instead of in the program's data segment.
13058 When generating code for shared libraries, @option{-fpic} implies
13059 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
13061 @item -msmall-text
13062 @itemx -mlarge-text
13063 @opindex msmall-text
13064 @opindex mlarge-text
13065 When @option{-msmall-text} is used, the compiler assumes that the
13066 code of the entire program (or shared library) fits in 4MB, and is
13067 thus reachable with a branch instruction.  When @option{-msmall-data}
13068 is used, the compiler can assume that all local symbols share the
13069 same @code{$gp} value, and thus reduce the number of instructions
13070 required for a function call from 4 to 1.
13072 The default is @option{-mlarge-text}.
13074 @item -mcpu=@var{cpu_type}
13075 @opindex mcpu
13076 Set the instruction set and instruction scheduling parameters for
13077 machine type @var{cpu_type}.  You can specify either the @samp{EV}
13078 style name or the corresponding chip number.  GCC supports scheduling
13079 parameters for the EV4, EV5 and EV6 family of processors and
13080 chooses the default values for the instruction set from the processor
13081 you specify.  If you do not specify a processor type, GCC defaults
13082 to the processor on which the compiler was built.
13084 Supported values for @var{cpu_type} are
13086 @table @samp
13087 @item ev4
13088 @itemx ev45
13089 @itemx 21064
13090 Schedules as an EV4 and has no instruction set extensions.
13092 @item ev5
13093 @itemx 21164
13094 Schedules as an EV5 and has no instruction set extensions.
13096 @item ev56
13097 @itemx 21164a
13098 Schedules as an EV5 and supports the BWX extension.
13100 @item pca56
13101 @itemx 21164pc
13102 @itemx 21164PC
13103 Schedules as an EV5 and supports the BWX and MAX extensions.
13105 @item ev6
13106 @itemx 21264
13107 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
13109 @item ev67
13110 @itemx 21264a
13111 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
13112 @end table
13114 Native toolchains also support the value @samp{native},
13115 which selects the best architecture option for the host processor.
13116 @option{-mcpu=native} has no effect if GCC does not recognize
13117 the processor.
13119 @item -mtune=@var{cpu_type}
13120 @opindex mtune
13121 Set only the instruction scheduling parameters for machine type
13122 @var{cpu_type}.  The instruction set is not changed.
13124 Native toolchains also support the value @samp{native},
13125 which selects the best architecture option for the host processor.
13126 @option{-mtune=native} has no effect if GCC does not recognize
13127 the processor.
13129 @item -mmemory-latency=@var{time}
13130 @opindex mmemory-latency
13131 Sets the latency the scheduler should assume for typical memory
13132 references as seen by the application.  This number is highly
13133 dependent on the memory access patterns used by the application
13134 and the size of the external cache on the machine.
13136 Valid options for @var{time} are
13138 @table @samp
13139 @item @var{number}
13140 A decimal number representing clock cycles.
13142 @item L1
13143 @itemx L2
13144 @itemx L3
13145 @itemx main
13146 The compiler contains estimates of the number of clock cycles for
13147 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
13148 (also called Dcache, Scache, and Bcache), as well as to main memory.
13149 Note that L3 is only valid for EV5.
13151 @end table
13152 @end table
13154 @node FR30 Options
13155 @subsection FR30 Options
13156 @cindex FR30 Options
13158 These options are defined specifically for the FR30 port.
13160 @table @gcctabopt
13162 @item -msmall-model
13163 @opindex msmall-model
13164 Use the small address space model.  This can produce smaller code, but
13165 it does assume that all symbolic values and addresses fit into a
13166 20-bit range.
13168 @item -mno-lsim
13169 @opindex mno-lsim
13170 Assume that runtime support has been provided and so there is no need
13171 to include the simulator library (@file{libsim.a}) on the linker
13172 command line.
13174 @end table
13176 @node FRV Options
13177 @subsection FRV Options
13178 @cindex FRV Options
13180 @table @gcctabopt
13181 @item -mgpr-32
13182 @opindex mgpr-32
13184 Only use the first 32 general-purpose registers.
13186 @item -mgpr-64
13187 @opindex mgpr-64
13189 Use all 64 general-purpose registers.
13191 @item -mfpr-32
13192 @opindex mfpr-32
13194 Use only the first 32 floating-point registers.
13196 @item -mfpr-64
13197 @opindex mfpr-64
13199 Use all 64 floating-point registers.
13201 @item -mhard-float
13202 @opindex mhard-float
13204 Use hardware instructions for floating-point operations.
13206 @item -msoft-float
13207 @opindex msoft-float
13209 Use library routines for floating-point operations.
13211 @item -malloc-cc
13212 @opindex malloc-cc
13214 Dynamically allocate condition code registers.
13216 @item -mfixed-cc
13217 @opindex mfixed-cc
13219 Do not try to dynamically allocate condition code registers, only
13220 use @code{icc0} and @code{fcc0}.
13222 @item -mdword
13223 @opindex mdword
13225 Change ABI to use double word insns.
13227 @item -mno-dword
13228 @opindex mno-dword
13230 Do not use double word instructions.
13232 @item -mdouble
13233 @opindex mdouble
13235 Use floating-point double instructions.
13237 @item -mno-double
13238 @opindex mno-double
13240 Do not use floating-point double instructions.
13242 @item -mmedia
13243 @opindex mmedia
13245 Use media instructions.
13247 @item -mno-media
13248 @opindex mno-media
13250 Do not use media instructions.
13252 @item -mmuladd
13253 @opindex mmuladd
13255 Use multiply and add/subtract instructions.
13257 @item -mno-muladd
13258 @opindex mno-muladd
13260 Do not use multiply and add/subtract instructions.
13262 @item -mfdpic
13263 @opindex mfdpic
13265 Select the FDPIC ABI, which uses function descriptors to represent
13266 pointers to functions.  Without any PIC/PIE-related options, it
13267 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
13268 assumes GOT entries and small data are within a 12-bit range from the
13269 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
13270 are computed with 32 bits.
13271 With a @samp{bfin-elf} target, this option implies @option{-msim}.
13273 @item -minline-plt
13274 @opindex minline-plt
13276 Enable inlining of PLT entries in function calls to functions that are
13277 not known to bind locally.  It has no effect without @option{-mfdpic}.
13278 It's enabled by default if optimizing for speed and compiling for
13279 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
13280 optimization option such as @option{-O3} or above is present in the
13281 command line.
13283 @item -mTLS
13284 @opindex mTLS
13286 Assume a large TLS segment when generating thread-local code.
13288 @item -mtls
13289 @opindex mtls
13291 Do not assume a large TLS segment when generating thread-local code.
13293 @item -mgprel-ro
13294 @opindex mgprel-ro
13296 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
13297 that is known to be in read-only sections.  It's enabled by default,
13298 except for @option{-fpic} or @option{-fpie}: even though it may help
13299 make the global offset table smaller, it trades 1 instruction for 4.
13300 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
13301 one of which may be shared by multiple symbols, and it avoids the need
13302 for a GOT entry for the referenced symbol, so it's more likely to be a
13303 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
13305 @item -multilib-library-pic
13306 @opindex multilib-library-pic
13308 Link with the (library, not FD) pic libraries.  It's implied by
13309 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
13310 @option{-fpic} without @option{-mfdpic}.  You should never have to use
13311 it explicitly.
13313 @item -mlinked-fp
13314 @opindex mlinked-fp
13316 Follow the EABI requirement of always creating a frame pointer whenever
13317 a stack frame is allocated.  This option is enabled by default and can
13318 be disabled with @option{-mno-linked-fp}.
13320 @item -mlong-calls
13321 @opindex mlong-calls
13323 Use indirect addressing to call functions outside the current
13324 compilation unit.  This allows the functions to be placed anywhere
13325 within the 32-bit address space.
13327 @item -malign-labels
13328 @opindex malign-labels
13330 Try to align labels to an 8-byte boundary by inserting NOPs into the
13331 previous packet.  This option only has an effect when VLIW packing
13332 is enabled.  It doesn't create new packets; it merely adds NOPs to
13333 existing ones.
13335 @item -mlibrary-pic
13336 @opindex mlibrary-pic
13338 Generate position-independent EABI code.
13340 @item -macc-4
13341 @opindex macc-4
13343 Use only the first four media accumulator registers.
13345 @item -macc-8
13346 @opindex macc-8
13348 Use all eight media accumulator registers.
13350 @item -mpack
13351 @opindex mpack
13353 Pack VLIW instructions.
13355 @item -mno-pack
13356 @opindex mno-pack
13358 Do not pack VLIW instructions.
13360 @item -mno-eflags
13361 @opindex mno-eflags
13363 Do not mark ABI switches in e_flags.
13365 @item -mcond-move
13366 @opindex mcond-move
13368 Enable the use of conditional-move instructions (default).
13370 This switch is mainly for debugging the compiler and will likely be removed
13371 in a future version.
13373 @item -mno-cond-move
13374 @opindex mno-cond-move
13376 Disable the use of conditional-move instructions.
13378 This switch is mainly for debugging the compiler and will likely be removed
13379 in a future version.
13381 @item -mscc
13382 @opindex mscc
13384 Enable the use of conditional set instructions (default).
13386 This switch is mainly for debugging the compiler and will likely be removed
13387 in a future version.
13389 @item -mno-scc
13390 @opindex mno-scc
13392 Disable the use of conditional set instructions.
13394 This switch is mainly for debugging the compiler and will likely be removed
13395 in a future version.
13397 @item -mcond-exec
13398 @opindex mcond-exec
13400 Enable the use of conditional execution (default).
13402 This switch is mainly for debugging the compiler and will likely be removed
13403 in a future version.
13405 @item -mno-cond-exec
13406 @opindex mno-cond-exec
13408 Disable the use of conditional execution.
13410 This switch is mainly for debugging the compiler and will likely be removed
13411 in a future version.
13413 @item -mvliw-branch
13414 @opindex mvliw-branch
13416 Run a pass to pack branches into VLIW instructions (default).
13418 This switch is mainly for debugging the compiler and will likely be removed
13419 in a future version.
13421 @item -mno-vliw-branch
13422 @opindex mno-vliw-branch
13424 Do not run a pass to pack branches into VLIW instructions.
13426 This switch is mainly for debugging the compiler and will likely be removed
13427 in a future version.
13429 @item -mmulti-cond-exec
13430 @opindex mmulti-cond-exec
13432 Enable optimization of @code{&&} and @code{||} in conditional execution
13433 (default).
13435 This switch is mainly for debugging the compiler and will likely be removed
13436 in a future version.
13438 @item -mno-multi-cond-exec
13439 @opindex mno-multi-cond-exec
13441 Disable optimization of @code{&&} and @code{||} in conditional execution.
13443 This switch is mainly for debugging the compiler and will likely be removed
13444 in a future version.
13446 @item -mnested-cond-exec
13447 @opindex mnested-cond-exec
13449 Enable nested conditional execution optimizations (default).
13451 This switch is mainly for debugging the compiler and will likely be removed
13452 in a future version.
13454 @item -mno-nested-cond-exec
13455 @opindex mno-nested-cond-exec
13457 Disable nested conditional execution optimizations.
13459 This switch is mainly for debugging the compiler and will likely be removed
13460 in a future version.
13462 @item -moptimize-membar
13463 @opindex moptimize-membar
13465 This switch removes redundant @code{membar} instructions from the
13466 compiler-generated code.  It is enabled by default.
13468 @item -mno-optimize-membar
13469 @opindex mno-optimize-membar
13471 This switch disables the automatic removal of redundant @code{membar}
13472 instructions from the generated code.
13474 @item -mtomcat-stats
13475 @opindex mtomcat-stats
13477 Cause gas to print out tomcat statistics.
13479 @item -mcpu=@var{cpu}
13480 @opindex mcpu
13482 Select the processor type for which to generate code.  Possible values are
13483 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
13484 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
13486 @end table
13488 @node GNU/Linux Options
13489 @subsection GNU/Linux Options
13491 These @samp{-m} options are defined for GNU/Linux targets:
13493 @table @gcctabopt
13494 @item -mglibc
13495 @opindex mglibc
13496 Use the GNU C library.  This is the default except
13497 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
13499 @item -muclibc
13500 @opindex muclibc
13501 Use uClibc C library.  This is the default on
13502 @samp{*-*-linux-*uclibc*} targets.
13504 @item -mbionic
13505 @opindex mbionic
13506 Use Bionic C library.  This is the default on
13507 @samp{*-*-linux-*android*} targets.
13509 @item -mandroid
13510 @opindex mandroid
13511 Compile code compatible with Android platform.  This is the default on
13512 @samp{*-*-linux-*android*} targets.
13514 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
13515 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
13516 this option makes the GCC driver pass Android-specific options to the linker.
13517 Finally, this option causes the preprocessor macro @code{__ANDROID__}
13518 to be defined.
13520 @item -tno-android-cc
13521 @opindex tno-android-cc
13522 Disable compilation effects of @option{-mandroid}, i.e., do not enable
13523 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
13524 @option{-fno-rtti} by default.
13526 @item -tno-android-ld
13527 @opindex tno-android-ld
13528 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
13529 linking options to the linker.
13531 @end table
13533 @node H8/300 Options
13534 @subsection H8/300 Options
13536 These @samp{-m} options are defined for the H8/300 implementations:
13538 @table @gcctabopt
13539 @item -mrelax
13540 @opindex mrelax
13541 Shorten some address references at link time, when possible; uses the
13542 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
13543 ld, Using ld}, for a fuller description.
13545 @item -mh
13546 @opindex mh
13547 Generate code for the H8/300H@.
13549 @item -ms
13550 @opindex ms
13551 Generate code for the H8S@.
13553 @item -mn
13554 @opindex mn
13555 Generate code for the H8S and H8/300H in the normal mode.  This switch
13556 must be used either with @option{-mh} or @option{-ms}.
13558 @item -ms2600
13559 @opindex ms2600
13560 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
13562 @item -mexr
13563 @opindex mexr
13564 Extended registers are stored on stack before execution of function
13565 with monitor attribute. Default option is @option{-mexr}.
13566 This option is valid only for H8S targets.
13568 @item -mno-exr
13569 @opindex mno-exr
13570 Extended registers are not stored on stack before execution of function 
13571 with monitor attribute. Default option is @option{-mno-exr}. 
13572 This option is valid only for H8S targets.
13574 @item -mint32
13575 @opindex mint32
13576 Make @code{int} data 32 bits by default.
13578 @item -malign-300
13579 @opindex malign-300
13580 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
13581 The default for the H8/300H and H8S is to align longs and floats on
13582 4-byte boundaries.
13583 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
13584 This option has no effect on the H8/300.
13585 @end table
13587 @node HPPA Options
13588 @subsection HPPA Options
13589 @cindex HPPA Options
13591 These @samp{-m} options are defined for the HPPA family of computers:
13593 @table @gcctabopt
13594 @item -march=@var{architecture-type}
13595 @opindex march
13596 Generate code for the specified architecture.  The choices for
13597 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
13598 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
13599 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
13600 architecture option for your machine.  Code compiled for lower numbered
13601 architectures runs on higher numbered architectures, but not the
13602 other way around.
13604 @item -mpa-risc-1-0
13605 @itemx -mpa-risc-1-1
13606 @itemx -mpa-risc-2-0
13607 @opindex mpa-risc-1-0
13608 @opindex mpa-risc-1-1
13609 @opindex mpa-risc-2-0
13610 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
13612 @item -mjump-in-delay
13613 @opindex mjump-in-delay
13614 Fill delay slots of function calls with unconditional jump instructions
13615 by modifying the return pointer for the function call to be the target
13616 of the conditional jump.
13618 @item -mdisable-fpregs
13619 @opindex mdisable-fpregs
13620 Prevent floating-point registers from being used in any manner.  This is
13621 necessary for compiling kernels that perform lazy context switching of
13622 floating-point registers.  If you use this option and attempt to perform
13623 floating-point operations, the compiler aborts.
13625 @item -mdisable-indexing
13626 @opindex mdisable-indexing
13627 Prevent the compiler from using indexing address modes.  This avoids some
13628 rather obscure problems when compiling MIG generated code under MACH@.
13630 @item -mno-space-regs
13631 @opindex mno-space-regs
13632 Generate code that assumes the target has no space registers.  This allows
13633 GCC to generate faster indirect calls and use unscaled index address modes.
13635 Such code is suitable for level 0 PA systems and kernels.
13637 @item -mfast-indirect-calls
13638 @opindex mfast-indirect-calls
13639 Generate code that assumes calls never cross space boundaries.  This
13640 allows GCC to emit code that performs faster indirect calls.
13642 This option does not work in the presence of shared libraries or nested
13643 functions.
13645 @item -mfixed-range=@var{register-range}
13646 @opindex mfixed-range
13647 Generate code treating the given register range as fixed registers.
13648 A fixed register is one that the register allocator cannot use.  This is
13649 useful when compiling kernel code.  A register range is specified as
13650 two registers separated by a dash.  Multiple register ranges can be
13651 specified separated by a comma.
13653 @item -mlong-load-store
13654 @opindex mlong-load-store
13655 Generate 3-instruction load and store sequences as sometimes required by
13656 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
13657 the HP compilers.
13659 @item -mportable-runtime
13660 @opindex mportable-runtime
13661 Use the portable calling conventions proposed by HP for ELF systems.
13663 @item -mgas
13664 @opindex mgas
13665 Enable the use of assembler directives only GAS understands.
13667 @item -mschedule=@var{cpu-type}
13668 @opindex mschedule
13669 Schedule code according to the constraints for the machine type
13670 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
13671 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
13672 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
13673 proper scheduling option for your machine.  The default scheduling is
13674 @samp{8000}.
13676 @item -mlinker-opt
13677 @opindex mlinker-opt
13678 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
13679 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
13680 linkers in which they give bogus error messages when linking some programs.
13682 @item -msoft-float
13683 @opindex msoft-float
13684 Generate output containing library calls for floating point.
13685 @strong{Warning:} the requisite libraries are not available for all HPPA
13686 targets.  Normally the facilities of the machine's usual C compiler are
13687 used, but this cannot be done directly in cross-compilation.  You must make
13688 your own arrangements to provide suitable library functions for
13689 cross-compilation.
13691 @option{-msoft-float} changes the calling convention in the output file;
13692 therefore, it is only useful if you compile @emph{all} of a program with
13693 this option.  In particular, you need to compile @file{libgcc.a}, the
13694 library that comes with GCC, with @option{-msoft-float} in order for
13695 this to work.
13697 @item -msio
13698 @opindex msio
13699 Generate the predefine, @code{_SIO}, for server IO@.  The default is
13700 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
13701 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
13702 options are available under HP-UX and HI-UX@.
13704 @item -mgnu-ld
13705 @opindex mgnu-ld
13706 Use options specific to GNU @command{ld}.
13707 This passes @option{-shared} to @command{ld} when
13708 building a shared library.  It is the default when GCC is configured,
13709 explicitly or implicitly, with the GNU linker.  This option does not
13710 affect which @command{ld} is called; it only changes what parameters
13711 are passed to that @command{ld}.
13712 The @command{ld} that is called is determined by the
13713 @option{--with-ld} configure option, GCC's program search path, and
13714 finally by the user's @env{PATH}.  The linker used by GCC can be printed
13715 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
13716 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13718 @item -mhp-ld
13719 @opindex mhp-ld
13720 Use options specific to HP @command{ld}.
13721 This passes @option{-b} to @command{ld} when building
13722 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
13723 links.  It is the default when GCC is configured, explicitly or
13724 implicitly, with the HP linker.  This option does not affect
13725 which @command{ld} is called; it only changes what parameters are passed to that
13726 @command{ld}.
13727 The @command{ld} that is called is determined by the @option{--with-ld}
13728 configure option, GCC's program search path, and finally by the user's
13729 @env{PATH}.  The linker used by GCC can be printed using @samp{which
13730 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
13731 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13733 @item -mlong-calls
13734 @opindex mno-long-calls
13735 Generate code that uses long call sequences.  This ensures that a call
13736 is always able to reach linker generated stubs.  The default is to generate
13737 long calls only when the distance from the call site to the beginning
13738 of the function or translation unit, as the case may be, exceeds a
13739 predefined limit set by the branch type being used.  The limits for
13740 normal calls are 7,600,000 and 240,000 bytes, respectively for the
13741 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
13742 240,000 bytes.
13744 Distances are measured from the beginning of functions when using the
13745 @option{-ffunction-sections} option, or when using the @option{-mgas}
13746 and @option{-mno-portable-runtime} options together under HP-UX with
13747 the SOM linker.
13749 It is normally not desirable to use this option as it degrades
13750 performance.  However, it may be useful in large applications,
13751 particularly when partial linking is used to build the application.
13753 The types of long calls used depends on the capabilities of the
13754 assembler and linker, and the type of code being generated.  The
13755 impact on systems that support long absolute calls, and long pic
13756 symbol-difference or pc-relative calls should be relatively small.
13757 However, an indirect call is used on 32-bit ELF systems in pic code
13758 and it is quite long.
13760 @item -munix=@var{unix-std}
13761 @opindex march
13762 Generate compiler predefines and select a startfile for the specified
13763 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
13764 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
13765 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
13766 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
13767 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
13768 and later.
13770 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
13771 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
13772 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
13773 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
13774 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
13775 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
13777 It is @emph{important} to note that this option changes the interfaces
13778 for various library routines.  It also affects the operational behavior
13779 of the C library.  Thus, @emph{extreme} care is needed in using this
13780 option.
13782 Library code that is intended to operate with more than one UNIX
13783 standard must test, set and restore the variable @var{__xpg4_extended_mask}
13784 as appropriate.  Most GNU software doesn't provide this capability.
13786 @item -nolibdld
13787 @opindex nolibdld
13788 Suppress the generation of link options to search libdld.sl when the
13789 @option{-static} option is specified on HP-UX 10 and later.
13791 @item -static
13792 @opindex static
13793 The HP-UX implementation of setlocale in libc has a dependency on
13794 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
13795 when the @option{-static} option is specified, special link options
13796 are needed to resolve this dependency.
13798 On HP-UX 10 and later, the GCC driver adds the necessary options to
13799 link with libdld.sl when the @option{-static} option is specified.
13800 This causes the resulting binary to be dynamic.  On the 64-bit port,
13801 the linkers generate dynamic binaries by default in any case.  The
13802 @option{-nolibdld} option can be used to prevent the GCC driver from
13803 adding these link options.
13805 @item -threads
13806 @opindex threads
13807 Add support for multithreading with the @dfn{dce thread} library
13808 under HP-UX@.  This option sets flags for both the preprocessor and
13809 linker.
13810 @end table
13812 @node i386 and x86-64 Options
13813 @subsection Intel 386 and AMD x86-64 Options
13814 @cindex i386 Options
13815 @cindex x86-64 Options
13816 @cindex Intel 386 Options
13817 @cindex AMD x86-64 Options
13819 These @samp{-m} options are defined for the i386 and x86-64 family of
13820 computers:
13822 @table @gcctabopt
13824 @item -march=@var{cpu-type}
13825 @opindex march
13826 Generate instructions for the machine type @var{cpu-type}.  In contrast to
13827 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
13828 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
13829 to generate code that may not run at all on processors other than the one
13830 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
13831 @option{-mtune=@var{cpu-type}}.
13833 The choices for @var{cpu-type} are:
13835 @table @samp
13836 @item native
13837 This selects the CPU to generate code for at compilation time by determining
13838 the processor type of the compiling machine.  Using @option{-march=native}
13839 enables all instruction subsets supported by the local machine (hence
13840 the result might not run on different machines).  Using @option{-mtune=native}
13841 produces code optimized for the local machine under the constraints
13842 of the selected instruction set.  
13844 @item i386
13845 Original Intel i386 CPU@.
13847 @item i486
13848 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
13850 @item i586
13851 @itemx pentium
13852 Intel Pentium CPU with no MMX support.
13854 @item pentium-mmx
13855 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
13857 @item pentiumpro
13858 Intel Pentium Pro CPU@.
13860 @item i686
13861 When used with @option{-march}, the Pentium Pro
13862 instruction set is used, so the code runs on all i686 family chips.
13863 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
13865 @item pentium2
13866 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
13867 support.
13869 @item pentium3
13870 @itemx pentium3m
13871 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
13872 set support.
13874 @item pentium-m
13875 Intel Pentium M; low-power version of Intel Pentium III CPU
13876 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
13878 @item pentium4
13879 @itemx pentium4m
13880 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
13882 @item prescott
13883 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
13884 set support.
13886 @item nocona
13887 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
13888 SSE2 and SSE3 instruction set support.
13890 @item core2
13891 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13892 instruction set support.
13894 @item corei7
13895 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
13896 and SSE4.2 instruction set support.
13898 @item corei7-avx
13899 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13900 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
13902 @item core-avx-i
13903 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13904 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
13905 set support.
13907 @item core-avx2
13908 Intel Core CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
13909 SSE4.1, SSE4.2, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2
13910 and F16C instruction set support.
13912 @item atom
13913 Intel Atom CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
13914 instruction set support.
13916 @item slm
13917 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
13918 SSE4.1 and SSE4.2 instruction set support.
13920 @item k6
13921 AMD K6 CPU with MMX instruction set support.
13923 @item k6-2
13924 @itemx k6-3
13925 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
13927 @item athlon
13928 @itemx athlon-tbird
13929 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
13930 support.
13932 @item athlon-4
13933 @itemx athlon-xp
13934 @itemx athlon-mp
13935 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
13936 instruction set support.
13938 @item k8
13939 @itemx opteron
13940 @itemx athlon64
13941 @itemx athlon-fx
13942 Processors based on the AMD K8 core with x86-64 instruction set support,
13943 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
13944 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
13945 instruction set extensions.)
13947 @item k8-sse3
13948 @itemx opteron-sse3
13949 @itemx athlon64-sse3
13950 Improved versions of AMD K8 cores with SSE3 instruction set support.
13952 @item amdfam10
13953 @itemx barcelona
13954 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
13955 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
13956 instruction set extensions.)
13958 @item bdver1
13959 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
13960 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
13961 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
13962 @item bdver2
13963 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
13964 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
13965 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
13966 extensions.)
13967 @item bdver3
13968 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
13969 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
13970 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
13971 extensions.
13973 @item btver1
13974 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
13975 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
13976 instruction set extensions.)
13978 @item btver2
13979 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
13980 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
13981 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
13983 @item winchip-c6
13984 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
13985 set support.
13987 @item winchip2
13988 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
13989 instruction set support.
13991 @item c3
13992 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
13993 implemented for this chip.)
13995 @item c3-2
13996 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
13997 (No scheduling is
13998 implemented for this chip.)
14000 @item geode
14001 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
14002 @end table
14004 @item -mtune=@var{cpu-type}
14005 @opindex mtune
14006 Tune to @var{cpu-type} everything applicable about the generated code, except
14007 for the ABI and the set of available instructions.  
14008 While picking a specific @var{cpu-type} schedules things appropriately
14009 for that particular chip, the compiler does not generate any code that
14010 cannot run on the default machine type unless you use a
14011 @option{-march=@var{cpu-type}} option.
14012 For example, if GCC is configured for i686-pc-linux-gnu
14013 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
14014 but still runs on i686 machines.
14016 The choices for @var{cpu-type} are the same as for @option{-march}.
14017 In addition, @option{-mtune} supports an extra choice for @var{cpu-type}:
14019 @table @samp
14020 @item generic
14021 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
14022 If you know the CPU on which your code will run, then you should use
14023 the corresponding @option{-mtune} or @option{-march} option instead of
14024 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
14025 of your application will have, then you should use this option.
14027 As new processors are deployed in the marketplace, the behavior of this
14028 option will change.  Therefore, if you upgrade to a newer version of
14029 GCC, code generation controlled by this option will change to reflect
14030 the processors
14031 that are most common at the time that version of GCC is released.
14033 There is no @option{-march=generic} option because @option{-march}
14034 indicates the instruction set the compiler can use, and there is no
14035 generic instruction set applicable to all processors.  In contrast,
14036 @option{-mtune} indicates the processor (or, in this case, collection of
14037 processors) for which the code is optimized.
14038 @end table
14040 @item -mcpu=@var{cpu-type}
14041 @opindex mcpu
14042 A deprecated synonym for @option{-mtune}.
14044 @item -mfpmath=@var{unit}
14045 @opindex mfpmath
14046 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
14047 for @var{unit} are:
14049 @table @samp
14050 @item 387
14051 Use the standard 387 floating-point coprocessor present on the majority of chips and
14052 emulated otherwise.  Code compiled with this option runs almost everywhere.
14053 The temporary results are computed in 80-bit precision instead of the precision
14054 specified by the type, resulting in slightly different results compared to most
14055 of other chips.  See @option{-ffloat-store} for more detailed description.
14057 This is the default choice for i386 compiler.
14059 @item sse
14060 Use scalar floating-point instructions present in the SSE instruction set.
14061 This instruction set is supported by Pentium III and newer chips,
14062 and in the AMD line
14063 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
14064 instruction set supports only single-precision arithmetic, thus the double and
14065 extended-precision arithmetic are still done using 387.  A later version, present
14066 only in Pentium 4 and AMD x86-64 chips, supports double-precision
14067 arithmetic too.
14069 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
14070 or @option{-msse2} switches to enable SSE extensions and make this option
14071 effective.  For the x86-64 compiler, these extensions are enabled by default.
14073 The resulting code should be considerably faster in the majority of cases and avoid
14074 the numerical instability problems of 387 code, but may break some existing
14075 code that expects temporaries to be 80 bits.
14077 This is the default choice for the x86-64 compiler.
14079 @item sse,387
14080 @itemx sse+387
14081 @itemx both
14082 Attempt to utilize both instruction sets at once.  This effectively doubles the
14083 amount of available registers, and on chips with separate execution units for
14084 387 and SSE the execution resources too.  Use this option with care, as it is
14085 still experimental, because the GCC register allocator does not model separate
14086 functional units well, resulting in unstable performance.
14087 @end table
14089 @item -masm=@var{dialect}
14090 @opindex masm=@var{dialect}
14091 Output assembly instructions using selected @var{dialect}.  Supported
14092 choices are @samp{intel} or @samp{att} (the default).  Darwin does
14093 not support @samp{intel}.
14095 @item -mieee-fp
14096 @itemx -mno-ieee-fp
14097 @opindex mieee-fp
14098 @opindex mno-ieee-fp
14099 Control whether or not the compiler uses IEEE floating-point
14100 comparisons.  These correctly handle the case where the result of a
14101 comparison is unordered.
14103 @item -msoft-float
14104 @opindex msoft-float
14105 Generate output containing library calls for floating point.
14107 @strong{Warning:} the requisite libraries are not part of GCC@.
14108 Normally the facilities of the machine's usual C compiler are used, but
14109 this can't be done directly in cross-compilation.  You must make your
14110 own arrangements to provide suitable library functions for
14111 cross-compilation.
14113 On machines where a function returns floating-point results in the 80387
14114 register stack, some floating-point opcodes may be emitted even if
14115 @option{-msoft-float} is used.
14117 @item -mno-fp-ret-in-387
14118 @opindex mno-fp-ret-in-387
14119 Do not use the FPU registers for return values of functions.
14121 The usual calling convention has functions return values of types
14122 @code{float} and @code{double} in an FPU register, even if there
14123 is no FPU@.  The idea is that the operating system should emulate
14124 an FPU@.
14126 The option @option{-mno-fp-ret-in-387} causes such values to be returned
14127 in ordinary CPU registers instead.
14129 @item -mno-fancy-math-387
14130 @opindex mno-fancy-math-387
14131 Some 387 emulators do not support the @code{sin}, @code{cos} and
14132 @code{sqrt} instructions for the 387.  Specify this option to avoid
14133 generating those instructions.  This option is the default on FreeBSD,
14134 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
14135 indicates that the target CPU always has an FPU and so the
14136 instruction does not need emulation.  These
14137 instructions are not generated unless you also use the
14138 @option{-funsafe-math-optimizations} switch.
14140 @item -malign-double
14141 @itemx -mno-align-double
14142 @opindex malign-double
14143 @opindex mno-align-double
14144 Control whether GCC aligns @code{double}, @code{long double}, and
14145 @code{long long} variables on a two-word boundary or a one-word
14146 boundary.  Aligning @code{double} variables on a two-word boundary
14147 produces code that runs somewhat faster on a Pentium at the
14148 expense of more memory.
14150 On x86-64, @option{-malign-double} is enabled by default.
14152 @strong{Warning:} if you use the @option{-malign-double} switch,
14153 structures containing the above types are aligned differently than
14154 the published application binary interface specifications for the 386
14155 and are not binary compatible with structures in code compiled
14156 without that switch.
14158 @item -m96bit-long-double
14159 @itemx -m128bit-long-double
14160 @opindex m96bit-long-double
14161 @opindex m128bit-long-double
14162 These switches control the size of @code{long double} type.  The i386
14163 application binary interface specifies the size to be 96 bits,
14164 so @option{-m96bit-long-double} is the default in 32-bit mode.
14166 Modern architectures (Pentium and newer) prefer @code{long double}
14167 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
14168 conforming to the ABI, this is not possible.  So specifying
14169 @option{-m128bit-long-double} aligns @code{long double}
14170 to a 16-byte boundary by padding the @code{long double} with an additional
14171 32-bit zero.
14173 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
14174 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
14176 Notice that neither of these options enable any extra precision over the x87
14177 standard of 80 bits for a @code{long double}.
14179 @strong{Warning:} if you override the default value for your target ABI, this
14180 changes the size of 
14181 structures and arrays containing @code{long double} variables,
14182 as well as modifying the function calling convention for functions taking
14183 @code{long double}.  Hence they are not binary-compatible
14184 with code compiled without that switch.
14186 @item -mlong-double-64
14187 @itemx -mlong-double-80
14188 @opindex mlong-double-64
14189 @opindex mlong-double-80
14190 These switches control the size of @code{long double} type. A size
14191 of 64 bits makes the @code{long double} type equivalent to the @code{double}
14192 type. This is the default for Bionic C library.
14194 @strong{Warning:} if you override the default value for your target ABI, this
14195 changes the size of
14196 structures and arrays containing @code{long double} variables,
14197 as well as modifying the function calling convention for functions taking
14198 @code{long double}.  Hence they are not binary-compatible
14199 with code compiled without that switch.
14201 @item -mlarge-data-threshold=@var{threshold}
14202 @opindex mlarge-data-threshold
14203 When @option{-mcmodel=medium} is specified, data objects larger than
14204 @var{threshold} are placed in the large data section.  This value must be the
14205 same across all objects linked into the binary, and defaults to 65535.
14207 @item -mrtd
14208 @opindex mrtd
14209 Use a different function-calling convention, in which functions that
14210 take a fixed number of arguments return with the @code{ret @var{num}}
14211 instruction, which pops their arguments while returning.  This saves one
14212 instruction in the caller since there is no need to pop the arguments
14213 there.
14215 You can specify that an individual function is called with this calling
14216 sequence with the function attribute @samp{stdcall}.  You can also
14217 override the @option{-mrtd} option by using the function attribute
14218 @samp{cdecl}.  @xref{Function Attributes}.
14220 @strong{Warning:} this calling convention is incompatible with the one
14221 normally used on Unix, so you cannot use it if you need to call
14222 libraries compiled with the Unix compiler.
14224 Also, you must provide function prototypes for all functions that
14225 take variable numbers of arguments (including @code{printf});
14226 otherwise incorrect code is generated for calls to those
14227 functions.
14229 In addition, seriously incorrect code results if you call a
14230 function with too many arguments.  (Normally, extra arguments are
14231 harmlessly ignored.)
14233 @item -mregparm=@var{num}
14234 @opindex mregparm
14235 Control how many registers are used to pass integer arguments.  By
14236 default, no registers are used to pass arguments, and at most 3
14237 registers can be used.  You can control this behavior for a specific
14238 function by using the function attribute @samp{regparm}.
14239 @xref{Function Attributes}.
14241 @strong{Warning:} if you use this switch, and
14242 @var{num} is nonzero, then you must build all modules with the same
14243 value, including any libraries.  This includes the system libraries and
14244 startup modules.
14246 @item -msseregparm
14247 @opindex msseregparm
14248 Use SSE register passing conventions for float and double arguments
14249 and return values.  You can control this behavior for a specific
14250 function by using the function attribute @samp{sseregparm}.
14251 @xref{Function Attributes}.
14253 @strong{Warning:} if you use this switch then you must build all
14254 modules with the same value, including any libraries.  This includes
14255 the system libraries and startup modules.
14257 @item -mvect8-ret-in-mem
14258 @opindex mvect8-ret-in-mem
14259 Return 8-byte vectors in memory instead of MMX registers.  This is the
14260 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
14261 Studio compilers until version 12.  Later compiler versions (starting
14262 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
14263 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
14264 you need to remain compatible with existing code produced by those
14265 previous compiler versions or older versions of GCC@.
14267 @item -mpc32
14268 @itemx -mpc64
14269 @itemx -mpc80
14270 @opindex mpc32
14271 @opindex mpc64
14272 @opindex mpc80
14274 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
14275 is specified, the significands of results of floating-point operations are
14276 rounded to 24 bits (single precision); @option{-mpc64} rounds the
14277 significands of results of floating-point operations to 53 bits (double
14278 precision) and @option{-mpc80} rounds the significands of results of
14279 floating-point operations to 64 bits (extended double precision), which is
14280 the default.  When this option is used, floating-point operations in higher
14281 precisions are not available to the programmer without setting the FPU
14282 control word explicitly.
14284 Setting the rounding of floating-point operations to less than the default
14285 80 bits can speed some programs by 2% or more.  Note that some mathematical
14286 libraries assume that extended-precision (80-bit) floating-point operations
14287 are enabled by default; routines in such libraries could suffer significant
14288 loss of accuracy, typically through so-called ``catastrophic cancellation'',
14289 when this option is used to set the precision to less than extended precision.
14291 @item -mstackrealign
14292 @opindex mstackrealign
14293 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
14294 option generates an alternate prologue and epilogue that realigns the
14295 run-time stack if necessary.  This supports mixing legacy codes that keep
14296 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
14297 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
14298 applicable to individual functions.
14300 @item -mpreferred-stack-boundary=@var{num}
14301 @opindex mpreferred-stack-boundary
14302 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
14303 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
14304 the default is 4 (16 bytes or 128 bits).
14306 @strong{Warning:} When generating code for the x86-64 architecture with
14307 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
14308 used to keep the stack boundary aligned to 8 byte boundary.  Since
14309 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
14310 intended to be used in controlled environment where stack space is
14311 important limitation.  This option will lead to wrong code when functions
14312 compiled with 16 byte stack alignment (such as functions from a standard
14313 library) are called with misaligned stack.  In this case, SSE
14314 instructions may lead to misaligned memory access traps.  In addition,
14315 variable arguments will be handled incorrectly for 16 byte aligned
14316 objects (including x87 long double and __int128), leading to wrong
14317 results.  You must build all modules with
14318 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
14319 includes the system libraries and startup modules.
14321 @item -mincoming-stack-boundary=@var{num}
14322 @opindex mincoming-stack-boundary
14323 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
14324 boundary.  If @option{-mincoming-stack-boundary} is not specified,
14325 the one specified by @option{-mpreferred-stack-boundary} is used.
14327 On Pentium and Pentium Pro, @code{double} and @code{long double} values
14328 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
14329 suffer significant run time performance penalties.  On Pentium III, the
14330 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
14331 properly if it is not 16-byte aligned.
14333 To ensure proper alignment of this values on the stack, the stack boundary
14334 must be as aligned as that required by any value stored on the stack.
14335 Further, every function must be generated such that it keeps the stack
14336 aligned.  Thus calling a function compiled with a higher preferred
14337 stack boundary from a function compiled with a lower preferred stack
14338 boundary most likely misaligns the stack.  It is recommended that
14339 libraries that use callbacks always use the default setting.
14341 This extra alignment does consume extra stack space, and generally
14342 increases code size.  Code that is sensitive to stack space usage, such
14343 as embedded systems and operating system kernels, may want to reduce the
14344 preferred alignment to @option{-mpreferred-stack-boundary=2}.
14346 @item -mmmx
14347 @itemx -mno-mmx
14348 @itemx -msse
14349 @itemx -mno-sse
14350 @itemx -msse2
14351 @itemx -mno-sse2
14352 @itemx -msse3
14353 @itemx -mno-sse3
14354 @itemx -mssse3
14355 @itemx -mno-ssse3
14356 @itemx -msse4.1
14357 @need 800
14358 @itemx -mno-sse4.1
14359 @itemx -msse4.2
14360 @itemx -mno-sse4.2
14361 @itemx -msse4
14362 @itemx -mno-sse4
14363 @itemx -mavx
14364 @itemx -mno-avx
14365 @itemx -mavx2
14366 @itemx -mno-avx2
14367 @itemx -maes
14368 @itemx -mno-aes
14369 @itemx -mpclmul
14370 @need 800
14371 @itemx -mno-pclmul
14372 @itemx -mfsgsbase
14373 @itemx -mno-fsgsbase
14374 @itemx -mrdrnd
14375 @itemx -mno-rdrnd
14376 @itemx -mf16c
14377 @itemx -mno-f16c
14378 @itemx -mfma
14379 @itemx -mno-fma
14380 @itemx -msse4a
14381 @itemx -mno-sse4a
14382 @itemx -mfma4
14383 @need 800
14384 @itemx -mno-fma4
14385 @itemx -mxop
14386 @itemx -mno-xop
14387 @itemx -mlwp
14388 @itemx -mno-lwp
14389 @itemx -m3dnow
14390 @itemx -mno-3dnow
14391 @itemx -mpopcnt
14392 @itemx -mno-popcnt
14393 @itemx -mabm
14394 @itemx -mno-abm
14395 @itemx -mbmi
14396 @itemx -mbmi2
14397 @itemx -mno-bmi
14398 @itemx -mno-bmi2
14399 @itemx -mlzcnt
14400 @itemx -mno-lzcnt
14401 @itemx -mrtm
14402 @itemx -mtbm
14403 @itemx -mno-tbm
14404 @opindex mmmx
14405 @opindex mno-mmx
14406 @opindex msse
14407 @opindex mno-sse
14408 @opindex m3dnow
14409 @opindex mno-3dnow
14410 These switches enable or disable the use of instructions in the MMX, SSE,
14411 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, F16C,
14412 FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2, LZCNT, RTM or 3DNow!@:
14413 extended instruction sets.
14414 These extensions are also available as built-in functions: see
14415 @ref{X86 Built-in Functions}, for details of the functions enabled and
14416 disabled by these switches.
14418 To generate SSE/SSE2 instructions automatically from floating-point
14419 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
14421 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
14422 generates new AVX instructions or AVX equivalence for all SSEx instructions
14423 when needed.
14425 These options enable GCC to use these extended instructions in
14426 generated code, even without @option{-mfpmath=sse}.  Applications that
14427 perform run-time CPU detection must compile separate files for each
14428 supported architecture, using the appropriate flags.  In particular,
14429 the file containing the CPU detection code should be compiled without
14430 these options.
14432 @item -mcld
14433 @opindex mcld
14434 This option instructs GCC to emit a @code{cld} instruction in the prologue
14435 of functions that use string instructions.  String instructions depend on
14436 the DF flag to select between autoincrement or autodecrement mode.  While the
14437 ABI specifies the DF flag to be cleared on function entry, some operating
14438 systems violate this specification by not clearing the DF flag in their
14439 exception dispatchers.  The exception handler can be invoked with the DF flag
14440 set, which leads to wrong direction mode when string instructions are used.
14441 This option can be enabled by default on 32-bit x86 targets by configuring
14442 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
14443 instructions can be suppressed with the @option{-mno-cld} compiler option
14444 in this case.
14446 @item -mvzeroupper
14447 @opindex mvzeroupper
14448 This option instructs GCC to emit a @code{vzeroupper} instruction
14449 before a transfer of control flow out of the function to minimize
14450 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
14451 intrinsics.
14453 @item -mprefer-avx128
14454 @opindex mprefer-avx128
14455 This option instructs GCC to use 128-bit AVX instructions instead of
14456 256-bit AVX instructions in the auto-vectorizer.
14458 @item -mcx16
14459 @opindex mcx16
14460 This option enables GCC to generate @code{CMPXCHG16B} instructions.
14461 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
14462 (or oword) data types.  
14463 This is useful for high-resolution counters that can be updated
14464 by multiple processors (or cores).  This instruction is generated as part of
14465 atomic built-in functions: see @ref{__sync Builtins} or
14466 @ref{__atomic Builtins} for details.
14468 @item -msahf
14469 @opindex msahf
14470 This option enables generation of @code{SAHF} instructions in 64-bit code.
14471 Early Intel Pentium 4 CPUs with Intel 64 support,
14472 prior to the introduction of Pentium 4 G1 step in December 2005,
14473 lacked the @code{LAHF} and @code{SAHF} instructions
14474 which were supported by AMD64.
14475 These are load and store instructions, respectively, for certain status flags.
14476 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
14477 @code{drem}, and @code{remainder} built-in functions;
14478 see @ref{Other Builtins} for details.
14480 @item -mmovbe
14481 @opindex mmovbe
14482 This option enables use of the @code{movbe} instruction to implement
14483 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
14485 @item -mcrc32
14486 @opindex mcrc32
14487 This option enables built-in functions @code{__builtin_ia32_crc32qi},
14488 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
14489 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
14491 @item -mrecip
14492 @opindex mrecip
14493 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
14494 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
14495 with an additional Newton-Raphson step
14496 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
14497 (and their vectorized
14498 variants) for single-precision floating-point arguments.  These instructions
14499 are generated only when @option{-funsafe-math-optimizations} is enabled
14500 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
14501 Note that while the throughput of the sequence is higher than the throughput
14502 of the non-reciprocal instruction, the precision of the sequence can be
14503 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
14505 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
14506 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
14507 combination), and doesn't need @option{-mrecip}.
14509 Also note that GCC emits the above sequence with additional Newton-Raphson step
14510 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
14511 already with @option{-ffast-math} (or the above option combination), and
14512 doesn't need @option{-mrecip}.
14514 @item -mrecip=@var{opt}
14515 @opindex mrecip=opt
14516 This option controls which reciprocal estimate instructions
14517 may be used.  @var{opt} is a comma-separated list of options, which may
14518 be preceded by a @samp{!} to invert the option:
14520 @table @samp
14521 @item all
14522 Enable all estimate instructions.
14524 @item default
14525 Enable the default instructions, equivalent to @option{-mrecip}.
14527 @item none
14528 Disable all estimate instructions, equivalent to @option{-mno-recip}.
14530 @item div
14531 Enable the approximation for scalar division.
14533 @item vec-div
14534 Enable the approximation for vectorized division.
14536 @item sqrt
14537 Enable the approximation for scalar square root.
14539 @item vec-sqrt
14540 Enable the approximation for vectorized square root.
14541 @end table
14543 So, for example, @option{-mrecip=all,!sqrt} enables
14544 all of the reciprocal approximations, except for square root.
14546 @item -mveclibabi=@var{type}
14547 @opindex mveclibabi
14548 Specifies the ABI type to use for vectorizing intrinsics using an
14549 external library.  Supported values for @var{type} are @samp{svml} 
14550 for the Intel short
14551 vector math library and @samp{acml} for the AMD math core library.
14552 To use this option, both @option{-ftree-vectorize} and
14553 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
14554 ABI-compatible library must be specified at link time.
14556 GCC currently emits calls to @code{vmldExp2},
14557 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
14558 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
14559 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
14560 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
14561 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
14562 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
14563 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
14564 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
14565 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
14566 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
14567 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
14568 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
14569 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
14570 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
14571 when @option{-mveclibabi=acml} is used.  
14573 @item -mabi=@var{name}
14574 @opindex mabi
14575 Generate code for the specified calling convention.  Permissible values
14576 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
14577 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
14578 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
14579 You can control this behavior for a specific function by
14580 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
14581 @xref{Function Attributes}.
14583 @item -mtls-dialect=@var{type}
14584 @opindex mtls-dialect
14585 Generate code to access thread-local storage using the @samp{gnu} or
14586 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
14587 @samp{gnu2} is more efficient, but it may add compile- and run-time
14588 requirements that cannot be satisfied on all systems.
14590 @item -mpush-args
14591 @itemx -mno-push-args
14592 @opindex mpush-args
14593 @opindex mno-push-args
14594 Use PUSH operations to store outgoing parameters.  This method is shorter
14595 and usually equally fast as method using SUB/MOV operations and is enabled
14596 by default.  In some cases disabling it may improve performance because of
14597 improved scheduling and reduced dependencies.
14599 @item -maccumulate-outgoing-args
14600 @opindex maccumulate-outgoing-args
14601 If enabled, the maximum amount of space required for outgoing arguments is
14602 computed in the function prologue.  This is faster on most modern CPUs
14603 because of reduced dependencies, improved scheduling and reduced stack usage
14604 when the preferred stack boundary is not equal to 2.  The drawback is a notable
14605 increase in code size.  This switch implies @option{-mno-push-args}.
14607 @item -mthreads
14608 @opindex mthreads
14609 Support thread-safe exception handling on MinGW.  Programs that rely
14610 on thread-safe exception handling must compile and link all code with the
14611 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
14612 @code{-D_MT}; when linking, it links in a special thread helper library
14613 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
14615 @item -mno-align-stringops
14616 @opindex mno-align-stringops
14617 Do not align the destination of inlined string operations.  This switch reduces
14618 code size and improves performance in case the destination is already aligned,
14619 but GCC doesn't know about it.
14621 @item -minline-all-stringops
14622 @opindex minline-all-stringops
14623 By default GCC inlines string operations only when the destination is 
14624 known to be aligned to least a 4-byte boundary.  
14625 This enables more inlining and increases code
14626 size, but may improve performance of code that depends on fast
14627 @code{memcpy}, @code{strlen},
14628 and @code{memset} for short lengths.
14630 @item -minline-stringops-dynamically
14631 @opindex minline-stringops-dynamically
14632 For string operations of unknown size, use run-time checks with
14633 inline code for small blocks and a library call for large blocks.
14635 @item -mstringop-strategy=@var{alg}
14636 @opindex mstringop-strategy=@var{alg}
14637 Override the internal decision heuristic for the particular algorithm to use
14638 for inlining string operations.  The allowed values for @var{alg} are:
14640 @table @samp
14641 @item rep_byte
14642 @itemx rep_4byte
14643 @itemx rep_8byte
14644 Expand using i386 @code{rep} prefix of the specified size.
14646 @item byte_loop
14647 @itemx loop
14648 @itemx unrolled_loop
14649 Expand into an inline loop.
14651 @item libcall
14652 Always use a library call.
14653 @end table
14655 @item -mmemcpy-strategy=@var{strategy}
14656 @opindex mmemcpy-strategy=@var{strategy}
14657 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
14658 should be inlined and what inline algorithm to use when the expected size
14659 of the copy operation is known. @var{strategy} 
14660 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
14661 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
14662 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
14663 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
14664 in the list must be specified in increasing order.  The minimal byte size for 
14665 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
14666 preceding range.
14668 @item -mmemset-strategy=@var{strategy}
14669 @opindex mmemset-strategy=@var{strategy}
14670 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
14671 @code{__builtin_memset} expansion.
14673 @item -momit-leaf-frame-pointer
14674 @opindex momit-leaf-frame-pointer
14675 Don't keep the frame pointer in a register for leaf functions.  This
14676 avoids the instructions to save, set up, and restore frame pointers and
14677 makes an extra register available in leaf functions.  The option
14678 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
14679 which might make debugging harder.
14681 @item -mtls-direct-seg-refs
14682 @itemx -mno-tls-direct-seg-refs
14683 @opindex mtls-direct-seg-refs
14684 Controls whether TLS variables may be accessed with offsets from the
14685 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
14686 or whether the thread base pointer must be added.  Whether or not this
14687 is valid depends on the operating system, and whether it maps the
14688 segment to cover the entire TLS area.
14690 For systems that use the GNU C Library, the default is on.
14692 @item -msse2avx
14693 @itemx -mno-sse2avx
14694 @opindex msse2avx
14695 Specify that the assembler should encode SSE instructions with VEX
14696 prefix.  The option @option{-mavx} turns this on by default.
14698 @item -mfentry
14699 @itemx -mno-fentry
14700 @opindex mfentry
14701 If profiling is active (@option{-pg}), put the profiling
14702 counter call before the prologue.
14703 Note: On x86 architectures the attribute @code{ms_hook_prologue}
14704 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
14706 @item -m8bit-idiv
14707 @itemx -mno-8bit-idiv
14708 @opindex 8bit-idiv
14709 On some processors, like Intel Atom, 8-bit unsigned integer divide is
14710 much faster than 32-bit/64-bit integer divide.  This option generates a
14711 run-time check.  If both dividend and divisor are within range of 0
14712 to 255, 8-bit unsigned integer divide is used instead of
14713 32-bit/64-bit integer divide.
14715 @item -mavx256-split-unaligned-load
14716 @itemx -mavx256-split-unaligned-store
14717 @opindex avx256-split-unaligned-load
14718 @opindex avx256-split-unaligned-store
14719 Split 32-byte AVX unaligned load and store.
14721 @item -mstack-protector-guard=@var{guard}
14722 @opindex mstack-protector-guard=@var{guard}
14723 Generate stack protection code using canary at @var{guard}.  Supported
14724 locations are @samp{global} for global canary or @samp{tls} for per-thread
14725 canary in the TLS block (the default).  This option has effect only when
14726 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
14728 @end table
14730 These @samp{-m} switches are supported in addition to the above
14731 on x86-64 processors in 64-bit environments.
14733 @table @gcctabopt
14734 @item -m32
14735 @itemx -m64
14736 @itemx -mx32
14737 @opindex m32
14738 @opindex m64
14739 @opindex mx32
14740 Generate code for a 32-bit or 64-bit environment.
14741 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
14742 to 32 bits, and
14743 generates code that runs on any i386 system.
14745 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
14746 types to 64 bits, and generates code for the x86-64 architecture.
14747 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
14748 and @option{-mdynamic-no-pic} options.
14750 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
14751 to 32 bits, and
14752 generates code for the x86-64 architecture.
14754 @item -mno-red-zone
14755 @opindex mno-red-zone
14756 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
14757 by the x86-64 ABI; it is a 128-byte area beyond the location of the
14758 stack pointer that is not modified by signal or interrupt handlers
14759 and therefore can be used for temporary data without adjusting the stack
14760 pointer.  The flag @option{-mno-red-zone} disables this red zone.
14762 @item -mcmodel=small
14763 @opindex mcmodel=small
14764 Generate code for the small code model: the program and its symbols must
14765 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
14766 Programs can be statically or dynamically linked.  This is the default
14767 code model.
14769 @item -mcmodel=kernel
14770 @opindex mcmodel=kernel
14771 Generate code for the kernel code model.  The kernel runs in the
14772 negative 2 GB of the address space.
14773 This model has to be used for Linux kernel code.
14775 @item -mcmodel=medium
14776 @opindex mcmodel=medium
14777 Generate code for the medium model: the program is linked in the lower 2
14778 GB of the address space.  Small symbols are also placed there.  Symbols
14779 with sizes larger than @option{-mlarge-data-threshold} are put into
14780 large data or BSS sections and can be located above 2GB.  Programs can
14781 be statically or dynamically linked.
14783 @item -mcmodel=large
14784 @opindex mcmodel=large
14785 Generate code for the large model.  This model makes no assumptions
14786 about addresses and sizes of sections.
14788 @item -maddress-mode=long
14789 @opindex maddress-mode=long
14790 Generate code for long address mode.  This is only supported for 64-bit
14791 and x32 environments.  It is the default address mode for 64-bit
14792 environments.
14794 @item -maddress-mode=short
14795 @opindex maddress-mode=short
14796 Generate code for short address mode.  This is only supported for 32-bit
14797 and x32 environments.  It is the default address mode for 32-bit and
14798 x32 environments.
14799 @end table
14801 @node i386 and x86-64 Windows Options
14802 @subsection i386 and x86-64 Windows Options
14803 @cindex i386 and x86-64 Windows Options
14805 These additional options are available for Microsoft Windows targets:
14807 @table @gcctabopt
14808 @item -mconsole
14809 @opindex mconsole
14810 This option
14811 specifies that a console application is to be generated, by
14812 instructing the linker to set the PE header subsystem type
14813 required for console applications.
14814 This option is available for Cygwin and MinGW targets and is
14815 enabled by default on those targets.
14817 @item -mdll
14818 @opindex mdll
14819 This option is available for Cygwin and MinGW targets.  It
14820 specifies that a DLL---a dynamic link library---is to be
14821 generated, enabling the selection of the required runtime
14822 startup object and entry point.
14824 @item -mnop-fun-dllimport
14825 @opindex mnop-fun-dllimport
14826 This option is available for Cygwin and MinGW targets.  It
14827 specifies that the @code{dllimport} attribute should be ignored.
14829 @item -mthread
14830 @opindex mthread
14831 This option is available for MinGW targets. It specifies
14832 that MinGW-specific thread support is to be used.
14834 @item -municode
14835 @opindex municode
14836 This option is available for MinGW-w64 targets.  It causes
14837 the @code{UNICODE} preprocessor macro to be predefined, and
14838 chooses Unicode-capable runtime startup code.
14840 @item -mwin32
14841 @opindex mwin32
14842 This option is available for Cygwin and MinGW targets.  It
14843 specifies that the typical Microsoft Windows predefined macros are to
14844 be set in the pre-processor, but does not influence the choice
14845 of runtime library/startup code.
14847 @item -mwindows
14848 @opindex mwindows
14849 This option is available for Cygwin and MinGW targets.  It
14850 specifies that a GUI application is to be generated by
14851 instructing the linker to set the PE header subsystem type
14852 appropriately.
14854 @item -fno-set-stack-executable
14855 @opindex fno-set-stack-executable
14856 This option is available for MinGW targets. It specifies that
14857 the executable flag for the stack used by nested functions isn't
14858 set. This is necessary for binaries running in kernel mode of
14859 Microsoft Windows, as there the User32 API, which is used to set executable
14860 privileges, isn't available.
14862 @item -fwritable-relocated-rdata
14863 @opindex fno-writable-relocated-rdata
14864 This option is available for MinGW and Cygwin targets.  It specifies
14865 that relocated-data in read-only section is put into .data
14866 section.  This is a necessary for older runtimes not supporting
14867 modification of .rdata sections for pseudo-relocation.
14869 @item -mpe-aligned-commons
14870 @opindex mpe-aligned-commons
14871 This option is available for Cygwin and MinGW targets.  It
14872 specifies that the GNU extension to the PE file format that
14873 permits the correct alignment of COMMON variables should be
14874 used when generating code.  It is enabled by default if
14875 GCC detects that the target assembler found during configuration
14876 supports the feature.
14877 @end table
14879 See also under @ref{i386 and x86-64 Options} for standard options.
14881 @node IA-64 Options
14882 @subsection IA-64 Options
14883 @cindex IA-64 Options
14885 These are the @samp{-m} options defined for the Intel IA-64 architecture.
14887 @table @gcctabopt
14888 @item -mbig-endian
14889 @opindex mbig-endian
14890 Generate code for a big-endian target.  This is the default for HP-UX@.
14892 @item -mlittle-endian
14893 @opindex mlittle-endian
14894 Generate code for a little-endian target.  This is the default for AIX5
14895 and GNU/Linux.
14897 @item -mgnu-as
14898 @itemx -mno-gnu-as
14899 @opindex mgnu-as
14900 @opindex mno-gnu-as
14901 Generate (or don't) code for the GNU assembler.  This is the default.
14902 @c Also, this is the default if the configure option @option{--with-gnu-as}
14903 @c is used.
14905 @item -mgnu-ld
14906 @itemx -mno-gnu-ld
14907 @opindex mgnu-ld
14908 @opindex mno-gnu-ld
14909 Generate (or don't) code for the GNU linker.  This is the default.
14910 @c Also, this is the default if the configure option @option{--with-gnu-ld}
14911 @c is used.
14913 @item -mno-pic
14914 @opindex mno-pic
14915 Generate code that does not use a global pointer register.  The result
14916 is not position independent code, and violates the IA-64 ABI@.
14918 @item -mvolatile-asm-stop
14919 @itemx -mno-volatile-asm-stop
14920 @opindex mvolatile-asm-stop
14921 @opindex mno-volatile-asm-stop
14922 Generate (or don't) a stop bit immediately before and after volatile asm
14923 statements.
14925 @item -mregister-names
14926 @itemx -mno-register-names
14927 @opindex mregister-names
14928 @opindex mno-register-names
14929 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
14930 the stacked registers.  This may make assembler output more readable.
14932 @item -mno-sdata
14933 @itemx -msdata
14934 @opindex mno-sdata
14935 @opindex msdata
14936 Disable (or enable) optimizations that use the small data section.  This may
14937 be useful for working around optimizer bugs.
14939 @item -mconstant-gp
14940 @opindex mconstant-gp
14941 Generate code that uses a single constant global pointer value.  This is
14942 useful when compiling kernel code.
14944 @item -mauto-pic
14945 @opindex mauto-pic
14946 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
14947 This is useful when compiling firmware code.
14949 @item -minline-float-divide-min-latency
14950 @opindex minline-float-divide-min-latency
14951 Generate code for inline divides of floating-point values
14952 using the minimum latency algorithm.
14954 @item -minline-float-divide-max-throughput
14955 @opindex minline-float-divide-max-throughput
14956 Generate code for inline divides of floating-point values
14957 using the maximum throughput algorithm.
14959 @item -mno-inline-float-divide
14960 @opindex mno-inline-float-divide
14961 Do not generate inline code for divides of floating-point values.
14963 @item -minline-int-divide-min-latency
14964 @opindex minline-int-divide-min-latency
14965 Generate code for inline divides of integer values
14966 using the minimum latency algorithm.
14968 @item -minline-int-divide-max-throughput
14969 @opindex minline-int-divide-max-throughput
14970 Generate code for inline divides of integer values
14971 using the maximum throughput algorithm.
14973 @item -mno-inline-int-divide
14974 @opindex mno-inline-int-divide
14975 Do not generate inline code for divides of integer values.
14977 @item -minline-sqrt-min-latency
14978 @opindex minline-sqrt-min-latency
14979 Generate code for inline square roots
14980 using the minimum latency algorithm.
14982 @item -minline-sqrt-max-throughput
14983 @opindex minline-sqrt-max-throughput
14984 Generate code for inline square roots
14985 using the maximum throughput algorithm.
14987 @item -mno-inline-sqrt
14988 @opindex mno-inline-sqrt
14989 Do not generate inline code for @code{sqrt}.
14991 @item -mfused-madd
14992 @itemx -mno-fused-madd
14993 @opindex mfused-madd
14994 @opindex mno-fused-madd
14995 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
14996 instructions.  The default is to use these instructions.
14998 @item -mno-dwarf2-asm
14999 @itemx -mdwarf2-asm
15000 @opindex mno-dwarf2-asm
15001 @opindex mdwarf2-asm
15002 Don't (or do) generate assembler code for the DWARF 2 line number debugging
15003 info.  This may be useful when not using the GNU assembler.
15005 @item -mearly-stop-bits
15006 @itemx -mno-early-stop-bits
15007 @opindex mearly-stop-bits
15008 @opindex mno-early-stop-bits
15009 Allow stop bits to be placed earlier than immediately preceding the
15010 instruction that triggered the stop bit.  This can improve instruction
15011 scheduling, but does not always do so.
15013 @item -mfixed-range=@var{register-range}
15014 @opindex mfixed-range
15015 Generate code treating the given register range as fixed registers.
15016 A fixed register is one that the register allocator cannot use.  This is
15017 useful when compiling kernel code.  A register range is specified as
15018 two registers separated by a dash.  Multiple register ranges can be
15019 specified separated by a comma.
15021 @item -mtls-size=@var{tls-size}
15022 @opindex mtls-size
15023 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
15026 @item -mtune=@var{cpu-type}
15027 @opindex mtune
15028 Tune the instruction scheduling for a particular CPU, Valid values are
15029 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
15030 and @samp{mckinley}.
15032 @item -milp32
15033 @itemx -mlp64
15034 @opindex milp32
15035 @opindex mlp64
15036 Generate code for a 32-bit or 64-bit environment.
15037 The 32-bit environment sets int, long and pointer to 32 bits.
15038 The 64-bit environment sets int to 32 bits and long and pointer
15039 to 64 bits.  These are HP-UX specific flags.
15041 @item -mno-sched-br-data-spec
15042 @itemx -msched-br-data-spec
15043 @opindex mno-sched-br-data-spec
15044 @opindex msched-br-data-spec
15045 (Dis/En)able data speculative scheduling before reload.
15046 This results in generation of @code{ld.a} instructions and
15047 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15048 The default is 'disable'.
15050 @item -msched-ar-data-spec
15051 @itemx -mno-sched-ar-data-spec
15052 @opindex msched-ar-data-spec
15053 @opindex mno-sched-ar-data-spec
15054 (En/Dis)able data speculative scheduling after reload.
15055 This results in generation of @code{ld.a} instructions and
15056 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
15057 The default is 'enable'.
15059 @item -mno-sched-control-spec
15060 @itemx -msched-control-spec
15061 @opindex mno-sched-control-spec
15062 @opindex msched-control-spec
15063 (Dis/En)able control speculative scheduling.  This feature is
15064 available only during region scheduling (i.e.@: before reload).
15065 This results in generation of the @code{ld.s} instructions and
15066 the corresponding check instructions @code{chk.s}.
15067 The default is 'disable'.
15069 @item -msched-br-in-data-spec
15070 @itemx -mno-sched-br-in-data-spec
15071 @opindex msched-br-in-data-spec
15072 @opindex mno-sched-br-in-data-spec
15073 (En/Dis)able speculative scheduling of the instructions that
15074 are dependent on the data speculative loads before reload.
15075 This is effective only with @option{-msched-br-data-spec} enabled.
15076 The default is 'enable'.
15078 @item -msched-ar-in-data-spec
15079 @itemx -mno-sched-ar-in-data-spec
15080 @opindex msched-ar-in-data-spec
15081 @opindex mno-sched-ar-in-data-spec
15082 (En/Dis)able speculative scheduling of the instructions that
15083 are dependent on the data speculative loads after reload.
15084 This is effective only with @option{-msched-ar-data-spec} enabled.
15085 The default is 'enable'.
15087 @item -msched-in-control-spec
15088 @itemx -mno-sched-in-control-spec
15089 @opindex msched-in-control-spec
15090 @opindex mno-sched-in-control-spec
15091 (En/Dis)able speculative scheduling of the instructions that
15092 are dependent on the control speculative loads.
15093 This is effective only with @option{-msched-control-spec} enabled.
15094 The default is 'enable'.
15096 @item -mno-sched-prefer-non-data-spec-insns
15097 @itemx -msched-prefer-non-data-spec-insns
15098 @opindex mno-sched-prefer-non-data-spec-insns
15099 @opindex msched-prefer-non-data-spec-insns
15100 If enabled, data-speculative instructions are chosen for schedule
15101 only if there are no other choices at the moment.  This makes
15102 the use of the data speculation much more conservative.
15103 The default is 'disable'.
15105 @item -mno-sched-prefer-non-control-spec-insns
15106 @itemx -msched-prefer-non-control-spec-insns
15107 @opindex mno-sched-prefer-non-control-spec-insns
15108 @opindex msched-prefer-non-control-spec-insns
15109 If enabled, control-speculative instructions are chosen for schedule
15110 only if there are no other choices at the moment.  This makes
15111 the use of the control speculation much more conservative.
15112 The default is 'disable'.
15114 @item -mno-sched-count-spec-in-critical-path
15115 @itemx -msched-count-spec-in-critical-path
15116 @opindex mno-sched-count-spec-in-critical-path
15117 @opindex msched-count-spec-in-critical-path
15118 If enabled, speculative dependencies are considered during
15119 computation of the instructions priorities.  This makes the use of the
15120 speculation a bit more conservative.
15121 The default is 'disable'.
15123 @item -msched-spec-ldc
15124 @opindex msched-spec-ldc
15125 Use a simple data speculation check.  This option is on by default.
15127 @item -msched-control-spec-ldc
15128 @opindex msched-spec-ldc
15129 Use a simple check for control speculation.  This option is on by default.
15131 @item -msched-stop-bits-after-every-cycle
15132 @opindex msched-stop-bits-after-every-cycle
15133 Place a stop bit after every cycle when scheduling.  This option is on
15134 by default.
15136 @item -msched-fp-mem-deps-zero-cost
15137 @opindex msched-fp-mem-deps-zero-cost
15138 Assume that floating-point stores and loads are not likely to cause a conflict
15139 when placed into the same instruction group.  This option is disabled by
15140 default.
15142 @item -msel-sched-dont-check-control-spec
15143 @opindex msel-sched-dont-check-control-spec
15144 Generate checks for control speculation in selective scheduling.
15145 This flag is disabled by default.
15147 @item -msched-max-memory-insns=@var{max-insns}
15148 @opindex msched-max-memory-insns
15149 Limit on the number of memory insns per instruction group, giving lower
15150 priority to subsequent memory insns attempting to schedule in the same
15151 instruction group. Frequently useful to prevent cache bank conflicts.
15152 The default value is 1.
15154 @item -msched-max-memory-insns-hard-limit
15155 @opindex msched-max-memory-insns-hard-limit
15156 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
15157 disallowing more than that number in an instruction group.
15158 Otherwise, the limit is ``soft'', meaning that non-memory operations
15159 are preferred when the limit is reached, but memory operations may still
15160 be scheduled.
15162 @end table
15164 @node LM32 Options
15165 @subsection LM32 Options
15166 @cindex LM32 options
15168 These @option{-m} options are defined for the LatticeMico32 architecture:
15170 @table @gcctabopt
15171 @item -mbarrel-shift-enabled
15172 @opindex mbarrel-shift-enabled
15173 Enable barrel-shift instructions.
15175 @item -mdivide-enabled
15176 @opindex mdivide-enabled
15177 Enable divide and modulus instructions.
15179 @item -mmultiply-enabled
15180 @opindex multiply-enabled
15181 Enable multiply instructions.
15183 @item -msign-extend-enabled
15184 @opindex msign-extend-enabled
15185 Enable sign extend instructions.
15187 @item -muser-enabled
15188 @opindex muser-enabled
15189 Enable user-defined instructions.
15191 @end table
15193 @node M32C Options
15194 @subsection M32C Options
15195 @cindex M32C options
15197 @table @gcctabopt
15198 @item -mcpu=@var{name}
15199 @opindex mcpu=
15200 Select the CPU for which code is generated.  @var{name} may be one of
15201 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
15202 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
15203 the M32C/80 series.
15205 @item -msim
15206 @opindex msim
15207 Specifies that the program will be run on the simulator.  This causes
15208 an alternate runtime library to be linked in which supports, for
15209 example, file I/O@.  You must not use this option when generating
15210 programs that will run on real hardware; you must provide your own
15211 runtime library for whatever I/O functions are needed.
15213 @item -memregs=@var{number}
15214 @opindex memregs=
15215 Specifies the number of memory-based pseudo-registers GCC uses
15216 during code generation.  These pseudo-registers are used like real
15217 registers, so there is a tradeoff between GCC's ability to fit the
15218 code into available registers, and the performance penalty of using
15219 memory instead of registers.  Note that all modules in a program must
15220 be compiled with the same value for this option.  Because of that, you
15221 must not use this option with GCC's default runtime libraries.
15223 @end table
15225 @node M32R/D Options
15226 @subsection M32R/D Options
15227 @cindex M32R/D options
15229 These @option{-m} options are defined for Renesas M32R/D architectures:
15231 @table @gcctabopt
15232 @item -m32r2
15233 @opindex m32r2
15234 Generate code for the M32R/2@.
15236 @item -m32rx
15237 @opindex m32rx
15238 Generate code for the M32R/X@.
15240 @item -m32r
15241 @opindex m32r
15242 Generate code for the M32R@.  This is the default.
15244 @item -mmodel=small
15245 @opindex mmodel=small
15246 Assume all objects live in the lower 16MB of memory (so that their addresses
15247 can be loaded with the @code{ld24} instruction), and assume all subroutines
15248 are reachable with the @code{bl} instruction.
15249 This is the default.
15251 The addressability of a particular object can be set with the
15252 @code{model} attribute.
15254 @item -mmodel=medium
15255 @opindex mmodel=medium
15256 Assume objects may be anywhere in the 32-bit address space (the compiler
15257 generates @code{seth/add3} instructions to load their addresses), and
15258 assume all subroutines are reachable with the @code{bl} instruction.
15260 @item -mmodel=large
15261 @opindex mmodel=large
15262 Assume objects may be anywhere in the 32-bit address space (the compiler
15263 generates @code{seth/add3} instructions to load their addresses), and
15264 assume subroutines may not be reachable with the @code{bl} instruction
15265 (the compiler generates the much slower @code{seth/add3/jl}
15266 instruction sequence).
15268 @item -msdata=none
15269 @opindex msdata=none
15270 Disable use of the small data area.  Variables are put into
15271 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
15272 @code{section} attribute has been specified).
15273 This is the default.
15275 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
15276 Objects may be explicitly put in the small data area with the
15277 @code{section} attribute using one of these sections.
15279 @item -msdata=sdata
15280 @opindex msdata=sdata
15281 Put small global and static data in the small data area, but do not
15282 generate special code to reference them.
15284 @item -msdata=use
15285 @opindex msdata=use
15286 Put small global and static data in the small data area, and generate
15287 special instructions to reference them.
15289 @item -G @var{num}
15290 @opindex G
15291 @cindex smaller data references
15292 Put global and static objects less than or equal to @var{num} bytes
15293 into the small data or BSS sections instead of the normal data or BSS
15294 sections.  The default value of @var{num} is 8.
15295 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
15296 for this option to have any effect.
15298 All modules should be compiled with the same @option{-G @var{num}} value.
15299 Compiling with different values of @var{num} may or may not work; if it
15300 doesn't the linker gives an error message---incorrect code is not
15301 generated.
15303 @item -mdebug
15304 @opindex mdebug
15305 Makes the M32R-specific code in the compiler display some statistics
15306 that might help in debugging programs.
15308 @item -malign-loops
15309 @opindex malign-loops
15310 Align all loops to a 32-byte boundary.
15312 @item -mno-align-loops
15313 @opindex mno-align-loops
15314 Do not enforce a 32-byte alignment for loops.  This is the default.
15316 @item -missue-rate=@var{number}
15317 @opindex missue-rate=@var{number}
15318 Issue @var{number} instructions per cycle.  @var{number} can only be 1
15319 or 2.
15321 @item -mbranch-cost=@var{number}
15322 @opindex mbranch-cost=@var{number}
15323 @var{number} can only be 1 or 2.  If it is 1 then branches are
15324 preferred over conditional code, if it is 2, then the opposite applies.
15326 @item -mflush-trap=@var{number}
15327 @opindex mflush-trap=@var{number}
15328 Specifies the trap number to use to flush the cache.  The default is
15329 12.  Valid numbers are between 0 and 15 inclusive.
15331 @item -mno-flush-trap
15332 @opindex mno-flush-trap
15333 Specifies that the cache cannot be flushed by using a trap.
15335 @item -mflush-func=@var{name}
15336 @opindex mflush-func=@var{name}
15337 Specifies the name of the operating system function to call to flush
15338 the cache.  The default is @emph{_flush_cache}, but a function call
15339 is only used if a trap is not available.
15341 @item -mno-flush-func
15342 @opindex mno-flush-func
15343 Indicates that there is no OS function for flushing the cache.
15345 @end table
15347 @node M680x0 Options
15348 @subsection M680x0 Options
15349 @cindex M680x0 options
15351 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
15352 The default settings depend on which architecture was selected when
15353 the compiler was configured; the defaults for the most common choices
15354 are given below.
15356 @table @gcctabopt
15357 @item -march=@var{arch}
15358 @opindex march
15359 Generate code for a specific M680x0 or ColdFire instruction set
15360 architecture.  Permissible values of @var{arch} for M680x0
15361 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
15362 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
15363 architectures are selected according to Freescale's ISA classification
15364 and the permissible values are: @samp{isaa}, @samp{isaaplus},
15365 @samp{isab} and @samp{isac}.
15367 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
15368 code for a ColdFire target.  The @var{arch} in this macro is one of the
15369 @option{-march} arguments given above.
15371 When used together, @option{-march} and @option{-mtune} select code
15372 that runs on a family of similar processors but that is optimized
15373 for a particular microarchitecture.
15375 @item -mcpu=@var{cpu}
15376 @opindex mcpu
15377 Generate code for a specific M680x0 or ColdFire processor.
15378 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
15379 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
15380 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
15381 below, which also classifies the CPUs into families:
15383 @multitable @columnfractions 0.20 0.80
15384 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
15385 @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}
15386 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
15387 @item @samp{5206e} @tab @samp{5206e}
15388 @item @samp{5208} @tab @samp{5207} @samp{5208}
15389 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
15390 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
15391 @item @samp{5216} @tab @samp{5214} @samp{5216}
15392 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
15393 @item @samp{5225} @tab @samp{5224} @samp{5225}
15394 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
15395 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
15396 @item @samp{5249} @tab @samp{5249}
15397 @item @samp{5250} @tab @samp{5250}
15398 @item @samp{5271} @tab @samp{5270} @samp{5271}
15399 @item @samp{5272} @tab @samp{5272}
15400 @item @samp{5275} @tab @samp{5274} @samp{5275}
15401 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
15402 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
15403 @item @samp{5307} @tab @samp{5307}
15404 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
15405 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
15406 @item @samp{5407} @tab @samp{5407}
15407 @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}
15408 @end multitable
15410 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
15411 @var{arch} is compatible with @var{cpu}.  Other combinations of
15412 @option{-mcpu} and @option{-march} are rejected.
15414 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
15415 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
15416 where the value of @var{family} is given by the table above.
15418 @item -mtune=@var{tune}
15419 @opindex mtune
15420 Tune the code for a particular microarchitecture within the
15421 constraints set by @option{-march} and @option{-mcpu}.
15422 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
15423 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
15424 and @samp{cpu32}.  The ColdFire microarchitectures
15425 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
15427 You can also use @option{-mtune=68020-40} for code that needs
15428 to run relatively well on 68020, 68030 and 68040 targets.
15429 @option{-mtune=68020-60} is similar but includes 68060 targets
15430 as well.  These two options select the same tuning decisions as
15431 @option{-m68020-40} and @option{-m68020-60} respectively.
15433 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
15434 when tuning for 680x0 architecture @var{arch}.  It also defines
15435 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
15436 option is used.  If GCC is tuning for a range of architectures,
15437 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
15438 it defines the macros for every architecture in the range.
15440 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
15441 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
15442 of the arguments given above.
15444 @item -m68000
15445 @itemx -mc68000
15446 @opindex m68000
15447 @opindex mc68000
15448 Generate output for a 68000.  This is the default
15449 when the compiler is configured for 68000-based systems.
15450 It is equivalent to @option{-march=68000}.
15452 Use this option for microcontrollers with a 68000 or EC000 core,
15453 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
15455 @item -m68010
15456 @opindex m68010
15457 Generate output for a 68010.  This is the default
15458 when the compiler is configured for 68010-based systems.
15459 It is equivalent to @option{-march=68010}.
15461 @item -m68020
15462 @itemx -mc68020
15463 @opindex m68020
15464 @opindex mc68020
15465 Generate output for a 68020.  This is the default
15466 when the compiler is configured for 68020-based systems.
15467 It is equivalent to @option{-march=68020}.
15469 @item -m68030
15470 @opindex m68030
15471 Generate output for a 68030.  This is the default when the compiler is
15472 configured for 68030-based systems.  It is equivalent to
15473 @option{-march=68030}.
15475 @item -m68040
15476 @opindex m68040
15477 Generate output for a 68040.  This is the default when the compiler is
15478 configured for 68040-based systems.  It is equivalent to
15479 @option{-march=68040}.
15481 This option inhibits the use of 68881/68882 instructions that have to be
15482 emulated by software on the 68040.  Use this option if your 68040 does not
15483 have code to emulate those instructions.
15485 @item -m68060
15486 @opindex m68060
15487 Generate output for a 68060.  This is the default when the compiler is
15488 configured for 68060-based systems.  It is equivalent to
15489 @option{-march=68060}.
15491 This option inhibits the use of 68020 and 68881/68882 instructions that
15492 have to be emulated by software on the 68060.  Use this option if your 68060
15493 does not have code to emulate those instructions.
15495 @item -mcpu32
15496 @opindex mcpu32
15497 Generate output for a CPU32.  This is the default
15498 when the compiler is configured for CPU32-based systems.
15499 It is equivalent to @option{-march=cpu32}.
15501 Use this option for microcontrollers with a
15502 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
15503 68336, 68340, 68341, 68349 and 68360.
15505 @item -m5200
15506 @opindex m5200
15507 Generate output for a 520X ColdFire CPU@.  This is the default
15508 when the compiler is configured for 520X-based systems.
15509 It is equivalent to @option{-mcpu=5206}, and is now deprecated
15510 in favor of that option.
15512 Use this option for microcontroller with a 5200 core, including
15513 the MCF5202, MCF5203, MCF5204 and MCF5206.
15515 @item -m5206e
15516 @opindex m5206e
15517 Generate output for a 5206e ColdFire CPU@.  The option is now
15518 deprecated in favor of the equivalent @option{-mcpu=5206e}.
15520 @item -m528x
15521 @opindex m528x
15522 Generate output for a member of the ColdFire 528X family.
15523 The option is now deprecated in favor of the equivalent
15524 @option{-mcpu=528x}.
15526 @item -m5307
15527 @opindex m5307
15528 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
15529 in favor of the equivalent @option{-mcpu=5307}.
15531 @item -m5407
15532 @opindex m5407
15533 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
15534 in favor of the equivalent @option{-mcpu=5407}.
15536 @item -mcfv4e
15537 @opindex mcfv4e
15538 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
15539 This includes use of hardware floating-point instructions.
15540 The option is equivalent to @option{-mcpu=547x}, and is now
15541 deprecated in favor of that option.
15543 @item -m68020-40
15544 @opindex m68020-40
15545 Generate output for a 68040, without using any of the new instructions.
15546 This results in code that can run relatively efficiently on either a
15547 68020/68881 or a 68030 or a 68040.  The generated code does use the
15548 68881 instructions that are emulated on the 68040.
15550 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
15552 @item -m68020-60
15553 @opindex m68020-60
15554 Generate output for a 68060, without using any of the new instructions.
15555 This results in code that can run relatively efficiently on either a
15556 68020/68881 or a 68030 or a 68040.  The generated code does use the
15557 68881 instructions that are emulated on the 68060.
15559 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
15561 @item -mhard-float
15562 @itemx -m68881
15563 @opindex mhard-float
15564 @opindex m68881
15565 Generate floating-point instructions.  This is the default for 68020
15566 and above, and for ColdFire devices that have an FPU@.  It defines the
15567 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
15568 on ColdFire targets.
15570 @item -msoft-float
15571 @opindex msoft-float
15572 Do not generate floating-point instructions; use library calls instead.
15573 This is the default for 68000, 68010, and 68832 targets.  It is also
15574 the default for ColdFire devices that have no FPU.
15576 @item -mdiv
15577 @itemx -mno-div
15578 @opindex mdiv
15579 @opindex mno-div
15580 Generate (do not generate) ColdFire hardware divide and remainder
15581 instructions.  If @option{-march} is used without @option{-mcpu},
15582 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
15583 architectures.  Otherwise, the default is taken from the target CPU
15584 (either the default CPU, or the one specified by @option{-mcpu}).  For
15585 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
15586 @option{-mcpu=5206e}.
15588 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
15590 @item -mshort
15591 @opindex mshort
15592 Consider type @code{int} to be 16 bits wide, like @code{short int}.
15593 Additionally, parameters passed on the stack are also aligned to a
15594 16-bit boundary even on targets whose API mandates promotion to 32-bit.
15596 @item -mno-short
15597 @opindex mno-short
15598 Do not consider type @code{int} to be 16 bits wide.  This is the default.
15600 @item -mnobitfield
15601 @itemx -mno-bitfield
15602 @opindex mnobitfield
15603 @opindex mno-bitfield
15604 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
15605 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
15607 @item -mbitfield
15608 @opindex mbitfield
15609 Do use the bit-field instructions.  The @option{-m68020} option implies
15610 @option{-mbitfield}.  This is the default if you use a configuration
15611 designed for a 68020.
15613 @item -mrtd
15614 @opindex mrtd
15615 Use a different function-calling convention, in which functions
15616 that take a fixed number of arguments return with the @code{rtd}
15617 instruction, which pops their arguments while returning.  This
15618 saves one instruction in the caller since there is no need to pop
15619 the arguments there.
15621 This calling convention is incompatible with the one normally
15622 used on Unix, so you cannot use it if you need to call libraries
15623 compiled with the Unix compiler.
15625 Also, you must provide function prototypes for all functions that
15626 take variable numbers of arguments (including @code{printf});
15627 otherwise incorrect code is generated for calls to those
15628 functions.
15630 In addition, seriously incorrect code results if you call a
15631 function with too many arguments.  (Normally, extra arguments are
15632 harmlessly ignored.)
15634 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
15635 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
15637 @item -mno-rtd
15638 @opindex mno-rtd
15639 Do not use the calling conventions selected by @option{-mrtd}.
15640 This is the default.
15642 @item -malign-int
15643 @itemx -mno-align-int
15644 @opindex malign-int
15645 @opindex mno-align-int
15646 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
15647 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
15648 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
15649 Aligning variables on 32-bit boundaries produces code that runs somewhat
15650 faster on processors with 32-bit busses at the expense of more memory.
15652 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
15653 aligns structures containing the above types differently than
15654 most published application binary interface specifications for the m68k.
15656 @item -mpcrel
15657 @opindex mpcrel
15658 Use the pc-relative addressing mode of the 68000 directly, instead of
15659 using a global offset table.  At present, this option implies @option{-fpic},
15660 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
15661 not presently supported with @option{-mpcrel}, though this could be supported for
15662 68020 and higher processors.
15664 @item -mno-strict-align
15665 @itemx -mstrict-align
15666 @opindex mno-strict-align
15667 @opindex mstrict-align
15668 Do not (do) assume that unaligned memory references are handled by
15669 the system.
15671 @item -msep-data
15672 Generate code that allows the data segment to be located in a different
15673 area of memory from the text segment.  This allows for execute-in-place in
15674 an environment without virtual memory management.  This option implies
15675 @option{-fPIC}.
15677 @item -mno-sep-data
15678 Generate code that assumes that the data segment follows the text segment.
15679 This is the default.
15681 @item -mid-shared-library
15682 Generate code that supports shared libraries via the library ID method.
15683 This allows for execute-in-place and shared libraries in an environment
15684 without virtual memory management.  This option implies @option{-fPIC}.
15686 @item -mno-id-shared-library
15687 Generate code that doesn't assume ID-based shared libraries are being used.
15688 This is the default.
15690 @item -mshared-library-id=n
15691 Specifies the identification number of the ID-based shared library being
15692 compiled.  Specifying a value of 0 generates more compact code; specifying
15693 other values forces the allocation of that number to the current
15694 library, but is no more space- or time-efficient than omitting this option.
15696 @item -mxgot
15697 @itemx -mno-xgot
15698 @opindex mxgot
15699 @opindex mno-xgot
15700 When generating position-independent code for ColdFire, generate code
15701 that works if the GOT has more than 8192 entries.  This code is
15702 larger and slower than code generated without this option.  On M680x0
15703 processors, this option is not needed; @option{-fPIC} suffices.
15705 GCC normally uses a single instruction to load values from the GOT@.
15706 While this is relatively efficient, it only works if the GOT
15707 is smaller than about 64k.  Anything larger causes the linker
15708 to report an error such as:
15710 @cindex relocation truncated to fit (ColdFire)
15711 @smallexample
15712 relocation truncated to fit: R_68K_GOT16O foobar
15713 @end smallexample
15715 If this happens, you should recompile your code with @option{-mxgot}.
15716 It should then work with very large GOTs.  However, code generated with
15717 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
15718 the value of a global symbol.
15720 Note that some linkers, including newer versions of the GNU linker,
15721 can create multiple GOTs and sort GOT entries.  If you have such a linker,
15722 you should only need to use @option{-mxgot} when compiling a single
15723 object file that accesses more than 8192 GOT entries.  Very few do.
15725 These options have no effect unless GCC is generating
15726 position-independent code.
15728 @end table
15730 @node MCore Options
15731 @subsection MCore Options
15732 @cindex MCore options
15734 These are the @samp{-m} options defined for the Motorola M*Core
15735 processors.
15737 @table @gcctabopt
15739 @item -mhardlit
15740 @itemx -mno-hardlit
15741 @opindex mhardlit
15742 @opindex mno-hardlit
15743 Inline constants into the code stream if it can be done in two
15744 instructions or less.
15746 @item -mdiv
15747 @itemx -mno-div
15748 @opindex mdiv
15749 @opindex mno-div
15750 Use the divide instruction.  (Enabled by default).
15752 @item -mrelax-immediate
15753 @itemx -mno-relax-immediate
15754 @opindex mrelax-immediate
15755 @opindex mno-relax-immediate
15756 Allow arbitrary-sized immediates in bit operations.
15758 @item -mwide-bitfields
15759 @itemx -mno-wide-bitfields
15760 @opindex mwide-bitfields
15761 @opindex mno-wide-bitfields
15762 Always treat bit-fields as @code{int}-sized.
15764 @item -m4byte-functions
15765 @itemx -mno-4byte-functions
15766 @opindex m4byte-functions
15767 @opindex mno-4byte-functions
15768 Force all functions to be aligned to a 4-byte boundary.
15770 @item -mcallgraph-data
15771 @itemx -mno-callgraph-data
15772 @opindex mcallgraph-data
15773 @opindex mno-callgraph-data
15774 Emit callgraph information.
15776 @item -mslow-bytes
15777 @itemx -mno-slow-bytes
15778 @opindex mslow-bytes
15779 @opindex mno-slow-bytes
15780 Prefer word access when reading byte quantities.
15782 @item -mlittle-endian
15783 @itemx -mbig-endian
15784 @opindex mlittle-endian
15785 @opindex mbig-endian
15786 Generate code for a little-endian target.
15788 @item -m210
15789 @itemx -m340
15790 @opindex m210
15791 @opindex m340
15792 Generate code for the 210 processor.
15794 @item -mno-lsim
15795 @opindex mno-lsim
15796 Assume that runtime support has been provided and so omit the
15797 simulator library (@file{libsim.a)} from the linker command line.
15799 @item -mstack-increment=@var{size}
15800 @opindex mstack-increment
15801 Set the maximum amount for a single stack increment operation.  Large
15802 values can increase the speed of programs that contain functions
15803 that need a large amount of stack space, but they can also trigger a
15804 segmentation fault if the stack is extended too much.  The default
15805 value is 0x1000.
15807 @end table
15809 @node MeP Options
15810 @subsection MeP Options
15811 @cindex MeP options
15813 @table @gcctabopt
15815 @item -mabsdiff
15816 @opindex mabsdiff
15817 Enables the @code{abs} instruction, which is the absolute difference
15818 between two registers.
15820 @item -mall-opts
15821 @opindex mall-opts
15822 Enables all the optional instructions---average, multiply, divide, bit
15823 operations, leading zero, absolute difference, min/max, clip, and
15824 saturation.
15827 @item -maverage
15828 @opindex maverage
15829 Enables the @code{ave} instruction, which computes the average of two
15830 registers.
15832 @item -mbased=@var{n}
15833 @opindex mbased=
15834 Variables of size @var{n} bytes or smaller are placed in the
15835 @code{.based} section by default.  Based variables use the @code{$tp}
15836 register as a base register, and there is a 128-byte limit to the
15837 @code{.based} section.
15839 @item -mbitops
15840 @opindex mbitops
15841 Enables the bit operation instructions---bit test (@code{btstm}), set
15842 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
15843 test-and-set (@code{tas}).
15845 @item -mc=@var{name}
15846 @opindex mc=
15847 Selects which section constant data is placed in.  @var{name} may
15848 be @code{tiny}, @code{near}, or @code{far}.
15850 @item -mclip
15851 @opindex mclip
15852 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
15853 useful unless you also provide @code{-mminmax}.
15855 @item -mconfig=@var{name}
15856 @opindex mconfig=
15857 Selects one of the built-in core configurations.  Each MeP chip has
15858 one or more modules in it; each module has a core CPU and a variety of
15859 coprocessors, optional instructions, and peripherals.  The
15860 @code{MeP-Integrator} tool, not part of GCC, provides these
15861 configurations through this option; using this option is the same as
15862 using all the corresponding command-line options.  The default
15863 configuration is @code{default}.
15865 @item -mcop
15866 @opindex mcop
15867 Enables the coprocessor instructions.  By default, this is a 32-bit
15868 coprocessor.  Note that the coprocessor is normally enabled via the
15869 @code{-mconfig=} option.
15871 @item -mcop32
15872 @opindex mcop32
15873 Enables the 32-bit coprocessor's instructions.
15875 @item -mcop64
15876 @opindex mcop64
15877 Enables the 64-bit coprocessor's instructions.
15879 @item -mivc2
15880 @opindex mivc2
15881 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
15883 @item -mdc
15884 @opindex mdc
15885 Causes constant variables to be placed in the @code{.near} section.
15887 @item -mdiv
15888 @opindex mdiv
15889 Enables the @code{div} and @code{divu} instructions.
15891 @item -meb
15892 @opindex meb
15893 Generate big-endian code.
15895 @item -mel
15896 @opindex mel
15897 Generate little-endian code.
15899 @item -mio-volatile
15900 @opindex mio-volatile
15901 Tells the compiler that any variable marked with the @code{io}
15902 attribute is to be considered volatile.
15904 @item -ml
15905 @opindex ml
15906 Causes variables to be assigned to the @code{.far} section by default.
15908 @item -mleadz
15909 @opindex mleadz
15910 Enables the @code{leadz} (leading zero) instruction.
15912 @item -mm
15913 @opindex mm
15914 Causes variables to be assigned to the @code{.near} section by default.
15916 @item -mminmax
15917 @opindex mminmax
15918 Enables the @code{min} and @code{max} instructions.
15920 @item -mmult
15921 @opindex mmult
15922 Enables the multiplication and multiply-accumulate instructions.
15924 @item -mno-opts
15925 @opindex mno-opts
15926 Disables all the optional instructions enabled by @code{-mall-opts}.
15928 @item -mrepeat
15929 @opindex mrepeat
15930 Enables the @code{repeat} and @code{erepeat} instructions, used for
15931 low-overhead looping.
15933 @item -ms
15934 @opindex ms
15935 Causes all variables to default to the @code{.tiny} section.  Note
15936 that there is a 65536-byte limit to this section.  Accesses to these
15937 variables use the @code{%gp} base register.
15939 @item -msatur
15940 @opindex msatur
15941 Enables the saturation instructions.  Note that the compiler does not
15942 currently generate these itself, but this option is included for
15943 compatibility with other tools, like @code{as}.
15945 @item -msdram
15946 @opindex msdram
15947 Link the SDRAM-based runtime instead of the default ROM-based runtime.
15949 @item -msim
15950 @opindex msim
15951 Link the simulator runtime libraries.
15953 @item -msimnovec
15954 @opindex msimnovec
15955 Link the simulator runtime libraries, excluding built-in support
15956 for reset and exception vectors and tables.
15958 @item -mtf
15959 @opindex mtf
15960 Causes all functions to default to the @code{.far} section.  Without
15961 this option, functions default to the @code{.near} section.
15963 @item -mtiny=@var{n}
15964 @opindex mtiny=
15965 Variables that are @var{n} bytes or smaller are allocated to the
15966 @code{.tiny} section.  These variables use the @code{$gp} base
15967 register.  The default for this option is 4, but note that there's a
15968 65536-byte limit to the @code{.tiny} section.
15970 @end table
15972 @node MicroBlaze Options
15973 @subsection MicroBlaze Options
15974 @cindex MicroBlaze Options
15976 @table @gcctabopt
15978 @item -msoft-float
15979 @opindex msoft-float
15980 Use software emulation for floating point (default).
15982 @item -mhard-float
15983 @opindex mhard-float
15984 Use hardware floating-point instructions.
15986 @item -mmemcpy
15987 @opindex mmemcpy
15988 Do not optimize block moves, use @code{memcpy}.
15990 @item -mno-clearbss
15991 @opindex mno-clearbss
15992 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
15994 @item -mcpu=@var{cpu-type}
15995 @opindex mcpu=
15996 Use features of, and schedule code for, the given CPU.
15997 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
15998 where @var{X} is a major version, @var{YY} is the minor version, and
15999 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
16000 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
16002 @item -mxl-soft-mul
16003 @opindex mxl-soft-mul
16004 Use software multiply emulation (default).
16006 @item -mxl-soft-div
16007 @opindex mxl-soft-div
16008 Use software emulation for divides (default).
16010 @item -mxl-barrel-shift
16011 @opindex mxl-barrel-shift
16012 Use the hardware barrel shifter.
16014 @item -mxl-pattern-compare
16015 @opindex mxl-pattern-compare
16016 Use pattern compare instructions.
16018 @item -msmall-divides
16019 @opindex msmall-divides
16020 Use table lookup optimization for small signed integer divisions.
16022 @item -mxl-stack-check
16023 @opindex mxl-stack-check
16024 This option is deprecated.  Use @option{-fstack-check} instead.
16026 @item -mxl-gp-opt
16027 @opindex mxl-gp-opt
16028 Use GP-relative @code{.sdata}/@code{.sbss} sections.
16030 @item -mxl-multiply-high
16031 @opindex mxl-multiply-high
16032 Use multiply high instructions for high part of 32x32 multiply.
16034 @item -mxl-float-convert
16035 @opindex mxl-float-convert
16036 Use hardware floating-point conversion instructions.
16038 @item -mxl-float-sqrt
16039 @opindex mxl-float-sqrt
16040 Use hardware floating-point square root instruction.
16042 @item -mbig-endian
16043 @opindex mbig-endian
16044 Generate code for a big-endian target.
16046 @item -mlittle-endian
16047 @opindex mlittle-endian
16048 Generate code for a little-endian target.
16050 @item -mxl-reorder
16051 @opindex mxl-reorder
16052 Use reorder instructions (swap and byte reversed load/store).
16054 @item -mxl-mode-@var{app-model}
16055 Select application model @var{app-model}.  Valid models are
16056 @table @samp
16057 @item executable
16058 normal executable (default), uses startup code @file{crt0.o}.
16060 @item xmdstub
16061 for use with Xilinx Microprocessor Debugger (XMD) based
16062 software intrusive debug agent called xmdstub. This uses startup file
16063 @file{crt1.o} and sets the start address of the program to 0x800.
16065 @item bootstrap
16066 for applications that are loaded using a bootloader.
16067 This model uses startup file @file{crt2.o} which does not contain a processor
16068 reset vector handler. This is suitable for transferring control on a
16069 processor reset to the bootloader rather than the application.
16071 @item novectors
16072 for applications that do not require any of the
16073 MicroBlaze vectors. This option may be useful for applications running
16074 within a monitoring application. This model uses @file{crt3.o} as a startup file.
16075 @end table
16077 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
16078 @option{-mxl-mode-@var{app-model}}.
16080 @end table
16082 @node MIPS Options
16083 @subsection MIPS Options
16084 @cindex MIPS options
16086 @table @gcctabopt
16088 @item -EB
16089 @opindex EB
16090 Generate big-endian code.
16092 @item -EL
16093 @opindex EL
16094 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
16095 configurations.
16097 @item -march=@var{arch}
16098 @opindex march
16099 Generate code that runs on @var{arch}, which can be the name of a
16100 generic MIPS ISA, or the name of a particular processor.
16101 The ISA names are:
16102 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
16103 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
16104 The processor names are:
16105 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
16106 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
16107 @samp{5kc}, @samp{5kf},
16108 @samp{20kc},
16109 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
16110 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
16111 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
16112 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
16113 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
16114 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
16115 @samp{m4k},
16116 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
16117 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
16118 @samp{orion},
16119 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
16120 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
16121 @samp{rm7000}, @samp{rm9000},
16122 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
16123 @samp{sb1},
16124 @samp{sr71000},
16125 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
16126 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
16127 @samp{xlr} and @samp{xlp}.
16128 The special value @samp{from-abi} selects the
16129 most compatible architecture for the selected ABI (that is,
16130 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
16132 The native Linux/GNU toolchain also supports the value @samp{native},
16133 which selects the best architecture option for the host processor.
16134 @option{-march=native} has no effect if GCC does not recognize
16135 the processor.
16137 In processor names, a final @samp{000} can be abbreviated as @samp{k}
16138 (for example, @option{-march=r2k}).  Prefixes are optional, and
16139 @samp{vr} may be written @samp{r}.
16141 Names of the form @samp{@var{n}f2_1} refer to processors with
16142 FPUs clocked at half the rate of the core, names of the form
16143 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
16144 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
16145 processors with FPUs clocked a ratio of 3:2 with respect to the core.
16146 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
16147 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
16148 accepted as synonyms for @samp{@var{n}f1_1}.
16150 GCC defines two macros based on the value of this option.  The first
16151 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
16152 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
16153 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
16154 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
16155 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
16157 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
16158 above.  In other words, it has the full prefix and does not
16159 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
16160 the macro names the resolved architecture (either @samp{"mips1"} or
16161 @samp{"mips3"}).  It names the default architecture when no
16162 @option{-march} option is given.
16164 @item -mtune=@var{arch}
16165 @opindex mtune
16166 Optimize for @var{arch}.  Among other things, this option controls
16167 the way instructions are scheduled, and the perceived cost of arithmetic
16168 operations.  The list of @var{arch} values is the same as for
16169 @option{-march}.
16171 When this option is not used, GCC optimizes for the processor
16172 specified by @option{-march}.  By using @option{-march} and
16173 @option{-mtune} together, it is possible to generate code that
16174 runs on a family of processors, but optimize the code for one
16175 particular member of that family.
16177 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
16178 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
16179 @option{-march} ones described above.
16181 @item -mips1
16182 @opindex mips1
16183 Equivalent to @option{-march=mips1}.
16185 @item -mips2
16186 @opindex mips2
16187 Equivalent to @option{-march=mips2}.
16189 @item -mips3
16190 @opindex mips3
16191 Equivalent to @option{-march=mips3}.
16193 @item -mips4
16194 @opindex mips4
16195 Equivalent to @option{-march=mips4}.
16197 @item -mips32
16198 @opindex mips32
16199 Equivalent to @option{-march=mips32}.
16201 @item -mips32r2
16202 @opindex mips32r2
16203 Equivalent to @option{-march=mips32r2}.
16205 @item -mips64
16206 @opindex mips64
16207 Equivalent to @option{-march=mips64}.
16209 @item -mips64r2
16210 @opindex mips64r2
16211 Equivalent to @option{-march=mips64r2}.
16213 @item -mips16
16214 @itemx -mno-mips16
16215 @opindex mips16
16216 @opindex mno-mips16
16217 Generate (do not generate) MIPS16 code.  If GCC is targeting a
16218 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
16220 MIPS16 code generation can also be controlled on a per-function basis
16221 by means of @code{mips16} and @code{nomips16} attributes.
16222 @xref{Function Attributes}, for more information.
16224 @item -mflip-mips16
16225 @opindex mflip-mips16
16226 Generate MIPS16 code on alternating functions.  This option is provided
16227 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
16228 not intended for ordinary use in compiling user code.
16230 @item -minterlink-compressed
16231 @item -mno-interlink-compressed
16232 @opindex minterlink-compressed
16233 @opindex mno-interlink-compressed
16234 Require (do not require) that code using the standard (uncompressed) MIPS ISA
16235 be link-compatible with MIPS16 and microMIPS code, and vice versa.
16237 For example, code using the standard ISA encoding cannot jump directly
16238 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
16239 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
16240 knows that the target of the jump is not compressed.
16242 @item -minterlink-mips16
16243 @itemx -mno-interlink-mips16
16244 @opindex minterlink-mips16
16245 @opindex mno-interlink-mips16
16246 Aliases of @option{-minterlink-compressed} and
16247 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
16248 and are retained for backwards compatibility.
16250 @item -mabi=32
16251 @itemx -mabi=o64
16252 @itemx -mabi=n32
16253 @itemx -mabi=64
16254 @itemx -mabi=eabi
16255 @opindex mabi=32
16256 @opindex mabi=o64
16257 @opindex mabi=n32
16258 @opindex mabi=64
16259 @opindex mabi=eabi
16260 Generate code for the given ABI@.
16262 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
16263 generates 64-bit code when you select a 64-bit architecture, but you
16264 can use @option{-mgp32} to get 32-bit code instead.
16266 For information about the O64 ABI, see
16267 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
16269 GCC supports a variant of the o32 ABI in which floating-point registers
16270 are 64 rather than 32 bits wide.  You can select this combination with
16271 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
16272 and @code{mfhc1} instructions and is therefore only supported for
16273 MIPS32R2 processors.
16275 The register assignments for arguments and return values remain the
16276 same, but each scalar value is passed in a single 64-bit register
16277 rather than a pair of 32-bit registers.  For example, scalar
16278 floating-point values are returned in @samp{$f0} only, not a
16279 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
16280 remains the same, but all 64 bits are saved.
16282 @item -mabicalls
16283 @itemx -mno-abicalls
16284 @opindex mabicalls
16285 @opindex mno-abicalls
16286 Generate (do not generate) code that is suitable for SVR4-style
16287 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
16288 systems.
16290 @item -mshared
16291 @itemx -mno-shared
16292 Generate (do not generate) code that is fully position-independent,
16293 and that can therefore be linked into shared libraries.  This option
16294 only affects @option{-mabicalls}.
16296 All @option{-mabicalls} code has traditionally been position-independent,
16297 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
16298 as an extension, the GNU toolchain allows executables to use absolute
16299 accesses for locally-binding symbols.  It can also use shorter GP
16300 initialization sequences and generate direct calls to locally-defined
16301 functions.  This mode is selected by @option{-mno-shared}.
16303 @option{-mno-shared} depends on binutils 2.16 or higher and generates
16304 objects that can only be linked by the GNU linker.  However, the option
16305 does not affect the ABI of the final executable; it only affects the ABI
16306 of relocatable objects.  Using @option{-mno-shared} generally makes
16307 executables both smaller and quicker.
16309 @option{-mshared} is the default.
16311 @item -mplt
16312 @itemx -mno-plt
16313 @opindex mplt
16314 @opindex mno-plt
16315 Assume (do not assume) that the static and dynamic linkers
16316 support PLTs and copy relocations.  This option only affects
16317 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
16318 has no effect without @option{-msym32}.
16320 You can make @option{-mplt} the default by configuring
16321 GCC with @option{--with-mips-plt}.  The default is
16322 @option{-mno-plt} otherwise.
16324 @item -mxgot
16325 @itemx -mno-xgot
16326 @opindex mxgot
16327 @opindex mno-xgot
16328 Lift (do not lift) the usual restrictions on the size of the global
16329 offset table.
16331 GCC normally uses a single instruction to load values from the GOT@.
16332 While this is relatively efficient, it only works if the GOT
16333 is smaller than about 64k.  Anything larger causes the linker
16334 to report an error such as:
16336 @cindex relocation truncated to fit (MIPS)
16337 @smallexample
16338 relocation truncated to fit: R_MIPS_GOT16 foobar
16339 @end smallexample
16341 If this happens, you should recompile your code with @option{-mxgot}.
16342 This works with very large GOTs, although the code is also
16343 less efficient, since it takes three instructions to fetch the
16344 value of a global symbol.
16346 Note that some linkers can create multiple GOTs.  If you have such a
16347 linker, you should only need to use @option{-mxgot} when a single object
16348 file accesses more than 64k's worth of GOT entries.  Very few do.
16350 These options have no effect unless GCC is generating position
16351 independent code.
16353 @item -mgp32
16354 @opindex mgp32
16355 Assume that general-purpose registers are 32 bits wide.
16357 @item -mgp64
16358 @opindex mgp64
16359 Assume that general-purpose registers are 64 bits wide.
16361 @item -mfp32
16362 @opindex mfp32
16363 Assume that floating-point registers are 32 bits wide.
16365 @item -mfp64
16366 @opindex mfp64
16367 Assume that floating-point registers are 64 bits wide.
16369 @item -mhard-float
16370 @opindex mhard-float
16371 Use floating-point coprocessor instructions.
16373 @item -msoft-float
16374 @opindex msoft-float
16375 Do not use floating-point coprocessor instructions.  Implement
16376 floating-point calculations using library calls instead.
16378 @item -mno-float
16379 @opindex mno-float
16380 Equivalent to @option{-msoft-float}, but additionally asserts that the
16381 program being compiled does not perform any floating-point operations.
16382 This option is presently supported only by some bare-metal MIPS
16383 configurations, where it may select a special set of libraries
16384 that lack all floating-point support (including, for example, the
16385 floating-point @code{printf} formats).  
16386 If code compiled with @code{-mno-float} accidentally contains
16387 floating-point operations, it is likely to suffer a link-time
16388 or run-time failure.
16390 @item -msingle-float
16391 @opindex msingle-float
16392 Assume that the floating-point coprocessor only supports single-precision
16393 operations.
16395 @item -mdouble-float
16396 @opindex mdouble-float
16397 Assume that the floating-point coprocessor supports double-precision
16398 operations.  This is the default.
16400 @item -mabs=2008
16401 @itemx -mabs=legacy
16402 @opindex mabs=2008
16403 @opindex mabs=legacy
16404 These options control the treatment of the special not-a-number (NaN)
16405 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
16406 @code{neg.@i{fmt}} machine instructions.
16408 By default or when the @option{-mabs=legacy} is used the legacy
16409 treatment is selected.  In this case these instructions are considered
16410 arithmetic and avoided where correct operation is required and the
16411 input operand might be a NaN.  A longer sequence of instructions that
16412 manipulate the sign bit of floating-point datum manually is used
16413 instead unless the @option{-ffinite-math-only} option has also been
16414 specified.
16416 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
16417 this case these instructions are considered non-arithmetic and therefore
16418 operating correctly in all cases, including in particular where the
16419 input operand is a NaN.  These instructions are therefore always used
16420 for the respective operations.
16422 @item -mnan=2008
16423 @itemx -mnan=legacy
16424 @opindex mnan=2008
16425 @opindex mnan=legacy
16426 These options control the encoding of the special not-a-number (NaN)
16427 IEEE 754 floating-point data.
16429 The @option{-mnan=legacy} option selects the legacy encoding.  In this
16430 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
16431 significand field being 0, whereas signalling NaNs (sNaNs) are denoted
16432 by the first bit of their trailing significand field being 1.
16434 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
16435 this case qNaNs are denoted by the first bit of their trailing
16436 significand field being 1, whereas sNaNs are denoted by the first bit of
16437 their trailing significand field being 0.
16439 The default is @option{-mnan=legacy} unless GCC has been configured with
16440 @option{--with-nan=2008}.
16442 @item -mllsc
16443 @itemx -mno-llsc
16444 @opindex mllsc
16445 @opindex mno-llsc
16446 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
16447 implement atomic memory built-in functions.  When neither option is
16448 specified, GCC uses the instructions if the target architecture
16449 supports them.
16451 @option{-mllsc} is useful if the runtime environment can emulate the
16452 instructions and @option{-mno-llsc} can be useful when compiling for
16453 nonstandard ISAs.  You can make either option the default by
16454 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
16455 respectively.  @option{--with-llsc} is the default for some
16456 configurations; see the installation documentation for details.
16458 @item -mdsp
16459 @itemx -mno-dsp
16460 @opindex mdsp
16461 @opindex mno-dsp
16462 Use (do not use) revision 1 of the MIPS DSP ASE@.
16463 @xref{MIPS DSP Built-in Functions}.  This option defines the
16464 preprocessor macro @samp{__mips_dsp}.  It also defines
16465 @samp{__mips_dsp_rev} to 1.
16467 @item -mdspr2
16468 @itemx -mno-dspr2
16469 @opindex mdspr2
16470 @opindex mno-dspr2
16471 Use (do not use) revision 2 of the MIPS DSP ASE@.
16472 @xref{MIPS DSP Built-in Functions}.  This option defines the
16473 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
16474 It also defines @samp{__mips_dsp_rev} to 2.
16476 @item -msmartmips
16477 @itemx -mno-smartmips
16478 @opindex msmartmips
16479 @opindex mno-smartmips
16480 Use (do not use) the MIPS SmartMIPS ASE.
16482 @item -mpaired-single
16483 @itemx -mno-paired-single
16484 @opindex mpaired-single
16485 @opindex mno-paired-single
16486 Use (do not use) paired-single floating-point instructions.
16487 @xref{MIPS Paired-Single Support}.  This option requires
16488 hardware floating-point support to be enabled.
16490 @item -mdmx
16491 @itemx -mno-mdmx
16492 @opindex mdmx
16493 @opindex mno-mdmx
16494 Use (do not use) MIPS Digital Media Extension instructions.
16495 This option can only be used when generating 64-bit code and requires
16496 hardware floating-point support to be enabled.
16498 @item -mips3d
16499 @itemx -mno-mips3d
16500 @opindex mips3d
16501 @opindex mno-mips3d
16502 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
16503 The option @option{-mips3d} implies @option{-mpaired-single}.
16505 @item -mmicromips
16506 @itemx -mno-micromips
16507 @opindex mmicromips
16508 @opindex mno-mmicromips
16509 Generate (do not generate) microMIPS code.
16511 MicroMIPS code generation can also be controlled on a per-function basis
16512 by means of @code{micromips} and @code{nomicromips} attributes.
16513 @xref{Function Attributes}, for more information.
16515 @item -mmt
16516 @itemx -mno-mt
16517 @opindex mmt
16518 @opindex mno-mt
16519 Use (do not use) MT Multithreading instructions.
16521 @item -mmcu
16522 @itemx -mno-mcu
16523 @opindex mmcu
16524 @opindex mno-mcu
16525 Use (do not use) the MIPS MCU ASE instructions.
16527 @item -meva
16528 @itemx -mno-eva
16529 @opindex meva
16530 @opindex mno-eva
16531 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
16533 @item -mlong64
16534 @opindex mlong64
16535 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
16536 an explanation of the default and the way that the pointer size is
16537 determined.
16539 @item -mlong32
16540 @opindex mlong32
16541 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
16543 The default size of @code{int}s, @code{long}s and pointers depends on
16544 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
16545 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
16546 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
16547 or the same size as integer registers, whichever is smaller.
16549 @item -msym32
16550 @itemx -mno-sym32
16551 @opindex msym32
16552 @opindex mno-sym32
16553 Assume (do not assume) that all symbols have 32-bit values, regardless
16554 of the selected ABI@.  This option is useful in combination with
16555 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
16556 to generate shorter and faster references to symbolic addresses.
16558 @item -G @var{num}
16559 @opindex G
16560 Put definitions of externally-visible data in a small data section
16561 if that data is no bigger than @var{num} bytes.  GCC can then generate
16562 more efficient accesses to the data; see @option{-mgpopt} for details.
16564 The default @option{-G} option depends on the configuration.
16566 @item -mlocal-sdata
16567 @itemx -mno-local-sdata
16568 @opindex mlocal-sdata
16569 @opindex mno-local-sdata
16570 Extend (do not extend) the @option{-G} behavior to local data too,
16571 such as to static variables in C@.  @option{-mlocal-sdata} is the
16572 default for all configurations.
16574 If the linker complains that an application is using too much small data,
16575 you might want to try rebuilding the less performance-critical parts with
16576 @option{-mno-local-sdata}.  You might also want to build large
16577 libraries with @option{-mno-local-sdata}, so that the libraries leave
16578 more room for the main program.
16580 @item -mextern-sdata
16581 @itemx -mno-extern-sdata
16582 @opindex mextern-sdata
16583 @opindex mno-extern-sdata
16584 Assume (do not assume) that externally-defined data is in
16585 a small data section if the size of that data is within the @option{-G} limit.
16586 @option{-mextern-sdata} is the default for all configurations.
16588 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
16589 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
16590 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
16591 is placed in a small data section.  If @var{Var} is defined by another
16592 module, you must either compile that module with a high-enough
16593 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
16594 definition.  If @var{Var} is common, you must link the application
16595 with a high-enough @option{-G} setting.
16597 The easiest way of satisfying these restrictions is to compile
16598 and link every module with the same @option{-G} option.  However,
16599 you may wish to build a library that supports several different
16600 small data limits.  You can do this by compiling the library with
16601 the highest supported @option{-G} setting and additionally using
16602 @option{-mno-extern-sdata} to stop the library from making assumptions
16603 about externally-defined data.
16605 @item -mgpopt
16606 @itemx -mno-gpopt
16607 @opindex mgpopt
16608 @opindex mno-gpopt
16609 Use (do not use) GP-relative accesses for symbols that are known to be
16610 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
16611 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
16612 configurations.
16614 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
16615 might not hold the value of @code{_gp}.  For example, if the code is
16616 part of a library that might be used in a boot monitor, programs that
16617 call boot monitor routines pass an unknown value in @code{$gp}.
16618 (In such situations, the boot monitor itself is usually compiled
16619 with @option{-G0}.)
16621 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
16622 @option{-mno-extern-sdata}.
16624 @item -membedded-data
16625 @itemx -mno-embedded-data
16626 @opindex membedded-data
16627 @opindex mno-embedded-data
16628 Allocate variables to the read-only data section first if possible, then
16629 next in the small data section if possible, otherwise in data.  This gives
16630 slightly slower code than the default, but reduces the amount of RAM required
16631 when executing, and thus may be preferred for some embedded systems.
16633 @item -muninit-const-in-rodata
16634 @itemx -mno-uninit-const-in-rodata
16635 @opindex muninit-const-in-rodata
16636 @opindex mno-uninit-const-in-rodata
16637 Put uninitialized @code{const} variables in the read-only data section.
16638 This option is only meaningful in conjunction with @option{-membedded-data}.
16640 @item -mcode-readable=@var{setting}
16641 @opindex mcode-readable
16642 Specify whether GCC may generate code that reads from executable sections.
16643 There are three possible settings:
16645 @table @gcctabopt
16646 @item -mcode-readable=yes
16647 Instructions may freely access executable sections.  This is the
16648 default setting.
16650 @item -mcode-readable=pcrel
16651 MIPS16 PC-relative load instructions can access executable sections,
16652 but other instructions must not do so.  This option is useful on 4KSc
16653 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
16654 It is also useful on processors that can be configured to have a dual
16655 instruction/data SRAM interface and that, like the M4K, automatically
16656 redirect PC-relative loads to the instruction RAM.
16658 @item -mcode-readable=no
16659 Instructions must not access executable sections.  This option can be
16660 useful on targets that are configured to have a dual instruction/data
16661 SRAM interface but that (unlike the M4K) do not automatically redirect
16662 PC-relative loads to the instruction RAM.
16663 @end table
16665 @item -msplit-addresses
16666 @itemx -mno-split-addresses
16667 @opindex msplit-addresses
16668 @opindex mno-split-addresses
16669 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
16670 relocation operators.  This option has been superseded by
16671 @option{-mexplicit-relocs} but is retained for backwards compatibility.
16673 @item -mexplicit-relocs
16674 @itemx -mno-explicit-relocs
16675 @opindex mexplicit-relocs
16676 @opindex mno-explicit-relocs
16677 Use (do not use) assembler relocation operators when dealing with symbolic
16678 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
16679 is to use assembler macros instead.
16681 @option{-mexplicit-relocs} is the default if GCC was configured
16682 to use an assembler that supports relocation operators.
16684 @item -mcheck-zero-division
16685 @itemx -mno-check-zero-division
16686 @opindex mcheck-zero-division
16687 @opindex mno-check-zero-division
16688 Trap (do not trap) on integer division by zero.
16690 The default is @option{-mcheck-zero-division}.
16692 @item -mdivide-traps
16693 @itemx -mdivide-breaks
16694 @opindex mdivide-traps
16695 @opindex mdivide-breaks
16696 MIPS systems check for division by zero by generating either a
16697 conditional trap or a break instruction.  Using traps results in
16698 smaller code, but is only supported on MIPS II and later.  Also, some
16699 versions of the Linux kernel have a bug that prevents trap from
16700 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
16701 allow conditional traps on architectures that support them and
16702 @option{-mdivide-breaks} to force the use of breaks.
16704 The default is usually @option{-mdivide-traps}, but this can be
16705 overridden at configure time using @option{--with-divide=breaks}.
16706 Divide-by-zero checks can be completely disabled using
16707 @option{-mno-check-zero-division}.
16709 @item -mmemcpy
16710 @itemx -mno-memcpy
16711 @opindex mmemcpy
16712 @opindex mno-memcpy
16713 Force (do not force) the use of @code{memcpy()} for non-trivial block
16714 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
16715 most constant-sized copies.
16717 @item -mlong-calls
16718 @itemx -mno-long-calls
16719 @opindex mlong-calls
16720 @opindex mno-long-calls
16721 Disable (do not disable) use of the @code{jal} instruction.  Calling
16722 functions using @code{jal} is more efficient but requires the caller
16723 and callee to be in the same 256 megabyte segment.
16725 This option has no effect on abicalls code.  The default is
16726 @option{-mno-long-calls}.
16728 @item -mmad
16729 @itemx -mno-mad
16730 @opindex mmad
16731 @opindex mno-mad
16732 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
16733 instructions, as provided by the R4650 ISA@.
16735 @item -mimadd
16736 @itemx -mno-imadd
16737 @opindex mimadd
16738 @opindex mno-imadd
16739 Enable (disable) use of the @code{madd} and @code{msub} integer
16740 instructions.  The default is @option{-mimadd} on architectures
16741 that support @code{madd} and @code{msub} except for the 74k 
16742 architecture where it was found to generate slower code.
16744 @item -mfused-madd
16745 @itemx -mno-fused-madd
16746 @opindex mfused-madd
16747 @opindex mno-fused-madd
16748 Enable (disable) use of the floating-point multiply-accumulate
16749 instructions, when they are available.  The default is
16750 @option{-mfused-madd}.
16752 On the R8000 CPU when multiply-accumulate instructions are used,
16753 the intermediate product is calculated to infinite precision
16754 and is not subject to the FCSR Flush to Zero bit.  This may be
16755 undesirable in some circumstances.  On other processors the result
16756 is numerically identical to the equivalent computation using
16757 separate multiply, add, subtract and negate instructions.
16759 @item -nocpp
16760 @opindex nocpp
16761 Tell the MIPS assembler to not run its preprocessor over user
16762 assembler files (with a @samp{.s} suffix) when assembling them.
16764 @item -mfix-24k
16765 @item -mno-fix-24k
16766 @opindex mfix-24k
16767 @opindex mno-fix-24k
16768 Work around the 24K E48 (lost data on stores during refill) errata.
16769 The workarounds are implemented by the assembler rather than by GCC@.
16771 @item -mfix-r4000
16772 @itemx -mno-fix-r4000
16773 @opindex mfix-r4000
16774 @opindex mno-fix-r4000
16775 Work around certain R4000 CPU errata:
16776 @itemize @minus
16777 @item
16778 A double-word or a variable shift may give an incorrect result if executed
16779 immediately after starting an integer division.
16780 @item
16781 A double-word or a variable shift may give an incorrect result if executed
16782 while an integer multiplication is in progress.
16783 @item
16784 An integer division may give an incorrect result if started in a delay slot
16785 of a taken branch or a jump.
16786 @end itemize
16788 @item -mfix-r4400
16789 @itemx -mno-fix-r4400
16790 @opindex mfix-r4400
16791 @opindex mno-fix-r4400
16792 Work around certain R4400 CPU errata:
16793 @itemize @minus
16794 @item
16795 A double-word or a variable shift may give an incorrect result if executed
16796 immediately after starting an integer division.
16797 @end itemize
16799 @item -mfix-r10000
16800 @itemx -mno-fix-r10000
16801 @opindex mfix-r10000
16802 @opindex mno-fix-r10000
16803 Work around certain R10000 errata:
16804 @itemize @minus
16805 @item
16806 @code{ll}/@code{sc} sequences may not behave atomically on revisions
16807 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
16808 @end itemize
16810 This option can only be used if the target architecture supports
16811 branch-likely instructions.  @option{-mfix-r10000} is the default when
16812 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
16813 otherwise.
16815 @item -mfix-vr4120
16816 @itemx -mno-fix-vr4120
16817 @opindex mfix-vr4120
16818 Work around certain VR4120 errata:
16819 @itemize @minus
16820 @item
16821 @code{dmultu} does not always produce the correct result.
16822 @item
16823 @code{div} and @code{ddiv} do not always produce the correct result if one
16824 of the operands is negative.
16825 @end itemize
16826 The workarounds for the division errata rely on special functions in
16827 @file{libgcc.a}.  At present, these functions are only provided by
16828 the @code{mips64vr*-elf} configurations.
16830 Other VR4120 errata require a NOP to be inserted between certain pairs of
16831 instructions.  These errata are handled by the assembler, not by GCC itself.
16833 @item -mfix-vr4130
16834 @opindex mfix-vr4130
16835 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
16836 workarounds are implemented by the assembler rather than by GCC,
16837 although GCC avoids using @code{mflo} and @code{mfhi} if the
16838 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
16839 instructions are available instead.
16841 @item -mfix-sb1
16842 @itemx -mno-fix-sb1
16843 @opindex mfix-sb1
16844 Work around certain SB-1 CPU core errata.
16845 (This flag currently works around the SB-1 revision 2
16846 ``F1'' and ``F2'' floating-point errata.)
16848 @item -mr10k-cache-barrier=@var{setting}
16849 @opindex mr10k-cache-barrier
16850 Specify whether GCC should insert cache barriers to avoid the
16851 side-effects of speculation on R10K processors.
16853 In common with many processors, the R10K tries to predict the outcome
16854 of a conditional branch and speculatively executes instructions from
16855 the ``taken'' branch.  It later aborts these instructions if the
16856 predicted outcome is wrong.  However, on the R10K, even aborted
16857 instructions can have side effects.
16859 This problem only affects kernel stores and, depending on the system,
16860 kernel loads.  As an example, a speculatively-executed store may load
16861 the target memory into cache and mark the cache line as dirty, even if
16862 the store itself is later aborted.  If a DMA operation writes to the
16863 same area of memory before the ``dirty'' line is flushed, the cached
16864 data overwrites the DMA-ed data.  See the R10K processor manual
16865 for a full description, including other potential problems.
16867 One workaround is to insert cache barrier instructions before every memory
16868 access that might be speculatively executed and that might have side
16869 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
16870 controls GCC's implementation of this workaround.  It assumes that
16871 aborted accesses to any byte in the following regions does not have
16872 side effects:
16874 @enumerate
16875 @item
16876 the memory occupied by the current function's stack frame;
16878 @item
16879 the memory occupied by an incoming stack argument;
16881 @item
16882 the memory occupied by an object with a link-time-constant address.
16883 @end enumerate
16885 It is the kernel's responsibility to ensure that speculative
16886 accesses to these regions are indeed safe.
16888 If the input program contains a function declaration such as:
16890 @smallexample
16891 void foo (void);
16892 @end smallexample
16894 then the implementation of @code{foo} must allow @code{j foo} and
16895 @code{jal foo} to be executed speculatively.  GCC honors this
16896 restriction for functions it compiles itself.  It expects non-GCC
16897 functions (such as hand-written assembly code) to do the same.
16899 The option has three forms:
16901 @table @gcctabopt
16902 @item -mr10k-cache-barrier=load-store
16903 Insert a cache barrier before a load or store that might be
16904 speculatively executed and that might have side effects even
16905 if aborted.
16907 @item -mr10k-cache-barrier=store
16908 Insert a cache barrier before a store that might be speculatively
16909 executed and that might have side effects even if aborted.
16911 @item -mr10k-cache-barrier=none
16912 Disable the insertion of cache barriers.  This is the default setting.
16913 @end table
16915 @item -mflush-func=@var{func}
16916 @itemx -mno-flush-func
16917 @opindex mflush-func
16918 Specifies the function to call to flush the I and D caches, or to not
16919 call any such function.  If called, the function must take the same
16920 arguments as the common @code{_flush_func()}, that is, the address of the
16921 memory range for which the cache is being flushed, the size of the
16922 memory range, and the number 3 (to flush both caches).  The default
16923 depends on the target GCC was configured for, but commonly is either
16924 @samp{_flush_func} or @samp{__cpu_flush}.
16926 @item mbranch-cost=@var{num}
16927 @opindex mbranch-cost
16928 Set the cost of branches to roughly @var{num} ``simple'' instructions.
16929 This cost is only a heuristic and is not guaranteed to produce
16930 consistent results across releases.  A zero cost redundantly selects
16931 the default, which is based on the @option{-mtune} setting.
16933 @item -mbranch-likely
16934 @itemx -mno-branch-likely
16935 @opindex mbranch-likely
16936 @opindex mno-branch-likely
16937 Enable or disable use of Branch Likely instructions, regardless of the
16938 default for the selected architecture.  By default, Branch Likely
16939 instructions may be generated if they are supported by the selected
16940 architecture.  An exception is for the MIPS32 and MIPS64 architectures
16941 and processors that implement those architectures; for those, Branch
16942 Likely instructions are not be generated by default because the MIPS32
16943 and MIPS64 architectures specifically deprecate their use.
16945 @item -mfp-exceptions
16946 @itemx -mno-fp-exceptions
16947 @opindex mfp-exceptions
16948 Specifies whether FP exceptions are enabled.  This affects how
16949 FP instructions are scheduled for some processors.
16950 The default is that FP exceptions are
16951 enabled.
16953 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
16954 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
16955 FP pipe.
16957 @item -mvr4130-align
16958 @itemx -mno-vr4130-align
16959 @opindex mvr4130-align
16960 The VR4130 pipeline is two-way superscalar, but can only issue two
16961 instructions together if the first one is 8-byte aligned.  When this
16962 option is enabled, GCC aligns pairs of instructions that it
16963 thinks should execute in parallel.
16965 This option only has an effect when optimizing for the VR4130.
16966 It normally makes code faster, but at the expense of making it bigger.
16967 It is enabled by default at optimization level @option{-O3}.
16969 @item -msynci
16970 @itemx -mno-synci
16971 @opindex msynci
16972 Enable (disable) generation of @code{synci} instructions on
16973 architectures that support it.  The @code{synci} instructions (if
16974 enabled) are generated when @code{__builtin___clear_cache()} is
16975 compiled.
16977 This option defaults to @code{-mno-synci}, but the default can be
16978 overridden by configuring with @code{--with-synci}.
16980 When compiling code for single processor systems, it is generally safe
16981 to use @code{synci}.  However, on many multi-core (SMP) systems, it
16982 does not invalidate the instruction caches on all cores and may lead
16983 to undefined behavior.
16985 @item -mrelax-pic-calls
16986 @itemx -mno-relax-pic-calls
16987 @opindex mrelax-pic-calls
16988 Try to turn PIC calls that are normally dispatched via register
16989 @code{$25} into direct calls.  This is only possible if the linker can
16990 resolve the destination at link-time and if the destination is within
16991 range for a direct call.
16993 @option{-mrelax-pic-calls} is the default if GCC was configured to use
16994 an assembler and a linker that support the @code{.reloc} assembly
16995 directive and @code{-mexplicit-relocs} is in effect.  With
16996 @code{-mno-explicit-relocs}, this optimization can be performed by the
16997 assembler and the linker alone without help from the compiler.
16999 @item -mmcount-ra-address
17000 @itemx -mno-mcount-ra-address
17001 @opindex mmcount-ra-address
17002 @opindex mno-mcount-ra-address
17003 Emit (do not emit) code that allows @code{_mcount} to modify the
17004 calling function's return address.  When enabled, this option extends
17005 the usual @code{_mcount} interface with a new @var{ra-address}
17006 parameter, which has type @code{intptr_t *} and is passed in register
17007 @code{$12}.  @code{_mcount} can then modify the return address by
17008 doing both of the following:
17009 @itemize
17010 @item
17011 Returning the new address in register @code{$31}.
17012 @item
17013 Storing the new address in @code{*@var{ra-address}},
17014 if @var{ra-address} is nonnull.
17015 @end itemize
17017 The default is @option{-mno-mcount-ra-address}.
17019 @end table
17021 @node MMIX Options
17022 @subsection MMIX Options
17023 @cindex MMIX Options
17025 These options are defined for the MMIX:
17027 @table @gcctabopt
17028 @item -mlibfuncs
17029 @itemx -mno-libfuncs
17030 @opindex mlibfuncs
17031 @opindex mno-libfuncs
17032 Specify that intrinsic library functions are being compiled, passing all
17033 values in registers, no matter the size.
17035 @item -mepsilon
17036 @itemx -mno-epsilon
17037 @opindex mepsilon
17038 @opindex mno-epsilon
17039 Generate floating-point comparison instructions that compare with respect
17040 to the @code{rE} epsilon register.
17042 @item -mabi=mmixware
17043 @itemx -mabi=gnu
17044 @opindex mabi=mmixware
17045 @opindex mabi=gnu
17046 Generate code that passes function parameters and return values that (in
17047 the called function) are seen as registers @code{$0} and up, as opposed to
17048 the GNU ABI which uses global registers @code{$231} and up.
17050 @item -mzero-extend
17051 @itemx -mno-zero-extend
17052 @opindex mzero-extend
17053 @opindex mno-zero-extend
17054 When reading data from memory in sizes shorter than 64 bits, use (do not
17055 use) zero-extending load instructions by default, rather than
17056 sign-extending ones.
17058 @item -mknuthdiv
17059 @itemx -mno-knuthdiv
17060 @opindex mknuthdiv
17061 @opindex mno-knuthdiv
17062 Make the result of a division yielding a remainder have the same sign as
17063 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
17064 remainder follows the sign of the dividend.  Both methods are
17065 arithmetically valid, the latter being almost exclusively used.
17067 @item -mtoplevel-symbols
17068 @itemx -mno-toplevel-symbols
17069 @opindex mtoplevel-symbols
17070 @opindex mno-toplevel-symbols
17071 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
17072 code can be used with the @code{PREFIX} assembly directive.
17074 @item -melf
17075 @opindex melf
17076 Generate an executable in the ELF format, rather than the default
17077 @samp{mmo} format used by the @command{mmix} simulator.
17079 @item -mbranch-predict
17080 @itemx -mno-branch-predict
17081 @opindex mbranch-predict
17082 @opindex mno-branch-predict
17083 Use (do not use) the probable-branch instructions, when static branch
17084 prediction indicates a probable branch.
17086 @item -mbase-addresses
17087 @itemx -mno-base-addresses
17088 @opindex mbase-addresses
17089 @opindex mno-base-addresses
17090 Generate (do not generate) code that uses @emph{base addresses}.  Using a
17091 base address automatically generates a request (handled by the assembler
17092 and the linker) for a constant to be set up in a global register.  The
17093 register is used for one or more base address requests within the range 0
17094 to 255 from the value held in the register.  The generally leads to short
17095 and fast code, but the number of different data items that can be
17096 addressed is limited.  This means that a program that uses lots of static
17097 data may require @option{-mno-base-addresses}.
17099 @item -msingle-exit
17100 @itemx -mno-single-exit
17101 @opindex msingle-exit
17102 @opindex mno-single-exit
17103 Force (do not force) generated code to have a single exit point in each
17104 function.
17105 @end table
17107 @node MN10300 Options
17108 @subsection MN10300 Options
17109 @cindex MN10300 options
17111 These @option{-m} options are defined for Matsushita MN10300 architectures:
17113 @table @gcctabopt
17114 @item -mmult-bug
17115 @opindex mmult-bug
17116 Generate code to avoid bugs in the multiply instructions for the MN10300
17117 processors.  This is the default.
17119 @item -mno-mult-bug
17120 @opindex mno-mult-bug
17121 Do not generate code to avoid bugs in the multiply instructions for the
17122 MN10300 processors.
17124 @item -mam33
17125 @opindex mam33
17126 Generate code using features specific to the AM33 processor.
17128 @item -mno-am33
17129 @opindex mno-am33
17130 Do not generate code using features specific to the AM33 processor.  This
17131 is the default.
17133 @item -mam33-2
17134 @opindex mam33-2
17135 Generate code using features specific to the AM33/2.0 processor.
17137 @item -mam34
17138 @opindex mam34
17139 Generate code using features specific to the AM34 processor.
17141 @item -mtune=@var{cpu-type}
17142 @opindex mtune
17143 Use the timing characteristics of the indicated CPU type when
17144 scheduling instructions.  This does not change the targeted processor
17145 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
17146 @samp{am33-2} or @samp{am34}.
17148 @item -mreturn-pointer-on-d0
17149 @opindex mreturn-pointer-on-d0
17150 When generating a function that returns a pointer, return the pointer
17151 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
17152 only in @code{a0}, and attempts to call such functions without a prototype
17153 result in errors.  Note that this option is on by default; use
17154 @option{-mno-return-pointer-on-d0} to disable it.
17156 @item -mno-crt0
17157 @opindex mno-crt0
17158 Do not link in the C run-time initialization object file.
17160 @item -mrelax
17161 @opindex mrelax
17162 Indicate to the linker that it should perform a relaxation optimization pass
17163 to shorten branches, calls and absolute memory addresses.  This option only
17164 has an effect when used on the command line for the final link step.
17166 This option makes symbolic debugging impossible.
17168 @item -mliw
17169 @opindex mliw
17170 Allow the compiler to generate @emph{Long Instruction Word}
17171 instructions if the target is the @samp{AM33} or later.  This is the
17172 default.  This option defines the preprocessor macro @samp{__LIW__}.
17174 @item -mnoliw
17175 @opindex mnoliw
17176 Do not allow the compiler to generate @emph{Long Instruction Word}
17177 instructions.  This option defines the preprocessor macro
17178 @samp{__NO_LIW__}.
17180 @item -msetlb
17181 @opindex msetlb
17182 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
17183 instructions if the target is the @samp{AM33} or later.  This is the
17184 default.  This option defines the preprocessor macro @samp{__SETLB__}.
17186 @item -mnosetlb
17187 @opindex mnosetlb
17188 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
17189 instructions.  This option defines the preprocessor macro
17190 @samp{__NO_SETLB__}.
17192 @end table
17194 @node Moxie Options
17195 @subsection Moxie Options
17196 @cindex Moxie Options
17198 @table @gcctabopt
17200 @item -meb
17201 @opindex meb
17202 Generate big-endian code.  This is the default for @samp{moxie-*-*}
17203 configurations.
17205 @item -mel
17206 @opindex mel
17207 Generate little-endian code.
17209 @item -mno-crt0
17210 @opindex mno-crt0
17211 Do not link in the C run-time initialization object file.
17213 @end table
17215 @node PDP-11 Options
17216 @subsection PDP-11 Options
17217 @cindex PDP-11 Options
17219 These options are defined for the PDP-11:
17221 @table @gcctabopt
17222 @item -mfpu
17223 @opindex mfpu
17224 Use hardware FPP floating point.  This is the default.  (FIS floating
17225 point on the PDP-11/40 is not supported.)
17227 @item -msoft-float
17228 @opindex msoft-float
17229 Do not use hardware floating point.
17231 @item -mac0
17232 @opindex mac0
17233 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
17235 @item -mno-ac0
17236 @opindex mno-ac0
17237 Return floating-point results in memory.  This is the default.
17239 @item -m40
17240 @opindex m40
17241 Generate code for a PDP-11/40.
17243 @item -m45
17244 @opindex m45
17245 Generate code for a PDP-11/45.  This is the default.
17247 @item -m10
17248 @opindex m10
17249 Generate code for a PDP-11/10.
17251 @item -mbcopy-builtin
17252 @opindex mbcopy-builtin
17253 Use inline @code{movmemhi} patterns for copying memory.  This is the
17254 default.
17256 @item -mbcopy
17257 @opindex mbcopy
17258 Do not use inline @code{movmemhi} patterns for copying memory.
17260 @item -mint16
17261 @itemx -mno-int32
17262 @opindex mint16
17263 @opindex mno-int32
17264 Use 16-bit @code{int}.  This is the default.
17266 @item -mint32
17267 @itemx -mno-int16
17268 @opindex mint32
17269 @opindex mno-int16
17270 Use 32-bit @code{int}.
17272 @item -mfloat64
17273 @itemx -mno-float32
17274 @opindex mfloat64
17275 @opindex mno-float32
17276 Use 64-bit @code{float}.  This is the default.
17278 @item -mfloat32
17279 @itemx -mno-float64
17280 @opindex mfloat32
17281 @opindex mno-float64
17282 Use 32-bit @code{float}.
17284 @item -mabshi
17285 @opindex mabshi
17286 Use @code{abshi2} pattern.  This is the default.
17288 @item -mno-abshi
17289 @opindex mno-abshi
17290 Do not use @code{abshi2} pattern.
17292 @item -mbranch-expensive
17293 @opindex mbranch-expensive
17294 Pretend that branches are expensive.  This is for experimenting with
17295 code generation only.
17297 @item -mbranch-cheap
17298 @opindex mbranch-cheap
17299 Do not pretend that branches are expensive.  This is the default.
17301 @item -munix-asm
17302 @opindex munix-asm
17303 Use Unix assembler syntax.  This is the default when configured for
17304 @samp{pdp11-*-bsd}.
17306 @item -mdec-asm
17307 @opindex mdec-asm
17308 Use DEC assembler syntax.  This is the default when configured for any
17309 PDP-11 target other than @samp{pdp11-*-bsd}.
17310 @end table
17312 @node picoChip Options
17313 @subsection picoChip Options
17314 @cindex picoChip options
17316 These @samp{-m} options are defined for picoChip implementations:
17318 @table @gcctabopt
17320 @item -mae=@var{ae_type}
17321 @opindex mcpu
17322 Set the instruction set, register set, and instruction scheduling
17323 parameters for array element type @var{ae_type}.  Supported values
17324 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
17326 @option{-mae=ANY} selects a completely generic AE type.  Code
17327 generated with this option runs on any of the other AE types.  The
17328 code is not as efficient as it would be if compiled for a specific
17329 AE type, and some types of operation (e.g., multiplication) do not
17330 work properly on all types of AE.
17332 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
17333 for compiled code, and is the default.
17335 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
17336 option may suffer from poor performance of byte (char) manipulation,
17337 since the DSP AE does not provide hardware support for byte load/stores.
17339 @item -msymbol-as-address
17340 Enable the compiler to directly use a symbol name as an address in a
17341 load/store instruction, without first loading it into a
17342 register.  Typically, the use of this option generates larger
17343 programs, which run faster than when the option isn't used.  However, the
17344 results vary from program to program, so it is left as a user option,
17345 rather than being permanently enabled.
17347 @item -mno-inefficient-warnings
17348 Disables warnings about the generation of inefficient code.  These
17349 warnings can be generated, for example, when compiling code that
17350 performs byte-level memory operations on the MAC AE type.  The MAC AE has
17351 no hardware support for byte-level memory operations, so all byte
17352 load/stores must be synthesized from word load/store operations.  This is
17353 inefficient and a warning is generated to indicate
17354 that you should rewrite the code to avoid byte operations, or to target
17355 an AE type that has the necessary hardware support.  This option disables
17356 these warnings.
17358 @end table
17360 @node PowerPC Options
17361 @subsection PowerPC Options
17362 @cindex PowerPC options
17364 These are listed under @xref{RS/6000 and PowerPC Options}.
17366 @node RL78 Options
17367 @subsection RL78 Options
17368 @cindex RL78 Options
17370 @table @gcctabopt
17372 @item -msim
17373 @opindex msim
17374 Links in additional target libraries to support operation within a
17375 simulator.
17377 @item -mmul=none
17378 @itemx -mmul=g13
17379 @itemx -mmul=rl78
17380 @opindex mmul
17381 Specifies the type of hardware multiplication support to be used.  The
17382 default is @code{none}, which uses software multiplication functions.
17383 The @code{g13} option is for the hardware multiply/divide peripheral
17384 only on the RL78/G13 targets.  The @code{rl78} option is for the
17385 standard hardware multiplication defined in the RL78 software manual.
17387 @end table
17389 @node RS/6000 and PowerPC Options
17390 @subsection IBM RS/6000 and PowerPC Options
17391 @cindex RS/6000 and PowerPC Options
17392 @cindex IBM RS/6000 and PowerPC Options
17394 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
17395 @table @gcctabopt
17396 @item -mpowerpc-gpopt
17397 @itemx -mno-powerpc-gpopt
17398 @itemx -mpowerpc-gfxopt
17399 @itemx -mno-powerpc-gfxopt
17400 @need 800
17401 @itemx -mpowerpc64
17402 @itemx -mno-powerpc64
17403 @itemx -mmfcrf
17404 @itemx -mno-mfcrf
17405 @itemx -mpopcntb
17406 @itemx -mno-popcntb
17407 @itemx -mpopcntd
17408 @itemx -mno-popcntd
17409 @itemx -mfprnd
17410 @itemx -mno-fprnd
17411 @need 800
17412 @itemx -mcmpb
17413 @itemx -mno-cmpb
17414 @itemx -mmfpgpr
17415 @itemx -mno-mfpgpr
17416 @itemx -mhard-dfp
17417 @itemx -mno-hard-dfp
17418 @opindex mpowerpc-gpopt
17419 @opindex mno-powerpc-gpopt
17420 @opindex mpowerpc-gfxopt
17421 @opindex mno-powerpc-gfxopt
17422 @opindex mpowerpc64
17423 @opindex mno-powerpc64
17424 @opindex mmfcrf
17425 @opindex mno-mfcrf
17426 @opindex mpopcntb
17427 @opindex mno-popcntb
17428 @opindex mpopcntd
17429 @opindex mno-popcntd
17430 @opindex mfprnd
17431 @opindex mno-fprnd
17432 @opindex mcmpb
17433 @opindex mno-cmpb
17434 @opindex mmfpgpr
17435 @opindex mno-mfpgpr
17436 @opindex mhard-dfp
17437 @opindex mno-hard-dfp
17438 You use these options to specify which instructions are available on the
17439 processor you are using.  The default value of these options is
17440 determined when configuring GCC@.  Specifying the
17441 @option{-mcpu=@var{cpu_type}} overrides the specification of these
17442 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
17443 rather than the options listed above.
17445 Specifying @option{-mpowerpc-gpopt} allows
17446 GCC to use the optional PowerPC architecture instructions in the
17447 General Purpose group, including floating-point square root.  Specifying
17448 @option{-mpowerpc-gfxopt} allows GCC to
17449 use the optional PowerPC architecture instructions in the Graphics
17450 group, including floating-point select.
17452 The @option{-mmfcrf} option allows GCC to generate the move from
17453 condition register field instruction implemented on the POWER4
17454 processor and other processors that support the PowerPC V2.01
17455 architecture.
17456 The @option{-mpopcntb} option allows GCC to generate the popcount and
17457 double-precision FP reciprocal estimate instruction implemented on the
17458 POWER5 processor and other processors that support the PowerPC V2.02
17459 architecture.
17460 The @option{-mpopcntd} option allows GCC to generate the popcount
17461 instruction implemented on the POWER7 processor and other processors
17462 that support the PowerPC V2.06 architecture.
17463 The @option{-mfprnd} option allows GCC to generate the FP round to
17464 integer instructions implemented on the POWER5+ processor and other
17465 processors that support the PowerPC V2.03 architecture.
17466 The @option{-mcmpb} option allows GCC to generate the compare bytes
17467 instruction implemented on the POWER6 processor and other processors
17468 that support the PowerPC V2.05 architecture.
17469 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
17470 general-purpose register instructions implemented on the POWER6X
17471 processor and other processors that support the extended PowerPC V2.05
17472 architecture.
17473 The @option{-mhard-dfp} option allows GCC to generate the decimal
17474 floating-point instructions implemented on some POWER processors.
17476 The @option{-mpowerpc64} option allows GCC to generate the additional
17477 64-bit instructions that are found in the full PowerPC64 architecture
17478 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
17479 @option{-mno-powerpc64}.
17481 @item -mcpu=@var{cpu_type}
17482 @opindex mcpu
17483 Set architecture type, register usage, and
17484 instruction scheduling parameters for machine type @var{cpu_type}.
17485 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
17486 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
17487 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
17488 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
17489 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
17490 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
17491 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
17492 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
17493 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
17494 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
17495 @samp{powerpc64}, and @samp{rs64}.
17497 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
17498 PowerPC and 64-bit PowerPC architecture machine
17499 types, with an appropriate, generic processor model assumed for
17500 scheduling purposes.
17502 The other options specify a specific processor.  Code generated under
17503 those options runs best on that processor, and may not run at all on
17504 others.
17506 The @option{-mcpu} options automatically enable or disable the
17507 following options:
17509 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
17510 -mpopcntb -mpopcntd  -mpowerpc64 @gol
17511 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
17512 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
17513 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector -mquad-memory}
17515 The particular options set for any particular CPU varies between
17516 compiler versions, depending on what setting seems to produce optimal
17517 code for that CPU; it doesn't necessarily reflect the actual hardware's
17518 capabilities.  If you wish to set an individual option to a particular
17519 value, you may specify it after the @option{-mcpu} option, like
17520 @option{-mcpu=970 -mno-altivec}.
17522 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
17523 not enabled or disabled by the @option{-mcpu} option at present because
17524 AIX does not have full support for these options.  You may still
17525 enable or disable them individually if you're sure it'll work in your
17526 environment.
17528 @item -mtune=@var{cpu_type}
17529 @opindex mtune
17530 Set the instruction scheduling parameters for machine type
17531 @var{cpu_type}, but do not set the architecture type or register usage,
17532 as @option{-mcpu=@var{cpu_type}} does.  The same
17533 values for @var{cpu_type} are used for @option{-mtune} as for
17534 @option{-mcpu}.  If both are specified, the code generated uses the
17535 architecture and registers set by @option{-mcpu}, but the
17536 scheduling parameters set by @option{-mtune}.
17538 @item -mcmodel=small
17539 @opindex mcmodel=small
17540 Generate PowerPC64 code for the small model: The TOC is limited to
17541 64k.
17543 @item -mcmodel=medium
17544 @opindex mcmodel=medium
17545 Generate PowerPC64 code for the medium model: The TOC and other static
17546 data may be up to a total of 4G in size.
17548 @item -mcmodel=large
17549 @opindex mcmodel=large
17550 Generate PowerPC64 code for the large model: The TOC may be up to 4G
17551 in size.  Other data and code is only limited by the 64-bit address
17552 space.
17554 @item -maltivec
17555 @itemx -mno-altivec
17556 @opindex maltivec
17557 @opindex mno-altivec
17558 Generate code that uses (does not use) AltiVec instructions, and also
17559 enable the use of built-in functions that allow more direct access to
17560 the AltiVec instruction set.  You may also need to set
17561 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
17562 enhancements.
17564 @item -mvrsave
17565 @itemx -mno-vrsave
17566 @opindex mvrsave
17567 @opindex mno-vrsave
17568 Generate VRSAVE instructions when generating AltiVec code.
17570 @item -mgen-cell-microcode
17571 @opindex mgen-cell-microcode
17572 Generate Cell microcode instructions.
17574 @item -mwarn-cell-microcode
17575 @opindex mwarn-cell-microcode
17576 Warn when a Cell microcode instruction is emitted.  An example
17577 of a Cell microcode instruction is a variable shift.
17579 @item -msecure-plt
17580 @opindex msecure-plt
17581 Generate code that allows @command{ld} and @command{ld.so}
17582 to build executables and shared
17583 libraries with non-executable @code{.plt} and @code{.got} sections.
17584 This is a PowerPC
17585 32-bit SYSV ABI option.
17587 @item -mbss-plt
17588 @opindex mbss-plt
17589 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
17590 fills in, and
17591 requires @code{.plt} and @code{.got}
17592 sections that are both writable and executable.
17593 This is a PowerPC 32-bit SYSV ABI option.
17595 @item -misel
17596 @itemx -mno-isel
17597 @opindex misel
17598 @opindex mno-isel
17599 This switch enables or disables the generation of ISEL instructions.
17601 @item -misel=@var{yes/no}
17602 This switch has been deprecated.  Use @option{-misel} and
17603 @option{-mno-isel} instead.
17605 @item -mspe
17606 @itemx -mno-spe
17607 @opindex mspe
17608 @opindex mno-spe
17609 This switch enables or disables the generation of SPE simd
17610 instructions.
17612 @item -mpaired
17613 @itemx -mno-paired
17614 @opindex mpaired
17615 @opindex mno-paired
17616 This switch enables or disables the generation of PAIRED simd
17617 instructions.
17619 @item -mspe=@var{yes/no}
17620 This option has been deprecated.  Use @option{-mspe} and
17621 @option{-mno-spe} instead.
17623 @item -mvsx
17624 @itemx -mno-vsx
17625 @opindex mvsx
17626 @opindex mno-vsx
17627 Generate code that uses (does not use) vector/scalar (VSX)
17628 instructions, and also enable the use of built-in functions that allow
17629 more direct access to the VSX instruction set.
17631 @item -mcrypto
17632 @itemx -mno-crypto
17633 @opindex mcrypto
17634 @opindex mno-crypto
17635 Enable the use (disable) of the built-in functions that allow direct
17636 access to the cryptographic instructions that were added in version
17637 2.07 of the PowerPC ISA.
17639 @item -mdirect-move
17640 @itemx -mno-direct-move
17641 @opindex mdirect-move
17642 @opindex mno-direct-move
17643 Generate code that uses (does not use) the instructions to move data
17644 between the general purpose registers and the vector/scalar (VSX)
17645 registers that were added in version 2.07 of the PowerPC ISA.
17647 @item -mpower8-fusion
17648 @itemx -mno-power8-fusion
17649 @opindex mpower8-fusion
17650 @opindex mno-power8-fusion
17651 Generate code that keeps (does not keeps) some integer operations
17652 adjacent so that the instructions can be fused together on power8 and
17653 later processors.
17655 @item -mpower8-vector
17656 @itemx -mno-power8-vector
17657 @opindex mpower8-vector
17658 @opindex mno-power8-vector
17659 Generate code that uses (does not use) the vector and scalar
17660 instructions that were added in version 2.07 of the PowerPC ISA.  Also
17661 enable the use of built-in functions that allow more direct access to
17662 the vector instructions.
17664 @item -mquad-memory
17665 @itemx -mno-quad-memory
17666 @opindex mquad-memory
17667 @opindex mno-quad-memory
17668 Generate code that uses (does not use) the quad word memory
17669 instructions.  The @option{-mquad-memory} option requires use of
17670 64-bit mode.
17672 @item -mfloat-gprs=@var{yes/single/double/no}
17673 @itemx -mfloat-gprs
17674 @opindex mfloat-gprs
17675 This switch enables or disables the generation of floating-point
17676 operations on the general-purpose registers for architectures that
17677 support it.
17679 The argument @var{yes} or @var{single} enables the use of
17680 single-precision floating-point operations.
17682 The argument @var{double} enables the use of single and
17683 double-precision floating-point operations.
17685 The argument @var{no} disables floating-point operations on the
17686 general-purpose registers.
17688 This option is currently only available on the MPC854x.
17690 @item -m32
17691 @itemx -m64
17692 @opindex m32
17693 @opindex m64
17694 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
17695 targets (including GNU/Linux).  The 32-bit environment sets int, long
17696 and pointer to 32 bits and generates code that runs on any PowerPC
17697 variant.  The 64-bit environment sets int to 32 bits and long and
17698 pointer to 64 bits, and generates code for PowerPC64, as for
17699 @option{-mpowerpc64}.
17701 @item -mfull-toc
17702 @itemx -mno-fp-in-toc
17703 @itemx -mno-sum-in-toc
17704 @itemx -mminimal-toc
17705 @opindex mfull-toc
17706 @opindex mno-fp-in-toc
17707 @opindex mno-sum-in-toc
17708 @opindex mminimal-toc
17709 Modify generation of the TOC (Table Of Contents), which is created for
17710 every executable file.  The @option{-mfull-toc} option is selected by
17711 default.  In that case, GCC allocates at least one TOC entry for
17712 each unique non-automatic variable reference in your program.  GCC
17713 also places floating-point constants in the TOC@.  However, only
17714 16,384 entries are available in the TOC@.
17716 If you receive a linker error message that saying you have overflowed
17717 the available TOC space, you can reduce the amount of TOC space used
17718 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
17719 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
17720 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
17721 generate code to calculate the sum of an address and a constant at
17722 run time instead of putting that sum into the TOC@.  You may specify one
17723 or both of these options.  Each causes GCC to produce very slightly
17724 slower and larger code at the expense of conserving TOC space.
17726 If you still run out of space in the TOC even when you specify both of
17727 these options, specify @option{-mminimal-toc} instead.  This option causes
17728 GCC to make only one TOC entry for every file.  When you specify this
17729 option, GCC produces code that is slower and larger but which
17730 uses extremely little TOC space.  You may wish to use this option
17731 only on files that contain less frequently-executed code.
17733 @item -maix64
17734 @itemx -maix32
17735 @opindex maix64
17736 @opindex maix32
17737 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
17738 @code{long} type, and the infrastructure needed to support them.
17739 Specifying @option{-maix64} implies @option{-mpowerpc64},
17740 while @option{-maix32} disables the 64-bit ABI and
17741 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
17743 @item -mxl-compat
17744 @itemx -mno-xl-compat
17745 @opindex mxl-compat
17746 @opindex mno-xl-compat
17747 Produce code that conforms more closely to IBM XL compiler semantics
17748 when using AIX-compatible ABI@.  Pass floating-point arguments to
17749 prototyped functions beyond the register save area (RSA) on the stack
17750 in addition to argument FPRs.  Do not assume that most significant
17751 double in 128-bit long double value is properly rounded when comparing
17752 values and converting to double.  Use XL symbol names for long double
17753 support routines.
17755 The AIX calling convention was extended but not initially documented to
17756 handle an obscure K&R C case of calling a function that takes the
17757 address of its arguments with fewer arguments than declared.  IBM XL
17758 compilers access floating-point arguments that do not fit in the
17759 RSA from the stack when a subroutine is compiled without
17760 optimization.  Because always storing floating-point arguments on the
17761 stack is inefficient and rarely needed, this option is not enabled by
17762 default and only is necessary when calling subroutines compiled by IBM
17763 XL compilers without optimization.
17765 @item -mpe
17766 @opindex mpe
17767 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
17768 application written to use message passing with special startup code to
17769 enable the application to run.  The system must have PE installed in the
17770 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
17771 must be overridden with the @option{-specs=} option to specify the
17772 appropriate directory location.  The Parallel Environment does not
17773 support threads, so the @option{-mpe} option and the @option{-pthread}
17774 option are incompatible.
17776 @item -malign-natural
17777 @itemx -malign-power
17778 @opindex malign-natural
17779 @opindex malign-power
17780 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
17781 @option{-malign-natural} overrides the ABI-defined alignment of larger
17782 types, such as floating-point doubles, on their natural size-based boundary.
17783 The option @option{-malign-power} instructs GCC to follow the ABI-specified
17784 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
17786 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
17787 is not supported.
17789 @item -msoft-float
17790 @itemx -mhard-float
17791 @opindex msoft-float
17792 @opindex mhard-float
17793 Generate code that does not use (uses) the floating-point register set.
17794 Software floating-point emulation is provided if you use the
17795 @option{-msoft-float} option, and pass the option to GCC when linking.
17797 @item -msingle-float
17798 @itemx -mdouble-float
17799 @opindex msingle-float
17800 @opindex mdouble-float
17801 Generate code for single- or double-precision floating-point operations.
17802 @option{-mdouble-float} implies @option{-msingle-float}.
17804 @item -msimple-fpu
17805 @opindex msimple-fpu
17806 Do not generate @code{sqrt} and @code{div} instructions for hardware
17807 floating-point unit.
17809 @item -mfpu=@var{name}
17810 @opindex mfpu
17811 Specify type of floating-point unit.  Valid values for @var{name} are
17812 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
17813 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
17814 @samp{sp_full} (equivalent to @option{-msingle-float}),
17815 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
17817 @item -mxilinx-fpu
17818 @opindex mxilinx-fpu
17819 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
17821 @item -mmultiple
17822 @itemx -mno-multiple
17823 @opindex mmultiple
17824 @opindex mno-multiple
17825 Generate code that uses (does not use) the load multiple word
17826 instructions and the store multiple word instructions.  These
17827 instructions are generated by default on POWER systems, and not
17828 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
17829 PowerPC systems, since those instructions do not work when the
17830 processor is in little-endian mode.  The exceptions are PPC740 and
17831 PPC750 which permit these instructions in little-endian mode.
17833 @item -mstring
17834 @itemx -mno-string
17835 @opindex mstring
17836 @opindex mno-string
17837 Generate code that uses (does not use) the load string instructions
17838 and the store string word instructions to save multiple registers and
17839 do small block moves.  These instructions are generated by default on
17840 POWER systems, and not generated on PowerPC systems.  Do not use
17841 @option{-mstring} on little-endian PowerPC systems, since those
17842 instructions do not work when the processor is in little-endian mode.
17843 The exceptions are PPC740 and PPC750 which permit these instructions
17844 in little-endian mode.
17846 @item -mupdate
17847 @itemx -mno-update
17848 @opindex mupdate
17849 @opindex mno-update
17850 Generate code that uses (does not use) the load or store instructions
17851 that update the base register to the address of the calculated memory
17852 location.  These instructions are generated by default.  If you use
17853 @option{-mno-update}, there is a small window between the time that the
17854 stack pointer is updated and the address of the previous frame is
17855 stored, which means code that walks the stack frame across interrupts or
17856 signals may get corrupted data.
17858 @item -mavoid-indexed-addresses
17859 @itemx -mno-avoid-indexed-addresses
17860 @opindex mavoid-indexed-addresses
17861 @opindex mno-avoid-indexed-addresses
17862 Generate code that tries to avoid (not avoid) the use of indexed load
17863 or store instructions. These instructions can incur a performance
17864 penalty on Power6 processors in certain situations, such as when
17865 stepping through large arrays that cross a 16M boundary.  This option
17866 is enabled by default when targeting Power6 and disabled otherwise.
17868 @item -mfused-madd
17869 @itemx -mno-fused-madd
17870 @opindex mfused-madd
17871 @opindex mno-fused-madd
17872 Generate code that uses (does not use) the floating-point multiply and
17873 accumulate instructions.  These instructions are generated by default
17874 if hardware floating point is used.  The machine-dependent
17875 @option{-mfused-madd} option is now mapped to the machine-independent
17876 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
17877 mapped to @option{-ffp-contract=off}.
17879 @item -mmulhw
17880 @itemx -mno-mulhw
17881 @opindex mmulhw
17882 @opindex mno-mulhw
17883 Generate code that uses (does not use) the half-word multiply and
17884 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
17885 These instructions are generated by default when targeting those
17886 processors.
17888 @item -mdlmzb
17889 @itemx -mno-dlmzb
17890 @opindex mdlmzb
17891 @opindex mno-dlmzb
17892 Generate code that uses (does not use) the string-search @samp{dlmzb}
17893 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
17894 generated by default when targeting those processors.
17896 @item -mno-bit-align
17897 @itemx -mbit-align
17898 @opindex mno-bit-align
17899 @opindex mbit-align
17900 On System V.4 and embedded PowerPC systems do not (do) force structures
17901 and unions that contain bit-fields to be aligned to the base type of the
17902 bit-field.
17904 For example, by default a structure containing nothing but 8
17905 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
17906 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
17907 the structure is aligned to a 1-byte boundary and is 1 byte in
17908 size.
17910 @item -mno-strict-align
17911 @itemx -mstrict-align
17912 @opindex mno-strict-align
17913 @opindex mstrict-align
17914 On System V.4 and embedded PowerPC systems do not (do) assume that
17915 unaligned memory references are handled by the system.
17917 @item -mrelocatable
17918 @itemx -mno-relocatable
17919 @opindex mrelocatable
17920 @opindex mno-relocatable
17921 Generate code that allows (does not allow) a static executable to be
17922 relocated to a different address at run time.  A simple embedded
17923 PowerPC system loader should relocate the entire contents of
17924 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
17925 a table of 32-bit addresses generated by this option.  For this to
17926 work, all objects linked together must be compiled with
17927 @option{-mrelocatable} or @option{-mrelocatable-lib}.
17928 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
17930 @item -mrelocatable-lib
17931 @itemx -mno-relocatable-lib
17932 @opindex mrelocatable-lib
17933 @opindex mno-relocatable-lib
17934 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
17935 @code{.fixup} section to allow static executables to be relocated at
17936 run time, but @option{-mrelocatable-lib} does not use the smaller stack
17937 alignment of @option{-mrelocatable}.  Objects compiled with
17938 @option{-mrelocatable-lib} may be linked with objects compiled with
17939 any combination of the @option{-mrelocatable} options.
17941 @item -mno-toc
17942 @itemx -mtoc
17943 @opindex mno-toc
17944 @opindex mtoc
17945 On System V.4 and embedded PowerPC systems do not (do) assume that
17946 register 2 contains a pointer to a global area pointing to the addresses
17947 used in the program.
17949 @item -mlittle
17950 @itemx -mlittle-endian
17951 @opindex mlittle
17952 @opindex mlittle-endian
17953 On System V.4 and embedded PowerPC systems compile code for the
17954 processor in little-endian mode.  The @option{-mlittle-endian} option is
17955 the same as @option{-mlittle}.
17957 @item -mbig
17958 @itemx -mbig-endian
17959 @opindex mbig
17960 @opindex mbig-endian
17961 On System V.4 and embedded PowerPC systems compile code for the
17962 processor in big-endian mode.  The @option{-mbig-endian} option is
17963 the same as @option{-mbig}.
17965 @item -mdynamic-no-pic
17966 @opindex mdynamic-no-pic
17967 On Darwin and Mac OS X systems, compile code so that it is not
17968 relocatable, but that its external references are relocatable.  The
17969 resulting code is suitable for applications, but not shared
17970 libraries.
17972 @item -msingle-pic-base
17973 @opindex msingle-pic-base
17974 Treat the register used for PIC addressing as read-only, rather than
17975 loading it in the prologue for each function.  The runtime system is
17976 responsible for initializing this register with an appropriate value
17977 before execution begins.
17979 @item -mprioritize-restricted-insns=@var{priority}
17980 @opindex mprioritize-restricted-insns
17981 This option controls the priority that is assigned to
17982 dispatch-slot restricted instructions during the second scheduling
17983 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
17984 or @samp{2} to assign no, highest, or second-highest (respectively) 
17985 priority to dispatch-slot restricted
17986 instructions.
17988 @item -msched-costly-dep=@var{dependence_type}
17989 @opindex msched-costly-dep
17990 This option controls which dependences are considered costly
17991 by the target during instruction scheduling.  The argument
17992 @var{dependence_type} takes one of the following values:
17994 @table @asis
17995 @item @samp{no}
17996 No dependence is costly.
17998 @item @samp{all}
17999 All dependences are costly.
18001 @item @samp{true_store_to_load}
18002 A true dependence from store to load is costly.
18004 @item @samp{store_to_load}
18005 Any dependence from store to load is costly.
18007 @item @var{number}
18008 Any dependence for which the latency is greater than or equal to 
18009 @var{number} is costly.
18010 @end table
18012 @item -minsert-sched-nops=@var{scheme}
18013 @opindex minsert-sched-nops
18014 This option controls which NOP insertion scheme is used during
18015 the second scheduling pass.  The argument @var{scheme} takes one of the
18016 following values:
18018 @table @asis
18019 @item @samp{no}
18020 Don't insert NOPs.
18022 @item @samp{pad}
18023 Pad with NOPs any dispatch group that has vacant issue slots,
18024 according to the scheduler's grouping.
18026 @item @samp{regroup_exact}
18027 Insert NOPs to force costly dependent insns into
18028 separate groups.  Insert exactly as many NOPs as needed to force an insn
18029 to a new group, according to the estimated processor grouping.
18031 @item @var{number}
18032 Insert NOPs to force costly dependent insns into
18033 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
18034 @end table
18036 @item -mcall-sysv
18037 @opindex mcall-sysv
18038 On System V.4 and embedded PowerPC systems compile code using calling
18039 conventions that adhere to the March 1995 draft of the System V
18040 Application Binary Interface, PowerPC processor supplement.  This is the
18041 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
18043 @item -mcall-sysv-eabi
18044 @itemx -mcall-eabi
18045 @opindex mcall-sysv-eabi
18046 @opindex mcall-eabi
18047 Specify both @option{-mcall-sysv} and @option{-meabi} options.
18049 @item -mcall-sysv-noeabi
18050 @opindex mcall-sysv-noeabi
18051 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
18053 @item -mcall-aixdesc
18054 @opindex m
18055 On System V.4 and embedded PowerPC systems compile code for the AIX
18056 operating system.
18058 @item -mcall-linux
18059 @opindex mcall-linux
18060 On System V.4 and embedded PowerPC systems compile code for the
18061 Linux-based GNU system.
18063 @item -mcall-freebsd
18064 @opindex mcall-freebsd
18065 On System V.4 and embedded PowerPC systems compile code for the
18066 FreeBSD operating system.
18068 @item -mcall-netbsd
18069 @opindex mcall-netbsd
18070 On System V.4 and embedded PowerPC systems compile code for the
18071 NetBSD operating system.
18073 @item -mcall-openbsd
18074 @opindex mcall-netbsd
18075 On System V.4 and embedded PowerPC systems compile code for the
18076 OpenBSD operating system.
18078 @item -maix-struct-return
18079 @opindex maix-struct-return
18080 Return all structures in memory (as specified by the AIX ABI)@.
18082 @item -msvr4-struct-return
18083 @opindex msvr4-struct-return
18084 Return structures smaller than 8 bytes in registers (as specified by the
18085 SVR4 ABI)@.
18087 @item -mabi=@var{abi-type}
18088 @opindex mabi
18089 Extend the current ABI with a particular extension, or remove such extension.
18090 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
18091 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
18093 @item -mabi=spe
18094 @opindex mabi=spe
18095 Extend the current ABI with SPE ABI extensions.  This does not change
18096 the default ABI, instead it adds the SPE ABI extensions to the current
18097 ABI@.
18099 @item -mabi=no-spe
18100 @opindex mabi=no-spe
18101 Disable Book-E SPE ABI extensions for the current ABI@.
18103 @item -mabi=ibmlongdouble
18104 @opindex mabi=ibmlongdouble
18105 Change the current ABI to use IBM extended-precision long double.
18106 This is a PowerPC 32-bit SYSV ABI option.
18108 @item -mabi=ieeelongdouble
18109 @opindex mabi=ieeelongdouble
18110 Change the current ABI to use IEEE extended-precision long double.
18111 This is a PowerPC 32-bit Linux ABI option.
18113 @item -mprototype
18114 @itemx -mno-prototype
18115 @opindex mprototype
18116 @opindex mno-prototype
18117 On System V.4 and embedded PowerPC systems assume that all calls to
18118 variable argument functions are properly prototyped.  Otherwise, the
18119 compiler must insert an instruction before every non-prototyped call to
18120 set or clear bit 6 of the condition code register (@var{CR}) to
18121 indicate whether floating-point values are passed in the floating-point
18122 registers in case the function takes variable arguments.  With
18123 @option{-mprototype}, only calls to prototyped variable argument functions
18124 set or clear the bit.
18126 @item -msim
18127 @opindex msim
18128 On embedded PowerPC systems, assume that the startup module is called
18129 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
18130 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
18131 configurations.
18133 @item -mmvme
18134 @opindex mmvme
18135 On embedded PowerPC systems, assume that the startup module is called
18136 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
18137 @file{libc.a}.
18139 @item -mads
18140 @opindex mads
18141 On embedded PowerPC systems, assume that the startup module is called
18142 @file{crt0.o} and the standard C libraries are @file{libads.a} and
18143 @file{libc.a}.
18145 @item -myellowknife
18146 @opindex myellowknife
18147 On embedded PowerPC systems, assume that the startup module is called
18148 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
18149 @file{libc.a}.
18151 @item -mvxworks
18152 @opindex mvxworks
18153 On System V.4 and embedded PowerPC systems, specify that you are
18154 compiling for a VxWorks system.
18156 @item -memb
18157 @opindex memb
18158 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
18159 header to indicate that @samp{eabi} extended relocations are used.
18161 @item -meabi
18162 @itemx -mno-eabi
18163 @opindex meabi
18164 @opindex mno-eabi
18165 On System V.4 and embedded PowerPC systems do (do not) adhere to the
18166 Embedded Applications Binary Interface (EABI), which is a set of
18167 modifications to the System V.4 specifications.  Selecting @option{-meabi}
18168 means that the stack is aligned to an 8-byte boundary, a function
18169 @code{__eabi} is called from @code{main} to set up the EABI
18170 environment, and the @option{-msdata} option can use both @code{r2} and
18171 @code{r13} to point to two separate small data areas.  Selecting
18172 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
18173 no EABI initialization function is called from @code{main}, and the
18174 @option{-msdata} option only uses @code{r13} to point to a single
18175 small data area.  The @option{-meabi} option is on by default if you
18176 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
18178 @item -msdata=eabi
18179 @opindex msdata=eabi
18180 On System V.4 and embedded PowerPC systems, put small initialized
18181 @code{const} global and static data in the @samp{.sdata2} section, which
18182 is pointed to by register @code{r2}.  Put small initialized
18183 non-@code{const} global and static data in the @samp{.sdata} section,
18184 which is pointed to by register @code{r13}.  Put small uninitialized
18185 global and static data in the @samp{.sbss} section, which is adjacent to
18186 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
18187 incompatible with the @option{-mrelocatable} option.  The
18188 @option{-msdata=eabi} option also sets the @option{-memb} option.
18190 @item -msdata=sysv
18191 @opindex msdata=sysv
18192 On System V.4 and embedded PowerPC systems, put small global and static
18193 data in the @samp{.sdata} section, which is pointed to by register
18194 @code{r13}.  Put small uninitialized global and static data in the
18195 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
18196 The @option{-msdata=sysv} option is incompatible with the
18197 @option{-mrelocatable} option.
18199 @item -msdata=default
18200 @itemx -msdata
18201 @opindex msdata=default
18202 @opindex msdata
18203 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
18204 compile code the same as @option{-msdata=eabi}, otherwise compile code the
18205 same as @option{-msdata=sysv}.
18207 @item -msdata=data
18208 @opindex msdata=data
18209 On System V.4 and embedded PowerPC systems, put small global
18210 data in the @samp{.sdata} section.  Put small uninitialized global
18211 data in the @samp{.sbss} section.  Do not use register @code{r13}
18212 to address small data however.  This is the default behavior unless
18213 other @option{-msdata} options are used.
18215 @item -msdata=none
18216 @itemx -mno-sdata
18217 @opindex msdata=none
18218 @opindex mno-sdata
18219 On embedded PowerPC systems, put all initialized global and static data
18220 in the @samp{.data} section, and all uninitialized data in the
18221 @samp{.bss} section.
18223 @item -mblock-move-inline-limit=@var{num}
18224 @opindex mblock-move-inline-limit
18225 Inline all block moves (such as calls to @code{memcpy} or structure
18226 copies) less than or equal to @var{num} bytes.  The minimum value for
18227 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
18228 targets.  The default value is target-specific.
18230 @item -G @var{num}
18231 @opindex G
18232 @cindex smaller data references (PowerPC)
18233 @cindex .sdata/.sdata2 references (PowerPC)
18234 On embedded PowerPC systems, put global and static items less than or
18235 equal to @var{num} bytes into the small data or BSS sections instead of
18236 the normal data or BSS section.  By default, @var{num} is 8.  The
18237 @option{-G @var{num}} switch is also passed to the linker.
18238 All modules should be compiled with the same @option{-G @var{num}} value.
18240 @item -mregnames
18241 @itemx -mno-regnames
18242 @opindex mregnames
18243 @opindex mno-regnames
18244 On System V.4 and embedded PowerPC systems do (do not) emit register
18245 names in the assembly language output using symbolic forms.
18247 @item -mlongcall
18248 @itemx -mno-longcall
18249 @opindex mlongcall
18250 @opindex mno-longcall
18251 By default assume that all calls are far away so that a longer and more
18252 expensive calling sequence is required.  This is required for calls
18253 farther than 32 megabytes (33,554,432 bytes) from the current location.
18254 A short call is generated if the compiler knows
18255 the call cannot be that far away.  This setting can be overridden by
18256 the @code{shortcall} function attribute, or by @code{#pragma
18257 longcall(0)}.
18259 Some linkers are capable of detecting out-of-range calls and generating
18260 glue code on the fly.  On these systems, long calls are unnecessary and
18261 generate slower code.  As of this writing, the AIX linker can do this,
18262 as can the GNU linker for PowerPC/64.  It is planned to add this feature
18263 to the GNU linker for 32-bit PowerPC systems as well.
18265 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
18266 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
18267 addresses represent the callee and the branch island.  The
18268 Darwin/PPC linker prefers the first address and generates a @code{bl
18269 callee} if the PPC @code{bl} instruction reaches the callee directly;
18270 otherwise, the linker generates @code{bl L42} to call the branch
18271 island.  The branch island is appended to the body of the
18272 calling function; it computes the full 32-bit address of the callee
18273 and jumps to it.
18275 On Mach-O (Darwin) systems, this option directs the compiler emit to
18276 the glue for every direct call, and the Darwin linker decides whether
18277 to use or discard it.
18279 In the future, GCC may ignore all longcall specifications
18280 when the linker is known to generate glue.
18282 @item -mtls-markers
18283 @itemx -mno-tls-markers
18284 @opindex mtls-markers
18285 @opindex mno-tls-markers
18286 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
18287 specifying the function argument.  The relocation allows the linker to
18288 reliably associate function call with argument setup instructions for
18289 TLS optimization, which in turn allows GCC to better schedule the
18290 sequence.
18292 @item -pthread
18293 @opindex pthread
18294 Adds support for multithreading with the @dfn{pthreads} library.
18295 This option sets flags for both the preprocessor and linker.
18297 @item -mrecip
18298 @itemx -mno-recip
18299 @opindex mrecip
18300 This option enables use of the reciprocal estimate and
18301 reciprocal square root estimate instructions with additional
18302 Newton-Raphson steps to increase precision instead of doing a divide or
18303 square root and divide for floating-point arguments.  You should use
18304 the @option{-ffast-math} option when using @option{-mrecip} (or at
18305 least @option{-funsafe-math-optimizations},
18306 @option{-finite-math-only}, @option{-freciprocal-math} and
18307 @option{-fno-trapping-math}).  Note that while the throughput of the
18308 sequence is generally higher than the throughput of the non-reciprocal
18309 instruction, the precision of the sequence can be decreased by up to 2
18310 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
18311 roots.
18313 @item -mrecip=@var{opt}
18314 @opindex mrecip=opt
18315 This option controls which reciprocal estimate instructions
18316 may be used.  @var{opt} is a comma-separated list of options, which may
18317 be preceded by a @code{!} to invert the option:
18318 @code{all}: enable all estimate instructions,
18319 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
18320 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
18321 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
18322 @code{divf}: enable the single-precision reciprocal approximation instructions;
18323 @code{divd}: enable the double-precision reciprocal approximation instructions;
18324 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
18325 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
18326 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
18328 So, for example, @option{-mrecip=all,!rsqrtd} enables
18329 all of the reciprocal estimate instructions, except for the
18330 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
18331 which handle the double-precision reciprocal square root calculations.
18333 @item -mrecip-precision
18334 @itemx -mno-recip-precision
18335 @opindex mrecip-precision
18336 Assume (do not assume) that the reciprocal estimate instructions
18337 provide higher-precision estimates than is mandated by the PowerPC
18338 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
18339 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
18340 The double-precision square root estimate instructions are not generated by
18341 default on low-precision machines, since they do not provide an
18342 estimate that converges after three steps.
18344 @item -mveclibabi=@var{type}
18345 @opindex mveclibabi
18346 Specifies the ABI type to use for vectorizing intrinsics using an
18347 external library.  The only type supported at present is @code{mass},
18348 which specifies to use IBM's Mathematical Acceleration Subsystem
18349 (MASS) libraries for vectorizing intrinsics using external libraries.
18350 GCC currently emits calls to @code{acosd2}, @code{acosf4},
18351 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
18352 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
18353 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
18354 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
18355 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
18356 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
18357 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
18358 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
18359 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
18360 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
18361 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
18362 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
18363 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
18364 for power7.  Both @option{-ftree-vectorize} and
18365 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
18366 libraries must be specified at link time.
18368 @item -mfriz
18369 @itemx -mno-friz
18370 @opindex mfriz
18371 Generate (do not generate) the @code{friz} instruction when the
18372 @option{-funsafe-math-optimizations} option is used to optimize
18373 rounding of floating-point values to 64-bit integer and back to floating
18374 point.  The @code{friz} instruction does not return the same value if
18375 the floating-point number is too large to fit in an integer.
18377 @item -mpointers-to-nested-functions
18378 @itemx -mno-pointers-to-nested-functions
18379 @opindex mpointers-to-nested-functions
18380 Generate (do not generate) code to load up the static chain register
18381 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
18382 systems where a function pointer points to a 3-word descriptor giving
18383 the function address, TOC value to be loaded in register @var{r2}, and
18384 static chain value to be loaded in register @var{r11}.  The
18385 @option{-mpointers-to-nested-functions} is on by default.  You cannot
18386 call through pointers to nested functions or pointers
18387 to functions compiled in other languages that use the static chain if
18388 you use the @option{-mno-pointers-to-nested-functions}.
18390 @item -msave-toc-indirect
18391 @itemx -mno-save-toc-indirect
18392 @opindex msave-toc-indirect
18393 Generate (do not generate) code to save the TOC value in the reserved
18394 stack location in the function prologue if the function calls through
18395 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
18396 saved in the prologue, it is saved just before the call through the
18397 pointer.  The @option{-mno-save-toc-indirect} option is the default.
18398 @end table
18400 @node RX Options
18401 @subsection RX Options
18402 @cindex RX Options
18404 These command-line options are defined for RX targets:
18406 @table @gcctabopt
18407 @item -m64bit-doubles
18408 @itemx -m32bit-doubles
18409 @opindex m64bit-doubles
18410 @opindex m32bit-doubles
18411 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
18412 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
18413 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
18414 works on 32-bit values, which is why the default is
18415 @option{-m32bit-doubles}.
18417 @item -fpu
18418 @itemx -nofpu
18419 @opindex fpu
18420 @opindex nofpu
18421 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
18422 floating-point hardware.  The default is enabled for the @var{RX600}
18423 series and disabled for the @var{RX200} series.
18425 Floating-point instructions are only generated for 32-bit floating-point 
18426 values, however, so the FPU hardware is not used for doubles if the
18427 @option{-m64bit-doubles} option is used.
18429 @emph{Note} If the @option{-fpu} option is enabled then
18430 @option{-funsafe-math-optimizations} is also enabled automatically.
18431 This is because the RX FPU instructions are themselves unsafe.
18433 @item -mcpu=@var{name}
18434 @opindex -mcpu
18435 Selects the type of RX CPU to be targeted.  Currently three types are
18436 supported, the generic @var{RX600} and @var{RX200} series hardware and
18437 the specific @var{RX610} CPU.  The default is @var{RX600}.
18439 The only difference between @var{RX600} and @var{RX610} is that the
18440 @var{RX610} does not support the @code{MVTIPL} instruction.
18442 The @var{RX200} series does not have a hardware floating-point unit
18443 and so @option{-nofpu} is enabled by default when this type is
18444 selected.
18446 @item -mbig-endian-data
18447 @itemx -mlittle-endian-data
18448 @opindex mbig-endian-data
18449 @opindex mlittle-endian-data
18450 Store data (but not code) in the big-endian format.  The default is
18451 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
18452 format.
18454 @item -msmall-data-limit=@var{N}
18455 @opindex msmall-data-limit
18456 Specifies the maximum size in bytes of global and static variables
18457 which can be placed into the small data area.  Using the small data
18458 area can lead to smaller and faster code, but the size of area is
18459 limited and it is up to the programmer to ensure that the area does
18460 not overflow.  Also when the small data area is used one of the RX's
18461 registers (usually @code{r13}) is reserved for use pointing to this
18462 area, so it is no longer available for use by the compiler.  This
18463 could result in slower and/or larger code if variables are pushed onto
18464 the stack instead of being held in this register.
18466 Note, common variables (variables that have not been initialized) and
18467 constants are not placed into the small data area as they are assigned
18468 to other sections in the output executable.
18470 The default value is zero, which disables this feature.  Note, this
18471 feature is not enabled by default with higher optimization levels
18472 (@option{-O2} etc) because of the potentially detrimental effects of
18473 reserving a register.  It is up to the programmer to experiment and
18474 discover whether this feature is of benefit to their program.  See the
18475 description of the @option{-mpid} option for a description of how the
18476 actual register to hold the small data area pointer is chosen.
18478 @item -msim
18479 @itemx -mno-sim
18480 @opindex msim
18481 @opindex mno-sim
18482 Use the simulator runtime.  The default is to use the libgloss
18483 board-specific runtime.
18485 @item -mas100-syntax
18486 @itemx -mno-as100-syntax
18487 @opindex mas100-syntax
18488 @opindex mno-as100-syntax
18489 When generating assembler output use a syntax that is compatible with
18490 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
18491 assembler, but it has some restrictions so it is not generated by default.
18493 @item -mmax-constant-size=@var{N}
18494 @opindex mmax-constant-size
18495 Specifies the maximum size, in bytes, of a constant that can be used as
18496 an operand in a RX instruction.  Although the RX instruction set does
18497 allow constants of up to 4 bytes in length to be used in instructions,
18498 a longer value equates to a longer instruction.  Thus in some
18499 circumstances it can be beneficial to restrict the size of constants
18500 that are used in instructions.  Constants that are too big are instead
18501 placed into a constant pool and referenced via register indirection.
18503 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
18504 or 4 means that constants of any size are allowed.
18506 @item -mrelax
18507 @opindex mrelax
18508 Enable linker relaxation.  Linker relaxation is a process whereby the
18509 linker attempts to reduce the size of a program by finding shorter
18510 versions of various instructions.  Disabled by default.
18512 @item -mint-register=@var{N}
18513 @opindex mint-register
18514 Specify the number of registers to reserve for fast interrupt handler
18515 functions.  The value @var{N} can be between 0 and 4.  A value of 1
18516 means that register @code{r13} is reserved for the exclusive use
18517 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
18518 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
18519 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
18520 A value of 0, the default, does not reserve any registers.
18522 @item -msave-acc-in-interrupts
18523 @opindex msave-acc-in-interrupts
18524 Specifies that interrupt handler functions should preserve the
18525 accumulator register.  This is only necessary if normal code might use
18526 the accumulator register, for example because it performs 64-bit
18527 multiplications.  The default is to ignore the accumulator as this
18528 makes the interrupt handlers faster.
18530 @item -mpid
18531 @itemx -mno-pid
18532 @opindex mpid
18533 @opindex mno-pid
18534 Enables the generation of position independent data.  When enabled any
18535 access to constant data is done via an offset from a base address
18536 held in a register.  This allows the location of constant data to be
18537 determined at run time without requiring the executable to be
18538 relocated, which is a benefit to embedded applications with tight
18539 memory constraints.  Data that can be modified is not affected by this
18540 option.
18542 Note, using this feature reserves a register, usually @code{r13}, for
18543 the constant data base address.  This can result in slower and/or
18544 larger code, especially in complicated functions.
18546 The actual register chosen to hold the constant data base address
18547 depends upon whether the @option{-msmall-data-limit} and/or the
18548 @option{-mint-register} command-line options are enabled.  Starting
18549 with register @code{r13} and proceeding downwards, registers are
18550 allocated first to satisfy the requirements of @option{-mint-register},
18551 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
18552 is possible for the small data area register to be @code{r8} if both
18553 @option{-mint-register=4} and @option{-mpid} are specified on the
18554 command line.
18556 By default this feature is not enabled.  The default can be restored
18557 via the @option{-mno-pid} command-line option.
18559 @item -mno-warn-multiple-fast-interrupts
18560 @itemx -mwarn-multiple-fast-interrupts
18561 @opindex mno-warn-multiple-fast-interrupts
18562 @opindex mwarn-multiple-fast-interrupts
18563 Prevents GCC from issuing a warning message if it finds more than one
18564 fast interrupt handler when it is compiling a file.  The default is to
18565 issue a warning for each extra fast interrupt handler found, as the RX
18566 only supports one such interrupt.
18568 @end table
18570 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
18571 has special significance to the RX port when used with the
18572 @code{interrupt} function attribute.  This attribute indicates a
18573 function intended to process fast interrupts.  GCC ensures
18574 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
18575 and/or @code{r13} and only provided that the normal use of the
18576 corresponding registers have been restricted via the
18577 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
18578 options.
18580 @node S/390 and zSeries Options
18581 @subsection S/390 and zSeries Options
18582 @cindex S/390 and zSeries Options
18584 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
18586 @table @gcctabopt
18587 @item -mhard-float
18588 @itemx -msoft-float
18589 @opindex mhard-float
18590 @opindex msoft-float
18591 Use (do not use) the hardware floating-point instructions and registers
18592 for floating-point operations.  When @option{-msoft-float} is specified,
18593 functions in @file{libgcc.a} are used to perform floating-point
18594 operations.  When @option{-mhard-float} is specified, the compiler
18595 generates IEEE floating-point instructions.  This is the default.
18597 @item -mhard-dfp
18598 @itemx -mno-hard-dfp
18599 @opindex mhard-dfp
18600 @opindex mno-hard-dfp
18601 Use (do not use) the hardware decimal-floating-point instructions for
18602 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
18603 specified, functions in @file{libgcc.a} are used to perform
18604 decimal-floating-point operations.  When @option{-mhard-dfp} is
18605 specified, the compiler generates decimal-floating-point hardware
18606 instructions.  This is the default for @option{-march=z9-ec} or higher.
18608 @item -mlong-double-64
18609 @itemx -mlong-double-128
18610 @opindex mlong-double-64
18611 @opindex mlong-double-128
18612 These switches control the size of @code{long double} type. A size
18613 of 64 bits makes the @code{long double} type equivalent to the @code{double}
18614 type. This is the default.
18616 @item -mbackchain
18617 @itemx -mno-backchain
18618 @opindex mbackchain
18619 @opindex mno-backchain
18620 Store (do not store) the address of the caller's frame as backchain pointer
18621 into the callee's stack frame.
18622 A backchain may be needed to allow debugging using tools that do not understand
18623 DWARF 2 call frame information.
18624 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
18625 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
18626 the backchain is placed into the topmost word of the 96/160 byte register
18627 save area.
18629 In general, code compiled with @option{-mbackchain} is call-compatible with
18630 code compiled with @option{-mmo-backchain}; however, use of the backchain
18631 for debugging purposes usually requires that the whole binary is built with
18632 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
18633 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18634 to build a linux kernel use @option{-msoft-float}.
18636 The default is to not maintain the backchain.
18638 @item -mpacked-stack
18639 @itemx -mno-packed-stack
18640 @opindex mpacked-stack
18641 @opindex mno-packed-stack
18642 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
18643 specified, the compiler uses the all fields of the 96/160 byte register save
18644 area only for their default purpose; unused fields still take up stack space.
18645 When @option{-mpacked-stack} is specified, register save slots are densely
18646 packed at the top of the register save area; unused space is reused for other
18647 purposes, allowing for more efficient use of the available stack space.
18648 However, when @option{-mbackchain} is also in effect, the topmost word of
18649 the save area is always used to store the backchain, and the return address
18650 register is always saved two words below the backchain.
18652 As long as the stack frame backchain is not used, code generated with
18653 @option{-mpacked-stack} is call-compatible with code generated with
18654 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
18655 S/390 or zSeries generated code that uses the stack frame backchain at run
18656 time, not just for debugging purposes.  Such code is not call-compatible
18657 with code compiled with @option{-mpacked-stack}.  Also, note that the
18658 combination of @option{-mbackchain},
18659 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18660 to build a linux kernel use @option{-msoft-float}.
18662 The default is to not use the packed stack layout.
18664 @item -msmall-exec
18665 @itemx -mno-small-exec
18666 @opindex msmall-exec
18667 @opindex mno-small-exec
18668 Generate (or do not generate) code using the @code{bras} instruction
18669 to do subroutine calls.
18670 This only works reliably if the total executable size does not
18671 exceed 64k.  The default is to use the @code{basr} instruction instead,
18672 which does not have this limitation.
18674 @item -m64
18675 @itemx -m31
18676 @opindex m64
18677 @opindex m31
18678 When @option{-m31} is specified, generate code compliant to the
18679 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
18680 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
18681 particular to generate 64-bit instructions.  For the @samp{s390}
18682 targets, the default is @option{-m31}, while the @samp{s390x}
18683 targets default to @option{-m64}.
18685 @item -mzarch
18686 @itemx -mesa
18687 @opindex mzarch
18688 @opindex mesa
18689 When @option{-mzarch} is specified, generate code using the
18690 instructions available on z/Architecture.
18691 When @option{-mesa} is specified, generate code using the
18692 instructions available on ESA/390.  Note that @option{-mesa} is
18693 not possible with @option{-m64}.
18694 When generating code compliant to the GNU/Linux for S/390 ABI,
18695 the default is @option{-mesa}.  When generating code compliant
18696 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
18698 @item -mmvcle
18699 @itemx -mno-mvcle
18700 @opindex mmvcle
18701 @opindex mno-mvcle
18702 Generate (or do not generate) code using the @code{mvcle} instruction
18703 to perform block moves.  When @option{-mno-mvcle} is specified,
18704 use a @code{mvc} loop instead.  This is the default unless optimizing for
18705 size.
18707 @item -mdebug
18708 @itemx -mno-debug
18709 @opindex mdebug
18710 @opindex mno-debug
18711 Print (or do not print) additional debug information when compiling.
18712 The default is to not print debug information.
18714 @item -march=@var{cpu-type}
18715 @opindex march
18716 Generate code that runs on @var{cpu-type}, which is the name of a system
18717 representing a certain processor type.  Possible values for
18718 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
18719 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
18720 When generating code using the instructions available on z/Architecture,
18721 the default is @option{-march=z900}.  Otherwise, the default is
18722 @option{-march=g5}.
18724 @item -mtune=@var{cpu-type}
18725 @opindex mtune
18726 Tune to @var{cpu-type} everything applicable about the generated code,
18727 except for the ABI and the set of available instructions.
18728 The list of @var{cpu-type} values is the same as for @option{-march}.
18729 The default is the value used for @option{-march}.
18731 @item -mtpf-trace
18732 @itemx -mno-tpf-trace
18733 @opindex mtpf-trace
18734 @opindex mno-tpf-trace
18735 Generate code that adds (does not add) in TPF OS specific branches to trace
18736 routines in the operating system.  This option is off by default, even
18737 when compiling for the TPF OS@.
18739 @item -mfused-madd
18740 @itemx -mno-fused-madd
18741 @opindex mfused-madd
18742 @opindex mno-fused-madd
18743 Generate code that uses (does not use) the floating-point multiply and
18744 accumulate instructions.  These instructions are generated by default if
18745 hardware floating point is used.
18747 @item -mwarn-framesize=@var{framesize}
18748 @opindex mwarn-framesize
18749 Emit a warning if the current function exceeds the given frame size.  Because
18750 this is a compile-time check it doesn't need to be a real problem when the program
18751 runs.  It is intended to identify functions that most probably cause
18752 a stack overflow.  It is useful to be used in an environment with limited stack
18753 size e.g.@: the linux kernel.
18755 @item -mwarn-dynamicstack
18756 @opindex mwarn-dynamicstack
18757 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
18758 arrays.  This is generally a bad idea with a limited stack size.
18760 @item -mstack-guard=@var{stack-guard}
18761 @itemx -mstack-size=@var{stack-size}
18762 @opindex mstack-guard
18763 @opindex mstack-size
18764 If these options are provided the S/390 back end emits additional instructions in
18765 the function prologue that trigger a trap if the stack size is @var{stack-guard}
18766 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
18767 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
18768 the frame size of the compiled function is chosen.
18769 These options are intended to be used to help debugging stack overflow problems.
18770 The additionally emitted code causes only little overhead and hence can also be
18771 used in production-like systems without greater performance degradation.  The given
18772 values have to be exact powers of 2 and @var{stack-size} has to be greater than
18773 @var{stack-guard} without exceeding 64k.
18774 In order to be efficient the extra code makes the assumption that the stack starts
18775 at an address aligned to the value given by @var{stack-size}.
18776 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
18777 @end table
18779 @node Score Options
18780 @subsection Score Options
18781 @cindex Score Options
18783 These options are defined for Score implementations:
18785 @table @gcctabopt
18786 @item -meb
18787 @opindex meb
18788 Compile code for big-endian mode.  This is the default.
18790 @item -mel
18791 @opindex mel
18792 Compile code for little-endian mode.
18794 @item -mnhwloop
18795 @opindex mnhwloop
18796 Disable generation of @code{bcnz} instructions.
18798 @item -muls
18799 @opindex muls
18800 Enable generation of unaligned load and store instructions.
18802 @item -mmac
18803 @opindex mmac
18804 Enable the use of multiply-accumulate instructions. Disabled by default.
18806 @item -mscore5
18807 @opindex mscore5
18808 Specify the SCORE5 as the target architecture.
18810 @item -mscore5u
18811 @opindex mscore5u
18812 Specify the SCORE5U of the target architecture.
18814 @item -mscore7
18815 @opindex mscore7
18816 Specify the SCORE7 as the target architecture. This is the default.
18818 @item -mscore7d
18819 @opindex mscore7d
18820 Specify the SCORE7D as the target architecture.
18821 @end table
18823 @node SH Options
18824 @subsection SH Options
18826 These @samp{-m} options are defined for the SH implementations:
18828 @table @gcctabopt
18829 @item -m1
18830 @opindex m1
18831 Generate code for the SH1.
18833 @item -m2
18834 @opindex m2
18835 Generate code for the SH2.
18837 @item -m2e
18838 Generate code for the SH2e.
18840 @item -m2a-nofpu
18841 @opindex m2a-nofpu
18842 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
18843 that the floating-point unit is not used.
18845 @item -m2a-single-only
18846 @opindex m2a-single-only
18847 Generate code for the SH2a-FPU, in such a way that no double-precision
18848 floating-point operations are used.
18850 @item -m2a-single
18851 @opindex m2a-single
18852 Generate code for the SH2a-FPU assuming the floating-point unit is in
18853 single-precision mode by default.
18855 @item -m2a
18856 @opindex m2a
18857 Generate code for the SH2a-FPU assuming the floating-point unit is in
18858 double-precision mode by default.
18860 @item -m3
18861 @opindex m3
18862 Generate code for the SH3.
18864 @item -m3e
18865 @opindex m3e
18866 Generate code for the SH3e.
18868 @item -m4-nofpu
18869 @opindex m4-nofpu
18870 Generate code for the SH4 without a floating-point unit.
18872 @item -m4-single-only
18873 @opindex m4-single-only
18874 Generate code for the SH4 with a floating-point unit that only
18875 supports single-precision arithmetic.
18877 @item -m4-single
18878 @opindex m4-single
18879 Generate code for the SH4 assuming the floating-point unit is in
18880 single-precision mode by default.
18882 @item -m4
18883 @opindex m4
18884 Generate code for the SH4.
18886 @item -m4a-nofpu
18887 @opindex m4a-nofpu
18888 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
18889 floating-point unit is not used.
18891 @item -m4a-single-only
18892 @opindex m4a-single-only
18893 Generate code for the SH4a, in such a way that no double-precision
18894 floating-point operations are used.
18896 @item -m4a-single
18897 @opindex m4a-single
18898 Generate code for the SH4a assuming the floating-point unit is in
18899 single-precision mode by default.
18901 @item -m4a
18902 @opindex m4a
18903 Generate code for the SH4a.
18905 @item -m4al
18906 @opindex m4al
18907 Same as @option{-m4a-nofpu}, except that it implicitly passes
18908 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
18909 instructions at the moment.
18911 @item -mb
18912 @opindex mb
18913 Compile code for the processor in big-endian mode.
18915 @item -ml
18916 @opindex ml
18917 Compile code for the processor in little-endian mode.
18919 @item -mdalign
18920 @opindex mdalign
18921 Align doubles at 64-bit boundaries.  Note that this changes the calling
18922 conventions, and thus some functions from the standard C library do
18923 not work unless you recompile it first with @option{-mdalign}.
18925 @item -mrelax
18926 @opindex mrelax
18927 Shorten some address references at link time, when possible; uses the
18928 linker option @option{-relax}.
18930 @item -mbigtable
18931 @opindex mbigtable
18932 Use 32-bit offsets in @code{switch} tables.  The default is to use
18933 16-bit offsets.
18935 @item -mbitops
18936 @opindex mbitops
18937 Enable the use of bit manipulation instructions on SH2A.
18939 @item -mfmovd
18940 @opindex mfmovd
18941 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
18942 alignment constraints.
18944 @item -mhitachi
18945 @opindex mhitachi
18946 Comply with the calling conventions defined by Renesas.
18948 @item -mrenesas
18949 @opindex mhitachi
18950 Comply with the calling conventions defined by Renesas.
18952 @item -mno-renesas
18953 @opindex mhitachi
18954 Comply with the calling conventions defined for GCC before the Renesas
18955 conventions were available.  This option is the default for all
18956 targets of the SH toolchain.
18958 @item -mnomacsave
18959 @opindex mnomacsave
18960 Mark the @code{MAC} register as call-clobbered, even if
18961 @option{-mhitachi} is given.
18963 @item -mieee
18964 @itemx -mno-ieee
18965 @opindex mieee
18966 @opindex mnoieee
18967 Control the IEEE compliance of floating-point comparisons, which affects the
18968 handling of cases where the result of a comparison is unordered.  By default
18969 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
18970 enabled @option{-mno-ieee} is implicitly set, which results in faster
18971 floating-point greater-equal and less-equal comparisons.  The implcit settings
18972 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
18974 @item -minline-ic_invalidate
18975 @opindex minline-ic_invalidate
18976 Inline code to invalidate instruction cache entries after setting up
18977 nested function trampolines.
18978 This option has no effect if @option{-musermode} is in effect and the selected
18979 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
18980 instruction.
18981 If the selected code generation option does not allow the use of the @code{icbi}
18982 instruction, and @option{-musermode} is not in effect, the inlined code
18983 manipulates the instruction cache address array directly with an associative
18984 write.  This not only requires privileged mode at run time, but it also
18985 fails if the cache line had been mapped via the TLB and has become unmapped.
18987 @item -misize
18988 @opindex misize
18989 Dump instruction size and location in the assembly code.
18991 @item -mpadstruct
18992 @opindex mpadstruct
18993 This option is deprecated.  It pads structures to multiple of 4 bytes,
18994 which is incompatible with the SH ABI@.
18996 @item -matomic-model=@var{model}
18997 @opindex matomic-model=@var{model}
18998 Sets the model of atomic operations and additional parameters as a comma
18999 separated list.  For details on the atomic built-in functions see
19000 @ref{__atomic Builtins}.  The following models and parameters are supported:
19002 @table @samp
19004 @item none
19005 Disable compiler generated atomic sequences and emit library calls for atomic
19006 operations.  This is the default if the target is not @code{sh-*-linux*}.
19008 @item soft-gusa
19009 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
19010 built-in functions.  The generated atomic sequences require additional support
19011 from the interrupt/exception handling code of the system and are only suitable
19012 for SH3* and SH4* single-core systems.  This option is enabled by default when
19013 the target is @code{sh-*-linux*} and SH3* or SH4*.  When the target is SH4A,
19014 this option will also partially utilize the hardware atomic instructions
19015 @code{movli.l} and @code{movco.l} to create more efficient code, unless
19016 @samp{strict} is specified.  
19018 @item soft-tcb
19019 Generate software atomic sequences that use a variable in the thread control
19020 block.  This is a variation of the gUSA sequences which can also be used on
19021 SH1* and SH2* targets.  The generated atomic sequences require additional
19022 support from the interrupt/exception handling code of the system and are only
19023 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
19024 parameter has to be specified as well.
19026 @item soft-imask
19027 Generate software atomic sequences that temporarily disable interrupts by
19028 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
19029 in privileged mode and is only suitable for single-core systems.  Additional
19030 support from the interrupt/exception handling code of the system is not
19031 required.  This model is enabled by default when the target is
19032 @code{sh-*-linux*} and SH1* or SH2*.
19034 @item hard-llcs
19035 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
19036 instructions only.  This is only available on SH4A and is suitable for
19037 multi-core systems.  Since the hardware instructions support only 32 bit atomic
19038 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
19039 Code compiled with this option will also be compatible with other software
19040 atomic model interrupt/exception handling systems if executed on an SH4A
19041 system.  Additional support from the interrupt/exception handling code of the
19042 system is not required for this model.
19044 @item gbr-offset=
19045 This parameter specifies the offset in bytes of the variable in the thread
19046 control block structure that should be used by the generated atomic sequences
19047 when the @samp{soft-tcb} model has been selected.  For other models this
19048 parameter is ignored.  The specified value must be an integer multiple of four
19049 and in the range 0-1020.
19051 @item strict
19052 This parameter prevents mixed usage of multiple atomic models, even though they
19053 would be compatible, and will make the compiler generate atomic sequences of the
19054 specified model only.
19056 @end table
19058 @item -mtas
19059 @opindex mtas
19060 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
19061 Notice that depending on the particular hardware and software configuration
19062 this can degrade overall performance due to the operand cache line flushes
19063 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
19064 processors the @code{tas.b} instruction must be used with caution since it
19065 can result in data corruption for certain cache configurations.
19067 @item -mspace
19068 @opindex mspace
19069 Optimize for space instead of speed.  Implied by @option{-Os}.
19071 @item -mprefergot
19072 @opindex mprefergot
19073 When generating position-independent code, emit function calls using
19074 the Global Offset Table instead of the Procedure Linkage Table.
19076 @item -musermode
19077 @opindex musermode
19078 Don't generate privileged mode only code.  This option
19079 implies @option{-mno-inline-ic_invalidate}
19080 if the inlined code would not work in user mode.
19081 This is the default when the target is @code{sh-*-linux*}.
19083 @item -multcost=@var{number}
19084 @opindex multcost=@var{number}
19085 Set the cost to assume for a multiply insn.
19087 @item -mdiv=@var{strategy}
19088 @opindex mdiv=@var{strategy}
19089 Set the division strategy to be used for integer division operations.
19090 For SHmedia @var{strategy} can be one of: 
19092 @table @samp
19094 @item fp 
19095 Performs the operation in floating point.  This has a very high latency,
19096 but needs only a few instructions, so it might be a good choice if
19097 your code has enough easily-exploitable ILP to allow the compiler to
19098 schedule the floating-point instructions together with other instructions.
19099 Division by zero causes a floating-point exception.
19101 @item inv
19102 Uses integer operations to calculate the inverse of the divisor,
19103 and then multiplies the dividend with the inverse.  This strategy allows
19104 CSE and hoisting of the inverse calculation.  Division by zero calculates
19105 an unspecified result, but does not trap.
19107 @item inv:minlat
19108 A variant of @samp{inv} where, if no CSE or hoisting opportunities
19109 have been found, or if the entire operation has been hoisted to the same
19110 place, the last stages of the inverse calculation are intertwined with the
19111 final multiply to reduce the overall latency, at the expense of using a few
19112 more instructions, and thus offering fewer scheduling opportunities with
19113 other code.
19115 @item call
19116 Calls a library function that usually implements the @samp{inv:minlat}
19117 strategy.
19118 This gives high code density for @code{m5-*media-nofpu} compilations.
19120 @item call2
19121 Uses a different entry point of the same library function, where it
19122 assumes that a pointer to a lookup table has already been set up, which
19123 exposes the pointer load to CSE and code hoisting optimizations.
19125 @item inv:call
19126 @itemx inv:call2
19127 @itemx inv:fp
19128 Use the @samp{inv} algorithm for initial
19129 code generation, but if the code stays unoptimized, revert to the @samp{call},
19130 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
19131 potentially-trapping side effect of division by zero is carried by a
19132 separate instruction, so it is possible that all the integer instructions
19133 are hoisted out, but the marker for the side effect stays where it is.
19134 A recombination to floating-point operations or a call is not possible
19135 in that case.
19137 @item inv20u
19138 @itemx inv20l
19139 Variants of the @samp{inv:minlat} strategy.  In the case
19140 that the inverse calculation is not separated from the multiply, they speed
19141 up division where the dividend fits into 20 bits (plus sign where applicable)
19142 by inserting a test to skip a number of operations in this case; this test
19143 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
19144 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
19146 @end table
19148 For targets other than SHmedia @var{strategy} can be one of:
19150 @table @samp
19152 @item call-div1
19153 Calls a library function that uses the single-step division instruction
19154 @code{div1} to perform the operation.  Division by zero calculates an
19155 unspecified result and does not trap.  This is the default except for SH4,
19156 SH2A and SHcompact.
19158 @item call-fp
19159 Calls a library function that performs the operation in double precision
19160 floating point.  Division by zero causes a floating-point exception.  This is
19161 the default for SHcompact with FPU.  Specifying this for targets that do not
19162 have a double precision FPU will default to @code{call-div1}.
19164 @item call-table
19165 Calls a library function that uses a lookup table for small divisors and
19166 the @code{div1} instruction with case distinction for larger divisors.  Division
19167 by zero calculates an unspecified result and does not trap.  This is the default
19168 for SH4.  Specifying this for targets that do not have dynamic shift
19169 instructions will default to @code{call-div1}.
19171 @end table
19173 When a division strategy has not been specified the default strategy will be
19174 selected based on the current target.  For SH2A the default strategy is to
19175 use the @code{divs} and @code{divu} instructions instead of library function
19176 calls.
19178 @item -maccumulate-outgoing-args
19179 @opindex maccumulate-outgoing-args
19180 Reserve space once for outgoing arguments in the function prologue rather
19181 than around each call.  Generally beneficial for performance and size.  Also
19182 needed for unwinding to avoid changing the stack frame around conditional code.
19184 @item -mdivsi3_libfunc=@var{name}
19185 @opindex mdivsi3_libfunc=@var{name}
19186 Set the name of the library function used for 32-bit signed division to
19187 @var{name}.
19188 This only affects the name used in the @samp{call} and @samp{inv:call}
19189 division strategies, and the compiler still expects the same
19190 sets of input/output/clobbered registers as if this option were not present.
19192 @item -mfixed-range=@var{register-range}
19193 @opindex mfixed-range
19194 Generate code treating the given register range as fixed registers.
19195 A fixed register is one that the register allocator can not use.  This is
19196 useful when compiling kernel code.  A register range is specified as
19197 two registers separated by a dash.  Multiple register ranges can be
19198 specified separated by a comma.
19200 @item -mindexed-addressing
19201 @opindex mindexed-addressing
19202 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
19203 This is only safe if the hardware and/or OS implement 32-bit wrap-around
19204 semantics for the indexed addressing mode.  The architecture allows the
19205 implementation of processors with 64-bit MMU, which the OS could use to
19206 get 32-bit addressing, but since no current hardware implementation supports
19207 this or any other way to make the indexed addressing mode safe to use in
19208 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
19210 @item -mgettrcost=@var{number}
19211 @opindex mgettrcost=@var{number}
19212 Set the cost assumed for the @code{gettr} instruction to @var{number}.
19213 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
19215 @item -mpt-fixed
19216 @opindex mpt-fixed
19217 Assume @code{pt*} instructions won't trap.  This generally generates
19218 better-scheduled code, but is unsafe on current hardware.
19219 The current architecture
19220 definition says that @code{ptabs} and @code{ptrel} trap when the target 
19221 anded with 3 is 3.
19222 This has the unintentional effect of making it unsafe to schedule these
19223 instructions before a branch, or hoist them out of a loop.  For example,
19224 @code{__do_global_ctors}, a part of @file{libgcc}
19225 that runs constructors at program
19226 startup, calls functions in a list which is delimited by @minus{}1.  With the
19227 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
19228 That means that all the constructors run a bit more quickly, but when
19229 the loop comes to the end of the list, the program crashes because @code{ptabs}
19230 loads @minus{}1 into a target register.  
19232 Since this option is unsafe for any
19233 hardware implementing the current architecture specification, the default
19234 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
19235 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
19236 this deters register allocation from using target registers for storing
19237 ordinary integers.
19239 @item -minvalid-symbols
19240 @opindex minvalid-symbols
19241 Assume symbols might be invalid.  Ordinary function symbols generated by
19242 the compiler are always valid to load with
19243 @code{movi}/@code{shori}/@code{ptabs} or
19244 @code{movi}/@code{shori}/@code{ptrel},
19245 but with assembler and/or linker tricks it is possible
19246 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
19247 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
19248 It prevents cross-basic-block CSE, hoisting and most scheduling
19249 of symbol loads.  The default is @option{-mno-invalid-symbols}.
19251 @item -mbranch-cost=@var{num}
19252 @opindex mbranch-cost=@var{num}
19253 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
19254 make the compiler try to generate more branch-free code if possible.  
19255 If not specified the value is selected depending on the processor type that
19256 is being compiled for.
19258 @item -mzdcbranch
19259 @itemx -mno-zdcbranch
19260 @opindex mzdcbranch
19261 @opindex mno-zdcbranch
19262 Assume (do not assume) that zero displacement conditional branch instructions
19263 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
19264 compiler will try to prefer zero displacement branch code sequences.  This is
19265 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
19266 disabled by specifying @option{-mno-zdcbranch}.
19268 @item -mcbranchdi
19269 @opindex mcbranchdi
19270 Enable the @code{cbranchdi4} instruction pattern.
19272 @item -mcmpeqdi
19273 @opindex mcmpeqdi
19274 Emit the @code{cmpeqdi_t} instruction pattern even when @option{-mcbranchdi}
19275 is in effect.
19277 @item -mfused-madd
19278 @itemx -mno-fused-madd
19279 @opindex mfused-madd
19280 @opindex mno-fused-madd
19281 Generate code that uses (does not use) the floating-point multiply and
19282 accumulate instructions.  These instructions are generated by default
19283 if hardware floating point is used.  The machine-dependent
19284 @option{-mfused-madd} option is now mapped to the machine-independent
19285 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
19286 mapped to @option{-ffp-contract=off}.
19288 @item -mfsca
19289 @itemx -mno-fsca
19290 @opindex mfsca
19291 @opindex mno-fsca
19292 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
19293 and cosine approximations.  The option @code{-mfsca} must be used in
19294 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
19295 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
19296 approximations even if @code{-funsafe-math-optimizations} is in effect.
19298 @item -mfsrra
19299 @itemx -mno-fsrra
19300 @opindex mfsrra
19301 @opindex mno-fsrra
19302 Allow or disallow the compiler to emit the @code{fsrra} instruction for
19303 reciprocal square root approximations.  The option @code{-mfsrra} must be used
19304 in combination with @code{-funsafe-math-optimizations} and
19305 @code{-ffinite-math-only}.  It is enabled by default when generating code for
19306 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
19307 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
19308 in effect.
19310 @item -mpretend-cmove
19311 @opindex mpretend-cmove
19312 Prefer zero-displacement conditional branches for conditional move instruction
19313 patterns.  This can result in faster code on the SH4 processor.
19315 @end table
19317 @node Solaris 2 Options
19318 @subsection Solaris 2 Options
19319 @cindex Solaris 2 options
19321 These @samp{-m} options are supported on Solaris 2:
19323 @table @gcctabopt
19324 @item -mimpure-text
19325 @opindex mimpure-text
19326 @option{-mimpure-text}, used in addition to @option{-shared}, tells
19327 the compiler to not pass @option{-z text} to the linker when linking a
19328 shared object.  Using this option, you can link position-dependent
19329 code into a shared object.
19331 @option{-mimpure-text} suppresses the ``relocations remain against
19332 allocatable but non-writable sections'' linker error message.
19333 However, the necessary relocations trigger copy-on-write, and the
19334 shared object is not actually shared across processes.  Instead of
19335 using @option{-mimpure-text}, you should compile all source code with
19336 @option{-fpic} or @option{-fPIC}.
19338 @end table
19340 These switches are supported in addition to the above on Solaris 2:
19342 @table @gcctabopt
19343 @item -pthreads
19344 @opindex pthreads
19345 Add support for multithreading using the POSIX threads library.  This
19346 option sets flags for both the preprocessor and linker.  This option does
19347 not affect the thread safety of object code produced  by the compiler or
19348 that of libraries supplied with it.
19350 @item -pthread
19351 @opindex pthread
19352 This is a synonym for @option{-pthreads}.
19353 @end table
19355 @node SPARC Options
19356 @subsection SPARC Options
19357 @cindex SPARC options
19359 These @samp{-m} options are supported on the SPARC:
19361 @table @gcctabopt
19362 @item -mno-app-regs
19363 @itemx -mapp-regs
19364 @opindex mno-app-regs
19365 @opindex mapp-regs
19366 Specify @option{-mapp-regs} to generate output using the global registers
19367 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
19368 is the default.
19370 To be fully SVR4 ABI-compliant at the cost of some performance loss,
19371 specify @option{-mno-app-regs}.  You should compile libraries and system
19372 software with this option.
19374 @item -mflat
19375 @itemx -mno-flat
19376 @opindex mflat
19377 @opindex mno-flat
19378 With @option{-mflat}, the compiler does not generate save/restore instructions
19379 and uses a ``flat'' or single register window model.  This model is compatible
19380 with the regular register window model.  The local registers and the input
19381 registers (0--5) are still treated as ``call-saved'' registers and are
19382 saved on the stack as needed.
19384 With @option{-mno-flat} (the default), the compiler generates save/restore
19385 instructions (except for leaf functions).  This is the normal operating mode.
19387 @item -mfpu
19388 @itemx -mhard-float
19389 @opindex mfpu
19390 @opindex mhard-float
19391 Generate output containing floating-point instructions.  This is the
19392 default.
19394 @item -mno-fpu
19395 @itemx -msoft-float
19396 @opindex mno-fpu
19397 @opindex msoft-float
19398 Generate output containing library calls for floating point.
19399 @strong{Warning:} the requisite libraries are not available for all SPARC
19400 targets.  Normally the facilities of the machine's usual C compiler are
19401 used, but this cannot be done directly in cross-compilation.  You must make
19402 your own arrangements to provide suitable library functions for
19403 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
19404 @samp{sparclite-*-*} do provide software floating-point support.
19406 @option{-msoft-float} changes the calling convention in the output file;
19407 therefore, it is only useful if you compile @emph{all} of a program with
19408 this option.  In particular, you need to compile @file{libgcc.a}, the
19409 library that comes with GCC, with @option{-msoft-float} in order for
19410 this to work.
19412 @item -mhard-quad-float
19413 @opindex mhard-quad-float
19414 Generate output containing quad-word (long double) floating-point
19415 instructions.
19417 @item -msoft-quad-float
19418 @opindex msoft-quad-float
19419 Generate output containing library calls for quad-word (long double)
19420 floating-point instructions.  The functions called are those specified
19421 in the SPARC ABI@.  This is the default.
19423 As of this writing, there are no SPARC implementations that have hardware
19424 support for the quad-word floating-point instructions.  They all invoke
19425 a trap handler for one of these instructions, and then the trap handler
19426 emulates the effect of the instruction.  Because of the trap handler overhead,
19427 this is much slower than calling the ABI library routines.  Thus the
19428 @option{-msoft-quad-float} option is the default.
19430 @item -mno-unaligned-doubles
19431 @itemx -munaligned-doubles
19432 @opindex mno-unaligned-doubles
19433 @opindex munaligned-doubles
19434 Assume that doubles have 8-byte alignment.  This is the default.
19436 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
19437 alignment only if they are contained in another type, or if they have an
19438 absolute address.  Otherwise, it assumes they have 4-byte alignment.
19439 Specifying this option avoids some rare compatibility problems with code
19440 generated by other compilers.  It is not the default because it results
19441 in a performance loss, especially for floating-point code.
19443 @item -mno-faster-structs
19444 @itemx -mfaster-structs
19445 @opindex mno-faster-structs
19446 @opindex mfaster-structs
19447 With @option{-mfaster-structs}, the compiler assumes that structures
19448 should have 8-byte alignment.  This enables the use of pairs of
19449 @code{ldd} and @code{std} instructions for copies in structure
19450 assignment, in place of twice as many @code{ld} and @code{st} pairs.
19451 However, the use of this changed alignment directly violates the SPARC
19452 ABI@.  Thus, it's intended only for use on targets where the developer
19453 acknowledges that their resulting code is not directly in line with
19454 the rules of the ABI@.
19456 @item -mcpu=@var{cpu_type}
19457 @opindex mcpu
19458 Set the instruction set, register set, and instruction scheduling parameters
19459 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
19460 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
19461 @samp{leon}, @samp{leon3}, @samp{sparclite}, @samp{f930}, @samp{f934},
19462 @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
19463 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
19464 @samp{niagara3} and @samp{niagara4}.
19466 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
19467 which selects the best architecture option for the host processor.
19468 @option{-mcpu=native} has no effect if GCC does not recognize
19469 the processor.
19471 Default instruction scheduling parameters are used for values that select
19472 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
19473 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
19475 Here is a list of each supported architecture and their supported
19476 implementations.
19478 @table @asis
19479 @item v7
19480 cypress
19482 @item v8
19483 supersparc, hypersparc, leon, leon3
19485 @item sparclite
19486 f930, f934, sparclite86x
19488 @item sparclet
19489 tsc701
19491 @item v9
19492 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
19493 @end table
19495 By default (unless configured otherwise), GCC generates code for the V7
19496 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
19497 additionally optimizes it for the Cypress CY7C602 chip, as used in the
19498 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
19499 SPARCStation 1, 2, IPX etc.
19501 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
19502 architecture.  The only difference from V7 code is that the compiler emits
19503 the integer multiply and integer divide instructions which exist in SPARC-V8
19504 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
19505 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
19506 2000 series.
19508 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
19509 the SPARC architecture.  This adds the integer multiply, integer divide step
19510 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
19511 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
19512 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
19513 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
19514 MB86934 chip, which is the more recent SPARClite with FPU@.
19516 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
19517 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
19518 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
19519 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
19520 optimizes it for the TEMIC SPARClet chip.
19522 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
19523 architecture.  This adds 64-bit integer and floating-point move instructions,
19524 3 additional floating-point condition code registers and conditional move
19525 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
19526 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
19527 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
19528 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
19529 @option{-mcpu=niagara}, the compiler additionally optimizes it for
19530 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
19531 additionally optimizes it for Sun UltraSPARC T2 chips. With
19532 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
19533 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
19534 additionally optimizes it for Sun UltraSPARC T4 chips.
19536 @item -mtune=@var{cpu_type}
19537 @opindex mtune
19538 Set the instruction scheduling parameters for machine type
19539 @var{cpu_type}, but do not set the instruction set or register set that the
19540 option @option{-mcpu=@var{cpu_type}} does.
19542 The same values for @option{-mcpu=@var{cpu_type}} can be used for
19543 @option{-mtune=@var{cpu_type}}, but the only useful values are those
19544 that select a particular CPU implementation.  Those are @samp{cypress},
19545 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3}, @samp{f930},
19546 @samp{f934}, @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
19547 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3} and
19548 @samp{niagara4}.  With native Solaris and GNU/Linux toolchains, @samp{native}
19549 can also be used.
19551 @item -mv8plus
19552 @itemx -mno-v8plus
19553 @opindex mv8plus
19554 @opindex mno-v8plus
19555 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
19556 difference from the V8 ABI is that the global and out registers are
19557 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
19558 mode for all SPARC-V9 processors.
19560 @item -mvis
19561 @itemx -mno-vis
19562 @opindex mvis
19563 @opindex mno-vis
19564 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
19565 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
19567 @item -mvis2
19568 @itemx -mno-vis2
19569 @opindex mvis2
19570 @opindex mno-vis2
19571 With @option{-mvis2}, GCC generates code that takes advantage of
19572 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
19573 default is @option{-mvis2} when targeting a cpu that supports such
19574 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
19575 also sets @option{-mvis}.
19577 @item -mvis3
19578 @itemx -mno-vis3
19579 @opindex mvis3
19580 @opindex mno-vis3
19581 With @option{-mvis3}, GCC generates code that takes advantage of
19582 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
19583 default is @option{-mvis3} when targeting a cpu that supports such
19584 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
19585 also sets @option{-mvis2} and @option{-mvis}.
19587 @item -mcbcond
19588 @itemx -mno-cbcond
19589 @opindex mcbcond
19590 @opindex mno-cbcond
19591 With @option{-mcbcond}, GCC generates code that takes advantage of
19592 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
19593 The default is @option{-mcbcond} when targeting a cpu that supports such
19594 instructions, such as niagara-4 and later.
19596 @item -mpopc
19597 @itemx -mno-popc
19598 @opindex mpopc
19599 @opindex mno-popc
19600 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
19601 population count instruction.  The default is @option{-mpopc}
19602 when targeting a cpu that supports such instructions, such as Niagara-2 and
19603 later.
19605 @item -mfmaf
19606 @itemx -mno-fmaf
19607 @opindex mfmaf
19608 @opindex mno-fmaf
19609 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
19610 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
19611 when targeting a cpu that supports such instructions, such as Niagara-3 and
19612 later.
19614 @item -mfix-at697f
19615 @opindex mfix-at697f
19616 Enable the documented workaround for the single erratum of the Atmel AT697F
19617 processor (which corresponds to erratum #13 of the AT697E processor).
19619 @item -mfix-ut699
19620 @opindex mfix-ut699
19621 Enable the documented workarounds for the floating-point errata and the data
19622 cache nullify errata of the UT699 processor.
19623 @end table
19625 These @samp{-m} options are supported in addition to the above
19626 on SPARC-V9 processors in 64-bit environments:
19628 @table @gcctabopt
19629 @item -m32
19630 @itemx -m64
19631 @opindex m32
19632 @opindex m64
19633 Generate code for a 32-bit or 64-bit environment.
19634 The 32-bit environment sets int, long and pointer to 32 bits.
19635 The 64-bit environment sets int to 32 bits and long and pointer
19636 to 64 bits.
19638 @item -mcmodel=@var{which}
19639 @opindex mcmodel
19640 Set the code model to one of
19642 @table @samp
19643 @item medlow
19644 The Medium/Low code model: 64-bit addresses, programs
19645 must be linked in the low 32 bits of memory.  Programs can be statically
19646 or dynamically linked.
19648 @item medmid
19649 The Medium/Middle code model: 64-bit addresses, programs
19650 must be linked in the low 44 bits of memory, the text and data segments must
19651 be less than 2GB in size and the data segment must be located within 2GB of
19652 the text segment.
19654 @item medany
19655 The Medium/Anywhere code model: 64-bit addresses, programs
19656 may be linked anywhere in memory, the text and data segments must be less
19657 than 2GB in size and the data segment must be located within 2GB of the
19658 text segment.
19660 @item embmedany
19661 The Medium/Anywhere code model for embedded systems:
19662 64-bit addresses, the text and data segments must be less than 2GB in
19663 size, both starting anywhere in memory (determined at link time).  The
19664 global register %g4 points to the base of the data segment.  Programs
19665 are statically linked and PIC is not supported.
19666 @end table
19668 @item -mmemory-model=@var{mem-model}
19669 @opindex mmemory-model
19670 Set the memory model in force on the processor to one of
19672 @table @samp
19673 @item default
19674 The default memory model for the processor and operating system.
19676 @item rmo
19677 Relaxed Memory Order
19679 @item pso
19680 Partial Store Order
19682 @item tso
19683 Total Store Order
19685 @item sc
19686 Sequential Consistency
19687 @end table
19689 These memory models are formally defined in Appendix D of the Sparc V9
19690 architecture manual, as set in the processor's @code{PSTATE.MM} field.
19692 @item -mstack-bias
19693 @itemx -mno-stack-bias
19694 @opindex mstack-bias
19695 @opindex mno-stack-bias
19696 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
19697 frame pointer if present, are offset by @minus{}2047 which must be added back
19698 when making stack frame references.  This is the default in 64-bit mode.
19699 Otherwise, assume no such offset is present.
19700 @end table
19702 @node SPU Options
19703 @subsection SPU Options
19704 @cindex SPU options
19706 These @samp{-m} options are supported on the SPU:
19708 @table @gcctabopt
19709 @item -mwarn-reloc
19710 @itemx -merror-reloc
19711 @opindex mwarn-reloc
19712 @opindex merror-reloc
19714 The loader for SPU does not handle dynamic relocations.  By default, GCC
19715 gives an error when it generates code that requires a dynamic
19716 relocation.  @option{-mno-error-reloc} disables the error,
19717 @option{-mwarn-reloc} generates a warning instead.
19719 @item -msafe-dma
19720 @itemx -munsafe-dma
19721 @opindex msafe-dma
19722 @opindex munsafe-dma
19724 Instructions that initiate or test completion of DMA must not be
19725 reordered with respect to loads and stores of the memory that is being
19726 accessed.
19727 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
19728 memory accesses, but that can lead to inefficient code in places where the
19729 memory is known to not change.  Rather than mark the memory as volatile,
19730 you can use @option{-msafe-dma} to tell the compiler to treat
19731 the DMA instructions as potentially affecting all memory.  
19733 @item -mbranch-hints
19734 @opindex mbranch-hints
19736 By default, GCC generates a branch hint instruction to avoid
19737 pipeline stalls for always-taken or probably-taken branches.  A hint
19738 is not generated closer than 8 instructions away from its branch.
19739 There is little reason to disable them, except for debugging purposes,
19740 or to make an object a little bit smaller.
19742 @item -msmall-mem
19743 @itemx -mlarge-mem
19744 @opindex msmall-mem
19745 @opindex mlarge-mem
19747 By default, GCC generates code assuming that addresses are never larger
19748 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
19749 a full 32-bit address.
19751 @item -mstdmain
19752 @opindex mstdmain
19754 By default, GCC links against startup code that assumes the SPU-style
19755 main function interface (which has an unconventional parameter list).
19756 With @option{-mstdmain}, GCC links your program against startup
19757 code that assumes a C99-style interface to @code{main}, including a
19758 local copy of @code{argv} strings.
19760 @item -mfixed-range=@var{register-range}
19761 @opindex mfixed-range
19762 Generate code treating the given register range as fixed registers.
19763 A fixed register is one that the register allocator cannot use.  This is
19764 useful when compiling kernel code.  A register range is specified as
19765 two registers separated by a dash.  Multiple register ranges can be
19766 specified separated by a comma.
19768 @item -mea32
19769 @itemx -mea64
19770 @opindex mea32
19771 @opindex mea64
19772 Compile code assuming that pointers to the PPU address space accessed
19773 via the @code{__ea} named address space qualifier are either 32 or 64
19774 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
19775 all object code in an executable must be compiled with the same setting.
19777 @item -maddress-space-conversion
19778 @itemx -mno-address-space-conversion
19779 @opindex maddress-space-conversion
19780 @opindex mno-address-space-conversion
19781 Allow/disallow treating the @code{__ea} address space as superset
19782 of the generic address space.  This enables explicit type casts
19783 between @code{__ea} and generic pointer as well as implicit
19784 conversions of generic pointers to @code{__ea} pointers.  The
19785 default is to allow address space pointer conversions.
19787 @item -mcache-size=@var{cache-size}
19788 @opindex mcache-size
19789 This option controls the version of libgcc that the compiler links to an
19790 executable and selects a software-managed cache for accessing variables
19791 in the @code{__ea} address space with a particular cache size.  Possible
19792 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
19793 and @samp{128}.  The default cache size is 64KB.
19795 @item -matomic-updates
19796 @itemx -mno-atomic-updates
19797 @opindex matomic-updates
19798 @opindex mno-atomic-updates
19799 This option controls the version of libgcc that the compiler links to an
19800 executable and selects whether atomic updates to the software-managed
19801 cache of PPU-side variables are used.  If you use atomic updates, changes
19802 to a PPU variable from SPU code using the @code{__ea} named address space
19803 qualifier do not interfere with changes to other PPU variables residing
19804 in the same cache line from PPU code.  If you do not use atomic updates,
19805 such interference may occur; however, writing back cache lines is
19806 more efficient.  The default behavior is to use atomic updates.
19808 @item -mdual-nops
19809 @itemx -mdual-nops=@var{n}
19810 @opindex mdual-nops
19811 By default, GCC inserts nops to increase dual issue when it expects
19812 it to increase performance.  @var{n} can be a value from 0 to 10.  A
19813 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
19814 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
19816 @item -mhint-max-nops=@var{n}
19817 @opindex mhint-max-nops
19818 Maximum number of nops to insert for a branch hint.  A branch hint must
19819 be at least 8 instructions away from the branch it is affecting.  GCC
19820 inserts up to @var{n} nops to enforce this, otherwise it does not
19821 generate the branch hint.
19823 @item -mhint-max-distance=@var{n}
19824 @opindex mhint-max-distance
19825 The encoding of the branch hint instruction limits the hint to be within
19826 256 instructions of the branch it is affecting.  By default, GCC makes
19827 sure it is within 125.
19829 @item -msafe-hints
19830 @opindex msafe-hints
19831 Work around a hardware bug that causes the SPU to stall indefinitely.
19832 By default, GCC inserts the @code{hbrp} instruction to make sure
19833 this stall won't happen.
19835 @end table
19837 @node System V Options
19838 @subsection Options for System V
19840 These additional options are available on System V Release 4 for
19841 compatibility with other compilers on those systems:
19843 @table @gcctabopt
19844 @item -G
19845 @opindex G
19846 Create a shared object.
19847 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
19849 @item -Qy
19850 @opindex Qy
19851 Identify the versions of each tool used by the compiler, in a
19852 @code{.ident} assembler directive in the output.
19854 @item -Qn
19855 @opindex Qn
19856 Refrain from adding @code{.ident} directives to the output file (this is
19857 the default).
19859 @item -YP,@var{dirs}
19860 @opindex YP
19861 Search the directories @var{dirs}, and no others, for libraries
19862 specified with @option{-l}.
19864 @item -Ym,@var{dir}
19865 @opindex Ym
19866 Look in the directory @var{dir} to find the M4 preprocessor.
19867 The assembler uses this option.
19868 @c This is supposed to go with a -Yd for predefined M4 macro files, but
19869 @c the generic assembler that comes with Solaris takes just -Ym.
19870 @end table
19872 @node TILE-Gx Options
19873 @subsection TILE-Gx Options
19874 @cindex TILE-Gx options
19876 These @samp{-m} options are supported on the TILE-Gx:
19878 @table @gcctabopt
19879 @item -mcmodel=small
19880 @opindex mcmodel=small
19881 Generate code for the small model.  The distance for direct calls is
19882 limited to 500M in either direction.  PC-relative addresses are 32
19883 bits.  Absolute addresses support the full address range.
19885 @item -mcmodel=large
19886 @opindex mcmodel=large
19887 Generate code for the large model.  There is no limitation on call
19888 distance, pc-relative addresses, or absolute addresses.
19890 @item -mcpu=@var{name}
19891 @opindex mcpu
19892 Selects the type of CPU to be targeted.  Currently the only supported
19893 type is @samp{tilegx}.
19895 @item -m32
19896 @itemx -m64
19897 @opindex m32
19898 @opindex m64
19899 Generate code for a 32-bit or 64-bit environment.  The 32-bit
19900 environment sets int, long, and pointer to 32 bits.  The 64-bit
19901 environment sets int to 32 bits and long and pointer to 64 bits.
19902 @end table
19904 @node TILEPro Options
19905 @subsection TILEPro Options
19906 @cindex TILEPro options
19908 These @samp{-m} options are supported on the TILEPro:
19910 @table @gcctabopt
19911 @item -mcpu=@var{name}
19912 @opindex mcpu
19913 Selects the type of CPU to be targeted.  Currently the only supported
19914 type is @samp{tilepro}.
19916 @item -m32
19917 @opindex m32
19918 Generate code for a 32-bit environment, which sets int, long, and
19919 pointer to 32 bits.  This is the only supported behavior so the flag
19920 is essentially ignored.
19921 @end table
19923 @node V850 Options
19924 @subsection V850 Options
19925 @cindex V850 Options
19927 These @samp{-m} options are defined for V850 implementations:
19929 @table @gcctabopt
19930 @item -mlong-calls
19931 @itemx -mno-long-calls
19932 @opindex mlong-calls
19933 @opindex mno-long-calls
19934 Treat all calls as being far away (near).  If calls are assumed to be
19935 far away, the compiler always loads the function's address into a
19936 register, and calls indirect through the pointer.
19938 @item -mno-ep
19939 @itemx -mep
19940 @opindex mno-ep
19941 @opindex mep
19942 Do not optimize (do optimize) basic blocks that use the same index
19943 pointer 4 or more times to copy pointer into the @code{ep} register, and
19944 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
19945 option is on by default if you optimize.
19947 @item -mno-prolog-function
19948 @itemx -mprolog-function
19949 @opindex mno-prolog-function
19950 @opindex mprolog-function
19951 Do not use (do use) external functions to save and restore registers
19952 at the prologue and epilogue of a function.  The external functions
19953 are slower, but use less code space if more than one function saves
19954 the same number of registers.  The @option{-mprolog-function} option
19955 is on by default if you optimize.
19957 @item -mspace
19958 @opindex mspace
19959 Try to make the code as small as possible.  At present, this just turns
19960 on the @option{-mep} and @option{-mprolog-function} options.
19962 @item -mtda=@var{n}
19963 @opindex mtda
19964 Put static or global variables whose size is @var{n} bytes or less into
19965 the tiny data area that register @code{ep} points to.  The tiny data
19966 area can hold up to 256 bytes in total (128 bytes for byte references).
19968 @item -msda=@var{n}
19969 @opindex msda
19970 Put static or global variables whose size is @var{n} bytes or less into
19971 the small data area that register @code{gp} points to.  The small data
19972 area can hold up to 64 kilobytes.
19974 @item -mzda=@var{n}
19975 @opindex mzda
19976 Put static or global variables whose size is @var{n} bytes or less into
19977 the first 32 kilobytes of memory.
19979 @item -mv850
19980 @opindex mv850
19981 Specify that the target processor is the V850.
19983 @item -mv850e3v5
19984 @opindex mv850e3v5
19985 Specify that the target processor is the V850E3V5.  The preprocessor
19986 constant @samp{__v850e3v5__} is defined if this option is used.
19988 @item -mv850e2v4
19989 @opindex mv850e2v4
19990 Specify that the target processor is the V850E3V5.  This is an alias for
19991 the @option{-mv850e3v5} option.
19993 @item -mv850e2v3
19994 @opindex mv850e2v3
19995 Specify that the target processor is the V850E2V3.  The preprocessor
19996 constant @samp{__v850e2v3__} is defined if this option is used.
19998 @item -mv850e2
19999 @opindex mv850e2
20000 Specify that the target processor is the V850E2.  The preprocessor
20001 constant @samp{__v850e2__} is defined if this option is used.
20003 @item -mv850e1
20004 @opindex mv850e1
20005 Specify that the target processor is the V850E1.  The preprocessor
20006 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
20007 this option is used.
20009 @item -mv850es
20010 @opindex mv850es
20011 Specify that the target processor is the V850ES.  This is an alias for
20012 the @option{-mv850e1} option.
20014 @item -mv850e
20015 @opindex mv850e
20016 Specify that the target processor is the V850E@.  The preprocessor
20017 constant @samp{__v850e__} is defined if this option is used.
20019 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
20020 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
20021 are defined then a default target processor is chosen and the
20022 relevant @samp{__v850*__} preprocessor constant is defined.
20024 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
20025 defined, regardless of which processor variant is the target.
20027 @item -mdisable-callt
20028 @itemx -mno-disable-callt
20029 @opindex mdisable-callt
20030 @opindex mno-disable-callt
20031 This option suppresses generation of the @code{CALLT} instruction for the
20032 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
20033 architecture.
20035 This option is enabled by default when the RH850 ABI is
20036 in use (see @option{-mrh850-abi}), and disabled by default when the
20037 GCC ABI is in use.  If @code{CALLT} instructions are being generated
20038 then the C preprocessor symbol @code{__V850_CALLT__} will be defined.
20040 @item -mrelax
20041 @itemx -mno-relax
20042 @opindex mrelax
20043 @opindex mno-relax
20044 Pass on (or do not pass on) the @option{-mrelax} command line option
20045 to the assembler.
20047 @item -mlong-jumps
20048 @itemx -mno-long-jumps
20049 @opindex mlong-jumps
20050 @opindex mno-long-jumps
20051 Disable (or re-enable) the generation of PC-relative jump instructions.
20053 @item -msoft-float
20054 @itemx -mhard-float
20055 @opindex msoft-float
20056 @opindex mhard-float
20057 Disable (or re-enable) the generation of hardware floating point
20058 instructions.  This option is only significant when the target
20059 architecture is @samp{V850E2V3} or higher.  If hardware floating point
20060 instructions are being generated then the C preprocessor symbol
20061 @code{__FPU_OK__} will be defined, otherwise the symbol
20062 @code{__NO_FPU__} will be defined.
20064 @item -mloop
20065 @opindex mloop
20066 Enables the use of the e3v5 LOOP instruction.  The use of this
20067 instruction is not enabled by default when the e3v5 architecture is
20068 selected because its use is still experimental.
20070 @item -mrh850-abi
20071 @itemx -mghs
20072 @opindex mrh850-abi
20073 @opindex mghs
20074 Enables support for the RH850 version of the V850 ABI.  This is the
20075 default.  With this version of the ABI the following rules apply:
20077 @itemize
20078 @item
20079 Integer sized structures and unions are returned via a memory pointer
20080 rather than a register.
20082 @item
20083 Large structures and unions (more than 8 bytes in size) are passed by
20084 value.
20086 @item
20087 Functions are aligned to 16-bit boundaries.
20089 @item
20090 The @option{-m8byte-align} command line option is supported.
20092 @item
20093 The @option{-mdisable-callt} command line option is enabled by
20094 default.  The @option{-mno-disable-callt} command line option is not
20095 supported.
20096 @end itemize
20098 When this version of the ABI is enabled the C preprocessor symbol
20099 @code{__V850_RH850_ABI__} is defined.
20101 @item -mgcc-abi
20102 @opindex mgcc-abi
20103 Enables support for the old GCC version of the V850 ABI.  With this
20104 version of the ABI the following rules apply:
20106 @itemize
20107 @item
20108 Integer sized structures and unions are returned in register @code{r10}.
20110 @item
20111 Large structures and unions (more than 8 bytes in size) are passed by
20112 reference.
20114 @item
20115 Functions are aligned to 32-bit boundaries, unless optimizing for
20116 size.
20118 @item
20119 The @option{-m8byte-align} command line option is not supported.
20121 @item
20122 The @option{-mdisable-callt} command line option is supported but not
20123 enabled by default.
20124 @end itemize
20126 When this version of the ABI is enabled the C preprocessor symbol
20127 @code{__V850_GCC_ABI__} is defined.
20129 @item -m8byte-align
20130 @itemx -mno-8byte-align
20131 @opindex m8byte-align
20132 @opindex mno-8byte-align
20133 Enables support for @code{doubles} and @code{long long} types to be
20134 aligned on 8-byte boundaries.  The default is to restrict the
20135 alignment of all objects to at most 4-bytes.  When
20136 @option{-m8byte-align} is in effect the C preprocessor symbol
20137 @code{__V850_8BYTE_ALIGN__} will be defined.
20139 @item -mbig-switch
20140 @opindex mbig-switch
20141 Generate code suitable for big switch tables.  Use this option only if
20142 the assembler/linker complain about out of range branches within a switch
20143 table.
20145 @item -mapp-regs
20146 @opindex mapp-regs
20147 This option causes r2 and r5 to be used in the code generated by
20148 the compiler.  This setting is the default.
20150 @item -mno-app-regs
20151 @opindex mno-app-regs
20152 This option causes r2 and r5 to be treated as fixed registers.
20154 @end table
20156 @node VAX Options
20157 @subsection VAX Options
20158 @cindex VAX options
20160 These @samp{-m} options are defined for the VAX:
20162 @table @gcctabopt
20163 @item -munix
20164 @opindex munix
20165 Do not output certain jump instructions (@code{aobleq} and so on)
20166 that the Unix assembler for the VAX cannot handle across long
20167 ranges.
20169 @item -mgnu
20170 @opindex mgnu
20171 Do output those jump instructions, on the assumption that the
20172 GNU assembler is being used.
20174 @item -mg
20175 @opindex mg
20176 Output code for G-format floating-point numbers instead of D-format.
20177 @end table
20179 @node VMS Options
20180 @subsection VMS Options
20182 These @samp{-m} options are defined for the VMS implementations:
20184 @table @gcctabopt
20185 @item -mvms-return-codes
20186 @opindex mvms-return-codes
20187 Return VMS condition codes from @code{main}. The default is to return POSIX-style
20188 condition (e.g.@ error) codes.
20190 @item -mdebug-main=@var{prefix}
20191 @opindex mdebug-main=@var{prefix}
20192 Flag the first routine whose name starts with @var{prefix} as the main
20193 routine for the debugger.
20195 @item -mmalloc64
20196 @opindex mmalloc64
20197 Default to 64-bit memory allocation routines.
20199 @item -mpointer-size=@var{size}
20200 @opindex -mpointer-size=@var{size}
20201 Set the default size of pointers. Possible options for @var{size} are
20202 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
20203 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
20204 The later option disables @code{pragma pointer_size}.
20205 @end table
20207 @node VxWorks Options
20208 @subsection VxWorks Options
20209 @cindex VxWorks Options
20211 The options in this section are defined for all VxWorks targets.
20212 Options specific to the target hardware are listed with the other
20213 options for that target.
20215 @table @gcctabopt
20216 @item -mrtp
20217 @opindex mrtp
20218 GCC can generate code for both VxWorks kernels and real time processes
20219 (RTPs).  This option switches from the former to the latter.  It also
20220 defines the preprocessor macro @code{__RTP__}.
20222 @item -non-static
20223 @opindex non-static
20224 Link an RTP executable against shared libraries rather than static
20225 libraries.  The options @option{-static} and @option{-shared} can
20226 also be used for RTPs (@pxref{Link Options}); @option{-static}
20227 is the default.
20229 @item -Bstatic
20230 @itemx -Bdynamic
20231 @opindex Bstatic
20232 @opindex Bdynamic
20233 These options are passed down to the linker.  They are defined for
20234 compatibility with Diab.
20236 @item -Xbind-lazy
20237 @opindex Xbind-lazy
20238 Enable lazy binding of function calls.  This option is equivalent to
20239 @option{-Wl,-z,now} and is defined for compatibility with Diab.
20241 @item -Xbind-now
20242 @opindex Xbind-now
20243 Disable lazy binding of function calls.  This option is the default and
20244 is defined for compatibility with Diab.
20245 @end table
20247 @node x86-64 Options
20248 @subsection x86-64 Options
20249 @cindex x86-64 options
20251 These are listed under @xref{i386 and x86-64 Options}.
20253 @node Xstormy16 Options
20254 @subsection Xstormy16 Options
20255 @cindex Xstormy16 Options
20257 These options are defined for Xstormy16:
20259 @table @gcctabopt
20260 @item -msim
20261 @opindex msim
20262 Choose startup files and linker script suitable for the simulator.
20263 @end table
20265 @node Xtensa Options
20266 @subsection Xtensa Options
20267 @cindex Xtensa Options
20269 These options are supported for Xtensa targets:
20271 @table @gcctabopt
20272 @item -mconst16
20273 @itemx -mno-const16
20274 @opindex mconst16
20275 @opindex mno-const16
20276 Enable or disable use of @code{CONST16} instructions for loading
20277 constant values.  The @code{CONST16} instruction is currently not a
20278 standard option from Tensilica.  When enabled, @code{CONST16}
20279 instructions are always used in place of the standard @code{L32R}
20280 instructions.  The use of @code{CONST16} is enabled by default only if
20281 the @code{L32R} instruction is not available.
20283 @item -mfused-madd
20284 @itemx -mno-fused-madd
20285 @opindex mfused-madd
20286 @opindex mno-fused-madd
20287 Enable or disable use of fused multiply/add and multiply/subtract
20288 instructions in the floating-point option.  This has no effect if the
20289 floating-point option is not also enabled.  Disabling fused multiply/add
20290 and multiply/subtract instructions forces the compiler to use separate
20291 instructions for the multiply and add/subtract operations.  This may be
20292 desirable in some cases where strict IEEE 754-compliant results are
20293 required: the fused multiply add/subtract instructions do not round the
20294 intermediate result, thereby producing results with @emph{more} bits of
20295 precision than specified by the IEEE standard.  Disabling fused multiply
20296 add/subtract instructions also ensures that the program output is not
20297 sensitive to the compiler's ability to combine multiply and add/subtract
20298 operations.
20300 @item -mserialize-volatile
20301 @itemx -mno-serialize-volatile
20302 @opindex mserialize-volatile
20303 @opindex mno-serialize-volatile
20304 When this option is enabled, GCC inserts @code{MEMW} instructions before
20305 @code{volatile} memory references to guarantee sequential consistency.
20306 The default is @option{-mserialize-volatile}.  Use
20307 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
20309 @item -mforce-no-pic
20310 @opindex mforce-no-pic
20311 For targets, like GNU/Linux, where all user-mode Xtensa code must be
20312 position-independent code (PIC), this option disables PIC for compiling
20313 kernel code.
20315 @item -mtext-section-literals
20316 @itemx -mno-text-section-literals
20317 @opindex mtext-section-literals
20318 @opindex mno-text-section-literals
20319 Control the treatment of literal pools.  The default is
20320 @option{-mno-text-section-literals}, which places literals in a separate
20321 section in the output file.  This allows the literal pool to be placed
20322 in a data RAM/ROM, and it also allows the linker to combine literal
20323 pools from separate object files to remove redundant literals and
20324 improve code size.  With @option{-mtext-section-literals}, the literals
20325 are interspersed in the text section in order to keep them as close as
20326 possible to their references.  This may be necessary for large assembly
20327 files.
20329 @item -mtarget-align
20330 @itemx -mno-target-align
20331 @opindex mtarget-align
20332 @opindex mno-target-align
20333 When this option is enabled, GCC instructs the assembler to
20334 automatically align instructions to reduce branch penalties at the
20335 expense of some code density.  The assembler attempts to widen density
20336 instructions to align branch targets and the instructions following call
20337 instructions.  If there are not enough preceding safe density
20338 instructions to align a target, no widening is performed.  The
20339 default is @option{-mtarget-align}.  These options do not affect the
20340 treatment of auto-aligned instructions like @code{LOOP}, which the
20341 assembler always aligns, either by widening density instructions or
20342 by inserting NOP instructions.
20344 @item -mlongcalls
20345 @itemx -mno-longcalls
20346 @opindex mlongcalls
20347 @opindex mno-longcalls
20348 When this option is enabled, GCC instructs the assembler to translate
20349 direct calls to indirect calls unless it can determine that the target
20350 of a direct call is in the range allowed by the call instruction.  This
20351 translation typically occurs for calls to functions in other source
20352 files.  Specifically, the assembler translates a direct @code{CALL}
20353 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
20354 The default is @option{-mno-longcalls}.  This option should be used in
20355 programs where the call target can potentially be out of range.  This
20356 option is implemented in the assembler, not the compiler, so the
20357 assembly code generated by GCC still shows direct call
20358 instructions---look at the disassembled object code to see the actual
20359 instructions.  Note that the assembler uses an indirect call for
20360 every cross-file call, not just those that really are out of range.
20361 @end table
20363 @node zSeries Options
20364 @subsection zSeries Options
20365 @cindex zSeries options
20367 These are listed under @xref{S/390 and zSeries Options}.
20369 @node Code Gen Options
20370 @section Options for Code Generation Conventions
20371 @cindex code generation conventions
20372 @cindex options, code generation
20373 @cindex run-time options
20375 These machine-independent options control the interface conventions
20376 used in code generation.
20378 Most of them have both positive and negative forms; the negative form
20379 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
20380 one of the forms is listed---the one that is not the default.  You
20381 can figure out the other form by either removing @samp{no-} or adding
20384 @table @gcctabopt
20385 @item -fbounds-check
20386 @opindex fbounds-check
20387 For front ends that support it, generate additional code to check that
20388 indices used to access arrays are within the declared range.  This is
20389 currently only supported by the Java and Fortran front ends, where
20390 this option defaults to true and false respectively.
20392 @item -fstack-reuse=@var{reuse-level}
20393 @opindex fstack_reuse
20394 This option controls stack space reuse for user declared local/auto variables
20395 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
20396 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
20397 local variables and temporaries, @samp{named_vars} enables the reuse only for
20398 user defined local variables with names, and @samp{none} disables stack reuse
20399 completely. The default value is @samp{all}. The option is needed when the
20400 program extends the lifetime of a scoped local variable or a compiler generated
20401 temporary beyond the end point defined by the language.  When a lifetime of
20402 a variable ends, and if the variable lives in memory, the optimizing compiler
20403 has the freedom to reuse its stack space with other temporaries or scoped
20404 local variables whose live range does not overlap with it. Legacy code extending
20405 local lifetime will likely to break with the stack reuse optimization.
20407 For example,
20409 @smallexample
20410    int *p;
20411    @{
20412      int local1;
20414      p = &local1;
20415      local1 = 10;
20416      ....
20417    @}
20418    @{
20419       int local2;
20420       local2 = 20;
20421       ...
20422    @}
20424    if (*p == 10)  // out of scope use of local1
20425      @{
20427      @}
20428 @end smallexample
20430 Another example:
20431 @smallexample
20433    struct A
20434    @{
20435        A(int k) : i(k), j(k) @{ @}
20436        int i;
20437        int j;
20438    @};
20440    A *ap;
20442    void foo(const A& ar)
20443    @{
20444       ap = &ar;
20445    @}
20447    void bar()
20448    @{
20449       foo(A(10)); // temp object's lifetime ends when foo returns
20451       @{
20452         A a(20);
20453         ....
20454       @}
20455       ap->i+= 10;  // ap references out of scope temp whose space
20456                    // is reused with a. What is the value of ap->i?
20457    @}
20459 @end smallexample
20461 The lifetime of a compiler generated temporary is well defined by the C++
20462 standard. When a lifetime of a temporary ends, and if the temporary lives
20463 in memory, the optimizing compiler has the freedom to reuse its stack
20464 space with other temporaries or scoped local variables whose live range
20465 does not overlap with it. However some of the legacy code relies on
20466 the behavior of older compilers in which temporaries' stack space is
20467 not reused, the aggressive stack reuse can lead to runtime errors. This
20468 option is used to control the temporary stack reuse optimization.
20470 @item -ftrapv
20471 @opindex ftrapv
20472 This option generates traps for signed overflow on addition, subtraction,
20473 multiplication operations.
20475 @item -fwrapv
20476 @opindex fwrapv
20477 This option instructs the compiler to assume that signed arithmetic
20478 overflow of addition, subtraction and multiplication wraps around
20479 using twos-complement representation.  This flag enables some optimizations
20480 and disables others.  This option is enabled by default for the Java
20481 front end, as required by the Java language specification.
20483 @item -fexceptions
20484 @opindex fexceptions
20485 Enable exception handling.  Generates extra code needed to propagate
20486 exceptions.  For some targets, this implies GCC generates frame
20487 unwind information for all functions, which can produce significant data
20488 size overhead, although it does not affect execution.  If you do not
20489 specify this option, GCC enables it by default for languages like
20490 C++ that normally require exception handling, and disables it for
20491 languages like C that do not normally require it.  However, you may need
20492 to enable this option when compiling C code that needs to interoperate
20493 properly with exception handlers written in C++.  You may also wish to
20494 disable this option if you are compiling older C++ programs that don't
20495 use exception handling.
20497 @item -fnon-call-exceptions
20498 @opindex fnon-call-exceptions
20499 Generate code that allows trapping instructions to throw exceptions.
20500 Note that this requires platform-specific runtime support that does
20501 not exist everywhere.  Moreover, it only allows @emph{trapping}
20502 instructions to throw exceptions, i.e.@: memory references or floating-point
20503 instructions.  It does not allow exceptions to be thrown from
20504 arbitrary signal handlers such as @code{SIGALRM}.
20506 @item -fdelete-dead-exceptions
20507 @opindex fdelete-dead-exceptions
20508 Consider that instructions that may throw exceptions but don't otherwise
20509 contribute to the execution of the program can be optimized away.
20510 This option is enabled by default for the Ada front end, as permitted by
20511 the Ada language specification.
20512 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
20514 @item -funwind-tables
20515 @opindex funwind-tables
20516 Similar to @option{-fexceptions}, except that it just generates any needed
20517 static data, but does not affect the generated code in any other way.
20518 You normally do not need to enable this option; instead, a language processor
20519 that needs this handling enables it on your behalf.
20521 @item -fasynchronous-unwind-tables
20522 @opindex fasynchronous-unwind-tables
20523 Generate unwind table in DWARF 2 format, if supported by target machine.  The
20524 table is exact at each instruction boundary, so it can be used for stack
20525 unwinding from asynchronous events (such as debugger or garbage collector).
20527 @item -fpcc-struct-return
20528 @opindex fpcc-struct-return
20529 Return ``short'' @code{struct} and @code{union} values in memory like
20530 longer ones, rather than in registers.  This convention is less
20531 efficient, but it has the advantage of allowing intercallability between
20532 GCC-compiled files and files compiled with other compilers, particularly
20533 the Portable C Compiler (pcc).
20535 The precise convention for returning structures in memory depends
20536 on the target configuration macros.
20538 Short structures and unions are those whose size and alignment match
20539 that of some integer type.
20541 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
20542 switch is not binary compatible with code compiled with the
20543 @option{-freg-struct-return} switch.
20544 Use it to conform to a non-default application binary interface.
20546 @item -freg-struct-return
20547 @opindex freg-struct-return
20548 Return @code{struct} and @code{union} values in registers when possible.
20549 This is more efficient for small structures than
20550 @option{-fpcc-struct-return}.
20552 If you specify neither @option{-fpcc-struct-return} nor
20553 @option{-freg-struct-return}, GCC defaults to whichever convention is
20554 standard for the target.  If there is no standard convention, GCC
20555 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
20556 the principal compiler.  In those cases, we can choose the standard, and
20557 we chose the more efficient register return alternative.
20559 @strong{Warning:} code compiled with the @option{-freg-struct-return}
20560 switch is not binary compatible with code compiled with the
20561 @option{-fpcc-struct-return} switch.
20562 Use it to conform to a non-default application binary interface.
20564 @item -fshort-enums
20565 @opindex fshort-enums
20566 Allocate to an @code{enum} type only as many bytes as it needs for the
20567 declared range of possible values.  Specifically, the @code{enum} type
20568 is equivalent to the smallest integer type that has enough room.
20570 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
20571 code that is not binary compatible with code generated without that switch.
20572 Use it to conform to a non-default application binary interface.
20574 @item -fshort-double
20575 @opindex fshort-double
20576 Use the same size for @code{double} as for @code{float}.
20578 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
20579 code that is not binary compatible with code generated without that switch.
20580 Use it to conform to a non-default application binary interface.
20582 @item -fshort-wchar
20583 @opindex fshort-wchar
20584 Override the underlying type for @samp{wchar_t} to be @samp{short
20585 unsigned int} instead of the default for the target.  This option is
20586 useful for building programs to run under WINE@.
20588 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
20589 code that is not binary compatible with code generated without that switch.
20590 Use it to conform to a non-default application binary interface.
20592 @item -fno-common
20593 @opindex fno-common
20594 In C code, controls the placement of uninitialized global variables.
20595 Unix C compilers have traditionally permitted multiple definitions of
20596 such variables in different compilation units by placing the variables
20597 in a common block.
20598 This is the behavior specified by @option{-fcommon}, and is the default
20599 for GCC on most targets.
20600 On the other hand, this behavior is not required by ISO C, and on some
20601 targets may carry a speed or code size penalty on variable references.
20602 The @option{-fno-common} option specifies that the compiler should place
20603 uninitialized global variables in the data section of the object file,
20604 rather than generating them as common blocks.
20605 This has the effect that if the same variable is declared
20606 (without @code{extern}) in two different compilations,
20607 you get a multiple-definition error when you link them.
20608 In this case, you must compile with @option{-fcommon} instead.
20609 Compiling with @option{-fno-common} is useful on targets for which
20610 it provides better performance, or if you wish to verify that the
20611 program will work on other systems that always treat uninitialized
20612 variable declarations this way.
20614 @item -fno-ident
20615 @opindex fno-ident
20616 Ignore the @samp{#ident} directive.
20618 @item -finhibit-size-directive
20619 @opindex finhibit-size-directive
20620 Don't output a @code{.size} assembler directive, or anything else that
20621 would cause trouble if the function is split in the middle, and the
20622 two halves are placed at locations far apart in memory.  This option is
20623 used when compiling @file{crtstuff.c}; you should not need to use it
20624 for anything else.
20626 @item -fverbose-asm
20627 @opindex fverbose-asm
20628 Put extra commentary information in the generated assembly code to
20629 make it more readable.  This option is generally only of use to those
20630 who actually need to read the generated assembly code (perhaps while
20631 debugging the compiler itself).
20633 @option{-fno-verbose-asm}, the default, causes the
20634 extra information to be omitted and is useful when comparing two assembler
20635 files.
20637 @item -frecord-gcc-switches
20638 @opindex frecord-gcc-switches
20639 This switch causes the command line used to invoke the
20640 compiler to be recorded into the object file that is being created.
20641 This switch is only implemented on some targets and the exact format
20642 of the recording is target and binary file format dependent, but it
20643 usually takes the form of a section containing ASCII text.  This
20644 switch is related to the @option{-fverbose-asm} switch, but that
20645 switch only records information in the assembler output file as
20646 comments, so it never reaches the object file.
20647 See also @option{-grecord-gcc-switches} for another
20648 way of storing compiler options into the object file.
20650 @item -fpic
20651 @opindex fpic
20652 @cindex global offset table
20653 @cindex PIC
20654 Generate position-independent code (PIC) suitable for use in a shared
20655 library, if supported for the target machine.  Such code accesses all
20656 constant addresses through a global offset table (GOT)@.  The dynamic
20657 loader resolves the GOT entries when the program starts (the dynamic
20658 loader is not part of GCC; it is part of the operating system).  If
20659 the GOT size for the linked executable exceeds a machine-specific
20660 maximum size, you get an error message from the linker indicating that
20661 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
20662 instead.  (These maximums are 8k on the SPARC and 32k
20663 on the m68k and RS/6000.  The 386 has no such limit.)
20665 Position-independent code requires special support, and therefore works
20666 only on certain machines.  For the 386, GCC supports PIC for System V
20667 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
20668 position-independent.
20670 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20671 are defined to 1.
20673 @item -fPIC
20674 @opindex fPIC
20675 If supported for the target machine, emit position-independent code,
20676 suitable for dynamic linking and avoiding any limit on the size of the
20677 global offset table.  This option makes a difference on the m68k,
20678 PowerPC and SPARC@.
20680 Position-independent code requires special support, and therefore works
20681 only on certain machines.
20683 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20684 are defined to 2.
20686 @item -fpie
20687 @itemx -fPIE
20688 @opindex fpie
20689 @opindex fPIE
20690 These options are similar to @option{-fpic} and @option{-fPIC}, but
20691 generated position independent code can be only linked into executables.
20692 Usually these options are used when @option{-pie} GCC option is
20693 used during linking.
20695 @option{-fpie} and @option{-fPIE} both define the macros
20696 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
20697 for @option{-fpie} and 2 for @option{-fPIE}.
20699 @item -fno-jump-tables
20700 @opindex fno-jump-tables
20701 Do not use jump tables for switch statements even where it would be
20702 more efficient than other code generation strategies.  This option is
20703 of use in conjunction with @option{-fpic} or @option{-fPIC} for
20704 building code that forms part of a dynamic linker and cannot
20705 reference the address of a jump table.  On some targets, jump tables
20706 do not require a GOT and this option is not needed.
20708 @item -ffixed-@var{reg}
20709 @opindex ffixed
20710 Treat the register named @var{reg} as a fixed register; generated code
20711 should never refer to it (except perhaps as a stack pointer, frame
20712 pointer or in some other fixed role).
20714 @var{reg} must be the name of a register.  The register names accepted
20715 are machine-specific and are defined in the @code{REGISTER_NAMES}
20716 macro in the machine description macro file.
20718 This flag does not have a negative form, because it specifies a
20719 three-way choice.
20721 @item -fcall-used-@var{reg}
20722 @opindex fcall-used
20723 Treat the register named @var{reg} as an allocable register that is
20724 clobbered by function calls.  It may be allocated for temporaries or
20725 variables that do not live across a call.  Functions compiled this way
20726 do not save and restore the register @var{reg}.
20728 It is an error to use this flag with the frame pointer or stack pointer.
20729 Use of this flag for other registers that have fixed pervasive roles in
20730 the machine's execution model produces disastrous results.
20732 This flag does not have a negative form, because it specifies a
20733 three-way choice.
20735 @item -fcall-saved-@var{reg}
20736 @opindex fcall-saved
20737 Treat the register named @var{reg} as an allocable register saved by
20738 functions.  It may be allocated even for temporaries or variables that
20739 live across a call.  Functions compiled this way save and restore
20740 the register @var{reg} if they use it.
20742 It is an error to use this flag with the frame pointer or stack pointer.
20743 Use of this flag for other registers that have fixed pervasive roles in
20744 the machine's execution model produces disastrous results.
20746 A different sort of disaster results from the use of this flag for
20747 a register in which function values may be returned.
20749 This flag does not have a negative form, because it specifies a
20750 three-way choice.
20752 @item -fpack-struct[=@var{n}]
20753 @opindex fpack-struct
20754 Without a value specified, pack all structure members together without
20755 holes.  When a value is specified (which must be a small power of two), pack
20756 structure members according to this value, representing the maximum
20757 alignment (that is, objects with default alignment requirements larger than
20758 this are output potentially unaligned at the next fitting location.
20760 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
20761 code that is not binary compatible with code generated without that switch.
20762 Additionally, it makes the code suboptimal.
20763 Use it to conform to a non-default application binary interface.
20765 @item -finstrument-functions
20766 @opindex finstrument-functions
20767 Generate instrumentation calls for entry and exit to functions.  Just
20768 after function entry and just before function exit, the following
20769 profiling functions are called with the address of the current
20770 function and its call site.  (On some platforms,
20771 @code{__builtin_return_address} does not work beyond the current
20772 function, so the call site information may not be available to the
20773 profiling functions otherwise.)
20775 @smallexample
20776 void __cyg_profile_func_enter (void *this_fn,
20777                                void *call_site);
20778 void __cyg_profile_func_exit  (void *this_fn,
20779                                void *call_site);
20780 @end smallexample
20782 The first argument is the address of the start of the current function,
20783 which may be looked up exactly in the symbol table.
20785 This instrumentation is also done for functions expanded inline in other
20786 functions.  The profiling calls indicate where, conceptually, the
20787 inline function is entered and exited.  This means that addressable
20788 versions of such functions must be available.  If all your uses of a
20789 function are expanded inline, this may mean an additional expansion of
20790 code size.  If you use @samp{extern inline} in your C code, an
20791 addressable version of such functions must be provided.  (This is
20792 normally the case anyway, but if you get lucky and the optimizer always
20793 expands the functions inline, you might have gotten away without
20794 providing static copies.)
20796 A function may be given the attribute @code{no_instrument_function}, in
20797 which case this instrumentation is not done.  This can be used, for
20798 example, for the profiling functions listed above, high-priority
20799 interrupt routines, and any functions from which the profiling functions
20800 cannot safely be called (perhaps signal handlers, if the profiling
20801 routines generate output or allocate memory).
20803 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
20804 @opindex finstrument-functions-exclude-file-list
20806 Set the list of functions that are excluded from instrumentation (see
20807 the description of @code{-finstrument-functions}).  If the file that
20808 contains a function definition matches with one of @var{file}, then
20809 that function is not instrumented.  The match is done on substrings:
20810 if the @var{file} parameter is a substring of the file name, it is
20811 considered to be a match.
20813 For example:
20815 @smallexample
20816 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
20817 @end smallexample
20819 @noindent
20820 excludes any inline function defined in files whose pathnames
20821 contain @code{/bits/stl} or @code{include/sys}.
20823 If, for some reason, you want to include letter @code{','} in one of
20824 @var{sym}, write @code{'\,'}. For example,
20825 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
20826 (note the single quote surrounding the option).
20828 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
20829 @opindex finstrument-functions-exclude-function-list
20831 This is similar to @code{-finstrument-functions-exclude-file-list},
20832 but this option sets the list of function names to be excluded from
20833 instrumentation.  The function name to be matched is its user-visible
20834 name, such as @code{vector<int> blah(const vector<int> &)}, not the
20835 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
20836 match is done on substrings: if the @var{sym} parameter is a substring
20837 of the function name, it is considered to be a match.  For C99 and C++
20838 extended identifiers, the function name must be given in UTF-8, not
20839 using universal character names.
20841 @item -fstack-check
20842 @opindex fstack-check
20843 Generate code to verify that you do not go beyond the boundary of the
20844 stack.  You should specify this flag if you are running in an
20845 environment with multiple threads, but you only rarely need to specify it in
20846 a single-threaded environment since stack overflow is automatically
20847 detected on nearly all systems if there is only one stack.
20849 Note that this switch does not actually cause checking to be done; the
20850 operating system or the language runtime must do that.  The switch causes
20851 generation of code to ensure that they see the stack being extended.
20853 You can additionally specify a string parameter: @code{no} means no
20854 checking, @code{generic} means force the use of old-style checking,
20855 @code{specific} means use the best checking method and is equivalent
20856 to bare @option{-fstack-check}.
20858 Old-style checking is a generic mechanism that requires no specific
20859 target support in the compiler but comes with the following drawbacks:
20861 @enumerate
20862 @item
20863 Modified allocation strategy for large objects: they are always
20864 allocated dynamically if their size exceeds a fixed threshold.
20866 @item
20867 Fixed limit on the size of the static frame of functions: when it is
20868 topped by a particular function, stack checking is not reliable and
20869 a warning is issued by the compiler.
20871 @item
20872 Inefficiency: because of both the modified allocation strategy and the
20873 generic implementation, code performance is hampered.
20874 @end enumerate
20876 Note that old-style stack checking is also the fallback method for
20877 @code{specific} if no target support has been added in the compiler.
20879 @item -fstack-limit-register=@var{reg}
20880 @itemx -fstack-limit-symbol=@var{sym}
20881 @itemx -fno-stack-limit
20882 @opindex fstack-limit-register
20883 @opindex fstack-limit-symbol
20884 @opindex fno-stack-limit
20885 Generate code to ensure that the stack does not grow beyond a certain value,
20886 either the value of a register or the address of a symbol.  If a larger
20887 stack is required, a signal is raised at run time.  For most targets,
20888 the signal is raised before the stack overruns the boundary, so
20889 it is possible to catch the signal without taking special precautions.
20891 For instance, if the stack starts at absolute address @samp{0x80000000}
20892 and grows downwards, you can use the flags
20893 @option{-fstack-limit-symbol=__stack_limit} and
20894 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
20895 of 128KB@.  Note that this may only work with the GNU linker.
20897 @item -fsplit-stack
20898 @opindex fsplit-stack
20899 Generate code to automatically split the stack before it overflows.
20900 The resulting program has a discontiguous stack which can only
20901 overflow if the program is unable to allocate any more memory.  This
20902 is most useful when running threaded programs, as it is no longer
20903 necessary to calculate a good stack size to use for each thread.  This
20904 is currently only implemented for the i386 and x86_64 back ends running
20905 GNU/Linux.
20907 When code compiled with @option{-fsplit-stack} calls code compiled
20908 without @option{-fsplit-stack}, there may not be much stack space
20909 available for the latter code to run.  If compiling all code,
20910 including library code, with @option{-fsplit-stack} is not an option,
20911 then the linker can fix up these calls so that the code compiled
20912 without @option{-fsplit-stack} always has a large stack.  Support for
20913 this is implemented in the gold linker in GNU binutils release 2.21
20914 and later.
20916 @item -fleading-underscore
20917 @opindex fleading-underscore
20918 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
20919 change the way C symbols are represented in the object file.  One use
20920 is to help link with legacy assembly code.
20922 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
20923 generate code that is not binary compatible with code generated without that
20924 switch.  Use it to conform to a non-default application binary interface.
20925 Not all targets provide complete support for this switch.
20927 @item -ftls-model=@var{model}
20928 @opindex ftls-model
20929 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
20930 The @var{model} argument should be one of @code{global-dynamic},
20931 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
20933 The default without @option{-fpic} is @code{initial-exec}; with
20934 @option{-fpic} the default is @code{global-dynamic}.
20936 @item -fvisibility=@var{default|internal|hidden|protected}
20937 @opindex fvisibility
20938 Set the default ELF image symbol visibility to the specified option---all
20939 symbols are marked with this unless overridden within the code.
20940 Using this feature can very substantially improve linking and
20941 load times of shared object libraries, produce more optimized
20942 code, provide near-perfect API export and prevent symbol clashes.
20943 It is @strong{strongly} recommended that you use this in any shared objects
20944 you distribute.
20946 Despite the nomenclature, @code{default} always means public; i.e.,
20947 available to be linked against from outside the shared object.
20948 @code{protected} and @code{internal} are pretty useless in real-world
20949 usage so the only other commonly used option is @code{hidden}.
20950 The default if @option{-fvisibility} isn't specified is
20951 @code{default}, i.e., make every
20952 symbol public---this causes the same behavior as previous versions of
20953 GCC@.
20955 A good explanation of the benefits offered by ensuring ELF
20956 symbols have the correct visibility is given by ``How To Write
20957 Shared Libraries'' by Ulrich Drepper (which can be found at
20958 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
20959 solution made possible by this option to marking things hidden when
20960 the default is public is to make the default hidden and mark things
20961 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
20962 and @code{__attribute__ ((visibility("default")))} instead of
20963 @code{__declspec(dllexport)} you get almost identical semantics with
20964 identical syntax.  This is a great boon to those working with
20965 cross-platform projects.
20967 For those adding visibility support to existing code, you may find
20968 @samp{#pragma GCC visibility} of use.  This works by you enclosing
20969 the declarations you wish to set visibility for with (for example)
20970 @samp{#pragma GCC visibility push(hidden)} and
20971 @samp{#pragma GCC visibility pop}.
20972 Bear in mind that symbol visibility should be viewed @strong{as
20973 part of the API interface contract} and thus all new code should
20974 always specify visibility when it is not the default; i.e., declarations
20975 only for use within the local DSO should @strong{always} be marked explicitly
20976 as hidden as so to avoid PLT indirection overheads---making this
20977 abundantly clear also aids readability and self-documentation of the code.
20978 Note that due to ISO C++ specification requirements, @code{operator new} and
20979 @code{operator delete} must always be of default visibility.
20981 Be aware that headers from outside your project, in particular system
20982 headers and headers from any other library you use, may not be
20983 expecting to be compiled with visibility other than the default.  You
20984 may need to explicitly say @samp{#pragma GCC visibility push(default)}
20985 before including any such headers.
20987 @samp{extern} declarations are not affected by @option{-fvisibility}, so
20988 a lot of code can be recompiled with @option{-fvisibility=hidden} with
20989 no modifications.  However, this means that calls to @code{extern}
20990 functions with no explicit visibility use the PLT, so it is more
20991 effective to use @code{__attribute ((visibility))} and/or
20992 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
20993 declarations should be treated as hidden.
20995 Note that @option{-fvisibility} does affect C++ vague linkage
20996 entities. This means that, for instance, an exception class that is
20997 be thrown between DSOs must be explicitly marked with default
20998 visibility so that the @samp{type_info} nodes are unified between
20999 the DSOs.
21001 An overview of these techniques, their benefits and how to use them
21002 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
21004 @item -fstrict-volatile-bitfields
21005 @opindex fstrict-volatile-bitfields
21006 This option should be used if accesses to volatile bit-fields (or other
21007 structure fields, although the compiler usually honors those types
21008 anyway) should use a single access of the width of the
21009 field's type, aligned to a natural alignment if possible.  For
21010 example, targets with memory-mapped peripheral registers might require
21011 all such accesses to be 16 bits wide; with this flag you can
21012 declare all peripheral bit-fields as @code{unsigned short} (assuming short
21013 is 16 bits on these targets) to force GCC to use 16-bit accesses
21014 instead of, perhaps, a more efficient 32-bit access.
21016 If this option is disabled, the compiler uses the most efficient
21017 instruction.  In the previous example, that might be a 32-bit load
21018 instruction, even though that accesses bytes that do not contain
21019 any portion of the bit-field, or memory-mapped registers unrelated to
21020 the one being updated.
21022 If the target requires strict alignment, and honoring the field
21023 type would require violating this alignment, a warning is issued.
21024 If the field has @code{packed} attribute, the access is done without
21025 honoring the field type.  If the field doesn't have @code{packed}
21026 attribute, the access is done honoring the field type.  In both cases,
21027 GCC assumes that the user knows something about the target hardware
21028 that it is unaware of.
21030 The default value of this option is determined by the application binary
21031 interface for the target processor.
21033 @item -fsync-libcalls
21034 @opindex fsync-libcalls
21035 This option controls whether any out-of-line instance of the @code{__sync}
21036 family of functions may be used to implement the C++11 @code{__atomic}
21037 family of functions.
21039 The default value of this option is enabled, thus the only useful form
21040 of the option is @option{-fno-sync-libcalls}.  This option is used in
21041 the implementation of the @file{libatomic} runtime library.
21043 @end table
21045 @c man end
21047 @node Environment Variables
21048 @section Environment Variables Affecting GCC
21049 @cindex environment variables
21051 @c man begin ENVIRONMENT
21052 This section describes several environment variables that affect how GCC
21053 operates.  Some of them work by specifying directories or prefixes to use
21054 when searching for various kinds of files.  Some are used to specify other
21055 aspects of the compilation environment.
21057 Note that you can also specify places to search using options such as
21058 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
21059 take precedence over places specified using environment variables, which
21060 in turn take precedence over those specified by the configuration of GCC@.
21061 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
21062 GNU Compiler Collection (GCC) Internals}.
21064 @table @env
21065 @item LANG
21066 @itemx LC_CTYPE
21067 @c @itemx LC_COLLATE
21068 @itemx LC_MESSAGES
21069 @c @itemx LC_MONETARY
21070 @c @itemx LC_NUMERIC
21071 @c @itemx LC_TIME
21072 @itemx LC_ALL
21073 @findex LANG
21074 @findex LC_CTYPE
21075 @c @findex LC_COLLATE
21076 @findex LC_MESSAGES
21077 @c @findex LC_MONETARY
21078 @c @findex LC_NUMERIC
21079 @c @findex LC_TIME
21080 @findex LC_ALL
21081 @cindex locale
21082 These environment variables control the way that GCC uses
21083 localization information which allows GCC to work with different
21084 national conventions.  GCC inspects the locale categories
21085 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
21086 so.  These locale categories can be set to any value supported by your
21087 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
21088 Kingdom encoded in UTF-8.
21090 The @env{LC_CTYPE} environment variable specifies character
21091 classification.  GCC uses it to determine the character boundaries in
21092 a string; this is needed for some multibyte encodings that contain quote
21093 and escape characters that are otherwise interpreted as a string
21094 end or escape.
21096 The @env{LC_MESSAGES} environment variable specifies the language to
21097 use in diagnostic messages.
21099 If the @env{LC_ALL} environment variable is set, it overrides the value
21100 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
21101 and @env{LC_MESSAGES} default to the value of the @env{LANG}
21102 environment variable.  If none of these variables are set, GCC
21103 defaults to traditional C English behavior.
21105 @item TMPDIR
21106 @findex TMPDIR
21107 If @env{TMPDIR} is set, it specifies the directory to use for temporary
21108 files.  GCC uses temporary files to hold the output of one stage of
21109 compilation which is to be used as input to the next stage: for example,
21110 the output of the preprocessor, which is the input to the compiler
21111 proper.
21113 @item GCC_COMPARE_DEBUG
21114 @findex GCC_COMPARE_DEBUG
21115 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
21116 @option{-fcompare-debug} to the compiler driver.  See the documentation
21117 of this option for more details.
21119 @item GCC_EXEC_PREFIX
21120 @findex GCC_EXEC_PREFIX
21121 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
21122 names of the subprograms executed by the compiler.  No slash is added
21123 when this prefix is combined with the name of a subprogram, but you can
21124 specify a prefix that ends with a slash if you wish.
21126 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
21127 an appropriate prefix to use based on the pathname it is invoked with.
21129 If GCC cannot find the subprogram using the specified prefix, it
21130 tries looking in the usual places for the subprogram.
21132 The default value of @env{GCC_EXEC_PREFIX} is
21133 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
21134 the installed compiler. In many cases @var{prefix} is the value
21135 of @code{prefix} when you ran the @file{configure} script.
21137 Other prefixes specified with @option{-B} take precedence over this prefix.
21139 This prefix is also used for finding files such as @file{crt0.o} that are
21140 used for linking.
21142 In addition, the prefix is used in an unusual way in finding the
21143 directories to search for header files.  For each of the standard
21144 directories whose name normally begins with @samp{/usr/local/lib/gcc}
21145 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
21146 replacing that beginning with the specified prefix to produce an
21147 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
21148 @file{foo/bar} just before it searches the standard directory 
21149 @file{/usr/local/lib/bar}.
21150 If a standard directory begins with the configured
21151 @var{prefix} then the value of @var{prefix} is replaced by
21152 @env{GCC_EXEC_PREFIX} when looking for header files.
21154 @item COMPILER_PATH
21155 @findex COMPILER_PATH
21156 The value of @env{COMPILER_PATH} is a colon-separated list of
21157 directories, much like @env{PATH}.  GCC tries the directories thus
21158 specified when searching for subprograms, if it can't find the
21159 subprograms using @env{GCC_EXEC_PREFIX}.
21161 @item LIBRARY_PATH
21162 @findex LIBRARY_PATH
21163 The value of @env{LIBRARY_PATH} is a colon-separated list of
21164 directories, much like @env{PATH}.  When configured as a native compiler,
21165 GCC tries the directories thus specified when searching for special
21166 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
21167 using GCC also uses these directories when searching for ordinary
21168 libraries for the @option{-l} option (but directories specified with
21169 @option{-L} come first).
21171 @item LANG
21172 @findex LANG
21173 @cindex locale definition
21174 This variable is used to pass locale information to the compiler.  One way in
21175 which this information is used is to determine the character set to be used
21176 when character literals, string literals and comments are parsed in C and C++.
21177 When the compiler is configured to allow multibyte characters,
21178 the following values for @env{LANG} are recognized:
21180 @table @samp
21181 @item C-JIS
21182 Recognize JIS characters.
21183 @item C-SJIS
21184 Recognize SJIS characters.
21185 @item C-EUCJP
21186 Recognize EUCJP characters.
21187 @end table
21189 If @env{LANG} is not defined, or if it has some other value, then the
21190 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
21191 recognize and translate multibyte characters.
21192 @end table
21194 @noindent
21195 Some additional environment variables affect the behavior of the
21196 preprocessor.
21198 @include cppenv.texi
21200 @c man end
21202 @node Precompiled Headers
21203 @section Using Precompiled Headers
21204 @cindex precompiled headers
21205 @cindex speed of compilation
21207 Often large projects have many header files that are included in every
21208 source file.  The time the compiler takes to process these header files
21209 over and over again can account for nearly all of the time required to
21210 build the project.  To make builds faster, GCC allows you to
21211 @dfn{precompile} a header file.
21213 To create a precompiled header file, simply compile it as you would any
21214 other file, if necessary using the @option{-x} option to make the driver
21215 treat it as a C or C++ header file.  You may want to use a
21216 tool like @command{make} to keep the precompiled header up-to-date when
21217 the headers it contains change.
21219 A precompiled header file is searched for when @code{#include} is
21220 seen in the compilation.  As it searches for the included file
21221 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
21222 compiler looks for a precompiled header in each directory just before it
21223 looks for the include file in that directory.  The name searched for is
21224 the name specified in the @code{#include} with @samp{.gch} appended.  If
21225 the precompiled header file can't be used, it is ignored.
21227 For instance, if you have @code{#include "all.h"}, and you have
21228 @file{all.h.gch} in the same directory as @file{all.h}, then the
21229 precompiled header file is used if possible, and the original
21230 header is used otherwise.
21232 Alternatively, you might decide to put the precompiled header file in a
21233 directory and use @option{-I} to ensure that directory is searched
21234 before (or instead of) the directory containing the original header.
21235 Then, if you want to check that the precompiled header file is always
21236 used, you can put a file of the same name as the original header in this
21237 directory containing an @code{#error} command.
21239 This also works with @option{-include}.  So yet another way to use
21240 precompiled headers, good for projects not designed with precompiled
21241 header files in mind, is to simply take most of the header files used by
21242 a project, include them from another header file, precompile that header
21243 file, and @option{-include} the precompiled header.  If the header files
21244 have guards against multiple inclusion, they are skipped because
21245 they've already been included (in the precompiled header).
21247 If you need to precompile the same header file for different
21248 languages, targets, or compiler options, you can instead make a
21249 @emph{directory} named like @file{all.h.gch}, and put each precompiled
21250 header in the directory, perhaps using @option{-o}.  It doesn't matter
21251 what you call the files in the directory; every precompiled header in
21252 the directory is considered.  The first precompiled header
21253 encountered in the directory that is valid for this compilation is
21254 used; they're searched in no particular order.
21256 There are many other possibilities, limited only by your imagination,
21257 good sense, and the constraints of your build system.
21259 A precompiled header file can be used only when these conditions apply:
21261 @itemize
21262 @item
21263 Only one precompiled header can be used in a particular compilation.
21265 @item
21266 A precompiled header can't be used once the first C token is seen.  You
21267 can have preprocessor directives before a precompiled header; you cannot
21268 include a precompiled header from inside another header.
21270 @item
21271 The precompiled header file must be produced for the same language as
21272 the current compilation.  You can't use a C precompiled header for a C++
21273 compilation.
21275 @item
21276 The precompiled header file must have been produced by the same compiler
21277 binary as the current compilation is using.
21279 @item
21280 Any macros defined before the precompiled header is included must
21281 either be defined in the same way as when the precompiled header was
21282 generated, or must not affect the precompiled header, which usually
21283 means that they don't appear in the precompiled header at all.
21285 The @option{-D} option is one way to define a macro before a
21286 precompiled header is included; using a @code{#define} can also do it.
21287 There are also some options that define macros implicitly, like
21288 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
21289 defined this way.
21291 @item If debugging information is output when using the precompiled
21292 header, using @option{-g} or similar, the same kind of debugging information
21293 must have been output when building the precompiled header.  However,
21294 a precompiled header built using @option{-g} can be used in a compilation
21295 when no debugging information is being output.
21297 @item The same @option{-m} options must generally be used when building
21298 and using the precompiled header.  @xref{Submodel Options},
21299 for any cases where this rule is relaxed.
21301 @item Each of the following options must be the same when building and using
21302 the precompiled header:
21304 @gccoptlist{-fexceptions}
21306 @item
21307 Some other command-line options starting with @option{-f},
21308 @option{-p}, or @option{-O} must be defined in the same way as when
21309 the precompiled header was generated.  At present, it's not clear
21310 which options are safe to change and which are not; the safest choice
21311 is to use exactly the same options when generating and using the
21312 precompiled header.  The following are known to be safe:
21314 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
21315 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
21316 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
21317 -pedantic-errors}
21319 @end itemize
21321 For all of these except the last, the compiler automatically
21322 ignores the precompiled header if the conditions aren't met.  If you
21323 find an option combination that doesn't work and doesn't cause the
21324 precompiled header to be ignored, please consider filing a bug report,
21325 see @ref{Bugs}.
21327 If you do use differing options when generating and using the
21328 precompiled header, the actual behavior is a mixture of the
21329 behavior for the options.  For instance, if you use @option{-g} to
21330 generate the precompiled header but not when using it, you may or may
21331 not get debugging information for routines in the precompiled header.