rename info files
[platform/upstream/gcc48.git] / gcc / doc / invoke.texi
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.
4
5 @ignore
6 @c man begin INCLUDE
7 @include gcc-vers.texi
8 @c man end
9
10 @c man begin COPYRIGHT
11 Copyright @copyright{} 1988-2013 Free Software Foundation, Inc.
12
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.
20
21 (a) The FSF's Front-Cover Text is:
22
23      A GNU Manual
24
25 (b) The FSF's Back-Cover Text is:
26
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{}
42
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
62
63 @node Invoking GCC
64 @chapter GCC Command Options
65 @cindex GCC command options
66 @cindex command options
67 @cindex options, GCC command
68
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.
75
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.
80
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.
87
88 @cindex C++ compilation options
89 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
90 options for compiling C++ programs.
91
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}}.
98
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.
106
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.
113
114 @c man end
115
116 @xref{Option Index}, for an index to GCC's options.
117
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
148
149 @c man begin OPTIONS
150
151 @node Option Summary
152 @section Option Summary
153
154 Here is a summary of all the options, grouped by type.  Explanations are
155 in the following sections.
156
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}}
165
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}
176
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 -fvisibility-ms-compat @gol
195 -fext-numeric-literals @gol
196 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
197 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
198 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
199 -Weffc++  -Wstrict-null-sentinel @gol
200 -Wno-non-template-friend  -Wold-style-cast @gol
201 -Woverloaded-virtual  -Wno-pmf-conversions @gol
202 -Wsign-promo}
203
204 @item Objective-C and Objective-C++ Language Options
205 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
206 Objective-C and Objective-C++ Dialects}.
207 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
208 -fgnu-runtime  -fnext-runtime @gol
209 -fno-nil-receivers @gol
210 -fobjc-abi-version=@var{n} @gol
211 -fobjc-call-cxx-cdtors @gol
212 -fobjc-direct-dispatch @gol
213 -fobjc-exceptions @gol
214 -fobjc-gc @gol
215 -fobjc-nilcheck @gol
216 -fobjc-std=objc1 @gol
217 -freplace-objc-classes @gol
218 -fzero-link @gol
219 -gen-decls @gol
220 -Wassign-intercept @gol
221 -Wno-protocol  -Wselector @gol
222 -Wstrict-selector-match @gol
223 -Wundeclared-selector}
224
225 @item Language Independent Options
226 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
227 @gccoptlist{-fmessage-length=@var{n}  @gol
228 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
229 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
230
231 @item Warning Options
232 @xref{Warning Options,,Options to Request or Suppress Warnings}.
233 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
234 -pedantic-errors @gol
235 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
236 -Waggressive-loop-optimizations -Warray-bounds @gol
237 -Wno-attributes -Wno-builtin-macro-redefined @gol
238 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
239 -Wchar-subscripts -Wclobbered  -Wcomment @gol
240 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
241 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
242 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
243 -Wno-endif-labels -Werror  -Werror=* @gol
244 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
245 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
246 -Wformat-security  -Wformat-y2k @gol
247 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
248 -Wignored-qualifiers @gol
249 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
250 -Winit-self  -Winline -Wmaybe-uninitialized @gol
251 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
252 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
253 -Wlogical-op -Wlong-long @gol
254 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
255 -Wmissing-include-dirs @gol
256 -Wno-mudflap @gol
257 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
258 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
259 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
260 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
261 -Wredundant-decls  -Wno-return-local-addr @gol
262 -Wreturn-type  -Wsequence-point  -Wshadow @gol
263 -Wsign-compare  -Wsign-conversion  -Wsizeof-pointer-memaccess @gol
264 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
265 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
266 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
267 -Wmissing-format-attribute @gol
268 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
269 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
270 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
271 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
272 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
273 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
274 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
275 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
276 -Wvla -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
277
278 @item C and Objective-C-only Warning Options
279 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
280 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
281 -Wold-style-declaration  -Wold-style-definition @gol
282 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
283 -Wdeclaration-after-statement -Wpointer-sign}
284
285 @item Debugging Options
286 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
287 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
288 -fsanitize=@var{style} @gol
289 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
290 -fdisable-ipa-@var{pass_name} @gol
291 -fdisable-rtl-@var{pass_name} @gol
292 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
293 -fdisable-tree-@var{pass_name} @gol
294 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
295 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
296 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
297 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
298 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
299 -fdump-passes @gol
300 -fdump-statistics @gol
301 -fdump-tree-all @gol
302 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
303 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
304 -fdump-tree-cfg -fdump-tree-alias @gol
305 -fdump-tree-ch @gol
306 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
307 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
308 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
309 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
310 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
315 -fdump-tree-nrv -fdump-tree-vect @gol
316 -fdump-tree-sink @gol
317 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
318 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
319 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
320 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
321 -ftree-vectorizer-verbose=@var{n} @gol
322 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
323 -fdump-final-insns=@var{file} @gol
324 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
325 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
326 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
327 -fenable-@var{kind}-@var{pass} @gol
328 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
329 -fdebug-types-section -fmem-report-wpa @gol
330 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
331 -fopt-info @gol
332 -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
333 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
334 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
335 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
336 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
337 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
338 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
339 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
340 -gvms  -gxcoff  -gxcoff+ @gol
341 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
342 -fdebug-prefix-map=@var{old}=@var{new} @gol
343 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
344 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
345 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
346 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
347 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
348 -print-sysroot -print-sysroot-headers-suffix @gol
349 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
350
351 @item Optimization Options
352 @xref{Optimize Options,,Options that Control Optimization}.
353 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
354 -falign-jumps[=@var{n}] @gol
355 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
356 -fassociative-math -fauto-inc-dec -fbranch-probabilities @gol
357 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
358 -fbtr-bb-exclusive -fcaller-saves @gol
359 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
360 -fcompare-elim -fcprop-registers -fcrossjumping @gol
361 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
362 -fcx-limited-range @gol
363 -fdata-sections -fdce -fdelayed-branch @gol
364 -fdelete-null-pointer-checks -fdevirtualize -fdse @gol
365 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
366 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
367 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
368 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
369 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
370 -fif-conversion2 -findirect-inlining @gol
371 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
372 -finline-small-functions -fipa-cp -fipa-cp-clone @gol
373 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
374 -fira-algorithm=@var{algorithm} @gol
375 -fira-region=@var{region} -fira-hoist-pressure @gol
376 -fira-loop-pressure -fno-ira-share-save-slots @gol
377 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
378 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
379 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
380 -floop-parallelize-all -flto -flto-compression-level @gol
381 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
382 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
383 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
384 -fno-default-inline @gol
385 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
386 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
387 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
388 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
389 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
390 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
391 -fprefetch-loop-arrays -fprofile-report @gol
392 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
393 -fprofile-generate=@var{path} @gol
394 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
395 -freciprocal-math -free -fregmove -frename-registers -freorder-blocks @gol
396 -freorder-blocks-and-partition -freorder-functions @gol
397 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
398 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
399 -fsched-spec-load -fsched-spec-load-dangerous @gol
400 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
401 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
402 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
403 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
404 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
405 -fselective-scheduling -fselective-scheduling2 @gol
406 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
407 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
408 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
409 -fstack-protector-all -fstrict-aliasing -fstrict-overflow @gol
410 -fthread-jumps -ftracer -ftree-bit-ccp @gol
411 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
412 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
413 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
414 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
415 -ftree-loop-if-convert-stores -ftree-loop-im @gol
416 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
417 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
418 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
419 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
420 -ftree-switch-conversion -ftree-tail-merge @gol
421 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
422 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
423 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
424 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
425 -fwhole-program -fwpa -fuse-ld=@var{linker} -fuse-linker-plugin @gol
426 --param @var{name}=@var{value}
427 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
428
429 @item Preprocessor Options
430 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
431 @gccoptlist{-A@var{question}=@var{answer} @gol
432 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
433 -C  -dD  -dI  -dM  -dN @gol
434 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
435 -idirafter @var{dir} @gol
436 -include @var{file}  -imacros @var{file} @gol
437 -iprefix @var{file}  -iwithprefix @var{dir} @gol
438 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
439 -imultilib @var{dir} -isysroot @var{dir} @gol
440 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
441 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
442 -remap -trigraphs  -undef  -U@var{macro}  @gol
443 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
444
445 @item Assembler Option
446 @xref{Assembler Options,,Passing Options to the Assembler}.
447 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
448
449 @item Linker Options
450 @xref{Link Options,,Options for Linking}.
451 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
452 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
453 -s  -static -static-libgcc -static-libstdc++ @gol
454 -static-libasan -static-libtsan @gol
455 -shared -shared-libgcc  -symbolic @gol
456 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
457 -u @var{symbol}}
458
459 @item Directory Options
460 @xref{Directory Options,,Options for Directory Search}.
461 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
462 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
463 --sysroot=@var{dir} --no-sysroot-suffix}
464
465 @item Machine Dependent Options
466 @xref{Submodel Options,,Hardware Models and Configurations}.
467 @c This list is ordered alphanumerically by subsection name.
468 @c Try and put the significant identifier (CPU or system) first,
469 @c so users have a clue at guessing where the ones they want will be.
470
471 @emph{AArch64 Options}
472 @gccoptlist{-mbig-endian  -mlittle-endian @gol
473 -mgeneral-regs-only @gol
474 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
475 -mstrict-align @gol
476 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
477 -mtls-dialect=desc  -mtls-dialect=traditional @gol
478 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
479
480 @emph{Adapteva Epiphany Options}
481 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
482 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
483 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
484 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
485 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
486 -msplit-vecmove-early -m1reg-@var{reg}}
487
488 @emph{ARM Options}
489 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
490 -mabi=@var{name} @gol
491 -mapcs-stack-check  -mno-apcs-stack-check @gol
492 -mapcs-float  -mno-apcs-float @gol
493 -mapcs-reentrant  -mno-apcs-reentrant @gol
494 -msched-prolog  -mno-sched-prolog @gol
495 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
496 -mfloat-abi=@var{name} @gol
497 -mfp16-format=@var{name}
498 -mthumb-interwork  -mno-thumb-interwork @gol
499 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
500 -mstructure-size-boundary=@var{n} @gol
501 -mabort-on-noreturn @gol
502 -mlong-calls  -mno-long-calls @gol
503 -msingle-pic-base  -mno-single-pic-base @gol
504 -mpic-register=@var{reg} @gol
505 -mnop-fun-dllimport @gol
506 -mpoke-function-name @gol
507 -mthumb  -marm @gol
508 -mtpcs-frame  -mtpcs-leaf-frame @gol
509 -mcaller-super-interworking  -mcallee-super-interworking @gol
510 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
511 -mword-relocations @gol
512 -mfix-cortex-m3-ldrd @gol
513 -munaligned-access}
514
515 @emph{AVR Options}
516 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
517 -mcall-prologues -mint8 -mno-interrupts -mrelax @gol
518 -mstrict-X -mtiny-stack -Waddr-space-convert}
519
520 @emph{Blackfin Options}
521 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
522 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
523 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
524 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
525 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
526 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
527 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
528 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
529 -micplb}
530
531 @emph{C6X Options}
532 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
533 -msim -msdata=@var{sdata-type}}
534
535 @emph{CRIS Options}
536 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
537 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
538 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
539 -mstack-align  -mdata-align  -mconst-align @gol
540 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
541 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
542 -mmul-bug-workaround  -mno-mul-bug-workaround}
543
544 @emph{CR16 Options}
545 @gccoptlist{-mmac @gol
546 -mcr16cplus -mcr16c @gol
547 -msim -mint32 -mbit-ops
548 -mdata-model=@var{model}}
549
550 @emph{Darwin Options}
551 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
552 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
553 -client_name  -compatibility_version  -current_version @gol
554 -dead_strip @gol
555 -dependency-file  -dylib_file  -dylinker_install_name @gol
556 -dynamic  -dynamiclib  -exported_symbols_list @gol
557 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
558 -force_flat_namespace  -headerpad_max_install_names @gol
559 -iframework @gol
560 -image_base  -init  -install_name  -keep_private_externs @gol
561 -multi_module  -multiply_defined  -multiply_defined_unused @gol
562 -noall_load   -no_dead_strip_inits_and_terms @gol
563 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
564 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
565 -private_bundle  -read_only_relocs  -sectalign @gol
566 -sectobjectsymbols  -whyload  -seg1addr @gol
567 -sectcreate  -sectobjectsymbols  -sectorder @gol
568 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
569 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
570 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
571 -single_module  -static  -sub_library  -sub_umbrella @gol
572 -twolevel_namespace  -umbrella  -undefined @gol
573 -unexported_symbols_list  -weak_reference_mismatches @gol
574 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
575 -mkernel -mone-byte-bool}
576
577 @emph{DEC Alpha Options}
578 @gccoptlist{-mno-fp-regs  -msoft-float @gol
579 -mieee  -mieee-with-inexact  -mieee-conformant @gol
580 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
581 -mtrap-precision=@var{mode}  -mbuild-constants @gol
582 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
583 -mbwx  -mmax  -mfix  -mcix @gol
584 -mfloat-vax  -mfloat-ieee @gol
585 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
586 -msmall-text  -mlarge-text @gol
587 -mmemory-latency=@var{time}}
588
589 @emph{FR30 Options}
590 @gccoptlist{-msmall-model -mno-lsim}
591
592 @emph{FRV Options}
593 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
594 -mhard-float  -msoft-float @gol
595 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
596 -mdouble  -mno-double @gol
597 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
598 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
599 -mlinked-fp  -mlong-calls  -malign-labels @gol
600 -mlibrary-pic  -macc-4  -macc-8 @gol
601 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
602 -moptimize-membar -mno-optimize-membar @gol
603 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
604 -mvliw-branch  -mno-vliw-branch @gol
605 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
606 -mno-nested-cond-exec  -mtomcat-stats @gol
607 -mTLS -mtls @gol
608 -mcpu=@var{cpu}}
609
610 @emph{GNU/Linux Options}
611 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
612 -tno-android-cc -tno-android-ld}
613
614 @emph{H8/300 Options}
615 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
616
617 @emph{HPPA Options}
618 @gccoptlist{-march=@var{architecture-type} @gol
619 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
620 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
621 -mfixed-range=@var{register-range} @gol
622 -mjump-in-delay -mlinker-opt -mlong-calls @gol
623 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
624 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
625 -mno-jump-in-delay  -mno-long-load-store @gol
626 -mno-portable-runtime  -mno-soft-float @gol
627 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
628 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
629 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
630 -munix=@var{unix-std}  -nolibdld  -static  -threads}
631
632 @emph{i386 and x86-64 Options}
633 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
634 -mfpmath=@var{unit} @gol
635 -masm=@var{dialect}  -mno-fancy-math-387 @gol
636 -mno-fp-ret-in-387  -msoft-float @gol
637 -mno-wide-multiply  -mrtd  -malign-double @gol
638 -mpreferred-stack-boundary=@var{num} @gol
639 -mincoming-stack-boundary=@var{num} @gol
640 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
641 -mrecip -mrecip=@var{opt} @gol
642 -mvzeroupper -mprefer-avx128 @gol
643 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
644 -mavx2 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
645 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
646 -mbmi2 -mrtm -mlwp -mthreads @gol
647 -mno-align-stringops  -minline-all-stringops @gol
648 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
649 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
650 -m96bit-long-double -mlong-double-64 -mlong-double-80 @gol
651 -mregparm=@var{num}  -msseregparm @gol
652 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
653 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
654 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
655 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
656 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
657 -msse2avx -mfentry -m8bit-idiv @gol
658 -mavx256-split-unaligned-load -mavx256-split-unaligned-store}
659
660 @emph{i386 and x86-64 Windows Options}
661 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
662 -mnop-fun-dllimport -mthread @gol
663 -municode -mwin32 -mwindows -fno-set-stack-executable}
664
665 @emph{IA-64 Options}
666 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
667 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
668 -mconstant-gp  -mauto-pic  -mfused-madd @gol
669 -minline-float-divide-min-latency @gol
670 -minline-float-divide-max-throughput @gol
671 -mno-inline-float-divide @gol
672 -minline-int-divide-min-latency @gol
673 -minline-int-divide-max-throughput  @gol
674 -mno-inline-int-divide @gol
675 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
676 -mno-inline-sqrt @gol
677 -mdwarf2-asm -mearly-stop-bits @gol
678 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
679 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
680 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
681 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
682 -msched-spec-ldc -msched-spec-control-ldc @gol
683 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
684 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
685 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
686 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
687
688 @emph{LM32 Options}
689 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
690 -msign-extend-enabled -muser-enabled}
691
692 @emph{M32R/D Options}
693 @gccoptlist{-m32r2 -m32rx -m32r @gol
694 -mdebug @gol
695 -malign-loops -mno-align-loops @gol
696 -missue-rate=@var{number} @gol
697 -mbranch-cost=@var{number} @gol
698 -mmodel=@var{code-size-model-type} @gol
699 -msdata=@var{sdata-type} @gol
700 -mno-flush-func -mflush-func=@var{name} @gol
701 -mno-flush-trap -mflush-trap=@var{number} @gol
702 -G @var{num}}
703
704 @emph{M32C Options}
705 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
706
707 @emph{M680x0 Options}
708 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
709 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
710 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
711 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
712 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
713 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
714 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
715 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
716 -mxgot -mno-xgot}
717
718 @emph{MCore Options}
719 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
720 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
721 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
722 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
723 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
724
725 @emph{MeP Options}
726 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
727 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
728 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
729 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
730 -mtiny=@var{n}}
731
732 @emph{MicroBlaze Options}
733 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
734 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
735 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
736 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
737 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
738
739 @emph{MIPS Options}
740 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
741 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
742 -mips64  -mips64r2 @gol
743 -mips16  -mno-mips16  -mflip-mips16 @gol
744 -minterlink-mips16  -mno-interlink-mips16 @gol
745 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
746 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
747 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
748 -mno-float -msingle-float  -mdouble-float  @gol
749 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
750 -mmcu -mmno-mcu @gol
751 -mfpu=@var{fpu-type} @gol
752 -msmartmips  -mno-smartmips @gol
753 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
754 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
755 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
756 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
757 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
758 -membedded-data  -mno-embedded-data @gol
759 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
760 -mcode-readable=@var{setting} @gol
761 -msplit-addresses  -mno-split-addresses @gol
762 -mexplicit-relocs  -mno-explicit-relocs @gol
763 -mcheck-zero-division  -mno-check-zero-division @gol
764 -mdivide-traps  -mdivide-breaks @gol
765 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
766 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
767 -mfix-24k -mno-fix-24k @gol
768 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
769 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
770 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
771 -mflush-func=@var{func}  -mno-flush-func @gol
772 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
773 -mfp-exceptions -mno-fp-exceptions @gol
774 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
775 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
776
777 @emph{MMIX Options}
778 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
779 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
780 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
781 -mno-base-addresses  -msingle-exit  -mno-single-exit}
782
783 @emph{MN10300 Options}
784 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
785 -mno-am33 -mam33 -mam33-2 -mam34 @gol
786 -mtune=@var{cpu-type} @gol
787 -mreturn-pointer-on-d0 @gol
788 -mno-crt0  -mrelax -mliw -msetlb}
789
790 @emph{Moxie Options}
791 @gccoptlist{-meb -mel -mno-crt0}
792
793 @emph{PDP-11 Options}
794 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
795 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
796 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
797 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
798 -mbranch-expensive  -mbranch-cheap @gol
799 -munix-asm  -mdec-asm}
800
801 @emph{picoChip Options}
802 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
803 -msymbol-as-address -mno-inefficient-warnings}
804
805 @emph{PowerPC Options}
806 See RS/6000 and PowerPC Options.
807
808 @emph{RL78 Options}
809 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
810
811 @emph{RS/6000 and PowerPC Options}
812 @gccoptlist{-mcpu=@var{cpu-type} @gol
813 -mtune=@var{cpu-type} @gol
814 -mcmodel=@var{code-model} @gol
815 -mpowerpc64 @gol
816 -maltivec  -mno-altivec @gol
817 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
818 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
819 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
820 -mfprnd  -mno-fprnd @gol
821 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
822 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
823 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
824 -malign-power  -malign-natural @gol
825 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
826 -msingle-float -mdouble-float -msimple-fpu @gol
827 -mstring  -mno-string  -mupdate  -mno-update @gol
828 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
829 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
830 -mstrict-align  -mno-strict-align  -mrelocatable @gol
831 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
832 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
833 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
834 -mprioritize-restricted-insns=@var{priority} @gol
835 -msched-costly-dep=@var{dependence_type} @gol
836 -minsert-sched-nops=@var{scheme} @gol
837 -mcall-sysv  -mcall-netbsd @gol
838 -maix-struct-return  -msvr4-struct-return @gol
839 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
840 -mblock-move-inline-limit=@var{num} @gol
841 -misel -mno-isel @gol
842 -misel=yes  -misel=no @gol
843 -mspe -mno-spe @gol
844 -mspe=yes  -mspe=no @gol
845 -mpaired @gol
846 -mgen-cell-microcode -mwarn-cell-microcode @gol
847 -mvrsave -mno-vrsave @gol
848 -mmulhw -mno-mulhw @gol
849 -mdlmzb -mno-dlmzb @gol
850 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
851 -mprototype  -mno-prototype @gol
852 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
853 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
854 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
855 -mno-recip-precision @gol
856 -mveclibabi=@var{type} -mfriz -mno-friz @gol
857 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
858 -msave-toc-indirect -mno-save-toc-indirect}
859
860 @emph{RX Options}
861 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
862 -mcpu=@gol
863 -mbig-endian-data -mlittle-endian-data @gol
864 -msmall-data @gol
865 -msim  -mno-sim@gol
866 -mas100-syntax -mno-as100-syntax@gol
867 -mrelax@gol
868 -mmax-constant-size=@gol
869 -mint-register=@gol
870 -mpid@gol
871 -mno-warn-multiple-fast-interrupts@gol
872 -msave-acc-in-interrupts}
873
874 @emph{S/390 and zSeries Options}
875 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
876 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
877 -mlong-double-64 -mlong-double-128 @gol
878 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
879 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
880 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
881 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
882 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
883
884 @emph{Score Options}
885 @gccoptlist{-meb -mel @gol
886 -mnhwloop @gol
887 -muls @gol
888 -mmac @gol
889 -mscore5 -mscore5u -mscore7 -mscore7d}
890
891 @emph{SH Options}
892 @gccoptlist{-m1  -m2  -m2e @gol
893 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
894 -m3  -m3e @gol
895 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
896 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
897 -m5-64media  -m5-64media-nofpu @gol
898 -m5-32media  -m5-32media-nofpu @gol
899 -m5-compact  -m5-compact-nofpu @gol
900 -mb  -ml  -mdalign  -mrelax @gol
901 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
902 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
903 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
904 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
905 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
906 -maccumulate-outgoing-args -minvalid-symbols @gol
907 -matomic-model=@var{atomic-model} @gol
908 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch -mcbranchdi -mcmpeqdi @gol
909 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
910 -mpretend-cmove -mtas}
911
912 @emph{Solaris 2 Options}
913 @gccoptlist{-mimpure-text  -mno-impure-text @gol
914 -pthreads -pthread}
915
916 @emph{SPARC Options}
917 @gccoptlist{-mcpu=@var{cpu-type} @gol
918 -mtune=@var{cpu-type} @gol
919 -mcmodel=@var{code-model} @gol
920 -mmemory-model=@var{mem-model} @gol
921 -m32  -m64  -mapp-regs  -mno-app-regs @gol
922 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
923 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
924 -mhard-quad-float  -msoft-quad-float @gol
925 -mstack-bias  -mno-stack-bias @gol
926 -munaligned-doubles  -mno-unaligned-doubles @gol
927 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
928 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
929 -mcbcond -mno-cbcond @gol
930 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
931 -mfix-at697f}
932
933 @emph{SPU Options}
934 @gccoptlist{-mwarn-reloc -merror-reloc @gol
935 -msafe-dma -munsafe-dma @gol
936 -mbranch-hints @gol
937 -msmall-mem -mlarge-mem -mstdmain @gol
938 -mfixed-range=@var{register-range} @gol
939 -mea32 -mea64 @gol
940 -maddress-space-conversion -mno-address-space-conversion @gol
941 -mcache-size=@var{cache-size} @gol
942 -matomic-updates -mno-atomic-updates}
943
944 @emph{System V Options}
945 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
946
947 @emph{TILE-Gx Options}
948 @gccoptlist{-mcpu=@var{cpu} -m32 -m64 -mcmodel=@var{code-model}}
949
950 @emph{TILEPro Options}
951 @gccoptlist{-mcpu=@var{cpu} -m32}
952
953 @emph{V850 Options}
954 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
955 -mprolog-function  -mno-prolog-function  -mspace @gol
956 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
957 -mapp-regs  -mno-app-regs @gol
958 -mdisable-callt  -mno-disable-callt @gol
959 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
960 -mv850e -mv850 -mv850e3v5 @gol
961 -mloop @gol
962 -mrelax @gol
963 -mlong-jumps @gol
964 -msoft-float @gol
965 -mhard-float @gol
966 -mgcc-abi @gol
967 -mrh850-abi @gol
968 -mbig-switch}
969
970 @emph{VAX Options}
971 @gccoptlist{-mg  -mgnu  -munix}
972
973 @emph{VMS Options}
974 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
975 -mpointer-size=@var{size}}
976
977 @emph{VxWorks Options}
978 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
979 -Xbind-lazy  -Xbind-now}
980
981 @emph{x86-64 Options}
982 See i386 and x86-64 Options.
983
984 @emph{Xstormy16 Options}
985 @gccoptlist{-msim}
986
987 @emph{Xtensa Options}
988 @gccoptlist{-mconst16 -mno-const16 @gol
989 -mfused-madd  -mno-fused-madd @gol
990 -mforce-no-pic @gol
991 -mserialize-volatile  -mno-serialize-volatile @gol
992 -mtext-section-literals  -mno-text-section-literals @gol
993 -mtarget-align  -mno-target-align @gol
994 -mlongcalls  -mno-longcalls}
995
996 @emph{zSeries Options}
997 See S/390 and zSeries Options.
998
999 @item Code Generation Options
1000 @xref{Code Gen Options,,Options for Code Generation Conventions}.
1001 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
1002 -ffixed-@var{reg}  -fexceptions @gol
1003 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
1004 -fasynchronous-unwind-tables @gol
1005 -finhibit-size-directive  -finstrument-functions @gol
1006 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
1007 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
1008 -fno-common  -fno-ident @gol
1009 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
1010 -fno-jump-tables @gol
1011 -frecord-gcc-switches @gol
1012 -freg-struct-return  -fshort-enums @gol
1013 -fshort-double  -fshort-wchar @gol
1014 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
1015 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
1016 -fno-stack-limit -fsplit-stack @gol
1017 -fleading-underscore  -ftls-model=@var{model} @gol
1018 -fstack-reuse=@var{reuse_level} @gol
1019 -ftrapv  -fwrapv  -fbounds-check @gol
1020 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1021 @end table
1022
1023 @menu
1024 * Overall Options::     Controlling the kind of output:
1025                         an executable, object files, assembler files,
1026                         or preprocessed source.
1027 * C Dialect Options::   Controlling the variant of C language compiled.
1028 * C++ Dialect Options:: Variations on C++.
1029 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
1030                         and Objective-C++.
1031 * Language Independent Options:: Controlling how diagnostics should be
1032                         formatted.
1033 * Warning Options::     How picky should the compiler be?
1034 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
1035 * Optimize Options::    How much optimization?
1036 * Preprocessor Options:: Controlling header files and macro definitions.
1037                          Also, getting dependency information for Make.
1038 * Assembler Options::   Passing options to the assembler.
1039 * Link Options::        Specifying libraries and so on.
1040 * Directory Options::   Where to find header files and libraries.
1041                         Where to find the compiler executable files.
1042 * Spec Files::          How to pass switches to sub-processes.
1043 * Target Options::      Running a cross-compiler, or an old version of GCC.
1044 @end menu
1045
1046 @node Overall Options
1047 @section Options Controlling the Kind of Output
1048
1049 Compilation can involve up to four stages: preprocessing, compilation
1050 proper, assembly and linking, always in that order.  GCC is capable of
1051 preprocessing and compiling several files either into several
1052 assembler input files, or into one assembler input file; then each
1053 assembler input file produces an object file, and linking combines all
1054 the object files (those newly compiled, and those specified as input)
1055 into an executable file.
1056
1057 @cindex file name suffix
1058 For any given input file, the file name suffix determines what kind of
1059 compilation is done:
1060
1061 @table @gcctabopt
1062 @item @var{file}.c
1063 C source code that must be preprocessed.
1064
1065 @item @var{file}.i
1066 C source code that should not be preprocessed.
1067
1068 @item @var{file}.ii
1069 C++ source code that should not be preprocessed.
1070
1071 @item @var{file}.m
1072 Objective-C source code.  Note that you must link with the @file{libobjc}
1073 library to make an Objective-C program work.
1074
1075 @item @var{file}.mi
1076 Objective-C source code that should not be preprocessed.
1077
1078 @item @var{file}.mm
1079 @itemx @var{file}.M
1080 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1081 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1082 to a literal capital M@.
1083
1084 @item @var{file}.mii
1085 Objective-C++ source code that should not be preprocessed.
1086
1087 @item @var{file}.h
1088 C, C++, Objective-C or Objective-C++ header file to be turned into a
1089 precompiled header (default), or C, C++ header file to be turned into an
1090 Ada spec (via the @option{-fdump-ada-spec} switch).
1091
1092 @item @var{file}.cc
1093 @itemx @var{file}.cp
1094 @itemx @var{file}.cxx
1095 @itemx @var{file}.cpp
1096 @itemx @var{file}.CPP
1097 @itemx @var{file}.c++
1098 @itemx @var{file}.C
1099 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1100 the last two letters must both be literally @samp{x}.  Likewise,
1101 @samp{.C} refers to a literal capital C@.
1102
1103 @item @var{file}.mm
1104 @itemx @var{file}.M
1105 Objective-C++ source code that must be preprocessed.
1106
1107 @item @var{file}.mii
1108 Objective-C++ source code that should not be preprocessed.
1109
1110 @item @var{file}.hh
1111 @itemx @var{file}.H
1112 @itemx @var{file}.hp
1113 @itemx @var{file}.hxx
1114 @itemx @var{file}.hpp
1115 @itemx @var{file}.HPP
1116 @itemx @var{file}.h++
1117 @itemx @var{file}.tcc
1118 C++ header file to be turned into a precompiled header or Ada spec.
1119
1120 @item @var{file}.f
1121 @itemx @var{file}.for
1122 @itemx @var{file}.ftn
1123 Fixed form Fortran source code that should not be preprocessed.
1124
1125 @item @var{file}.F
1126 @itemx @var{file}.FOR
1127 @itemx @var{file}.fpp
1128 @itemx @var{file}.FPP
1129 @itemx @var{file}.FTN
1130 Fixed form Fortran source code that must be preprocessed (with the traditional
1131 preprocessor).
1132
1133 @item @var{file}.f90
1134 @itemx @var{file}.f95
1135 @itemx @var{file}.f03
1136 @itemx @var{file}.f08
1137 Free form Fortran source code that should not be preprocessed.
1138
1139 @item @var{file}.F90
1140 @itemx @var{file}.F95
1141 @itemx @var{file}.F03
1142 @itemx @var{file}.F08
1143 Free form Fortran source code that must be preprocessed (with the
1144 traditional preprocessor).
1145
1146 @item @var{file}.go
1147 Go source code.
1148
1149 @c FIXME: Descriptions of Java file types.
1150 @c @var{file}.java
1151 @c @var{file}.class
1152 @c @var{file}.zip
1153 @c @var{file}.jar
1154
1155 @item @var{file}.ads
1156 Ada source code file that contains a library unit declaration (a
1157 declaration of a package, subprogram, or generic, or a generic
1158 instantiation), or a library unit renaming declaration (a package,
1159 generic, or subprogram renaming declaration).  Such files are also
1160 called @dfn{specs}.
1161
1162 @item @var{file}.adb
1163 Ada source code file containing a library unit body (a subprogram or
1164 package body).  Such files are also called @dfn{bodies}.
1165
1166 @c GCC also knows about some suffixes for languages not yet included:
1167 @c Pascal:
1168 @c @var{file}.p
1169 @c @var{file}.pas
1170 @c Ratfor:
1171 @c @var{file}.r
1172
1173 @item @var{file}.s
1174 Assembler code.
1175
1176 @item @var{file}.S
1177 @itemx @var{file}.sx
1178 Assembler code that must be preprocessed.
1179
1180 @item @var{other}
1181 An object file to be fed straight into linking.
1182 Any file name with no recognized suffix is treated this way.
1183 @end table
1184
1185 @opindex x
1186 You can specify the input language explicitly with the @option{-x} option:
1187
1188 @table @gcctabopt
1189 @item -x @var{language}
1190 Specify explicitly the @var{language} for the following input files
1191 (rather than letting the compiler choose a default based on the file
1192 name suffix).  This option applies to all following input files until
1193 the next @option{-x} option.  Possible values for @var{language} are:
1194 @smallexample
1195 c  c-header  cpp-output
1196 c++  c++-header  c++-cpp-output
1197 objective-c  objective-c-header  objective-c-cpp-output
1198 objective-c++ objective-c++-header objective-c++-cpp-output
1199 assembler  assembler-with-cpp
1200 ada
1201 f77  f77-cpp-input f95  f95-cpp-input
1202 go
1203 java
1204 @end smallexample
1205
1206 @item -x none
1207 Turn off any specification of a language, so that subsequent files are
1208 handled according to their file name suffixes (as they are if @option{-x}
1209 has not been used at all).
1210
1211 @item -pass-exit-codes
1212 @opindex pass-exit-codes
1213 Normally the @command{gcc} program exits with the code of 1 if any
1214 phase of the compiler returns a non-success return code.  If you specify
1215 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1216 the numerically highest error produced by any phase returning an error
1217 indication.  The C, C++, and Fortran front ends return 4 if an internal
1218 compiler error is encountered.
1219 @end table
1220
1221 If you only want some of the stages of compilation, you can use
1222 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1223 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1224 @command{gcc} is to stop.  Note that some combinations (for example,
1225 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1226
1227 @table @gcctabopt
1228 @item -c
1229 @opindex c
1230 Compile or assemble the source files, but do not link.  The linking
1231 stage simply is not done.  The ultimate output is in the form of an
1232 object file for each source file.
1233
1234 By default, the object file name for a source file is made by replacing
1235 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1236
1237 Unrecognized input files, not requiring compilation or assembly, are
1238 ignored.
1239
1240 @item -S
1241 @opindex S
1242 Stop after the stage of compilation proper; do not assemble.  The output
1243 is in the form of an assembler code file for each non-assembler input
1244 file specified.
1245
1246 By default, the assembler file name for a source file is made by
1247 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1248
1249 Input files that don't require compilation are ignored.
1250
1251 @item -E
1252 @opindex E
1253 Stop after the preprocessing stage; do not run the compiler proper.  The
1254 output is in the form of preprocessed source code, which is sent to the
1255 standard output.
1256
1257 Input files that don't require preprocessing are ignored.
1258
1259 @cindex output file option
1260 @item -o @var{file}
1261 @opindex o
1262 Place output in file @var{file}.  This applies to whatever
1263 sort of output is being produced, whether it be an executable file,
1264 an object file, an assembler file or preprocessed C code.
1265
1266 If @option{-o} is not specified, the default is to put an executable
1267 file in @file{a.out}, the object file for
1268 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1269 assembler file in @file{@var{source}.s}, a precompiled header file in
1270 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1271 standard output.
1272
1273 @item -v
1274 @opindex v
1275 Print (on standard error output) the commands executed to run the stages
1276 of compilation.  Also print the version number of the compiler driver
1277 program and of the preprocessor and the compiler proper.
1278
1279 @item -###
1280 @opindex ###
1281 Like @option{-v} except the commands are not executed and arguments
1282 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1283 This is useful for shell scripts to capture the driver-generated command lines.
1284
1285 @item -pipe
1286 @opindex pipe
1287 Use pipes rather than temporary files for communication between the
1288 various stages of compilation.  This fails to work on some systems where
1289 the assembler is unable to read from a pipe; but the GNU assembler has
1290 no trouble.
1291
1292 @item --help
1293 @opindex help
1294 Print (on the standard output) a description of the command-line options
1295 understood by @command{gcc}.  If the @option{-v} option is also specified
1296 then @option{--help} is also passed on to the various processes
1297 invoked by @command{gcc}, so that they can display the command-line options
1298 they accept.  If the @option{-Wextra} option has also been specified
1299 (prior to the @option{--help} option), then command-line options that
1300 have no documentation associated with them are also displayed.
1301
1302 @item --target-help
1303 @opindex target-help
1304 Print (on the standard output) a description of target-specific command-line
1305 options for each tool.  For some targets extra target-specific
1306 information may also be printed.
1307
1308 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1309 Print (on the standard output) a description of the command-line
1310 options understood by the compiler that fit into all specified classes
1311 and qualifiers.  These are the supported classes:
1312
1313 @table @asis
1314 @item @samp{optimizers}
1315 Display all of the optimization options supported by the
1316 compiler.
1317
1318 @item @samp{warnings}
1319 Display all of the options controlling warning messages
1320 produced by the compiler.
1321
1322 @item @samp{target}
1323 Display target-specific options.  Unlike the
1324 @option{--target-help} option however, target-specific options of the
1325 linker and assembler are not displayed.  This is because those
1326 tools do not currently support the extended @option{--help=} syntax.
1327
1328 @item @samp{params}
1329 Display the values recognized by the @option{--param}
1330 option.
1331
1332 @item @var{language}
1333 Display the options supported for @var{language}, where
1334 @var{language} is the name of one of the languages supported in this
1335 version of GCC@.
1336
1337 @item @samp{common}
1338 Display the options that are common to all languages.
1339 @end table
1340
1341 These are the supported qualifiers:
1342
1343 @table @asis
1344 @item @samp{undocumented}
1345 Display only those options that are undocumented.
1346
1347 @item @samp{joined}
1348 Display options taking an argument that appears after an equal
1349 sign in the same continuous piece of text, such as:
1350 @samp{--help=target}.
1351
1352 @item @samp{separate}
1353 Display options taking an argument that appears as a separate word
1354 following the original option, such as: @samp{-o output-file}.
1355 @end table
1356
1357 Thus for example to display all the undocumented target-specific
1358 switches supported by the compiler, use:
1359
1360 @smallexample
1361 --help=target,undocumented
1362 @end smallexample
1363
1364 The sense of a qualifier can be inverted by prefixing it with the
1365 @samp{^} character, so for example to display all binary warning
1366 options (i.e., ones that are either on or off and that do not take an
1367 argument) that have a description, use:
1368
1369 @smallexample
1370 --help=warnings,^joined,^undocumented
1371 @end smallexample
1372
1373 The argument to @option{--help=} should not consist solely of inverted
1374 qualifiers.
1375
1376 Combining several classes is possible, although this usually
1377 restricts the output so much that there is nothing to display.  One
1378 case where it does work, however, is when one of the classes is
1379 @var{target}.  For example, to display all the target-specific
1380 optimization options, use:
1381
1382 @smallexample
1383 --help=target,optimizers
1384 @end smallexample
1385
1386 The @option{--help=} option can be repeated on the command line.  Each
1387 successive use displays its requested class of options, skipping
1388 those that have already been displayed.
1389
1390 If the @option{-Q} option appears on the command line before the
1391 @option{--help=} option, then the descriptive text displayed by
1392 @option{--help=} is changed.  Instead of describing the displayed
1393 options, an indication is given as to whether the option is enabled,
1394 disabled or set to a specific value (assuming that the compiler
1395 knows this at the point where the @option{--help=} option is used).
1396
1397 Here is a truncated example from the ARM port of @command{gcc}:
1398
1399 @smallexample
1400   % gcc -Q -mabi=2 --help=target -c
1401   The following options are target specific:
1402   -mabi=                                2
1403   -mabort-on-noreturn                   [disabled]
1404   -mapcs                                [disabled]
1405 @end smallexample
1406
1407 The output is sensitive to the effects of previous command-line
1408 options, so for example it is possible to find out which optimizations
1409 are enabled at @option{-O2} by using:
1410
1411 @smallexample
1412 -Q -O2 --help=optimizers
1413 @end smallexample
1414
1415 Alternatively you can discover which binary optimizations are enabled
1416 by @option{-O3} by using:
1417
1418 @smallexample
1419 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1420 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1421 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1422 @end smallexample
1423
1424 @item -no-canonical-prefixes
1425 @opindex no-canonical-prefixes
1426 Do not expand any symbolic links, resolve references to @samp{/../}
1427 or @samp{/./}, or make the path absolute when generating a relative
1428 prefix.
1429
1430 @item --version
1431 @opindex version
1432 Display the version number and copyrights of the invoked GCC@.
1433
1434 @item -wrapper
1435 @opindex wrapper
1436 Invoke all subcommands under a wrapper program.  The name of the
1437 wrapper program and its parameters are passed as a comma separated
1438 list.
1439
1440 @smallexample
1441 gcc -c t.c -wrapper gdb,--args
1442 @end smallexample
1443
1444 @noindent
1445 This invokes all subprograms of @command{gcc} under
1446 @samp{gdb --args}, thus the invocation of @command{cc1} is
1447 @samp{gdb --args cc1 @dots{}}.
1448
1449 @item -fplugin=@var{name}.so
1450 Load the plugin code in file @var{name}.so, assumed to be a
1451 shared object to be dlopen'd by the compiler.  The base name of
1452 the shared object file is used to identify the plugin for the
1453 purposes of argument parsing (See
1454 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1455 Each plugin should define the callback functions specified in the
1456 Plugins API.
1457
1458 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1459 Define an argument called @var{key} with a value of @var{value}
1460 for the plugin called @var{name}.
1461
1462 @item -fdump-ada-spec@r{[}-slim@r{]}
1463 For C and C++ source and include files, generate corresponding Ada
1464 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1465 GNAT User's Guide}, which provides detailed documentation on this feature.
1466
1467 @item -fdump-go-spec=@var{file}
1468 For input files in any language, generate corresponding Go
1469 declarations in @var{file}.  This generates Go @code{const},
1470 @code{type}, @code{var}, and @code{func} declarations which may be a
1471 useful way to start writing a Go interface to code written in some
1472 other language.
1473
1474 @include @value{srcdir}/../libiberty/at-file.texi
1475 @end table
1476
1477 @node Invoking G++
1478 @section Compiling C++ Programs
1479
1480 @cindex suffixes for C++ source
1481 @cindex C++ source file suffixes
1482 C++ source files conventionally use one of the suffixes @samp{.C},
1483 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1484 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1485 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1486 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1487 files with these names and compiles them as C++ programs even if you
1488 call the compiler the same way as for compiling C programs (usually
1489 with the name @command{gcc}).
1490
1491 @findex g++
1492 @findex c++
1493 However, the use of @command{gcc} does not add the C++ library.
1494 @command{g++} is a program that calls GCC and automatically specifies linking
1495 against the C++ library.  It treats @samp{.c},
1496 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1497 files unless @option{-x} is used.  This program is also useful when
1498 precompiling a C header file with a @samp{.h} extension for use in C++
1499 compilations.  On many systems, @command{g++} is also installed with
1500 the name @command{c++}.
1501
1502 @cindex invoking @command{g++}
1503 When you compile C++ programs, you may specify many of the same
1504 command-line options that you use for compiling programs in any
1505 language; or command-line options meaningful for C and related
1506 languages; or options that are meaningful only for C++ programs.
1507 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1508 explanations of options for languages related to C@.
1509 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1510 explanations of options that are meaningful only for C++ programs.
1511
1512 @node C Dialect Options
1513 @section Options Controlling C Dialect
1514 @cindex dialect options
1515 @cindex language dialect options
1516 @cindex options, dialect
1517
1518 The following options control the dialect of C (or languages derived
1519 from C, such as C++, Objective-C and Objective-C++) that the compiler
1520 accepts:
1521
1522 @table @gcctabopt
1523 @cindex ANSI support
1524 @cindex ISO support
1525 @item -ansi
1526 @opindex ansi
1527 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1528 equivalent to @option{-std=c++98}.
1529
1530 This turns off certain features of GCC that are incompatible with ISO
1531 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1532 such as the @code{asm} and @code{typeof} keywords, and
1533 predefined macros such as @code{unix} and @code{vax} that identify the
1534 type of system you are using.  It also enables the undesirable and
1535 rarely used ISO trigraph feature.  For the C compiler,
1536 it disables recognition of C++ style @samp{//} comments as well as
1537 the @code{inline} keyword.
1538
1539 The alternate keywords @code{__asm__}, @code{__extension__},
1540 @code{__inline__} and @code{__typeof__} continue to work despite
1541 @option{-ansi}.  You would not want to use them in an ISO C program, of
1542 course, but it is useful to put them in header files that might be included
1543 in compilations done with @option{-ansi}.  Alternate predefined macros
1544 such as @code{__unix__} and @code{__vax__} are also available, with or
1545 without @option{-ansi}.
1546
1547 The @option{-ansi} option does not cause non-ISO programs to be
1548 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1549 addition to @option{-ansi}.  @xref{Warning Options}.
1550
1551 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1552 option is used.  Some header files may notice this macro and refrain
1553 from declaring certain functions or defining certain macros that the
1554 ISO standard doesn't call for; this is to avoid interfering with any
1555 programs that might use these names for other things.
1556
1557 Functions that are normally built in but do not have semantics
1558 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1559 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1560 built-in functions provided by GCC}, for details of the functions
1561 affected.
1562
1563 @item -std=
1564 @opindex std
1565 Determine the language standard. @xref{Standards,,Language Standards
1566 Supported by GCC}, for details of these standard versions.  This option
1567 is currently only supported when compiling C or C++.
1568
1569 The compiler can accept several base standards, such as @samp{c90} or
1570 @samp{c++98}, and GNU dialects of those standards, such as
1571 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1572 compiler accepts all programs following that standard plus those
1573 using GNU extensions that do not contradict it.  For example,
1574 @option{-std=c90} turns off certain features of GCC that are
1575 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1576 keywords, but not other GNU extensions that do not have a meaning in
1577 ISO C90, such as omitting the middle term of a @code{?:}
1578 expression. On the other hand, when a GNU dialect of a standard is
1579 specified, all features supported by the compiler are enabled, even when
1580 those features change the meaning of the base standard.  As a result, some
1581 strict-conforming programs may be rejected.  The particular standard
1582 is used by @option{-Wpedantic} to identify which features are GNU
1583 extensions given that version of the standard. For example
1584 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1585 comments, while @option{-std=gnu99 -Wpedantic} does not.
1586
1587 A value for this option must be provided; possible values are
1588
1589 @table @samp
1590 @item c90
1591 @itemx c89
1592 @itemx iso9899:1990
1593 Support all ISO C90 programs (certain GNU extensions that conflict
1594 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1595
1596 @item iso9899:199409
1597 ISO C90 as modified in amendment 1.
1598
1599 @item c99
1600 @itemx c9x
1601 @itemx iso9899:1999
1602 @itemx iso9899:199x
1603 ISO C99.  Note that this standard is not yet fully supported; see
1604 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1605 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1606
1607 @item c11
1608 @itemx c1x
1609 @itemx iso9899:2011
1610 ISO C11, the 2011 revision of the ISO C standard.
1611 Support is incomplete and experimental.  The name @samp{c1x} is
1612 deprecated.
1613
1614 @item gnu90
1615 @itemx gnu89
1616 GNU dialect of ISO C90 (including some C99 features). This
1617 is the default for C code.
1618
1619 @item gnu99
1620 @itemx gnu9x
1621 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1622 this will become the default.  The name @samp{gnu9x} is deprecated.
1623
1624 @item gnu11
1625 @itemx gnu1x
1626 GNU dialect of ISO C11.  Support is incomplete and experimental.  The
1627 name @samp{gnu1x} is deprecated.
1628
1629 @item c++98
1630 @itemx c++03
1631 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1632 additional defect reports. Same as @option{-ansi} for C++ code.
1633
1634 @item gnu++98
1635 @itemx gnu++03
1636 GNU dialect of @option{-std=c++98}.  This is the default for
1637 C++ code.
1638
1639 @item c++11
1640 @itemx c++0x
1641 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1642 experimental, and may change in incompatible ways in future releases.
1643 The name @samp{c++0x} is deprecated.
1644
1645 @item gnu++11
1646 @itemx gnu++0x
1647 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1648 experimental, and may change in incompatible ways in future releases.
1649 The name @samp{gnu++0x} is deprecated.
1650
1651 @item c++1y
1652 The next revision of the ISO C++ standard, tentatively planned for
1653 2017.  Support is highly experimental, and will almost certainly
1654 change in incompatible ways in future releases.
1655
1656 @item gnu++1y
1657 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1658 and will almost certainly change in incompatible ways in future
1659 releases.
1660 @end table
1661
1662 @item -fgnu89-inline
1663 @opindex fgnu89-inline
1664 The option @option{-fgnu89-inline} tells GCC to use the traditional
1665 GNU semantics for @code{inline} functions when in C99 mode.
1666 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1667 is accepted and ignored by GCC versions 4.1.3 up to but not including
1668 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1669 C99 mode.  Using this option is roughly equivalent to adding the
1670 @code{gnu_inline} function attribute to all inline functions
1671 (@pxref{Function Attributes}).
1672
1673 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1674 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1675 specifies the default behavior).  This option was first supported in
1676 GCC 4.3.  This option is not supported in @option{-std=c90} or
1677 @option{-std=gnu90} mode.
1678
1679 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1680 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1681 in effect for @code{inline} functions.  @xref{Common Predefined
1682 Macros,,,cpp,The C Preprocessor}.
1683
1684 @item -aux-info @var{filename}
1685 @opindex aux-info
1686 Output to the given filename prototyped declarations for all functions
1687 declared and/or defined in a translation unit, including those in header
1688 files.  This option is silently ignored in any language other than C@.
1689
1690 Besides declarations, the file indicates, in comments, the origin of
1691 each declaration (source file and line), whether the declaration was
1692 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1693 @samp{O} for old, respectively, in the first character after the line
1694 number and the colon), and whether it came from a declaration or a
1695 definition (@samp{C} or @samp{F}, respectively, in the following
1696 character).  In the case of function definitions, a K&R-style list of
1697 arguments followed by their declarations is also provided, inside
1698 comments, after the declaration.
1699
1700 @item -fallow-parameterless-variadic-functions
1701 Accept variadic functions without named parameters.
1702
1703 Although it is possible to define such a function, this is not very
1704 useful as it is not possible to read the arguments.  This is only
1705 supported for C as this construct is allowed by C++.
1706
1707 @item -fno-asm
1708 @opindex fno-asm
1709 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1710 keyword, so that code can use these words as identifiers.  You can use
1711 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1712 instead.  @option{-ansi} implies @option{-fno-asm}.
1713
1714 In C++, this switch only affects the @code{typeof} keyword, since
1715 @code{asm} and @code{inline} are standard keywords.  You may want to
1716 use the @option{-fno-gnu-keywords} flag instead, which has the same
1717 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1718 switch only affects the @code{asm} and @code{typeof} keywords, since
1719 @code{inline} is a standard keyword in ISO C99.
1720
1721 @item -fno-builtin
1722 @itemx -fno-builtin-@var{function}
1723 @opindex fno-builtin
1724 @cindex built-in functions
1725 Don't recognize built-in functions that do not begin with
1726 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1727 functions provided by GCC}, for details of the functions affected,
1728 including those which are not built-in functions when @option{-ansi} or
1729 @option{-std} options for strict ISO C conformance are used because they
1730 do not have an ISO standard meaning.
1731
1732 GCC normally generates special code to handle certain built-in functions
1733 more efficiently; for instance, calls to @code{alloca} may become single
1734 instructions which adjust the stack directly, and calls to @code{memcpy}
1735 may become inline copy loops.  The resulting code is often both smaller
1736 and faster, but since the function calls no longer appear as such, you
1737 cannot set a breakpoint on those calls, nor can you change the behavior
1738 of the functions by linking with a different library.  In addition,
1739 when a function is recognized as a built-in function, GCC may use
1740 information about that function to warn about problems with calls to
1741 that function, or to generate more efficient code, even if the
1742 resulting code still contains calls to that function.  For example,
1743 warnings are given with @option{-Wformat} for bad calls to
1744 @code{printf} when @code{printf} is built in and @code{strlen} is
1745 known not to modify global memory.
1746
1747 With the @option{-fno-builtin-@var{function}} option
1748 only the built-in function @var{function} is
1749 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1750 function is named that is not built-in in this version of GCC, this
1751 option is ignored.  There is no corresponding
1752 @option{-fbuiltin-@var{function}} option; if you wish to enable
1753 built-in functions selectively when using @option{-fno-builtin} or
1754 @option{-ffreestanding}, you may define macros such as:
1755
1756 @smallexample
1757 #define abs(n)          __builtin_abs ((n))
1758 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1759 @end smallexample
1760
1761 @item -fhosted
1762 @opindex fhosted
1763 @cindex hosted environment
1764
1765 Assert that compilation targets a hosted environment.  This implies
1766 @option{-fbuiltin}.  A hosted environment is one in which the
1767 entire standard library is available, and in which @code{main} has a return
1768 type of @code{int}.  Examples are nearly everything except a kernel.
1769 This is equivalent to @option{-fno-freestanding}.
1770
1771 @item -ffreestanding
1772 @opindex ffreestanding
1773 @cindex hosted environment
1774
1775 Assert that compilation targets a freestanding environment.  This
1776 implies @option{-fno-builtin}.  A freestanding environment
1777 is one in which the standard library may not exist, and program startup may
1778 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1779 This is equivalent to @option{-fno-hosted}.
1780
1781 @xref{Standards,,Language Standards Supported by GCC}, for details of
1782 freestanding and hosted environments.
1783
1784 @item -fopenmp
1785 @opindex fopenmp
1786 @cindex OpenMP parallel
1787 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1788 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1789 compiler generates parallel code according to the OpenMP Application
1790 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1791 implies @option{-pthread}, and thus is only supported on targets that
1792 have support for @option{-pthread}.
1793
1794 @item -fgnu-tm
1795 @opindex fgnu-tm
1796 When the option @option{-fgnu-tm} is specified, the compiler
1797 generates code for the Linux variant of Intel's current Transactional
1798 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1799 an experimental feature whose interface may change in future versions
1800 of GCC, as the official specification changes.  Please note that not
1801 all architectures are supported for this feature.
1802
1803 For more information on GCC's support for transactional memory,
1804 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1805 Transactional Memory Library}.
1806
1807 Note that the transactional memory feature is not supported with
1808 non-call exceptions (@option{-fnon-call-exceptions}).
1809
1810 @item -fms-extensions
1811 @opindex fms-extensions
1812 Accept some non-standard constructs used in Microsoft header files.
1813
1814 In C++ code, this allows member names in structures to be similar
1815 to previous types declarations.
1816
1817 @smallexample
1818 typedef int UOW;
1819 struct ABC @{
1820   UOW UOW;
1821 @};
1822 @end smallexample
1823
1824 Some cases of unnamed fields in structures and unions are only
1825 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1826 fields within structs/unions}, for details.
1827
1828 @item -fplan9-extensions
1829 Accept some non-standard constructs used in Plan 9 code.
1830
1831 This enables @option{-fms-extensions}, permits passing pointers to
1832 structures with anonymous fields to functions that expect pointers to
1833 elements of the type of the field, and permits referring to anonymous
1834 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1835 struct/union fields within structs/unions}, for details.  This is only
1836 supported for C, not C++.
1837
1838 @item -trigraphs
1839 @opindex trigraphs
1840 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1841 options for strict ISO C conformance) implies @option{-trigraphs}.
1842
1843 @cindex traditional C language
1844 @cindex C language, traditional
1845 @item -traditional
1846 @itemx -traditional-cpp
1847 @opindex traditional-cpp
1848 @opindex traditional
1849 Formerly, these options caused GCC to attempt to emulate a pre-standard
1850 C compiler.  They are now only supported with the @option{-E} switch.
1851 The preprocessor continues to support a pre-standard mode.  See the GNU
1852 CPP manual for details.
1853
1854 @item -fcond-mismatch
1855 @opindex fcond-mismatch
1856 Allow conditional expressions with mismatched types in the second and
1857 third arguments.  The value of such an expression is void.  This option
1858 is not supported for C++.
1859
1860 @item -flax-vector-conversions
1861 @opindex flax-vector-conversions
1862 Allow implicit conversions between vectors with differing numbers of
1863 elements and/or incompatible element types.  This option should not be
1864 used for new code.
1865
1866 @item -funsigned-char
1867 @opindex funsigned-char
1868 Let the type @code{char} be unsigned, like @code{unsigned char}.
1869
1870 Each kind of machine has a default for what @code{char} should
1871 be.  It is either like @code{unsigned char} by default or like
1872 @code{signed char} by default.
1873
1874 Ideally, a portable program should always use @code{signed char} or
1875 @code{unsigned char} when it depends on the signedness of an object.
1876 But many programs have been written to use plain @code{char} and
1877 expect it to be signed, or expect it to be unsigned, depending on the
1878 machines they were written for.  This option, and its inverse, let you
1879 make such a program work with the opposite default.
1880
1881 The type @code{char} is always a distinct type from each of
1882 @code{signed char} or @code{unsigned char}, even though its behavior
1883 is always just like one of those two.
1884
1885 @item -fsigned-char
1886 @opindex fsigned-char
1887 Let the type @code{char} be signed, like @code{signed char}.
1888
1889 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1890 the negative form of @option{-funsigned-char}.  Likewise, the option
1891 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1892
1893 @item -fsigned-bitfields
1894 @itemx -funsigned-bitfields
1895 @itemx -fno-signed-bitfields
1896 @itemx -fno-unsigned-bitfields
1897 @opindex fsigned-bitfields
1898 @opindex funsigned-bitfields
1899 @opindex fno-signed-bitfields
1900 @opindex fno-unsigned-bitfields
1901 These options control whether a bit-field is signed or unsigned, when the
1902 declaration does not use either @code{signed} or @code{unsigned}.  By
1903 default, such a bit-field is signed, because this is consistent: the
1904 basic integer types such as @code{int} are signed types.
1905 @end table
1906
1907 @node C++ Dialect Options
1908 @section Options Controlling C++ Dialect
1909
1910 @cindex compiler options, C++
1911 @cindex C++ options, command-line
1912 @cindex options, C++
1913 This section describes the command-line options that are only meaningful
1914 for C++ programs.  You can also use most of the GNU compiler options
1915 regardless of what language your program is in.  For example, you
1916 might compile a file @code{firstClass.C} like this:
1917
1918 @smallexample
1919 g++ -g -frepo -O -c firstClass.C
1920 @end smallexample
1921
1922 @noindent
1923 In this example, only @option{-frepo} is an option meant
1924 only for C++ programs; you can use the other options with any
1925 language supported by GCC@.
1926
1927 Here is a list of options that are @emph{only} for compiling C++ programs:
1928
1929 @table @gcctabopt
1930
1931 @item -fabi-version=@var{n}
1932 @opindex fabi-version
1933 Use version @var{n} of the C++ ABI@.  The default is version 2.
1934
1935 Version 0 refers to the version conforming most closely to
1936 the C++ ABI specification.  Therefore, the ABI obtained using version 0
1937 will change in different versions of G++ as ABI bugs are fixed.
1938
1939 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
1940
1941 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.  
1942
1943 Version 3 corrects an error in mangling a constant address as a
1944 template argument.
1945
1946 Version 4, which first appeared in G++ 4.5, implements a standard
1947 mangling for vector types.
1948
1949 Version 5, which first appeared in G++ 4.6, corrects the mangling of
1950 attribute const/volatile on function pointer types, decltype of a
1951 plain decl, and use of a function parameter in the declaration of
1952 another parameter.
1953
1954 Version 6, which first appeared in G++ 4.7, corrects the promotion
1955 behavior of C++11 scoped enums and the mangling of template argument
1956 packs, const/static_cast, prefix ++ and --, and a class scope function
1957 used as a template argument.
1958
1959 See also @option{-Wabi}.
1960
1961 @item -fno-access-control
1962 @opindex fno-access-control
1963 Turn off all access checking.  This switch is mainly useful for working
1964 around bugs in the access control code.
1965
1966 @item -fcheck-new
1967 @opindex fcheck-new
1968 Check that the pointer returned by @code{operator new} is non-null
1969 before attempting to modify the storage allocated.  This check is
1970 normally unnecessary because the C++ standard specifies that
1971 @code{operator new} only returns @code{0} if it is declared
1972 @samp{throw()}, in which case the compiler always checks the
1973 return value even without this option.  In all other cases, when
1974 @code{operator new} has a non-empty exception specification, memory
1975 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1976 @samp{new (nothrow)}.
1977
1978 @item -fconstexpr-depth=@var{n}
1979 @opindex fconstexpr-depth
1980 Set the maximum nested evaluation depth for C++11 constexpr functions
1981 to @var{n}.  A limit is needed to detect endless recursion during
1982 constant expression evaluation.  The minimum specified by the standard
1983 is 512.
1984
1985 @item -fdeduce-init-list
1986 @opindex fdeduce-init-list
1987 Enable deduction of a template type parameter as
1988 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
1989
1990 @smallexample
1991 template <class T> auto forward(T t) -> decltype (realfn (t))
1992 @{
1993   return realfn (t);
1994 @}
1995
1996 void f()
1997 @{
1998   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1999 @}
2000 @end smallexample
2001
2002 This deduction was implemented as a possible extension to the
2003 originally proposed semantics for the C++11 standard, but was not part
2004 of the final standard, so it is disabled by default.  This option is
2005 deprecated, and may be removed in a future version of G++.
2006
2007 @item -ffriend-injection
2008 @opindex ffriend-injection
2009 Inject friend functions into the enclosing namespace, so that they are
2010 visible outside the scope of the class in which they are declared.
2011 Friend functions were documented to work this way in the old Annotated
2012 C++ Reference Manual, and versions of G++ before 4.1 always worked
2013 that way.  However, in ISO C++ a friend function that is not declared
2014 in an enclosing scope can only be found using argument dependent
2015 lookup.  This option causes friends to be injected as they were in
2016 earlier releases.
2017
2018 This option is for compatibility, and may be removed in a future
2019 release of G++.
2020
2021 @item -fno-elide-constructors
2022 @opindex fno-elide-constructors
2023 The C++ standard allows an implementation to omit creating a temporary
2024 that is only used to initialize another object of the same type.
2025 Specifying this option disables that optimization, and forces G++ to
2026 call the copy constructor in all cases.
2027
2028 @item -fno-enforce-eh-specs
2029 @opindex fno-enforce-eh-specs
2030 Don't generate code to check for violation of exception specifications
2031 at run time.  This option violates the C++ standard, but may be useful
2032 for reducing code size in production builds, much like defining
2033 @samp{NDEBUG}.  This does not give user code permission to throw
2034 exceptions in violation of the exception specifications; the compiler
2035 still optimizes based on the specifications, so throwing an
2036 unexpected exception results in undefined behavior at run time.
2037
2038 @item -fextern-tls-init
2039 @itemx -fno-extern-tls-init
2040 @opindex fextern-tls-init
2041 @opindex fno-extern-tls-init
2042 The C++11 and OpenMP standards allow @samp{thread_local} and
2043 @samp{threadprivate} variables to have dynamic (runtime)
2044 initialization.  To support this, any use of such a variable goes
2045 through a wrapper function that performs any necessary initialization.
2046 When the use and definition of the variable are in the same
2047 translation unit, this overhead can be optimized away, but when the
2048 use is in a different translation unit there is significant overhead
2049 even if the variable doesn't actually need dynamic initialization.  If
2050 the programmer can be sure that no use of the variable in a
2051 non-defining TU needs to trigger dynamic initialization (either
2052 because the variable is statically initialized, or a use of the
2053 variable in the defining TU will be executed before any uses in
2054 another TU), they can avoid this overhead with the
2055 @option{-fno-extern-tls-init} option.
2056
2057 On targets that support symbol aliases, the default is
2058 @option{-fextern-tls-init}.  On targets that do not support symbol
2059 aliases, the default is @option{-fno-extern-tls-init}.
2060
2061 @item -ffor-scope
2062 @itemx -fno-for-scope
2063 @opindex ffor-scope
2064 @opindex fno-for-scope
2065 If @option{-ffor-scope} is specified, the scope of variables declared in
2066 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2067 as specified by the C++ standard.
2068 If @option{-fno-for-scope} is specified, the scope of variables declared in
2069 a @i{for-init-statement} extends to the end of the enclosing scope,
2070 as was the case in old versions of G++, and other (traditional)
2071 implementations of C++.
2072
2073 If neither flag is given, the default is to follow the standard,
2074 but to allow and give a warning for old-style code that would
2075 otherwise be invalid, or have different behavior.
2076
2077 @item -fno-gnu-keywords
2078 @opindex fno-gnu-keywords
2079 Do not recognize @code{typeof} as a keyword, so that code can use this
2080 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2081 @option{-ansi} implies @option{-fno-gnu-keywords}.
2082
2083 @item -fno-implicit-templates
2084 @opindex fno-implicit-templates
2085 Never emit code for non-inline templates that are instantiated
2086 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2087 @xref{Template Instantiation}, for more information.
2088
2089 @item -fno-implicit-inline-templates
2090 @opindex fno-implicit-inline-templates
2091 Don't emit code for implicit instantiations of inline templates, either.
2092 The default is to handle inlines differently so that compiles with and
2093 without optimization need the same set of explicit instantiations.
2094
2095 @item -fno-implement-inlines
2096 @opindex fno-implement-inlines
2097 To save space, do not emit out-of-line copies of inline functions
2098 controlled by @samp{#pragma implementation}.  This causes linker
2099 errors if these functions are not inlined everywhere they are called.
2100
2101 @item -fms-extensions
2102 @opindex fms-extensions
2103 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2104 int and getting a pointer to member function via non-standard syntax.
2105
2106 @item -fno-nonansi-builtins
2107 @opindex fno-nonansi-builtins
2108 Disable built-in declarations of functions that are not mandated by
2109 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2110 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2111
2112 @item -fnothrow-opt
2113 @opindex fnothrow-opt
2114 Treat a @code{throw()} exception specification as if it were a
2115 @code{noexcept} specification to reduce or eliminate the text size
2116 overhead relative to a function with no exception specification.  If
2117 the function has local variables of types with non-trivial
2118 destructors, the exception specification actually makes the
2119 function smaller because the EH cleanups for those variables can be
2120 optimized away.  The semantic effect is that an exception thrown out of
2121 a function with such an exception specification results in a call
2122 to @code{terminate} rather than @code{unexpected}.
2123
2124 @item -fno-operator-names
2125 @opindex fno-operator-names
2126 Do not treat the operator name keywords @code{and}, @code{bitand},
2127 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2128 synonyms as keywords.
2129
2130 @item -fno-optional-diags
2131 @opindex fno-optional-diags
2132 Disable diagnostics that the standard says a compiler does not need to
2133 issue.  Currently, the only such diagnostic issued by G++ is the one for
2134 a name having multiple meanings within a class.
2135
2136 @item -fpermissive
2137 @opindex fpermissive
2138 Downgrade some diagnostics about nonconformant code from errors to
2139 warnings.  Thus, using @option{-fpermissive} allows some
2140 nonconforming code to compile.
2141
2142 @item -fno-pretty-templates
2143 @opindex fno-pretty-templates
2144 When an error message refers to a specialization of a function
2145 template, the compiler normally prints the signature of the
2146 template followed by the template arguments and any typedefs or
2147 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2148 rather than @code{void f(int)}) so that it's clear which template is
2149 involved.  When an error message refers to a specialization of a class
2150 template, the compiler omits any template arguments that match
2151 the default template arguments for that template.  If either of these
2152 behaviors make it harder to understand the error message rather than
2153 easier, you can use @option{-fno-pretty-templates} to disable them.
2154
2155 @item -frepo
2156 @opindex frepo
2157 Enable automatic template instantiation at link time.  This option also
2158 implies @option{-fno-implicit-templates}.  @xref{Template
2159 Instantiation}, for more information.
2160
2161 @item -fno-rtti
2162 @opindex fno-rtti
2163 Disable generation of information about every class with virtual
2164 functions for use by the C++ run-time type identification features
2165 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2166 of the language, you can save some space by using this flag.  Note that
2167 exception handling uses the same information, but G++ generates it as
2168 needed. The @samp{dynamic_cast} operator can still be used for casts that
2169 do not require run-time type information, i.e.@: casts to @code{void *} or to
2170 unambiguous base classes.
2171
2172 @item -fstats
2173 @opindex fstats
2174 Emit statistics about front-end processing at the end of the compilation.
2175 This information is generally only useful to the G++ development team.
2176
2177 @item -fstrict-enums
2178 @opindex fstrict-enums
2179 Allow the compiler to optimize using the assumption that a value of
2180 enumerated type can only be one of the values of the enumeration (as
2181 defined in the C++ standard; basically, a value that can be
2182 represented in the minimum number of bits needed to represent all the
2183 enumerators).  This assumption may not be valid if the program uses a
2184 cast to convert an arbitrary integer value to the enumerated type.
2185
2186 @item -ftemplate-backtrace-limit=@var{n}
2187 @opindex ftemplate-backtrace-limit
2188 Set the maximum number of template instantiation notes for a single
2189 warning or error to @var{n}.  The default value is 10.
2190
2191 @item -ftemplate-depth=@var{n}
2192 @opindex ftemplate-depth
2193 Set the maximum instantiation depth for template classes to @var{n}.
2194 A limit on the template instantiation depth is needed to detect
2195 endless recursions during template class instantiation.  ANSI/ISO C++
2196 conforming programs must not rely on a maximum depth greater than 17
2197 (changed to 1024 in C++11).  The default value is 900, as the compiler
2198 can run out of stack space before hitting 1024 in some situations.
2199
2200 @item -fno-threadsafe-statics
2201 @opindex fno-threadsafe-statics
2202 Do not emit the extra code to use the routines specified in the C++
2203 ABI for thread-safe initialization of local statics.  You can use this
2204 option to reduce code size slightly in code that doesn't need to be
2205 thread-safe.
2206
2207 @item -fuse-cxa-atexit
2208 @opindex fuse-cxa-atexit
2209 Register destructors for objects with static storage duration with the
2210 @code{__cxa_atexit} function rather than the @code{atexit} function.
2211 This option is required for fully standards-compliant handling of static
2212 destructors, but only works if your C library supports
2213 @code{__cxa_atexit}.
2214
2215 @item -fno-use-cxa-get-exception-ptr
2216 @opindex fno-use-cxa-get-exception-ptr
2217 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2218 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2219 if the runtime routine is not available.
2220
2221 @item -fvisibility-inlines-hidden
2222 @opindex fvisibility-inlines-hidden
2223 This switch declares that the user does not attempt to compare
2224 pointers to inline functions or methods where the addresses of the two functions
2225 are taken in different shared objects.
2226
2227 The effect of this is that GCC may, effectively, mark inline methods with
2228 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2229 appear in the export table of a DSO and do not require a PLT indirection
2230 when used within the DSO@.  Enabling this option can have a dramatic effect
2231 on load and link times of a DSO as it massively reduces the size of the
2232 dynamic export table when the library makes heavy use of templates.
2233
2234 The behavior of this switch is not quite the same as marking the
2235 methods as hidden directly, because it does not affect static variables
2236 local to the function or cause the compiler to deduce that
2237 the function is defined in only one shared object.
2238
2239 You may mark a method as having a visibility explicitly to negate the
2240 effect of the switch for that method.  For example, if you do want to
2241 compare pointers to a particular inline method, you might mark it as
2242 having default visibility.  Marking the enclosing class with explicit
2243 visibility has no effect.
2244
2245 Explicitly instantiated inline methods are unaffected by this option
2246 as their linkage might otherwise cross a shared library boundary.
2247 @xref{Template Instantiation}.
2248
2249 @item -fvisibility-ms-compat
2250 @opindex fvisibility-ms-compat
2251 This flag attempts to use visibility settings to make GCC's C++
2252 linkage model compatible with that of Microsoft Visual Studio.
2253
2254 The flag makes these changes to GCC's linkage model:
2255
2256 @enumerate
2257 @item
2258 It sets the default visibility to @code{hidden}, like
2259 @option{-fvisibility=hidden}.
2260
2261 @item
2262 Types, but not their members, are not hidden by default.
2263
2264 @item
2265 The One Definition Rule is relaxed for types without explicit
2266 visibility specifications that are defined in more than one
2267 shared object: those declarations are permitted if they are
2268 permitted when this option is not used.
2269 @end enumerate
2270
2271 In new code it is better to use @option{-fvisibility=hidden} and
2272 export those classes that are intended to be externally visible.
2273 Unfortunately it is possible for code to rely, perhaps accidentally,
2274 on the Visual Studio behavior.
2275
2276 Among the consequences of these changes are that static data members
2277 of the same type with the same name but defined in different shared
2278 objects are different, so changing one does not change the other;
2279 and that pointers to function members defined in different shared
2280 objects may not compare equal.  When this flag is given, it is a
2281 violation of the ODR to define types with the same name differently.
2282
2283 @item -fno-weak
2284 @opindex fno-weak
2285 Do not use weak symbol support, even if it is provided by the linker.
2286 By default, G++ uses weak symbols if they are available.  This
2287 option exists only for testing, and should not be used by end-users;
2288 it results in inferior code and has no benefits.  This option may
2289 be removed in a future release of G++.
2290
2291 @item -nostdinc++
2292 @opindex nostdinc++
2293 Do not search for header files in the standard directories specific to
2294 C++, but do still search the other standard directories.  (This option
2295 is used when building the C++ library.)
2296 @end table
2297
2298 In addition, these optimization, warning, and code generation options
2299 have meanings only for C++ programs:
2300
2301 @table @gcctabopt
2302 @item -fno-default-inline
2303 @opindex fno-default-inline
2304 Do not assume @samp{inline} for functions defined inside a class scope.
2305 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2306 functions have linkage like inline functions; they just aren't
2307 inlined by default.
2308
2309 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2310 @opindex Wabi
2311 @opindex Wno-abi
2312 Warn when G++ generates code that is probably not compatible with the
2313 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2314 all such cases, there are probably some cases that are not warned about,
2315 even though G++ is generating incompatible code.  There may also be
2316 cases where warnings are emitted even though the code that is generated
2317 is compatible.
2318
2319 You should rewrite your code to avoid these warnings if you are
2320 concerned about the fact that code generated by G++ may not be binary
2321 compatible with code generated by other compilers.
2322
2323 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2324
2325 @itemize @bullet
2326
2327 @item
2328 A template with a non-type template parameter of reference type is
2329 mangled incorrectly:
2330 @smallexample
2331 extern int N;
2332 template <int &> struct S @{@};
2333 void n (S<N>) @{2@}
2334 @end smallexample
2335
2336 This is fixed in @option{-fabi-version=3}.
2337
2338 @item
2339 SIMD vector types declared using @code{__attribute ((vector_size))} are
2340 mangled in a non-standard way that does not allow for overloading of
2341 functions taking vectors of different sizes.
2342
2343 The mangling is changed in @option{-fabi-version=4}.
2344 @end itemize
2345
2346 The known incompatibilities in @option{-fabi-version=1} include:
2347
2348 @itemize @bullet
2349
2350 @item
2351 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2352 pack data into the same byte as a base class.  For example:
2353
2354 @smallexample
2355 struct A @{ virtual void f(); int f1 : 1; @};
2356 struct B : public A @{ int f2 : 1; @};
2357 @end smallexample
2358
2359 @noindent
2360 In this case, G++ places @code{B::f2} into the same byte
2361 as @code{A::f1}; other compilers do not.  You can avoid this problem
2362 by explicitly padding @code{A} so that its size is a multiple of the
2363 byte size on your platform; that causes G++ and other compilers to
2364 lay out @code{B} identically.
2365
2366 @item
2367 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2368 tail padding when laying out virtual bases.  For example:
2369
2370 @smallexample
2371 struct A @{ virtual void f(); char c1; @};
2372 struct B @{ B(); char c2; @};
2373 struct C : public A, public virtual B @{@};
2374 @end smallexample
2375
2376 @noindent
2377 In this case, G++ does not place @code{B} into the tail-padding for
2378 @code{A}; other compilers do.  You can avoid this problem by
2379 explicitly padding @code{A} so that its size is a multiple of its
2380 alignment (ignoring virtual base classes); that causes G++ and other
2381 compilers to lay out @code{C} identically.
2382
2383 @item
2384 Incorrect handling of bit-fields with declared widths greater than that
2385 of their underlying types, when the bit-fields appear in a union.  For
2386 example:
2387
2388 @smallexample
2389 union U @{ int i : 4096; @};
2390 @end smallexample
2391
2392 @noindent
2393 Assuming that an @code{int} does not have 4096 bits, G++ makes the
2394 union too small by the number of bits in an @code{int}.
2395
2396 @item
2397 Empty classes can be placed at incorrect offsets.  For example:
2398
2399 @smallexample
2400 struct A @{@};
2401
2402 struct B @{
2403   A a;
2404   virtual void f ();
2405 @};
2406
2407 struct C : public B, public A @{@};
2408 @end smallexample
2409
2410 @noindent
2411 G++ places the @code{A} base class of @code{C} at a nonzero offset;
2412 it should be placed at offset zero.  G++ mistakenly believes that the
2413 @code{A} data member of @code{B} is already at offset zero.
2414
2415 @item
2416 Names of template functions whose types involve @code{typename} or
2417 template template parameters can be mangled incorrectly.
2418
2419 @smallexample
2420 template <typename Q>
2421 void f(typename Q::X) @{@}
2422
2423 template <template <typename> class Q>
2424 void f(typename Q<int>::X) @{@}
2425 @end smallexample
2426
2427 @noindent
2428 Instantiations of these templates may be mangled incorrectly.
2429
2430 @end itemize
2431
2432 It also warns about psABI-related changes.  The known psABI changes at this
2433 point include:
2434
2435 @itemize @bullet
2436
2437 @item
2438 For SysV/x86-64, unions with @code{long double} members are 
2439 passed in memory as specified in psABI.  For example:
2440
2441 @smallexample
2442 union U @{
2443   long double ld;
2444   int i;
2445 @};
2446 @end smallexample
2447
2448 @noindent
2449 @code{union U} is always passed in memory.
2450
2451 @end itemize
2452
2453 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2454 @opindex Wctor-dtor-privacy
2455 @opindex Wno-ctor-dtor-privacy
2456 Warn when a class seems unusable because all the constructors or
2457 destructors in that class are private, and it has neither friends nor
2458 public static member functions.  Also warn if there are no non-private
2459 methods, and there's at least one private member function that isn't
2460 a constructor or destructor.
2461
2462 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2463 @opindex Wdelete-non-virtual-dtor
2464 @opindex Wno-delete-non-virtual-dtor
2465 Warn when @samp{delete} is used to destroy an instance of a class that
2466 has virtual functions and non-virtual destructor. It is unsafe to delete
2467 an instance of a derived class through a pointer to a base class if the
2468 base class does not have a virtual destructor.  This warning is enabled
2469 by @option{-Wall}.
2470
2471 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2472 @opindex Wliteral-suffix
2473 @opindex Wno-literal-suffix
2474 Warn when a string or character literal is followed by a ud-suffix which does
2475 not begin with an underscore.  As a conforming extension, GCC treats such
2476 suffixes as separate preprocessing tokens in order to maintain backwards
2477 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2478 For example:
2479
2480 @smallexample
2481 #define __STDC_FORMAT_MACROS
2482 #include <inttypes.h>
2483 #include <stdio.h>
2484
2485 int main() @{
2486   int64_t i64 = 123;
2487   printf("My int64: %"PRId64"\n", i64);
2488 @}
2489 @end smallexample
2490
2491 In this case, @code{PRId64} is treated as a separate preprocessing token.
2492
2493 This warning is enabled by default.
2494
2495 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2496 @opindex Wnarrowing
2497 @opindex Wno-narrowing
2498 Warn when a narrowing conversion prohibited by C++11 occurs within
2499 @samp{@{ @}}, e.g.
2500
2501 @smallexample
2502 int i = @{ 2.2 @}; // error: narrowing from double to int
2503 @end smallexample
2504
2505 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2506
2507 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2508 required by the standard.  Note that this does not affect the meaning
2509 of well-formed code; narrowing conversions are still considered
2510 ill-formed in SFINAE context.
2511
2512 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2513 @opindex Wnoexcept
2514 @opindex Wno-noexcept
2515 Warn when a noexcept-expression evaluates to false because of a call
2516 to a function that does not have a non-throwing exception
2517 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2518 the compiler to never throw an exception.
2519
2520 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2521 @opindex Wnon-virtual-dtor
2522 @opindex Wno-non-virtual-dtor
2523 Warn when a class has virtual functions and an accessible non-virtual
2524 destructor, in which case it is possible but unsafe to delete
2525 an instance of a derived class through a pointer to the base class.
2526 This warning is also enabled if @option{-Weffc++} is specified.
2527
2528 @item -Wreorder @r{(C++ and Objective-C++ only)}
2529 @opindex Wreorder
2530 @opindex Wno-reorder
2531 @cindex reordering, warning
2532 @cindex warning for reordering of member initializers
2533 Warn when the order of member initializers given in the code does not
2534 match the order in which they must be executed.  For instance:
2535
2536 @smallexample
2537 struct A @{
2538   int i;
2539   int j;
2540   A(): j (0), i (1) @{ @}
2541 @};
2542 @end smallexample
2543
2544 @noindent
2545 The compiler rearranges the member initializers for @samp{i}
2546 and @samp{j} to match the declaration order of the members, emitting
2547 a warning to that effect.  This warning is enabled by @option{-Wall}.
2548
2549 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2550 @opindex fext-numeric-literals
2551 @opindex fno-ext-numeric-literals
2552 Accept imaginary, fixed-point, or machine-defined
2553 literal number suffixes as GNU extensions.
2554 When this option is turned off these suffixes are treated
2555 as C++11 user-defined literal numeric suffixes.
2556 This is on by default for all pre-C++11 dialects and all GNU dialects:
2557 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2558 @option{-std=gnu++1y}.
2559 This option is off by default
2560 for ISO C++11 onwards (@option{-std=c++11}, ...).
2561 @end table
2562
2563 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2564
2565 @table @gcctabopt
2566 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2567 @opindex Weffc++
2568 @opindex Wno-effc++
2569 Warn about violations of the following style guidelines from Scott Meyers'
2570 @cite{Effective C++, Second Edition} book:
2571
2572 @itemize @bullet
2573 @item
2574 Item 11:  Define a copy constructor and an assignment operator for classes
2575 with dynamically-allocated memory.
2576
2577 @item
2578 Item 12:  Prefer initialization to assignment in constructors.
2579
2580 @item
2581 Item 14:  Make destructors virtual in base classes.
2582
2583 @item
2584 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2585
2586 @item
2587 Item 23:  Don't try to return a reference when you must return an object.
2588
2589 @end itemize
2590
2591 Also warn about violations of the following style guidelines from
2592 Scott Meyers' @cite{More Effective C++} book:
2593
2594 @itemize @bullet
2595 @item
2596 Item 6:  Distinguish between prefix and postfix forms of increment and
2597 decrement operators.
2598
2599 @item
2600 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2601
2602 @end itemize
2603
2604 When selecting this option, be aware that the standard library
2605 headers do not obey all of these guidelines; use @samp{grep -v}
2606 to filter out those warnings.
2607
2608 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2609 @opindex Wstrict-null-sentinel
2610 @opindex Wno-strict-null-sentinel
2611 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2612 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2613 to @code{__null}.  Although it is a null pointer constant rather than a
2614 null pointer, it is guaranteed to be of the same size as a pointer.
2615 But this use is not portable across different compilers.
2616
2617 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2618 @opindex Wno-non-template-friend
2619 @opindex Wnon-template-friend
2620 Disable warnings when non-templatized friend functions are declared
2621 within a template.  Since the advent of explicit template specification
2622 support in G++, if the name of the friend is an unqualified-id (i.e.,
2623 @samp{friend foo(int)}), the C++ language specification demands that the
2624 friend declare or define an ordinary, nontemplate function.  (Section
2625 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2626 could be interpreted as a particular specialization of a templatized
2627 function.  Because this non-conforming behavior is no longer the default
2628 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2629 check existing code for potential trouble spots and is on by default.
2630 This new compiler behavior can be turned off with
2631 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2632 but disables the helpful warning.
2633
2634 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2635 @opindex Wold-style-cast
2636 @opindex Wno-old-style-cast
2637 Warn if an old-style (C-style) cast to a non-void type is used within
2638 a C++ program.  The new-style casts (@samp{dynamic_cast},
2639 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2640 less vulnerable to unintended effects and much easier to search for.
2641
2642 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2643 @opindex Woverloaded-virtual
2644 @opindex Wno-overloaded-virtual
2645 @cindex overloaded virtual function, warning
2646 @cindex warning for overloaded virtual function
2647 Warn when a function declaration hides virtual functions from a
2648 base class.  For example, in:
2649
2650 @smallexample
2651 struct A @{
2652   virtual void f();
2653 @};
2654
2655 struct B: public A @{
2656   void f(int);
2657 @};
2658 @end smallexample
2659
2660 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2661 like:
2662
2663 @smallexample
2664 B* b;
2665 b->f();
2666 @end smallexample
2667
2668 @noindent
2669 fails to compile.
2670
2671 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2672 @opindex Wno-pmf-conversions
2673 @opindex Wpmf-conversions
2674 Disable the diagnostic for converting a bound pointer to member function
2675 to a plain pointer.
2676
2677 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2678 @opindex Wsign-promo
2679 @opindex Wno-sign-promo
2680 Warn when overload resolution chooses a promotion from unsigned or
2681 enumerated type to a signed type, over a conversion to an unsigned type of
2682 the same size.  Previous versions of G++ tried to preserve
2683 unsignedness, but the standard mandates the current behavior.
2684 @end table
2685
2686 @node Objective-C and Objective-C++ Dialect Options
2687 @section Options Controlling Objective-C and Objective-C++ Dialects
2688
2689 @cindex compiler options, Objective-C and Objective-C++
2690 @cindex Objective-C and Objective-C++ options, command-line
2691 @cindex options, Objective-C and Objective-C++
2692 (NOTE: This manual does not describe the Objective-C and Objective-C++
2693 languages themselves.  @xref{Standards,,Language Standards
2694 Supported by GCC}, for references.)
2695
2696 This section describes the command-line options that are only meaningful
2697 for Objective-C and Objective-C++ programs.  You can also use most of
2698 the language-independent GNU compiler options.
2699 For example, you might compile a file @code{some_class.m} like this:
2700
2701 @smallexample
2702 gcc -g -fgnu-runtime -O -c some_class.m
2703 @end smallexample
2704
2705 @noindent
2706 In this example, @option{-fgnu-runtime} is an option meant only for
2707 Objective-C and Objective-C++ programs; you can use the other options with
2708 any language supported by GCC@.
2709
2710 Note that since Objective-C is an extension of the C language, Objective-C
2711 compilations may also use options specific to the C front-end (e.g.,
2712 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2713 C++-specific options (e.g., @option{-Wabi}).
2714
2715 Here is a list of options that are @emph{only} for compiling Objective-C
2716 and Objective-C++ programs:
2717
2718 @table @gcctabopt
2719 @item -fconstant-string-class=@var{class-name}
2720 @opindex fconstant-string-class
2721 Use @var{class-name} as the name of the class to instantiate for each
2722 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2723 class name is @code{NXConstantString} if the GNU runtime is being used, and
2724 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2725 @option{-fconstant-cfstrings} option, if also present, overrides the
2726 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2727 to be laid out as constant CoreFoundation strings.
2728
2729 @item -fgnu-runtime
2730 @opindex fgnu-runtime
2731 Generate object code compatible with the standard GNU Objective-C
2732 runtime.  This is the default for most types of systems.
2733
2734 @item -fnext-runtime
2735 @opindex fnext-runtime
2736 Generate output compatible with the NeXT runtime.  This is the default
2737 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2738 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2739 used.
2740
2741 @item -fno-nil-receivers
2742 @opindex fno-nil-receivers
2743 Assume that all Objective-C message dispatches (@code{[receiver
2744 message:arg]}) in this translation unit ensure that the receiver is
2745 not @code{nil}.  This allows for more efficient entry points in the
2746 runtime to be used.  This option is only available in conjunction with
2747 the NeXT runtime and ABI version 0 or 1.
2748
2749 @item -fobjc-abi-version=@var{n}
2750 @opindex fobjc-abi-version
2751 Use version @var{n} of the Objective-C ABI for the selected runtime.
2752 This option is currently supported only for the NeXT runtime.  In that
2753 case, Version 0 is the traditional (32-bit) ABI without support for
2754 properties and other Objective-C 2.0 additions.  Version 1 is the
2755 traditional (32-bit) ABI with support for properties and other
2756 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2757 nothing is specified, the default is Version 0 on 32-bit target
2758 machines, and Version 2 on 64-bit target machines.
2759
2760 @item -fobjc-call-cxx-cdtors
2761 @opindex fobjc-call-cxx-cdtors
2762 For each Objective-C class, check if any of its instance variables is a
2763 C++ object with a non-trivial default constructor.  If so, synthesize a
2764 special @code{- (id) .cxx_construct} instance method which runs
2765 non-trivial default constructors on any such instance variables, in order,
2766 and then return @code{self}.  Similarly, check if any instance variable
2767 is a C++ object with a non-trivial destructor, and if so, synthesize a
2768 special @code{- (void) .cxx_destruct} method which runs
2769 all such default destructors, in reverse order.
2770
2771 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2772 methods thusly generated only operate on instance variables
2773 declared in the current Objective-C class, and not those inherited
2774 from superclasses.  It is the responsibility of the Objective-C
2775 runtime to invoke all such methods in an object's inheritance
2776 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2777 by the runtime immediately after a new object instance is allocated;
2778 the @code{- (void) .cxx_destruct} methods are invoked immediately
2779 before the runtime deallocates an object instance.
2780
2781 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2782 support for invoking the @code{- (id) .cxx_construct} and
2783 @code{- (void) .cxx_destruct} methods.
2784
2785 @item -fobjc-direct-dispatch
2786 @opindex fobjc-direct-dispatch
2787 Allow fast jumps to the message dispatcher.  On Darwin this is
2788 accomplished via the comm page.
2789
2790 @item -fobjc-exceptions
2791 @opindex fobjc-exceptions
2792 Enable syntactic support for structured exception handling in
2793 Objective-C, similar to what is offered by C++ and Java.  This option
2794 is required to use the Objective-C keywords @code{@@try},
2795 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2796 @code{@@synchronized}.  This option is available with both the GNU
2797 runtime and the NeXT runtime (but not available in conjunction with
2798 the NeXT runtime on Mac OS X 10.2 and earlier).
2799
2800 @item -fobjc-gc
2801 @opindex fobjc-gc
2802 Enable garbage collection (GC) in Objective-C and Objective-C++
2803 programs.  This option is only available with the NeXT runtime; the
2804 GNU runtime has a different garbage collection implementation that
2805 does not require special compiler flags.
2806
2807 @item -fobjc-nilcheck
2808 @opindex fobjc-nilcheck
2809 For the NeXT runtime with version 2 of the ABI, check for a nil
2810 receiver in method invocations before doing the actual method call.
2811 This is the default and can be disabled using
2812 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2813 checked for nil in this way no matter what this flag is set to.
2814 Currently this flag does nothing when the GNU runtime, or an older
2815 version of the NeXT runtime ABI, is used.
2816
2817 @item -fobjc-std=objc1
2818 @opindex fobjc-std
2819 Conform to the language syntax of Objective-C 1.0, the language
2820 recognized by GCC 4.0.  This only affects the Objective-C additions to
2821 the C/C++ language; it does not affect conformance to C/C++ standards,
2822 which is controlled by the separate C/C++ dialect option flags.  When
2823 this option is used with the Objective-C or Objective-C++ compiler,
2824 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2825 This is useful if you need to make sure that your Objective-C code can
2826 be compiled with older versions of GCC@.
2827
2828 @item -freplace-objc-classes
2829 @opindex freplace-objc-classes
2830 Emit a special marker instructing @command{ld(1)} not to statically link in
2831 the resulting object file, and allow @command{dyld(1)} to load it in at
2832 run time instead.  This is used in conjunction with the Fix-and-Continue
2833 debugging mode, where the object file in question may be recompiled and
2834 dynamically reloaded in the course of program execution, without the need
2835 to restart the program itself.  Currently, Fix-and-Continue functionality
2836 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2837 and later.
2838
2839 @item -fzero-link
2840 @opindex fzero-link
2841 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2842 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2843 compile time) with static class references that get initialized at load time,
2844 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2845 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2846 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2847 for individual class implementations to be modified during program execution.
2848 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2849 regardless of command-line options.
2850
2851 @item -gen-decls
2852 @opindex gen-decls
2853 Dump interface declarations for all classes seen in the source file to a
2854 file named @file{@var{sourcename}.decl}.
2855
2856 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2857 @opindex Wassign-intercept
2858 @opindex Wno-assign-intercept
2859 Warn whenever an Objective-C assignment is being intercepted by the
2860 garbage collector.
2861
2862 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2863 @opindex Wno-protocol
2864 @opindex Wprotocol
2865 If a class is declared to implement a protocol, a warning is issued for
2866 every method in the protocol that is not implemented by the class.  The
2867 default behavior is to issue a warning for every method not explicitly
2868 implemented in the class, even if a method implementation is inherited
2869 from the superclass.  If you use the @option{-Wno-protocol} option, then
2870 methods inherited from the superclass are considered to be implemented,
2871 and no warning is issued for them.
2872
2873 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2874 @opindex Wselector
2875 @opindex Wno-selector
2876 Warn if multiple methods of different types for the same selector are
2877 found during compilation.  The check is performed on the list of methods
2878 in the final stage of compilation.  Additionally, a check is performed
2879 for each selector appearing in a @code{@@selector(@dots{})}
2880 expression, and a corresponding method for that selector has been found
2881 during compilation.  Because these checks scan the method table only at
2882 the end of compilation, these warnings are not produced if the final
2883 stage of compilation is not reached, for example because an error is
2884 found during compilation, or because the @option{-fsyntax-only} option is
2885 being used.
2886
2887 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2888 @opindex Wstrict-selector-match
2889 @opindex Wno-strict-selector-match
2890 Warn if multiple methods with differing argument and/or return types are
2891 found for a given selector when attempting to send a message using this
2892 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2893 is off (which is the default behavior), the compiler omits such warnings
2894 if any differences found are confined to types that share the same size
2895 and alignment.
2896
2897 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2898 @opindex Wundeclared-selector
2899 @opindex Wno-undeclared-selector
2900 Warn if a @code{@@selector(@dots{})} expression referring to an
2901 undeclared selector is found.  A selector is considered undeclared if no
2902 method with that name has been declared before the
2903 @code{@@selector(@dots{})} expression, either explicitly in an
2904 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2905 an @code{@@implementation} section.  This option always performs its
2906 checks as soon as a @code{@@selector(@dots{})} expression is found,
2907 while @option{-Wselector} only performs its checks in the final stage of
2908 compilation.  This also enforces the coding style convention
2909 that methods and selectors must be declared before being used.
2910
2911 @item -print-objc-runtime-info
2912 @opindex print-objc-runtime-info
2913 Generate C header describing the largest structure that is passed by
2914 value, if any.
2915
2916 @end table
2917
2918 @node Language Independent Options
2919 @section Options to Control Diagnostic Messages Formatting
2920 @cindex options to control diagnostics formatting
2921 @cindex diagnostic messages
2922 @cindex message formatting
2923
2924 Traditionally, diagnostic messages have been formatted irrespective of
2925 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
2926 options described below
2927 to control the formatting algorithm for diagnostic messages, 
2928 e.g.@: how many characters per line, how often source location
2929 information should be reported.  Note that some language front ends may not
2930 honor these options.
2931
2932 @table @gcctabopt
2933 @item -fmessage-length=@var{n}
2934 @opindex fmessage-length
2935 Try to format error messages so that they fit on lines of about @var{n}
2936 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2937 the front ends supported by GCC@.  If @var{n} is zero, then no
2938 line-wrapping is done; each error message appears on a single
2939 line.
2940
2941 @item -fdiagnostics-show-location=once
2942 @opindex fdiagnostics-show-location
2943 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2944 reporter to emit source location information @emph{once}; that is, in
2945 case the message is too long to fit on a single physical line and has to
2946 be wrapped, the source location won't be emitted (as prefix) again,
2947 over and over, in subsequent continuation lines.  This is the default
2948 behavior.
2949
2950 @item -fdiagnostics-show-location=every-line
2951 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2952 messages reporter to emit the same source location information (as
2953 prefix) for physical lines that result from the process of breaking
2954 a message which is too long to fit on a single line.
2955
2956 @item -fno-diagnostics-show-option
2957 @opindex fno-diagnostics-show-option
2958 @opindex fdiagnostics-show-option
2959 By default, each diagnostic emitted includes text indicating the
2960 command-line option that directly controls the diagnostic (if such an
2961 option is known to the diagnostic machinery).  Specifying the
2962 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
2963
2964 @item -fno-diagnostics-show-caret
2965 @opindex fno-diagnostics-show-caret
2966 @opindex fdiagnostics-show-caret
2967 By default, each diagnostic emitted includes the original source line
2968 and a caret '^' indicating the column.  This option suppresses this
2969 information.
2970
2971 @end table
2972
2973 @node Warning Options
2974 @section Options to Request or Suppress Warnings
2975 @cindex options to control warnings
2976 @cindex warning messages
2977 @cindex messages, warning
2978 @cindex suppressing warnings
2979
2980 Warnings are diagnostic messages that report constructions that
2981 are not inherently erroneous but that are risky or suggest there
2982 may have been an error.
2983
2984 The following language-independent options do not enable specific
2985 warnings but control the kinds of diagnostics produced by GCC@.
2986
2987 @table @gcctabopt
2988 @cindex syntax checking
2989 @item -fsyntax-only
2990 @opindex fsyntax-only
2991 Check the code for syntax errors, but don't do anything beyond that.
2992
2993 @item -fmax-errors=@var{n}
2994 @opindex fmax-errors
2995 Limits the maximum number of error messages to @var{n}, at which point
2996 GCC bails out rather than attempting to continue processing the source
2997 code.  If @var{n} is 0 (the default), there is no limit on the number
2998 of error messages produced.  If @option{-Wfatal-errors} is also
2999 specified, then @option{-Wfatal-errors} takes precedence over this
3000 option.
3001
3002 @item -w
3003 @opindex w
3004 Inhibit all warning messages.
3005
3006 @item -Werror
3007 @opindex Werror
3008 @opindex Wno-error
3009 Make all warnings into errors.
3010
3011 @item -Werror=
3012 @opindex Werror=
3013 @opindex Wno-error=
3014 Make the specified warning into an error.  The specifier for a warning
3015 is appended; for example @option{-Werror=switch} turns the warnings
3016 controlled by @option{-Wswitch} into errors.  This switch takes a
3017 negative form, to be used to negate @option{-Werror} for specific
3018 warnings; for example @option{-Wno-error=switch} makes
3019 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3020 is in effect.
3021
3022 The warning message for each controllable warning includes the
3023 option that controls the warning.  That option can then be used with
3024 @option{-Werror=} and @option{-Wno-error=} as described above.
3025 (Printing of the option in the warning message can be disabled using the
3026 @option{-fno-diagnostics-show-option} flag.)
3027
3028 Note that specifying @option{-Werror=}@var{foo} automatically implies
3029 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3030 imply anything.
3031
3032 @item -Wfatal-errors
3033 @opindex Wfatal-errors
3034 @opindex Wno-fatal-errors
3035 This option causes the compiler to abort compilation on the first error
3036 occurred rather than trying to keep going and printing further error
3037 messages.
3038
3039 @end table
3040
3041 You can request many specific warnings with options beginning with
3042 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3043 implicit declarations.  Each of these specific warning options also
3044 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3045 example, @option{-Wno-implicit}.  This manual lists only one of the
3046 two forms, whichever is not the default.  For further
3047 language-specific options also refer to @ref{C++ Dialect Options} and
3048 @ref{Objective-C and Objective-C++ Dialect Options}.
3049
3050 When an unrecognized warning option is requested (e.g.,
3051 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3052 that the option is not recognized.  However, if the @option{-Wno-} form
3053 is used, the behavior is slightly different: no diagnostic is
3054 produced for @option{-Wno-unknown-warning} unless other diagnostics
3055 are being produced.  This allows the use of new @option{-Wno-} options
3056 with old compilers, but if something goes wrong, the compiler
3057 warns that an unrecognized option is present.
3058
3059 @table @gcctabopt
3060 @item -Wpedantic
3061 @itemx -pedantic
3062 @opindex pedantic
3063 @opindex Wpedantic
3064 Issue all the warnings demanded by strict ISO C and ISO C++;
3065 reject all programs that use forbidden extensions, and some other
3066 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3067 version of the ISO C standard specified by any @option{-std} option used.
3068
3069 Valid ISO C and ISO C++ programs should compile properly with or without
3070 this option (though a rare few require @option{-ansi} or a
3071 @option{-std} option specifying the required version of ISO C)@.  However,
3072 without this option, certain GNU extensions and traditional C and C++
3073 features are supported as well.  With this option, they are rejected.
3074
3075 @option{-Wpedantic} does not cause warning messages for use of the
3076 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3077 warnings are also disabled in the expression that follows
3078 @code{__extension__}.  However, only system header files should use
3079 these escape routes; application programs should avoid them.
3080 @xref{Alternate Keywords}.
3081
3082 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3083 C conformance.  They soon find that it does not do quite what they want:
3084 it finds some non-ISO practices, but not all---only those for which
3085 ISO C @emph{requires} a diagnostic, and some others for which
3086 diagnostics have been added.
3087
3088 A feature to report any failure to conform to ISO C might be useful in
3089 some instances, but would require considerable additional work and would
3090 be quite different from @option{-Wpedantic}.  We don't have plans to
3091 support such a feature in the near future.
3092
3093 Where the standard specified with @option{-std} represents a GNU
3094 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3095 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3096 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3097 where they are required by the base standard.  (It does not make sense
3098 for such warnings to be given only for features not in the specified GNU
3099 C dialect, since by definition the GNU dialects of C include all
3100 features the compiler supports with the given option, and there would be
3101 nothing to warn about.)
3102
3103 @item -pedantic-errors
3104 @opindex pedantic-errors
3105 Like @option{-Wpedantic}, except that errors are produced rather than
3106 warnings.
3107
3108 @item -Wall
3109 @opindex Wall
3110 @opindex Wno-all
3111 This enables all the warnings about constructions that some users
3112 consider questionable, and that are easy to avoid (or modify to
3113 prevent the warning), even in conjunction with macros.  This also
3114 enables some language-specific warnings described in @ref{C++ Dialect
3115 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3116
3117 @option{-Wall} turns on the following warning flags:
3118
3119 @gccoptlist{-Waddress   @gol
3120 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3121 -Wc++11-compat  @gol
3122 -Wchar-subscripts  @gol
3123 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3124 -Wimplicit-int @r{(C and Objective-C only)} @gol
3125 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3126 -Wcomment  @gol
3127 -Wformat   @gol
3128 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3129 -Wmaybe-uninitialized @gol
3130 -Wmissing-braces @r{(only for C/ObjC)} @gol
3131 -Wnonnull  @gol
3132 -Wparentheses  @gol
3133 -Wpointer-sign  @gol
3134 -Wreorder   @gol
3135 -Wreturn-type  @gol
3136 -Wsequence-point  @gol
3137 -Wsign-compare @r{(only in C++)}  @gol
3138 -Wstrict-aliasing  @gol
3139 -Wstrict-overflow=1  @gol
3140 -Wswitch  @gol
3141 -Wtrigraphs  @gol
3142 -Wuninitialized  @gol
3143 -Wunknown-pragmas  @gol
3144 -Wunused-function  @gol
3145 -Wunused-label     @gol
3146 -Wunused-value     @gol
3147 -Wunused-variable  @gol
3148 -Wvolatile-register-var @gol
3149 }
3150
3151 Note that some warning flags are not implied by @option{-Wall}.  Some of
3152 them warn about constructions that users generally do not consider
3153 questionable, but which occasionally you might wish to check for;
3154 others warn about constructions that are necessary or hard to avoid in
3155 some cases, and there is no simple way to modify the code to suppress
3156 the warning. Some of them are enabled by @option{-Wextra} but many of
3157 them must be enabled individually.
3158
3159 @item -Wextra
3160 @opindex W
3161 @opindex Wextra
3162 @opindex Wno-extra
3163 This enables some extra warning flags that are not enabled by
3164 @option{-Wall}. (This option used to be called @option{-W}.  The older
3165 name is still supported, but the newer name is more descriptive.)
3166
3167 @gccoptlist{-Wclobbered  @gol
3168 -Wempty-body  @gol
3169 -Wignored-qualifiers @gol
3170 -Wmissing-field-initializers  @gol
3171 -Wmissing-parameter-type @r{(C only)}  @gol
3172 -Wold-style-declaration @r{(C only)}  @gol
3173 -Woverride-init  @gol
3174 -Wsign-compare  @gol
3175 -Wtype-limits  @gol
3176 -Wuninitialized  @gol
3177 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3178 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3179 }
3180
3181 The option @option{-Wextra} also prints warning messages for the
3182 following cases:
3183
3184 @itemize @bullet
3185
3186 @item
3187 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3188 @samp{>}, or @samp{>=}.
3189
3190 @item
3191 (C++ only) An enumerator and a non-enumerator both appear in a
3192 conditional expression.
3193
3194 @item
3195 (C++ only) Ambiguous virtual bases.
3196
3197 @item
3198 (C++ only) Subscripting an array that has been declared @samp{register}.
3199
3200 @item
3201 (C++ only) Taking the address of a variable that has been declared
3202 @samp{register}.
3203
3204 @item
3205 (C++ only) A base class is not initialized in a derived class's copy
3206 constructor.
3207
3208 @end itemize
3209
3210 @item -Wchar-subscripts
3211 @opindex Wchar-subscripts
3212 @opindex Wno-char-subscripts
3213 Warn if an array subscript has type @code{char}.  This is a common cause
3214 of error, as programmers often forget that this type is signed on some
3215 machines.
3216 This warning is enabled by @option{-Wall}.
3217
3218 @item -Wcomment
3219 @opindex Wcomment
3220 @opindex Wno-comment
3221 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3222 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3223 This warning is enabled by @option{-Wall}.
3224
3225 @item -Wno-coverage-mismatch
3226 @opindex Wno-coverage-mismatch
3227 Warn if feedback profiles do not match when using the
3228 @option{-fprofile-use} option.
3229 If a source file is changed between compiling with @option{-fprofile-gen} and
3230 with @option{-fprofile-use}, the files with the profile feedback can fail
3231 to match the source file and GCC cannot use the profile feedback
3232 information.  By default, this warning is enabled and is treated as an
3233 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3234 warning or @option{-Wno-error=coverage-mismatch} can be used to
3235 disable the error.  Disabling the error for this warning can result in
3236 poorly optimized code and is useful only in the
3237 case of very minor changes such as bug fixes to an existing code-base.
3238 Completely disabling the warning is not recommended.
3239
3240 @item -Wno-cpp
3241 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3242
3243 Suppress warning messages emitted by @code{#warning} directives.
3244
3245 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3246 @opindex Wdouble-promotion
3247 @opindex Wno-double-promotion
3248 Give a warning when a value of type @code{float} is implicitly
3249 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3250 floating-point unit implement @code{float} in hardware, but emulate
3251 @code{double} in software.  On such a machine, doing computations
3252 using @code{double} values is much more expensive because of the
3253 overhead required for software emulation.
3254
3255 It is easy to accidentally do computations with @code{double} because
3256 floating-point literals are implicitly of type @code{double}.  For
3257 example, in:
3258 @smallexample
3259 @group
3260 float area(float radius)
3261 @{
3262    return 3.14159 * radius * radius;
3263 @}
3264 @end group
3265 @end smallexample
3266 the compiler performs the entire computation with @code{double}
3267 because the floating-point literal is a @code{double}.
3268
3269 @item -Wformat
3270 @itemx -Wformat=@var{n}
3271 @opindex Wformat
3272 @opindex Wno-format
3273 @opindex ffreestanding
3274 @opindex fno-builtin
3275 @opindex Wformat=
3276 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3277 the arguments supplied have types appropriate to the format string
3278 specified, and that the conversions specified in the format string make
3279 sense.  This includes standard functions, and others specified by format
3280 attributes (@pxref{Function Attributes}), in the @code{printf},
3281 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3282 not in the C standard) families (or other target-specific families).
3283 Which functions are checked without format attributes having been
3284 specified depends on the standard version selected, and such checks of
3285 functions without the attribute specified are disabled by
3286 @option{-ffreestanding} or @option{-fno-builtin}.
3287
3288 The formats are checked against the format features supported by GNU
3289 libc version 2.2.  These include all ISO C90 and C99 features, as well
3290 as features from the Single Unix Specification and some BSD and GNU
3291 extensions.  Other library implementations may not support all these
3292 features; GCC does not support warning about features that go beyond a
3293 particular library's limitations.  However, if @option{-Wpedantic} is used
3294 with @option{-Wformat}, warnings are given about format features not
3295 in the selected standard version (but not for @code{strfmon} formats,
3296 since those are not in any version of the C standard).  @xref{C Dialect
3297 Options,,Options Controlling C Dialect}.
3298
3299 @table @gcctabopt
3300 @item -Wformat=1
3301 @itemx -Wformat
3302 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3303 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3304 @option{-Wformat} also checks for null format arguments for several
3305 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3306 aspects of this level of format checking can be disabled by the
3307 options: @option{-Wno-format-contains-nul},
3308 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3309 @option{-Wformat} is enabled by @option{-Wall}.
3310
3311 @item -Wno-format-contains-nul
3312 @opindex Wno-format-contains-nul
3313 @opindex Wformat-contains-nul
3314 If @option{-Wformat} is specified, do not warn about format strings that
3315 contain NUL bytes.
3316
3317 @item -Wno-format-extra-args
3318 @opindex Wno-format-extra-args
3319 @opindex Wformat-extra-args
3320 If @option{-Wformat} is specified, do not warn about excess arguments to a
3321 @code{printf} or @code{scanf} format function.  The C standard specifies
3322 that such arguments are ignored.
3323
3324 Where the unused arguments lie between used arguments that are
3325 specified with @samp{$} operand number specifications, normally
3326 warnings are still given, since the implementation could not know what
3327 type to pass to @code{va_arg} to skip the unused arguments.  However,
3328 in the case of @code{scanf} formats, this option suppresses the
3329 warning if the unused arguments are all pointers, since the Single
3330 Unix Specification says that such unused arguments are allowed.
3331
3332 @item -Wno-format-zero-length
3333 @opindex Wno-format-zero-length
3334 @opindex Wformat-zero-length
3335 If @option{-Wformat} is specified, do not warn about zero-length formats.
3336 The C standard specifies that zero-length formats are allowed.
3337
3338
3339 @item -Wformat=2
3340 Enable @option{-Wformat} plus additional format checks.  Currently
3341 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3342 -Wformat-y2k}.
3343
3344 @item -Wformat-nonliteral
3345 @opindex Wformat-nonliteral
3346 @opindex Wno-format-nonliteral
3347 If @option{-Wformat} is specified, also warn if the format string is not a
3348 string literal and so cannot be checked, unless the format function
3349 takes its format arguments as a @code{va_list}.
3350
3351 @item -Wformat-security
3352 @opindex Wformat-security
3353 @opindex Wno-format-security
3354 If @option{-Wformat} is specified, also warn about uses of format
3355 functions that represent possible security problems.  At present, this
3356 warns about calls to @code{printf} and @code{scanf} functions where the
3357 format string is not a string literal and there are no format arguments,
3358 as in @code{printf (foo);}.  This may be a security hole if the format
3359 string came from untrusted input and contains @samp{%n}.  (This is
3360 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3361 in future warnings may be added to @option{-Wformat-security} that are not
3362 included in @option{-Wformat-nonliteral}.)
3363
3364 @item -Wformat-y2k
3365 @opindex Wformat-y2k
3366 @opindex Wno-format-y2k
3367 If @option{-Wformat} is specified, also warn about @code{strftime}
3368 formats that may yield only a two-digit year.
3369 @end table
3370
3371 @item -Wnonnull
3372 @opindex Wnonnull
3373 @opindex Wno-nonnull
3374 Warn about passing a null pointer for arguments marked as
3375 requiring a non-null value by the @code{nonnull} function attribute.
3376
3377 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3378 can be disabled with the @option{-Wno-nonnull} option.
3379
3380 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3381 @opindex Winit-self
3382 @opindex Wno-init-self
3383 Warn about uninitialized variables that are initialized with themselves.
3384 Note this option can only be used with the @option{-Wuninitialized} option.
3385
3386 For example, GCC warns about @code{i} being uninitialized in the
3387 following snippet only when @option{-Winit-self} has been specified:
3388 @smallexample
3389 @group
3390 int f()
3391 @{
3392   int i = i;
3393   return i;
3394 @}
3395 @end group
3396 @end smallexample
3397
3398 This warning is enabled by @option{-Wall} in C++.
3399
3400 @item -Wimplicit-int @r{(C and Objective-C only)}
3401 @opindex Wimplicit-int
3402 @opindex Wno-implicit-int
3403 Warn when a declaration does not specify a type.
3404 This warning is enabled by @option{-Wall}.
3405
3406 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3407 @opindex Wimplicit-function-declaration
3408 @opindex Wno-implicit-function-declaration
3409 Give a warning whenever a function is used before being declared. In
3410 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3411 enabled by default and it is made into an error by
3412 @option{-pedantic-errors}. This warning is also enabled by
3413 @option{-Wall}.
3414
3415 @item -Wimplicit @r{(C and Objective-C only)}
3416 @opindex Wimplicit
3417 @opindex Wno-implicit
3418 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3419 This warning is enabled by @option{-Wall}.
3420
3421 @item -Wignored-qualifiers @r{(C and C++ only)}
3422 @opindex Wignored-qualifiers
3423 @opindex Wno-ignored-qualifiers
3424 Warn if the return type of a function has a type qualifier
3425 such as @code{const}.  For ISO C such a type qualifier has no effect,
3426 since the value returned by a function is not an lvalue.
3427 For C++, the warning is only emitted for scalar types or @code{void}.
3428 ISO C prohibits qualified @code{void} return types on function
3429 definitions, so such return types always receive a warning
3430 even without this option.
3431
3432 This warning is also enabled by @option{-Wextra}.
3433
3434 @item -Wmain
3435 @opindex Wmain
3436 @opindex Wno-main
3437 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3438 a function with external linkage, returning int, taking either zero
3439 arguments, two, or three arguments of appropriate types.  This warning
3440 is enabled by default in C++ and is enabled by either @option{-Wall}
3441 or @option{-Wpedantic}.
3442
3443 @item -Wmissing-braces
3444 @opindex Wmissing-braces
3445 @opindex Wno-missing-braces
3446 Warn if an aggregate or union initializer is not fully bracketed.  In
3447 the following example, the initializer for @samp{a} is not fully
3448 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3449 enabled by @option{-Wall} in C.
3450
3451 @smallexample
3452 int a[2][2] = @{ 0, 1, 2, 3 @};
3453 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3454 @end smallexample
3455
3456 This warning is enabled by @option{-Wall}.
3457
3458 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3459 @opindex Wmissing-include-dirs
3460 @opindex Wno-missing-include-dirs
3461 Warn if a user-supplied include directory does not exist.
3462
3463 @item -Wparentheses
3464 @opindex Wparentheses
3465 @opindex Wno-parentheses
3466 Warn if parentheses are omitted in certain contexts, such
3467 as when there is an assignment in a context where a truth value
3468 is expected, or when operators are nested whose precedence people
3469 often get confused about.
3470
3471 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3472 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3473 interpretation from that of ordinary mathematical notation.
3474
3475 Also warn about constructions where there may be confusion to which
3476 @code{if} statement an @code{else} branch belongs.  Here is an example of
3477 such a case:
3478
3479 @smallexample
3480 @group
3481 @{
3482   if (a)
3483     if (b)
3484       foo ();
3485   else
3486     bar ();
3487 @}
3488 @end group
3489 @end smallexample
3490
3491 In C/C++, every @code{else} branch belongs to the innermost possible
3492 @code{if} statement, which in this example is @code{if (b)}.  This is
3493 often not what the programmer expected, as illustrated in the above
3494 example by indentation the programmer chose.  When there is the
3495 potential for this confusion, GCC issues a warning when this flag
3496 is specified.  To eliminate the warning, add explicit braces around
3497 the innermost @code{if} statement so there is no way the @code{else}
3498 can belong to the enclosing @code{if}.  The resulting code
3499 looks like this:
3500
3501 @smallexample
3502 @group
3503 @{
3504   if (a)
3505     @{
3506       if (b)
3507         foo ();
3508       else
3509         bar ();
3510     @}
3511 @}
3512 @end group
3513 @end smallexample
3514
3515 Also warn for dangerous uses of the GNU extension to
3516 @code{?:} with omitted middle operand. When the condition
3517 in the @code{?}: operator is a boolean expression, the omitted value is
3518 always 1.  Often programmers expect it to be a value computed
3519 inside the conditional expression instead.
3520
3521 This warning is enabled by @option{-Wall}.
3522
3523 @item -Wsequence-point
3524 @opindex Wsequence-point
3525 @opindex Wno-sequence-point
3526 Warn about code that may have undefined semantics because of violations
3527 of sequence point rules in the C and C++ standards.
3528
3529 The C and C++ standards define the order in which expressions in a C/C++
3530 program are evaluated in terms of @dfn{sequence points}, which represent
3531 a partial ordering between the execution of parts of the program: those
3532 executed before the sequence point, and those executed after it.  These
3533 occur after the evaluation of a full expression (one which is not part
3534 of a larger expression), after the evaluation of the first operand of a
3535 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3536 function is called (but after the evaluation of its arguments and the
3537 expression denoting the called function), and in certain other places.
3538 Other than as expressed by the sequence point rules, the order of
3539 evaluation of subexpressions of an expression is not specified.  All
3540 these rules describe only a partial order rather than a total order,
3541 since, for example, if two functions are called within one expression
3542 with no sequence point between them, the order in which the functions
3543 are called is not specified.  However, the standards committee have
3544 ruled that function calls do not overlap.
3545
3546 It is not specified when between sequence points modifications to the
3547 values of objects take effect.  Programs whose behavior depends on this
3548 have undefined behavior; the C and C++ standards specify that ``Between
3549 the previous and next sequence point an object shall have its stored
3550 value modified at most once by the evaluation of an expression.
3551 Furthermore, the prior value shall be read only to determine the value
3552 to be stored.''.  If a program breaks these rules, the results on any
3553 particular implementation are entirely unpredictable.
3554
3555 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3556 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3557 diagnosed by this option, and it may give an occasional false positive
3558 result, but in general it has been found fairly effective at detecting
3559 this sort of problem in programs.
3560
3561 The standard is worded confusingly, therefore there is some debate
3562 over the precise meaning of the sequence point rules in subtle cases.
3563 Links to discussions of the problem, including proposed formal
3564 definitions, may be found on the GCC readings page, at
3565 @uref{http://gcc.gnu.org/@/readings.html}.
3566
3567 This warning is enabled by @option{-Wall} for C and C++.
3568
3569 @item -Wno-return-local-addr
3570 @opindex Wno-return-local-addr
3571 @opindex Wreturn-local-addr
3572 Do not warn about returning a pointer (or in C++, a reference) to a
3573 variable that goes out of scope after the function returns.
3574
3575 @item -Wreturn-type
3576 @opindex Wreturn-type
3577 @opindex Wno-return-type
3578 Warn whenever a function is defined with a return type that defaults
3579 to @code{int}.  Also warn about any @code{return} statement with no
3580 return value in a function whose return type is not @code{void}
3581 (falling off the end of the function body is considered returning
3582 without a value), and about a @code{return} statement with an
3583 expression in a function whose return type is @code{void}.
3584
3585 For C++, a function without return type always produces a diagnostic
3586 message, even when @option{-Wno-return-type} is specified.  The only
3587 exceptions are @samp{main} and functions defined in system headers.
3588
3589 This warning is enabled by @option{-Wall}.
3590
3591 @item -Wswitch
3592 @opindex Wswitch
3593 @opindex Wno-switch
3594 Warn whenever a @code{switch} statement has an index of enumerated type
3595 and lacks a @code{case} for one or more of the named codes of that
3596 enumeration.  (The presence of a @code{default} label prevents this
3597 warning.)  @code{case} labels outside the enumeration range also
3598 provoke warnings when this option is used (even if there is a
3599 @code{default} label).
3600 This warning is enabled by @option{-Wall}.
3601
3602 @item -Wswitch-default
3603 @opindex Wswitch-default
3604 @opindex Wno-switch-default
3605 Warn whenever a @code{switch} statement does not have a @code{default}
3606 case.
3607
3608 @item -Wswitch-enum
3609 @opindex Wswitch-enum
3610 @opindex Wno-switch-enum
3611 Warn whenever a @code{switch} statement has an index of enumerated type
3612 and lacks a @code{case} for one or more of the named codes of that
3613 enumeration.  @code{case} labels outside the enumeration range also
3614 provoke warnings when this option is used.  The only difference
3615 between @option{-Wswitch} and this option is that this option gives a
3616 warning about an omitted enumeration code even if there is a
3617 @code{default} label.
3618
3619 @item -Wsync-nand @r{(C and C++ only)}
3620 @opindex Wsync-nand
3621 @opindex Wno-sync-nand
3622 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3623 built-in functions are used.  These functions changed semantics in GCC 4.4.
3624
3625 @item -Wtrigraphs
3626 @opindex Wtrigraphs
3627 @opindex Wno-trigraphs
3628 Warn if any trigraphs are encountered that might change the meaning of
3629 the program (trigraphs within comments are not warned about).
3630 This warning is enabled by @option{-Wall}.
3631
3632 @item -Wunused-but-set-parameter
3633 @opindex Wunused-but-set-parameter
3634 @opindex Wno-unused-but-set-parameter
3635 Warn whenever a function parameter is assigned to, but otherwise unused
3636 (aside from its declaration).
3637
3638 To suppress this warning use the @samp{unused} attribute
3639 (@pxref{Variable Attributes}).
3640
3641 This warning is also enabled by @option{-Wunused} together with
3642 @option{-Wextra}.
3643
3644 @item -Wunused-but-set-variable
3645 @opindex Wunused-but-set-variable
3646 @opindex Wno-unused-but-set-variable
3647 Warn whenever a local variable is assigned to, but otherwise unused
3648 (aside from its declaration).
3649 This warning is enabled by @option{-Wall}.
3650
3651 To suppress this warning use the @samp{unused} attribute
3652 (@pxref{Variable Attributes}).
3653
3654 This warning is also enabled by @option{-Wunused}, which is enabled
3655 by @option{-Wall}.
3656
3657 @item -Wunused-function
3658 @opindex Wunused-function
3659 @opindex Wno-unused-function
3660 Warn whenever a static function is declared but not defined or a
3661 non-inline static function is unused.
3662 This warning is enabled by @option{-Wall}.
3663
3664 @item -Wunused-label
3665 @opindex Wunused-label
3666 @opindex Wno-unused-label
3667 Warn whenever a label is declared but not used.
3668 This warning is enabled by @option{-Wall}.
3669
3670 To suppress this warning use the @samp{unused} attribute
3671 (@pxref{Variable Attributes}).
3672
3673 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3674 @opindex Wunused-local-typedefs
3675 Warn when a typedef locally defined in a function is not used.
3676 This warning is enabled by @option{-Wall}.
3677
3678 @item -Wunused-parameter
3679 @opindex Wunused-parameter
3680 @opindex Wno-unused-parameter
3681 Warn whenever a function parameter is unused aside from its declaration.
3682
3683 To suppress this warning use the @samp{unused} attribute
3684 (@pxref{Variable Attributes}).
3685
3686 @item -Wno-unused-result
3687 @opindex Wunused-result
3688 @opindex Wno-unused-result
3689 Do not warn if a caller of a function marked with attribute
3690 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3691 its return value. The default is @option{-Wunused-result}.
3692
3693 @item -Wunused-variable
3694 @opindex Wunused-variable
3695 @opindex Wno-unused-variable
3696 Warn whenever a local variable or non-constant static variable is unused
3697 aside from its declaration.
3698 This warning is enabled by @option{-Wall}.
3699
3700 To suppress this warning use the @samp{unused} attribute
3701 (@pxref{Variable Attributes}).
3702
3703 @item -Wunused-value
3704 @opindex Wunused-value
3705 @opindex Wno-unused-value
3706 Warn whenever a statement computes a result that is explicitly not
3707 used. To suppress this warning cast the unused expression to
3708 @samp{void}. This includes an expression-statement or the left-hand
3709 side of a comma expression that contains no side effects. For example,
3710 an expression such as @samp{x[i,j]} causes a warning, while
3711 @samp{x[(void)i,j]} does not.
3712
3713 This warning is enabled by @option{-Wall}.
3714
3715 @item -Wunused
3716 @opindex Wunused
3717 @opindex Wno-unused
3718 All the above @option{-Wunused} options combined.
3719
3720 In order to get a warning about an unused function parameter, you must
3721 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3722 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3723
3724 @item -Wuninitialized
3725 @opindex Wuninitialized
3726 @opindex Wno-uninitialized
3727 Warn if an automatic variable is used without first being initialized
3728 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3729 warn if a non-static reference or non-static @samp{const} member
3730 appears in a class without constructors.
3731
3732 If you want to warn about code that uses the uninitialized value of the
3733 variable in its own initializer, use the @option{-Winit-self} option.
3734
3735 These warnings occur for individual uninitialized or clobbered
3736 elements of structure, union or array variables as well as for
3737 variables that are uninitialized or clobbered as a whole.  They do
3738 not occur for variables or elements declared @code{volatile}.  Because
3739 these warnings depend on optimization, the exact variables or elements
3740 for which there are warnings depends on the precise optimization
3741 options and version of GCC used.
3742
3743 Note that there may be no warning about a variable that is used only
3744 to compute a value that itself is never used, because such
3745 computations may be deleted by data flow analysis before the warnings
3746 are printed.
3747
3748 @item -Wmaybe-uninitialized
3749 @opindex Wmaybe-uninitialized
3750 @opindex Wno-maybe-uninitialized
3751 For an automatic variable, if there exists a path from the function
3752 entry to a use of the variable that is initialized, but there exist
3753 some other paths for which the variable is not initialized, the compiler
3754 emits a warning if it cannot prove the uninitialized paths are not
3755 executed at run time. These warnings are made optional because GCC is
3756 not smart enough to see all the reasons why the code might be correct
3757 in spite of appearing to have an error.  Here is one example of how
3758 this can happen:
3759
3760 @smallexample
3761 @group
3762 @{
3763   int x;
3764   switch (y)
3765     @{
3766     case 1: x = 1;
3767       break;
3768     case 2: x = 4;
3769       break;
3770     case 3: x = 5;
3771     @}
3772   foo (x);
3773 @}
3774 @end group
3775 @end smallexample
3776
3777 @noindent
3778 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3779 always initialized, but GCC doesn't know this. To suppress the
3780 warning, you need to provide a default case with assert(0) or
3781 similar code.
3782
3783 @cindex @code{longjmp} warnings
3784 This option also warns when a non-volatile automatic variable might be
3785 changed by a call to @code{longjmp}.  These warnings as well are possible
3786 only in optimizing compilation.
3787
3788 The compiler sees only the calls to @code{setjmp}.  It cannot know
3789 where @code{longjmp} will be called; in fact, a signal handler could
3790 call it at any point in the code.  As a result, you may get a warning
3791 even when there is in fact no problem because @code{longjmp} cannot
3792 in fact be called at the place that would cause a problem.
3793
3794 Some spurious warnings can be avoided if you declare all the functions
3795 you use that never return as @code{noreturn}.  @xref{Function
3796 Attributes}.
3797
3798 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3799
3800 @item -Wunknown-pragmas
3801 @opindex Wunknown-pragmas
3802 @opindex Wno-unknown-pragmas
3803 @cindex warning for unknown pragmas
3804 @cindex unknown pragmas, warning
3805 @cindex pragmas, warning of unknown
3806 Warn when a @code{#pragma} directive is encountered that is not understood by 
3807 GCC@.  If this command-line option is used, warnings are even issued
3808 for unknown pragmas in system header files.  This is not the case if
3809 the warnings are only enabled by the @option{-Wall} command-line option.
3810
3811 @item -Wno-pragmas
3812 @opindex Wno-pragmas
3813 @opindex Wpragmas
3814 Do not warn about misuses of pragmas, such as incorrect parameters,
3815 invalid syntax, or conflicts between pragmas.  See also
3816 @option{-Wunknown-pragmas}.
3817
3818 @item -Wstrict-aliasing
3819 @opindex Wstrict-aliasing
3820 @opindex Wno-strict-aliasing
3821 This option is only active when @option{-fstrict-aliasing} is active.
3822 It warns about code that might break the strict aliasing rules that the
3823 compiler is using for optimization.  The warning does not catch all
3824 cases, but does attempt to catch the more common pitfalls.  It is
3825 included in @option{-Wall}.
3826 It is equivalent to @option{-Wstrict-aliasing=3}
3827
3828 @item -Wstrict-aliasing=n
3829 @opindex Wstrict-aliasing=n
3830 This option is only active when @option{-fstrict-aliasing} is active.
3831 It warns about code that might break the strict aliasing rules that the
3832 compiler is using for optimization.
3833 Higher levels correspond to higher accuracy (fewer false positives).
3834 Higher levels also correspond to more effort, similar to the way @option{-O} 
3835 works.
3836 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
3837
3838 Level 1: Most aggressive, quick, least accurate.
3839 Possibly useful when higher levels
3840 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
3841 false negatives.  However, it has many false positives.
3842 Warns for all pointer conversions between possibly incompatible types,
3843 even if never dereferenced.  Runs in the front end only.
3844
3845 Level 2: Aggressive, quick, not too precise.
3846 May still have many false positives (not as many as level 1 though),
3847 and few false negatives (but possibly more than level 1).
3848 Unlike level 1, it only warns when an address is taken.  Warns about
3849 incomplete types.  Runs in the front end only.
3850
3851 Level 3 (default for @option{-Wstrict-aliasing}):
3852 Should have very few false positives and few false
3853 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3854 Takes care of the common pun+dereference pattern in the front end:
3855 @code{*(int*)&some_float}.
3856 If optimization is enabled, it also runs in the back end, where it deals
3857 with multiple statement cases using flow-sensitive points-to information.
3858 Only warns when the converted pointer is dereferenced.
3859 Does not warn about incomplete types.
3860
3861 @item -Wstrict-overflow
3862 @itemx -Wstrict-overflow=@var{n}
3863 @opindex Wstrict-overflow
3864 @opindex Wno-strict-overflow
3865 This option is only active when @option{-fstrict-overflow} is active.
3866 It warns about cases where the compiler optimizes based on the
3867 assumption that signed overflow does not occur.  Note that it does not
3868 warn about all cases where the code might overflow: it only warns
3869 about cases where the compiler implements some optimization.  Thus
3870 this warning depends on the optimization level.
3871
3872 An optimization that assumes that signed overflow does not occur is
3873 perfectly safe if the values of the variables involved are such that
3874 overflow never does, in fact, occur.  Therefore this warning can
3875 easily give a false positive: a warning about code that is not
3876 actually a problem.  To help focus on important issues, several
3877 warning levels are defined.  No warnings are issued for the use of
3878 undefined signed overflow when estimating how many iterations a loop
3879 requires, in particular when determining whether a loop will be
3880 executed at all.
3881
3882 @table @gcctabopt
3883 @item -Wstrict-overflow=1
3884 Warn about cases that are both questionable and easy to avoid.  For
3885 example,  with @option{-fstrict-overflow}, the compiler simplifies
3886 @code{x + 1 > x} to @code{1}.  This level of
3887 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3888 are not, and must be explicitly requested.
3889
3890 @item -Wstrict-overflow=2
3891 Also warn about other cases where a comparison is simplified to a
3892 constant.  For example: @code{abs (x) >= 0}.  This can only be
3893 simplified when @option{-fstrict-overflow} is in effect, because
3894 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3895 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3896 @option{-Wstrict-overflow=2}.
3897
3898 @item -Wstrict-overflow=3
3899 Also warn about other cases where a comparison is simplified.  For
3900 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
3901
3902 @item -Wstrict-overflow=4
3903 Also warn about other simplifications not covered by the above cases.
3904 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
3905
3906 @item -Wstrict-overflow=5
3907 Also warn about cases where the compiler reduces the magnitude of a
3908 constant involved in a comparison.  For example: @code{x + 2 > y} is
3909 simplified to @code{x + 1 >= y}.  This is reported only at the
3910 highest warning level because this simplification applies to many
3911 comparisons, so this warning level gives a very large number of
3912 false positives.
3913 @end table
3914
3915 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
3916 @opindex Wsuggest-attribute=
3917 @opindex Wno-suggest-attribute=
3918 Warn for cases where adding an attribute may be beneficial. The
3919 attributes currently supported are listed below.
3920
3921 @table @gcctabopt
3922 @item -Wsuggest-attribute=pure
3923 @itemx -Wsuggest-attribute=const
3924 @itemx -Wsuggest-attribute=noreturn
3925 @opindex Wsuggest-attribute=pure
3926 @opindex Wno-suggest-attribute=pure
3927 @opindex Wsuggest-attribute=const
3928 @opindex Wno-suggest-attribute=const
3929 @opindex Wsuggest-attribute=noreturn
3930 @opindex Wno-suggest-attribute=noreturn
3931
3932 Warn about functions that might be candidates for attributes
3933 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3934 functions visible in other compilation units or (in the case of @code{pure} and
3935 @code{const}) if it cannot prove that the function returns normally. A function
3936 returns normally if it doesn't contain an infinite loop or return abnormally
3937 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3938 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3939 higher.  Higher optimization levels improve the accuracy of the analysis.
3940
3941 @item -Wsuggest-attribute=format
3942 @itemx -Wmissing-format-attribute
3943 @opindex Wsuggest-attribute=format
3944 @opindex Wmissing-format-attribute
3945 @opindex Wno-suggest-attribute=format
3946 @opindex Wno-missing-format-attribute
3947 @opindex Wformat
3948 @opindex Wno-format
3949
3950 Warn about function pointers that might be candidates for @code{format}
3951 attributes.  Note these are only possible candidates, not absolute ones.
3952 GCC guesses that function pointers with @code{format} attributes that
3953 are used in assignment, initialization, parameter passing or return
3954 statements should have a corresponding @code{format} attribute in the
3955 resulting type.  I.e.@: the left-hand side of the assignment or
3956 initialization, the type of the parameter variable, or the return type
3957 of the containing function respectively should also have a @code{format}
3958 attribute to avoid the warning.
3959
3960 GCC also warns about function definitions that might be
3961 candidates for @code{format} attributes.  Again, these are only
3962 possible candidates.  GCC guesses that @code{format} attributes
3963 might be appropriate for any function that calls a function like
3964 @code{vprintf} or @code{vscanf}, but this might not always be the
3965 case, and some functions for which @code{format} attributes are
3966 appropriate may not be detected.
3967 @end table
3968
3969 @item -Warray-bounds
3970 @opindex Wno-array-bounds
3971 @opindex Warray-bounds
3972 This option is only active when @option{-ftree-vrp} is active
3973 (default for @option{-O2} and above). It warns about subscripts to arrays
3974 that are always out of bounds. This warning is enabled by @option{-Wall}.
3975
3976 @item -Wno-div-by-zero
3977 @opindex Wno-div-by-zero
3978 @opindex Wdiv-by-zero
3979 Do not warn about compile-time integer division by zero.  Floating-point
3980 division by zero is not warned about, as it can be a legitimate way of
3981 obtaining infinities and NaNs.
3982
3983 @item -Wsystem-headers
3984 @opindex Wsystem-headers
3985 @opindex Wno-system-headers
3986 @cindex warnings from system headers
3987 @cindex system headers, warnings from
3988 Print warning messages for constructs found in system header files.
3989 Warnings from system headers are normally suppressed, on the assumption
3990 that they usually do not indicate real problems and would only make the
3991 compiler output harder to read.  Using this command-line option tells
3992 GCC to emit warnings from system headers as if they occurred in user
3993 code.  However, note that using @option{-Wall} in conjunction with this
3994 option does @emph{not} warn about unknown pragmas in system
3995 headers---for that, @option{-Wunknown-pragmas} must also be used.
3996
3997 @item -Wtrampolines
3998 @opindex Wtrampolines
3999 @opindex Wno-trampolines
4000  Warn about trampolines generated for pointers to nested functions.
4001
4002  A trampoline is a small piece of data or code that is created at run
4003  time on the stack when the address of a nested function is taken, and
4004  is used to call the nested function indirectly.  For some targets, it
4005  is made up of data only and thus requires no special treatment.  But,
4006  for most targets, it is made up of code and thus requires the stack
4007  to be made executable in order for the program to work properly.
4008
4009 @item -Wfloat-equal
4010 @opindex Wfloat-equal
4011 @opindex Wno-float-equal
4012 Warn if floating-point values are used in equality comparisons.
4013
4014 The idea behind this is that sometimes it is convenient (for the
4015 programmer) to consider floating-point values as approximations to
4016 infinitely precise real numbers.  If you are doing this, then you need
4017 to compute (by analyzing the code, or in some other way) the maximum or
4018 likely maximum error that the computation introduces, and allow for it
4019 when performing comparisons (and when producing output, but that's a
4020 different problem).  In particular, instead of testing for equality, you
4021 should check to see whether the two values have ranges that overlap; and
4022 this is done with the relational operators, so equality comparisons are
4023 probably mistaken.
4024
4025 @item -Wtraditional @r{(C and Objective-C only)}
4026 @opindex Wtraditional
4027 @opindex Wno-traditional
4028 Warn about certain constructs that behave differently in traditional and
4029 ISO C@.  Also warn about ISO C constructs that have no traditional C
4030 equivalent, and/or problematic constructs that should be avoided.
4031
4032 @itemize @bullet
4033 @item
4034 Macro parameters that appear within string literals in the macro body.
4035 In traditional C macro replacement takes place within string literals,
4036 but in ISO C it does not.
4037
4038 @item
4039 In traditional C, some preprocessor directives did not exist.
4040 Traditional preprocessors only considered a line to be a directive
4041 if the @samp{#} appeared in column 1 on the line.  Therefore
4042 @option{-Wtraditional} warns about directives that traditional C
4043 understands but ignores because the @samp{#} does not appear as the
4044 first character on the line.  It also suggests you hide directives like
4045 @samp{#pragma} not understood by traditional C by indenting them.  Some
4046 traditional implementations do not recognize @samp{#elif}, so this option
4047 suggests avoiding it altogether.
4048
4049 @item
4050 A function-like macro that appears without arguments.
4051
4052 @item
4053 The unary plus operator.
4054
4055 @item
4056 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4057 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4058 constants.)  Note, these suffixes appear in macros defined in the system
4059 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4060 Use of these macros in user code might normally lead to spurious
4061 warnings, however GCC's integrated preprocessor has enough context to
4062 avoid warning in these cases.
4063
4064 @item
4065 A function declared external in one block and then used after the end of
4066 the block.
4067
4068 @item
4069 A @code{switch} statement has an operand of type @code{long}.
4070
4071 @item
4072 A non-@code{static} function declaration follows a @code{static} one.
4073 This construct is not accepted by some traditional C compilers.
4074
4075 @item
4076 The ISO type of an integer constant has a different width or
4077 signedness from its traditional type.  This warning is only issued if
4078 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4079 typically represent bit patterns, are not warned about.
4080
4081 @item
4082 Usage of ISO string concatenation is detected.
4083
4084 @item
4085 Initialization of automatic aggregates.
4086
4087 @item
4088 Identifier conflicts with labels.  Traditional C lacks a separate
4089 namespace for labels.
4090
4091 @item
4092 Initialization of unions.  If the initializer is zero, the warning is
4093 omitted.  This is done under the assumption that the zero initializer in
4094 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4095 initializer warnings and relies on default initialization to zero in the
4096 traditional C case.
4097
4098 @item
4099 Conversions by prototypes between fixed/floating-point values and vice
4100 versa.  The absence of these prototypes when compiling with traditional
4101 C causes serious problems.  This is a subset of the possible
4102 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4103
4104 @item
4105 Use of ISO C style function definitions.  This warning intentionally is
4106 @emph{not} issued for prototype declarations or variadic functions
4107 because these ISO C features appear in your code when using
4108 libiberty's traditional C compatibility macros, @code{PARAMS} and
4109 @code{VPARAMS}.  This warning is also bypassed for nested functions
4110 because that feature is already a GCC extension and thus not relevant to
4111 traditional C compatibility.
4112 @end itemize
4113
4114 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4115 @opindex Wtraditional-conversion
4116 @opindex Wno-traditional-conversion
4117 Warn if a prototype causes a type conversion that is different from what
4118 would happen to the same argument in the absence of a prototype.  This
4119 includes conversions of fixed point to floating and vice versa, and
4120 conversions changing the width or signedness of a fixed-point argument
4121 except when the same as the default promotion.
4122
4123 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4124 @opindex Wdeclaration-after-statement
4125 @opindex Wno-declaration-after-statement
4126 Warn when a declaration is found after a statement in a block.  This
4127 construct, known from C++, was introduced with ISO C99 and is by default
4128 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4129 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4130
4131 @item -Wundef
4132 @opindex Wundef
4133 @opindex Wno-undef
4134 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4135
4136 @item -Wno-endif-labels
4137 @opindex Wno-endif-labels
4138 @opindex Wendif-labels
4139 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4140
4141 @item -Wshadow
4142 @opindex Wshadow
4143 @opindex Wno-shadow
4144 Warn whenever a local variable or type declaration shadows another variable,
4145 parameter, type, or class member (in C++), or whenever a built-in function
4146 is shadowed. Note that in C++, the compiler warns if a local variable
4147 shadows an explicit typedef, but not if it shadows a struct/class/enum.
4148
4149 @item -Wlarger-than=@var{len}
4150 @opindex Wlarger-than=@var{len}
4151 @opindex Wlarger-than-@var{len}
4152 Warn whenever an object of larger than @var{len} bytes is defined.
4153
4154 @item -Wframe-larger-than=@var{len}
4155 @opindex Wframe-larger-than
4156 Warn if the size of a function frame is larger than @var{len} bytes.
4157 The computation done to determine the stack frame size is approximate
4158 and not conservative.
4159 The actual requirements may be somewhat greater than @var{len}
4160 even if you do not get a warning.  In addition, any space allocated
4161 via @code{alloca}, variable-length arrays, or related constructs
4162 is not included by the compiler when determining
4163 whether or not to issue a warning.
4164
4165 @item -Wno-free-nonheap-object
4166 @opindex Wno-free-nonheap-object
4167 @opindex Wfree-nonheap-object
4168 Do not warn when attempting to free an object that was not allocated
4169 on the heap.
4170
4171 @item -Wstack-usage=@var{len}
4172 @opindex Wstack-usage
4173 Warn if the stack usage of a function might be larger than @var{len} bytes.
4174 The computation done to determine the stack usage is conservative.
4175 Any space allocated via @code{alloca}, variable-length arrays, or related
4176 constructs is included by the compiler when determining whether or not to
4177 issue a warning.
4178
4179 The message is in keeping with the output of @option{-fstack-usage}.
4180
4181 @itemize
4182 @item
4183 If the stack usage is fully static but exceeds the specified amount, it's:
4184
4185 @smallexample
4186   warning: stack usage is 1120 bytes
4187 @end smallexample
4188 @item
4189 If the stack usage is (partly) dynamic but bounded, it's:
4190
4191 @smallexample
4192   warning: stack usage might be 1648 bytes
4193 @end smallexample
4194 @item
4195 If the stack usage is (partly) dynamic and not bounded, it's:
4196
4197 @smallexample
4198   warning: stack usage might be unbounded
4199 @end smallexample
4200 @end itemize
4201
4202 @item -Wunsafe-loop-optimizations
4203 @opindex Wunsafe-loop-optimizations
4204 @opindex Wno-unsafe-loop-optimizations
4205 Warn if the loop cannot be optimized because the compiler cannot
4206 assume anything on the bounds of the loop indices.  With
4207 @option{-funsafe-loop-optimizations} warn if the compiler makes
4208 such assumptions.
4209
4210 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4211 @opindex Wno-pedantic-ms-format
4212 @opindex Wpedantic-ms-format
4213 When used in combination with @option{-Wformat}
4214 and @option{-pedantic} without GNU extensions, this option
4215 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4216 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4217 which depend on the MS runtime.
4218
4219 @item -Wpointer-arith
4220 @opindex Wpointer-arith
4221 @opindex Wno-pointer-arith
4222 Warn about anything that depends on the ``size of'' a function type or
4223 of @code{void}.  GNU C assigns these types a size of 1, for
4224 convenience in calculations with @code{void *} pointers and pointers
4225 to functions.  In C++, warn also when an arithmetic operation involves
4226 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4227
4228 @item -Wtype-limits
4229 @opindex Wtype-limits
4230 @opindex Wno-type-limits
4231 Warn if a comparison is always true or always false due to the limited
4232 range of the data type, but do not warn for constant expressions.  For
4233 example, warn if an unsigned variable is compared against zero with
4234 @samp{<} or @samp{>=}.  This warning is also enabled by
4235 @option{-Wextra}.
4236
4237 @item -Wbad-function-cast @r{(C and Objective-C only)}
4238 @opindex Wbad-function-cast
4239 @opindex Wno-bad-function-cast
4240 Warn whenever a function call is cast to a non-matching type.
4241 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4242
4243 @item -Wc++-compat @r{(C and Objective-C only)}
4244 Warn about ISO C constructs that are outside of the common subset of
4245 ISO C and ISO C++, e.g.@: request for implicit conversion from
4246 @code{void *} to a pointer to non-@code{void} type.
4247
4248 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4249 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4250 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4251 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4252 enabled by @option{-Wall}.
4253
4254 @item -Wcast-qual
4255 @opindex Wcast-qual
4256 @opindex Wno-cast-qual
4257 Warn whenever a pointer is cast so as to remove a type qualifier from
4258 the target type.  For example, warn if a @code{const char *} is cast
4259 to an ordinary @code{char *}.
4260
4261 Also warn when making a cast that introduces a type qualifier in an
4262 unsafe way.  For example, casting @code{char **} to @code{const char **}
4263 is unsafe, as in this example:
4264
4265 @smallexample
4266   /* p is char ** value.  */
4267   const char **q = (const char **) p;
4268   /* Assignment of readonly string to const char * is OK.  */
4269   *q = "string";
4270   /* Now char** pointer points to read-only memory.  */
4271   **p = 'b';
4272 @end smallexample
4273
4274 @item -Wcast-align
4275 @opindex Wcast-align
4276 @opindex Wno-cast-align
4277 Warn whenever a pointer is cast such that the required alignment of the
4278 target is increased.  For example, warn if a @code{char *} is cast to
4279 an @code{int *} on machines where integers can only be accessed at
4280 two- or four-byte boundaries.
4281
4282 @item -Wwrite-strings
4283 @opindex Wwrite-strings
4284 @opindex Wno-write-strings
4285 When compiling C, give string constants the type @code{const
4286 char[@var{length}]} so that copying the address of one into a
4287 non-@code{const} @code{char *} pointer produces a warning.  These
4288 warnings help you find at compile time code that can try to write
4289 into a string constant, but only if you have been very careful about
4290 using @code{const} in declarations and prototypes.  Otherwise, it is
4291 just a nuisance. This is why we did not make @option{-Wall} request
4292 these warnings.
4293
4294 When compiling C++, warn about the deprecated conversion from string
4295 literals to @code{char *}.  This warning is enabled by default for C++
4296 programs.
4297
4298 @item -Wclobbered
4299 @opindex Wclobbered
4300 @opindex Wno-clobbered
4301 Warn for variables that might be changed by @samp{longjmp} or
4302 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4303
4304 @item -Wconversion
4305 @opindex Wconversion
4306 @opindex Wno-conversion
4307 Warn for implicit conversions that may alter a value. This includes
4308 conversions between real and integer, like @code{abs (x)} when
4309 @code{x} is @code{double}; conversions between signed and unsigned,
4310 like @code{unsigned ui = -1}; and conversions to smaller types, like
4311 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4312 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4313 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4314 conversions between signed and unsigned integers can be disabled by
4315 using @option{-Wno-sign-conversion}.
4316
4317 For C++, also warn for confusing overload resolution for user-defined
4318 conversions; and conversions that never use a type conversion
4319 operator: conversions to @code{void}, the same type, a base class or a
4320 reference to them. Warnings about conversions between signed and
4321 unsigned integers are disabled by default in C++ unless
4322 @option{-Wsign-conversion} is explicitly enabled.
4323
4324 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4325 @opindex Wconversion-null
4326 @opindex Wno-conversion-null
4327 Do not warn for conversions between @code{NULL} and non-pointer
4328 types. @option{-Wconversion-null} is enabled by default.
4329
4330 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4331 @opindex Wzero-as-null-pointer-constant
4332 @opindex Wno-zero-as-null-pointer-constant
4333 Warn when a literal '0' is used as null pointer constant.  This can
4334 be useful to facilitate the conversion to @code{nullptr} in C++11.
4335
4336 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4337 @opindex Wuseless-cast
4338 @opindex Wno-useless-cast
4339 Warn when an expression is casted to its own type.
4340
4341 @item -Wempty-body
4342 @opindex Wempty-body
4343 @opindex Wno-empty-body
4344 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4345 while} statement.  This warning is also enabled by @option{-Wextra}.
4346
4347 @item -Wenum-compare
4348 @opindex Wenum-compare
4349 @opindex Wno-enum-compare
4350 Warn about a comparison between values of different enumerated types.
4351 In C++ enumeral mismatches in conditional expressions are also
4352 diagnosed and the warning is enabled by default.  In C this warning is 
4353 enabled by @option{-Wall}.
4354
4355 @item -Wjump-misses-init @r{(C, Objective-C only)}
4356 @opindex Wjump-misses-init
4357 @opindex Wno-jump-misses-init
4358 Warn if a @code{goto} statement or a @code{switch} statement jumps
4359 forward across the initialization of a variable, or jumps backward to a
4360 label after the variable has been initialized.  This only warns about
4361 variables that are initialized when they are declared.  This warning is
4362 only supported for C and Objective-C; in C++ this sort of branch is an
4363 error in any case.
4364
4365 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4366 can be disabled with the @option{-Wno-jump-misses-init} option.
4367
4368 @item -Wsign-compare
4369 @opindex Wsign-compare
4370 @opindex Wno-sign-compare
4371 @cindex warning for comparison of signed and unsigned values
4372 @cindex comparison of signed and unsigned values, warning
4373 @cindex signed and unsigned values, comparison warning
4374 Warn when a comparison between signed and unsigned values could produce
4375 an incorrect result when the signed value is converted to unsigned.
4376 This warning is also enabled by @option{-Wextra}; to get the other warnings
4377 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4378
4379 @item -Wsign-conversion
4380 @opindex Wsign-conversion
4381 @opindex Wno-sign-conversion
4382 Warn for implicit conversions that may change the sign of an integer
4383 value, like assigning a signed integer expression to an unsigned
4384 integer variable. An explicit cast silences the warning. In C, this
4385 option is enabled also by @option{-Wconversion}.
4386
4387 @item -Wsizeof-pointer-memaccess
4388 @opindex Wsizeof-pointer-memaccess
4389 @opindex Wno-sizeof-pointer-memaccess
4390 Warn for suspicious length parameters to certain string and memory built-in
4391 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4392 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4393 but a pointer, and suggests a possible fix, or about
4394 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4395 @option{-Wall}.
4396
4397 @item -Waddress
4398 @opindex Waddress
4399 @opindex Wno-address
4400 Warn about suspicious uses of memory addresses. These include using
4401 the address of a function in a conditional expression, such as
4402 @code{void func(void); if (func)}, and comparisons against the memory
4403 address of a string literal, such as @code{if (x == "abc")}.  Such
4404 uses typically indicate a programmer error: the address of a function
4405 always evaluates to true, so their use in a conditional usually
4406 indicate that the programmer forgot the parentheses in a function
4407 call; and comparisons against string literals result in unspecified
4408 behavior and are not portable in C, so they usually indicate that the
4409 programmer intended to use @code{strcmp}.  This warning is enabled by
4410 @option{-Wall}.
4411
4412 @item -Wlogical-op
4413 @opindex Wlogical-op
4414 @opindex Wno-logical-op
4415 Warn about suspicious uses of logical operators in expressions.
4416 This includes using logical operators in contexts where a
4417 bit-wise operator is likely to be expected.
4418
4419 @item -Waggregate-return
4420 @opindex Waggregate-return
4421 @opindex Wno-aggregate-return
4422 Warn if any functions that return structures or unions are defined or
4423 called.  (In languages where you can return an array, this also elicits
4424 a warning.)
4425
4426 @item -Wno-aggressive-loop-optimizations
4427 @opindex Wno-aggressive-loop-optimizations
4428 @opindex Waggressive-loop-optimizations
4429 Warn if in a loop with constant number of iterations the compiler detects
4430 undefined behavior in some statement during one or more of the iterations.
4431
4432 @item -Wno-attributes
4433 @opindex Wno-attributes
4434 @opindex Wattributes
4435 Do not warn if an unexpected @code{__attribute__} is used, such as
4436 unrecognized attributes, function attributes applied to variables,
4437 etc.  This does not stop errors for incorrect use of supported
4438 attributes.
4439
4440 @item -Wno-builtin-macro-redefined
4441 @opindex Wno-builtin-macro-redefined
4442 @opindex Wbuiltin-macro-redefined
4443 Do not warn if certain built-in macros are redefined.  This suppresses
4444 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4445 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4446
4447 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4448 @opindex Wstrict-prototypes
4449 @opindex Wno-strict-prototypes
4450 Warn if a function is declared or defined without specifying the
4451 argument types.  (An old-style function definition is permitted without
4452 a warning if preceded by a declaration that specifies the argument
4453 types.)
4454
4455 @item -Wold-style-declaration @r{(C and Objective-C only)}
4456 @opindex Wold-style-declaration
4457 @opindex Wno-old-style-declaration
4458 Warn for obsolescent usages, according to the C Standard, in a
4459 declaration. For example, warn if storage-class specifiers like
4460 @code{static} are not the first things in a declaration.  This warning
4461 is also enabled by @option{-Wextra}.
4462
4463 @item -Wold-style-definition @r{(C and Objective-C only)}
4464 @opindex Wold-style-definition
4465 @opindex Wno-old-style-definition
4466 Warn if an old-style function definition is used.  A warning is given
4467 even if there is a previous prototype.
4468
4469 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4470 @opindex Wmissing-parameter-type
4471 @opindex Wno-missing-parameter-type
4472 A function parameter is declared without a type specifier in K&R-style
4473 functions:
4474
4475 @smallexample
4476 void foo(bar) @{ @}
4477 @end smallexample
4478
4479 This warning is also enabled by @option{-Wextra}.
4480
4481 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4482 @opindex Wmissing-prototypes
4483 @opindex Wno-missing-prototypes
4484 Warn if a global function is defined without a previous prototype
4485 declaration.  This warning is issued even if the definition itself
4486 provides a prototype.  Use this option to detect global functions
4487 that do not have a matching prototype declaration in a header file.
4488 This option is not valid for C++ because all function declarations
4489 provide prototypes and a non-matching declaration will declare an
4490 overload rather than conflict with an earlier declaration.
4491 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4492
4493 @item -Wmissing-declarations
4494 @opindex Wmissing-declarations
4495 @opindex Wno-missing-declarations
4496 Warn if a global function is defined without a previous declaration.
4497 Do so even if the definition itself provides a prototype.
4498 Use this option to detect global functions that are not declared in
4499 header files.  In C, no warnings are issued for functions with previous
4500 non-prototype declarations; use @option{-Wmissing-prototype} to detect
4501 missing prototypes.  In C++, no warnings are issued for function templates,
4502 or for inline functions, or for functions in anonymous namespaces.
4503
4504 @item -Wmissing-field-initializers
4505 @opindex Wmissing-field-initializers
4506 @opindex Wno-missing-field-initializers
4507 @opindex W
4508 @opindex Wextra
4509 @opindex Wno-extra
4510 Warn if a structure's initializer has some fields missing.  For
4511 example, the following code causes such a warning, because
4512 @code{x.h} is implicitly zero:
4513
4514 @smallexample
4515 struct s @{ int f, g, h; @};
4516 struct s x = @{ 3, 4 @};
4517 @end smallexample
4518
4519 This option does not warn about designated initializers, so the following
4520 modification does not trigger a warning:
4521
4522 @smallexample
4523 struct s @{ int f, g, h; @};
4524 struct s x = @{ .f = 3, .g = 4 @};
4525 @end smallexample
4526
4527 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4528 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4529
4530 @item -Wno-multichar
4531 @opindex Wno-multichar
4532 @opindex Wmultichar
4533 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4534 Usually they indicate a typo in the user's code, as they have
4535 implementation-defined values, and should not be used in portable code.
4536
4537 @item -Wnormalized=<none|id|nfc|nfkc>
4538 @opindex Wnormalized=
4539 @cindex NFC
4540 @cindex NFKC
4541 @cindex character set, input normalization
4542 In ISO C and ISO C++, two identifiers are different if they are
4543 different sequences of characters.  However, sometimes when characters
4544 outside the basic ASCII character set are used, you can have two
4545 different character sequences that look the same.  To avoid confusion,
4546 the ISO 10646 standard sets out some @dfn{normalization rules} which
4547 when applied ensure that two sequences that look the same are turned into
4548 the same sequence.  GCC can warn you if you are using identifiers that
4549 have not been normalized; this option controls that warning.
4550
4551 There are four levels of warning supported by GCC@.  The default is
4552 @option{-Wnormalized=nfc}, which warns about any identifier that is
4553 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4554 recommended form for most uses.
4555
4556 Unfortunately, there are some characters allowed in identifiers by
4557 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4558 identifiers.  That is, there's no way to use these symbols in portable
4559 ISO C or C++ and have all your identifiers in NFC@.
4560 @option{-Wnormalized=id} suppresses the warning for these characters.
4561 It is hoped that future versions of the standards involved will correct
4562 this, which is why this option is not the default.
4563
4564 You can switch the warning off for all characters by writing
4565 @option{-Wnormalized=none}.  You should only do this if you
4566 are using some other normalization scheme (like ``D''), because
4567 otherwise you can easily create bugs that are literally impossible to see.
4568
4569 Some characters in ISO 10646 have distinct meanings but look identical
4570 in some fonts or display methodologies, especially once formatting has
4571 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4572 LETTER N'', displays just like a regular @code{n} that has been
4573 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4574 normalization scheme to convert all these into a standard form as
4575 well, and GCC warns if your code is not in NFKC if you use
4576 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4577 about every identifier that contains the letter O because it might be
4578 confused with the digit 0, and so is not the default, but may be
4579 useful as a local coding convention if the programming environment 
4580 cannot be fixed to display these characters distinctly.
4581
4582 @item -Wno-deprecated
4583 @opindex Wno-deprecated
4584 @opindex Wdeprecated
4585 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4586
4587 @item -Wno-deprecated-declarations
4588 @opindex Wno-deprecated-declarations
4589 @opindex Wdeprecated-declarations
4590 Do not warn about uses of functions (@pxref{Function Attributes}),
4591 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4592 Attributes}) marked as deprecated by using the @code{deprecated}
4593 attribute.
4594
4595 @item -Wno-overflow
4596 @opindex Wno-overflow
4597 @opindex Woverflow
4598 Do not warn about compile-time overflow in constant expressions.
4599
4600 @item -Woverride-init @r{(C and Objective-C only)}
4601 @opindex Woverride-init
4602 @opindex Wno-override-init
4603 @opindex W
4604 @opindex Wextra
4605 @opindex Wno-extra
4606 Warn if an initialized field without side effects is overridden when
4607 using designated initializers (@pxref{Designated Inits, , Designated
4608 Initializers}).
4609
4610 This warning is included in @option{-Wextra}.  To get other
4611 @option{-Wextra} warnings without this one, use @option{-Wextra
4612 -Wno-override-init}.
4613
4614 @item -Wpacked
4615 @opindex Wpacked
4616 @opindex Wno-packed
4617 Warn if a structure is given the packed attribute, but the packed
4618 attribute has no effect on the layout or size of the structure.
4619 Such structures may be mis-aligned for little benefit.  For
4620 instance, in this code, the variable @code{f.x} in @code{struct bar}
4621 is misaligned even though @code{struct bar} does not itself
4622 have the packed attribute:
4623
4624 @smallexample
4625 @group
4626 struct foo @{
4627   int x;
4628   char a, b, c, d;
4629 @} __attribute__((packed));
4630 struct bar @{
4631   char z;
4632   struct foo f;
4633 @};
4634 @end group
4635 @end smallexample
4636
4637 @item -Wpacked-bitfield-compat
4638 @opindex Wpacked-bitfield-compat
4639 @opindex Wno-packed-bitfield-compat
4640 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4641 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4642 the change can lead to differences in the structure layout.  GCC
4643 informs you when the offset of such a field has changed in GCC 4.4.
4644 For example there is no longer a 4-bit padding between field @code{a}
4645 and @code{b} in this structure:
4646
4647 @smallexample
4648 struct foo
4649 @{
4650   char a:4;
4651   char b:8;
4652 @} __attribute__ ((packed));
4653 @end smallexample
4654
4655 This warning is enabled by default.  Use
4656 @option{-Wno-packed-bitfield-compat} to disable this warning.
4657
4658 @item -Wpadded
4659 @opindex Wpadded
4660 @opindex Wno-padded
4661 Warn if padding is included in a structure, either to align an element
4662 of the structure or to align the whole structure.  Sometimes when this
4663 happens it is possible to rearrange the fields of the structure to
4664 reduce the padding and so make the structure smaller.
4665
4666 @item -Wredundant-decls
4667 @opindex Wredundant-decls
4668 @opindex Wno-redundant-decls
4669 Warn if anything is declared more than once in the same scope, even in
4670 cases where multiple declaration is valid and changes nothing.
4671
4672 @item -Wnested-externs @r{(C and Objective-C only)}
4673 @opindex Wnested-externs
4674 @opindex Wno-nested-externs
4675 Warn if an @code{extern} declaration is encountered within a function.
4676
4677 @item -Wno-inherited-variadic-ctor
4678 @opindex Winherited-variadic-ctor
4679 @opindex Wno-inherited-variadic-ctor
4680 Suppress warnings about use of C++11 inheriting constructors when the
4681 base class inherited from has a C variadic constructor; the warning is
4682 on by default because the ellipsis is not inherited.
4683
4684 @item -Winline
4685 @opindex Winline
4686 @opindex Wno-inline
4687 Warn if a function that is declared as inline cannot be inlined.
4688 Even with this option, the compiler does not warn about failures to
4689 inline functions declared in system headers.
4690
4691 The compiler uses a variety of heuristics to determine whether or not
4692 to inline a function.  For example, the compiler takes into account
4693 the size of the function being inlined and the amount of inlining
4694 that has already been done in the current function.  Therefore,
4695 seemingly insignificant changes in the source program can cause the
4696 warnings produced by @option{-Winline} to appear or disappear.
4697
4698 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4699 @opindex Wno-invalid-offsetof
4700 @opindex Winvalid-offsetof
4701 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4702 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4703 to a non-POD type is undefined.  In existing C++ implementations,
4704 however, @samp{offsetof} typically gives meaningful results even when
4705 applied to certain kinds of non-POD types (such as a simple
4706 @samp{struct} that fails to be a POD type only by virtue of having a
4707 constructor).  This flag is for users who are aware that they are
4708 writing nonportable code and who have deliberately chosen to ignore the
4709 warning about it.
4710
4711 The restrictions on @samp{offsetof} may be relaxed in a future version
4712 of the C++ standard.
4713
4714 @item -Wno-int-to-pointer-cast
4715 @opindex Wno-int-to-pointer-cast
4716 @opindex Wint-to-pointer-cast
4717 Suppress warnings from casts to pointer type of an integer of a
4718 different size. In C++, casting to a pointer type of smaller size is
4719 an error. @option{Wint-to-pointer-cast} is enabled by default.
4720
4721
4722 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4723 @opindex Wno-pointer-to-int-cast
4724 @opindex Wpointer-to-int-cast
4725 Suppress warnings from casts from a pointer to an integer type of a
4726 different size.
4727
4728 @item -Winvalid-pch
4729 @opindex Winvalid-pch
4730 @opindex Wno-invalid-pch
4731 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4732 the search path but can't be used.
4733
4734 @item -Wlong-long
4735 @opindex Wlong-long
4736 @opindex Wno-long-long
4737 Warn if @samp{long long} type is used.  This is enabled by either
4738 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
4739 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4740
4741 @item -Wvariadic-macros
4742 @opindex Wvariadic-macros
4743 @opindex Wno-variadic-macros
4744 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4745 alternate syntax when in pedantic ISO C99 mode.  This is default.
4746 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4747
4748 @item -Wvarargs
4749 @opindex Wvarargs
4750 @opindex Wno-varargs
4751 Warn upon questionable usage of the macros used to handle variable
4752 arguments like @samp{va_start}.  This is default.  To inhibit the
4753 warning messages, use @option{-Wno-varargs}.
4754
4755 @item -Wvector-operation-performance
4756 @opindex Wvector-operation-performance
4757 @opindex Wno-vector-operation-performance
4758 Warn if vector operation is not implemented via SIMD capabilities of the
4759 architecture.  Mainly useful for the performance tuning.
4760 Vector operation can be implemented @code{piecewise}, which means that the
4761 scalar operation is performed on every vector element; 
4762 @code{in parallel}, which means that the vector operation is implemented
4763 using scalars of wider type, which normally is more performance efficient;
4764 and @code{as a single scalar}, which means that vector fits into a
4765 scalar type.
4766
4767 @item -Wno-virtual-move-assign
4768 @opindex Wvirtual-move-assign
4769 @opindex Wno-virtual-move-assign
4770 Suppress warnings about inheriting from a virtual base with a
4771 non-trivial C++11 move assignment operator.  This is dangerous because
4772 if the virtual base is reachable along more than one path, it will be
4773 moved multiple times, which can mean both objects end up in the
4774 moved-from state.  If the move assignment operator is written to avoid
4775 moving from a moved-from object, this warning can be disabled.
4776
4777 @item -Wvla
4778 @opindex Wvla
4779 @opindex Wno-vla
4780 Warn if variable length array is used in the code.
4781 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
4782 the variable length array.
4783
4784 @item -Wvolatile-register-var
4785 @opindex Wvolatile-register-var
4786 @opindex Wno-volatile-register-var
4787 Warn if a register variable is declared volatile.  The volatile
4788 modifier does not inhibit all optimizations that may eliminate reads
4789 and/or writes to register variables.  This warning is enabled by
4790 @option{-Wall}.
4791
4792 @item -Wdisabled-optimization
4793 @opindex Wdisabled-optimization
4794 @opindex Wno-disabled-optimization
4795 Warn if a requested optimization pass is disabled.  This warning does
4796 not generally indicate that there is anything wrong with your code; it
4797 merely indicates that GCC's optimizers are unable to handle the code
4798 effectively.  Often, the problem is that your code is too big or too
4799 complex; GCC refuses to optimize programs when the optimization
4800 itself is likely to take inordinate amounts of time.
4801
4802 @item -Wpointer-sign @r{(C and Objective-C only)}
4803 @opindex Wpointer-sign
4804 @opindex Wno-pointer-sign
4805 Warn for pointer argument passing or assignment with different signedness.
4806 This option is only supported for C and Objective-C@.  It is implied by
4807 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
4808 @option{-Wno-pointer-sign}.
4809
4810 @item -Wstack-protector
4811 @opindex Wstack-protector
4812 @opindex Wno-stack-protector
4813 This option is only active when @option{-fstack-protector} is active.  It
4814 warns about functions that are not protected against stack smashing.
4815
4816 @item -Wno-mudflap
4817 @opindex Wno-mudflap
4818 Suppress warnings about constructs that cannot be instrumented by
4819 @option{-fmudflap}.
4820
4821 @item -Woverlength-strings
4822 @opindex Woverlength-strings
4823 @opindex Wno-overlength-strings
4824 Warn about string constants that are longer than the ``minimum
4825 maximum'' length specified in the C standard.  Modern compilers
4826 generally allow string constants that are much longer than the
4827 standard's minimum limit, but very portable programs should avoid
4828 using longer strings.
4829
4830 The limit applies @emph{after} string constant concatenation, and does
4831 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4832 C99, it was raised to 4095.  C++98 does not specify a normative
4833 minimum maximum, so we do not diagnose overlength strings in C++@.
4834
4835 This option is implied by @option{-Wpedantic}, and can be disabled with
4836 @option{-Wno-overlength-strings}.
4837
4838 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4839 @opindex Wunsuffixed-float-constants
4840
4841 Issue a warning for any floating constant that does not have
4842 a suffix.  When used together with @option{-Wsystem-headers} it
4843 warns about such constants in system header files.  This can be useful
4844 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4845 from the decimal floating-point extension to C99.
4846 @end table
4847
4848 @node Debugging Options
4849 @section Options for Debugging Your Program or GCC
4850 @cindex options, debugging
4851 @cindex debugging information options
4852
4853 GCC has various special options that are used for debugging
4854 either your program or GCC:
4855
4856 @table @gcctabopt
4857 @item -g
4858 @opindex g
4859 Produce debugging information in the operating system's native format
4860 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4861 information.
4862
4863 On most systems that use stabs format, @option{-g} enables use of extra
4864 debugging information that only GDB can use; this extra information
4865 makes debugging work better in GDB but probably makes other debuggers
4866 crash or
4867 refuse to read the program.  If you want to control for certain whether
4868 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4869 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4870
4871 GCC allows you to use @option{-g} with
4872 @option{-O}.  The shortcuts taken by optimized code may occasionally
4873 produce surprising results: some variables you declared may not exist
4874 at all; flow of control may briefly move where you did not expect it;
4875 some statements may not be executed because they compute constant
4876 results or their values are already at hand; some statements may
4877 execute in different places because they have been moved out of loops.
4878
4879 Nevertheless it proves possible to debug optimized output.  This makes
4880 it reasonable to use the optimizer for programs that might have bugs.
4881
4882 The following options are useful when GCC is generated with the
4883 capability for more than one debugging format.
4884
4885 @item -gsplit-dwarf
4886 @opindex gsplit-dwarf
4887 Separate as much dwarf debugging information as possible into a
4888 separate output file with the extension .dwo.  This option allows
4889 the build system to avoid linking files with debug information.  To
4890 be useful, this option requires a debugger capable of reading .dwo
4891 files.
4892
4893 @item -ggdb
4894 @opindex ggdb
4895 Produce debugging information for use by GDB@.  This means to use the
4896 most expressive format available (DWARF 2, stabs, or the native format
4897 if neither of those are supported), including GDB extensions if at all
4898 possible.
4899
4900 @item -gpubnames
4901 @opindex gpubnames
4902 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
4903
4904 @item -gstabs
4905 @opindex gstabs
4906 Produce debugging information in stabs format (if that is supported),
4907 without GDB extensions.  This is the format used by DBX on most BSD
4908 systems.  On MIPS, Alpha and System V Release 4 systems this option
4909 produces stabs debugging output that is not understood by DBX or SDB@.
4910 On System V Release 4 systems this option requires the GNU assembler.
4911
4912 @item -feliminate-unused-debug-symbols
4913 @opindex feliminate-unused-debug-symbols
4914 Produce debugging information in stabs format (if that is supported),
4915 for only symbols that are actually used.
4916
4917 @item -femit-class-debug-always
4918 Instead of emitting debugging information for a C++ class in only one
4919 object file, emit it in all object files using the class.  This option
4920 should be used only with debuggers that are unable to handle the way GCC
4921 normally emits debugging information for classes because using this
4922 option increases the size of debugging information by as much as a
4923 factor of two.
4924
4925 @item -fdebug-types-section
4926 @opindex fdebug-types-section
4927 @opindex fno-debug-types-section
4928 When using DWARF Version 4 or higher, type DIEs can be put into
4929 their own @code{.debug_types} section instead of making them part of the
4930 @code{.debug_info} section.  It is more efficient to put them in a separate
4931 comdat sections since the linker can then remove duplicates.
4932 But not all DWARF consumers support @code{.debug_types} sections yet
4933 and on some objects @code{.debug_types} produces larger instead of smaller
4934 debugging information.
4935
4936 @item -gstabs+
4937 @opindex gstabs+
4938 Produce debugging information in stabs format (if that is supported),
4939 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4940 use of these extensions is likely to make other debuggers crash or
4941 refuse to read the program.
4942
4943 @item -gcoff
4944 @opindex gcoff
4945 Produce debugging information in COFF format (if that is supported).
4946 This is the format used by SDB on most System V systems prior to
4947 System V Release 4.
4948
4949 @item -gxcoff
4950 @opindex gxcoff
4951 Produce debugging information in XCOFF format (if that is supported).
4952 This is the format used by the DBX debugger on IBM RS/6000 systems.
4953
4954 @item -gxcoff+
4955 @opindex gxcoff+
4956 Produce debugging information in XCOFF format (if that is supported),
4957 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4958 use of these extensions is likely to make other debuggers crash or
4959 refuse to read the program, and may cause assemblers other than the GNU
4960 assembler (GAS) to fail with an error.
4961
4962 @item -gdwarf-@var{version}
4963 @opindex gdwarf-@var{version}
4964 Produce debugging information in DWARF format (if that is supported).
4965 The value of @var{version} may be either 2, 3 or 4; the default version
4966 for most targets is 4.
4967
4968 Note that with DWARF Version 2, some ports require and always
4969 use some non-conflicting DWARF 3 extensions in the unwind tables.
4970
4971 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4972 for maximum benefit.
4973
4974 @item -grecord-gcc-switches
4975 @opindex grecord-gcc-switches
4976 This switch causes the command-line options used to invoke the
4977 compiler that may affect code generation to be appended to the
4978 DW_AT_producer attribute in DWARF debugging information.  The options
4979 are concatenated with spaces separating them from each other and from
4980 the compiler version.  See also @option{-frecord-gcc-switches} for another
4981 way of storing compiler options into the object file.  This is the default.
4982
4983 @item -gno-record-gcc-switches
4984 @opindex gno-record-gcc-switches
4985 Disallow appending command-line options to the DW_AT_producer attribute
4986 in DWARF debugging information.
4987
4988 @item -gstrict-dwarf
4989 @opindex gstrict-dwarf
4990 Disallow using extensions of later DWARF standard version than selected
4991 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4992 DWARF extensions from later standard versions is allowed.
4993
4994 @item -gno-strict-dwarf
4995 @opindex gno-strict-dwarf
4996 Allow using extensions of later DWARF standard version than selected with
4997 @option{-gdwarf-@var{version}}.
4998
4999 @item -gvms
5000 @opindex gvms
5001 Produce debugging information in Alpha/VMS debug format (if that is
5002 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5003
5004 @item -g@var{level}
5005 @itemx -ggdb@var{level}
5006 @itemx -gstabs@var{level}
5007 @itemx -gcoff@var{level}
5008 @itemx -gxcoff@var{level}
5009 @itemx -gvms@var{level}
5010 Request debugging information and also use @var{level} to specify how
5011 much information.  The default level is 2.
5012
5013 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5014 @option{-g}.
5015
5016 Level 1 produces minimal information, enough for making backtraces in
5017 parts of the program that you don't plan to debug.  This includes
5018 descriptions of functions and external variables, but no information
5019 about local variables and no line numbers.
5020
5021 Level 3 includes extra information, such as all the macro definitions
5022 present in the program.  Some debuggers support macro expansion when
5023 you use @option{-g3}.
5024
5025 @option{-gdwarf-2} does not accept a concatenated debug level, because
5026 GCC used to support an option @option{-gdwarf} that meant to generate
5027 debug information in version 1 of the DWARF format (which is very
5028 different from version 2), and it would have been too confusing.  That
5029 debug format is long obsolete, but the option cannot be changed now.
5030 Instead use an additional @option{-g@var{level}} option to change the
5031 debug level for DWARF.
5032
5033 @item -gtoggle
5034 @opindex gtoggle
5035 Turn off generation of debug info, if leaving out this option
5036 generates it, or turn it on at level 2 otherwise.  The position of this
5037 argument in the command line does not matter; it takes effect after all
5038 other options are processed, and it does so only once, no matter how
5039 many times it is given.  This is mainly intended to be used with
5040 @option{-fcompare-debug}.
5041
5042 @item -fsanitize=address
5043 Enable AddressSanitizer, a fast memory error detector.
5044 Memory access instructions will be instrumented to detect
5045 out-of-bounds and use-after-free bugs.
5046 See @uref{http://code.google.com/p/address-sanitizer/} for more details.
5047
5048 @item -fsanitize=thread
5049 Enable ThreadSanitizer, a fast data race detector.
5050 Memory access instructions will be instrumented to detect
5051 data race bugs.
5052 See @uref{http://code.google.com/p/data-race-test/wiki/ThreadSanitizer} for more details.
5053
5054 @item -fdump-final-insns@r{[}=@var{file}@r{]}
5055 @opindex fdump-final-insns
5056 Dump the final internal representation (RTL) to @var{file}.  If the
5057 optional argument is omitted (or if @var{file} is @code{.}), the name
5058 of the dump file is determined by appending @code{.gkd} to the
5059 compilation output file name.
5060
5061 @item -fcompare-debug@r{[}=@var{opts}@r{]}
5062 @opindex fcompare-debug
5063 @opindex fno-compare-debug
5064 If no error occurs during compilation, run the compiler a second time,
5065 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
5066 passed to the second compilation.  Dump the final internal
5067 representation in both compilations, and print an error if they differ.
5068
5069 If the equal sign is omitted, the default @option{-gtoggle} is used.
5070
5071 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
5072 and nonzero, implicitly enables @option{-fcompare-debug}.  If
5073 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
5074 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
5075 is used.
5076
5077 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
5078 is equivalent to @option{-fno-compare-debug}, which disables the dumping
5079 of the final representation and the second compilation, preventing even
5080 @env{GCC_COMPARE_DEBUG} from taking effect.
5081
5082 To verify full coverage during @option{-fcompare-debug} testing, set
5083 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
5084 which GCC rejects as an invalid option in any actual compilation
5085 (rather than preprocessing, assembly or linking).  To get just a
5086 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
5087 not overridden} will do.
5088
5089 @item -fcompare-debug-second
5090 @opindex fcompare-debug-second
5091 This option is implicitly passed to the compiler for the second
5092 compilation requested by @option{-fcompare-debug}, along with options to
5093 silence warnings, and omitting other options that would cause
5094 side-effect compiler outputs to files or to the standard output.  Dump
5095 files and preserved temporary files are renamed so as to contain the
5096 @code{.gk} additional extension during the second compilation, to avoid
5097 overwriting those generated by the first.
5098
5099 When this option is passed to the compiler driver, it causes the
5100 @emph{first} compilation to be skipped, which makes it useful for little
5101 other than debugging the compiler proper.
5102
5103 @item -feliminate-dwarf2-dups
5104 @opindex feliminate-dwarf2-dups
5105 Compress DWARF 2 debugging information by eliminating duplicated
5106 information about each symbol.  This option only makes sense when
5107 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5108
5109 @item -femit-struct-debug-baseonly
5110 Emit debug information for struct-like types
5111 only when the base name of the compilation source file
5112 matches the base name of file in which the struct is defined.
5113
5114 This option substantially reduces the size of debugging information,
5115 but at significant potential loss in type information to the debugger.
5116 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5117 See @option{-femit-struct-debug-detailed} for more detailed control.
5118
5119 This option works only with DWARF 2.
5120
5121 @item -femit-struct-debug-reduced
5122 Emit debug information for struct-like types
5123 only when the base name of the compilation source file
5124 matches the base name of file in which the type is defined,
5125 unless the struct is a template or defined in a system header.
5126
5127 This option significantly reduces the size of debugging information,
5128 with some potential loss in type information to the debugger.
5129 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5130 See @option{-femit-struct-debug-detailed} for more detailed control.
5131
5132 This option works only with DWARF 2.
5133
5134 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5135 Specify the struct-like types
5136 for which the compiler generates debug information.
5137 The intent is to reduce duplicate struct debug information
5138 between different object files within the same program.
5139
5140 This option is a detailed version of
5141 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5142 which serves for most needs.
5143
5144 A specification has the syntax@*
5145 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5146
5147 The optional first word limits the specification to
5148 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5149 A struct type is used directly when it is the type of a variable, member.
5150 Indirect uses arise through pointers to structs.
5151 That is, when use of an incomplete struct is valid, the use is indirect.
5152 An example is
5153 @samp{struct one direct; struct two * indirect;}.
5154
5155 The optional second word limits the specification to
5156 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5157 Generic structs are a bit complicated to explain.
5158 For C++, these are non-explicit specializations of template classes,
5159 or non-template classes within the above.
5160 Other programming languages have generics,
5161 but @option{-femit-struct-debug-detailed} does not yet implement them.
5162
5163 The third word specifies the source files for those
5164 structs for which the compiler should emit debug information.
5165 The values @samp{none} and @samp{any} have the normal meaning.
5166 The value @samp{base} means that
5167 the base of name of the file in which the type declaration appears
5168 must match the base of the name of the main compilation file.
5169 In practice, this means that when compiling @file{foo.c}, debug information
5170 is generated for types declared in that file and @file{foo.h},
5171 but not other header files.
5172 The value @samp{sys} means those types satisfying @samp{base}
5173 or declared in system or compiler headers.
5174
5175 You may need to experiment to determine the best settings for your application.
5176
5177 The default is @option{-femit-struct-debug-detailed=all}.
5178
5179 This option works only with DWARF 2.
5180
5181 @item -fno-merge-debug-strings
5182 @opindex fmerge-debug-strings
5183 @opindex fno-merge-debug-strings
5184 Direct the linker to not merge together strings in the debugging
5185 information that are identical in different object files.  Merging is
5186 not supported by all assemblers or linkers.  Merging decreases the size
5187 of the debug information in the output file at the cost of increasing
5188 link processing time.  Merging is enabled by default.
5189
5190 @item -fdebug-prefix-map=@var{old}=@var{new}
5191 @opindex fdebug-prefix-map
5192 When compiling files in directory @file{@var{old}}, record debugging
5193 information describing them as in @file{@var{new}} instead.
5194
5195 @item -fno-dwarf2-cfi-asm
5196 @opindex fdwarf2-cfi-asm
5197 @opindex fno-dwarf2-cfi-asm
5198 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5199 instead of using GAS @code{.cfi_*} directives.
5200
5201 @cindex @command{prof}
5202 @item -p
5203 @opindex p
5204 Generate extra code to write profile information suitable for the
5205 analysis program @command{prof}.  You must use this option when compiling
5206 the source files you want data about, and you must also use it when
5207 linking.
5208
5209 @cindex @command{gprof}
5210 @item -pg
5211 @opindex pg
5212 Generate extra code to write profile information suitable for the
5213 analysis program @command{gprof}.  You must use this option when compiling
5214 the source files you want data about, and you must also use it when
5215 linking.
5216
5217 @item -Q
5218 @opindex Q
5219 Makes the compiler print out each function name as it is compiled, and
5220 print some statistics about each pass when it finishes.
5221
5222 @item -ftime-report
5223 @opindex ftime-report
5224 Makes the compiler print some statistics about the time consumed by each
5225 pass when it finishes.
5226
5227 @item -fmem-report
5228 @opindex fmem-report
5229 Makes the compiler print some statistics about permanent memory
5230 allocation when it finishes.
5231
5232 @item -fmem-report-wpa
5233 @opindex fmem-report-wpa
5234 Makes the compiler print some statistics about permanent memory
5235 allocation for the WPA phase only.
5236
5237 @item -fpre-ipa-mem-report
5238 @opindex fpre-ipa-mem-report
5239 @item -fpost-ipa-mem-report
5240 @opindex fpost-ipa-mem-report
5241 Makes the compiler print some statistics about permanent memory
5242 allocation before or after interprocedural optimization.
5243
5244 @item -fprofile-report
5245 @opindex fprofile-report
5246 Makes the compiler print some statistics about consistency of the
5247 (estimated) profile and effect of individual passes.
5248
5249 @item -fstack-usage
5250 @opindex fstack-usage
5251 Makes the compiler output stack usage information for the program, on a
5252 per-function basis.  The filename for the dump is made by appending
5253 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5254 the output file, if explicitly specified and it is not an executable,
5255 otherwise it is the basename of the source file.  An entry is made up
5256 of three fields:
5257
5258 @itemize
5259 @item
5260 The name of the function.
5261 @item
5262 A number of bytes.
5263 @item
5264 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5265 @end itemize
5266
5267 The qualifier @code{static} means that the function manipulates the stack
5268 statically: a fixed number of bytes are allocated for the frame on function
5269 entry and released on function exit; no stack adjustments are otherwise made
5270 in the function.  The second field is this fixed number of bytes.
5271
5272 The qualifier @code{dynamic} means that the function manipulates the stack
5273 dynamically: in addition to the static allocation described above, stack
5274 adjustments are made in the body of the function, for example to push/pop
5275 arguments around function calls.  If the qualifier @code{bounded} is also
5276 present, the amount of these adjustments is bounded at compile time and
5277 the second field is an upper bound of the total amount of stack used by
5278 the function.  If it is not present, the amount of these adjustments is
5279 not bounded at compile time and the second field only represents the
5280 bounded part.
5281
5282 @item -fprofile-arcs
5283 @opindex fprofile-arcs
5284 Add code so that program flow @dfn{arcs} are instrumented.  During
5285 execution the program records how many times each branch and call is
5286 executed and how many times it is taken or returns.  When the compiled
5287 program exits it saves this data to a file called
5288 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5289 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5290 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5291 @var{auxname} is generated from the name of the output file, if
5292 explicitly specified and it is not the final executable, otherwise it is
5293 the basename of the source file.  In both cases any suffix is removed
5294 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5295 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5296 @xref{Cross-profiling}.
5297
5298 @cindex @command{gcov}
5299 @item --coverage
5300 @opindex coverage
5301
5302 This option is used to compile and link code instrumented for coverage
5303 analysis.  The option is a synonym for @option{-fprofile-arcs}
5304 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5305 linking).  See the documentation for those options for more details.
5306
5307 @itemize
5308
5309 @item
5310 Compile the source files with @option{-fprofile-arcs} plus optimization
5311 and code generation options.  For test coverage analysis, use the
5312 additional @option{-ftest-coverage} option.  You do not need to profile
5313 every source file in a program.
5314
5315 @item
5316 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5317 (the latter implies the former).
5318
5319 @item
5320 Run the program on a representative workload to generate the arc profile
5321 information.  This may be repeated any number of times.  You can run
5322 concurrent instances of your program, and provided that the file system
5323 supports locking, the data files will be correctly updated.  Also
5324 @code{fork} calls are detected and correctly handled (double counting
5325 will not happen).
5326
5327 @item
5328 For profile-directed optimizations, compile the source files again with
5329 the same optimization and code generation options plus
5330 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5331 Control Optimization}).
5332
5333 @item
5334 For test coverage analysis, use @command{gcov} to produce human readable
5335 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5336 @command{gcov} documentation for further information.
5337
5338 @end itemize
5339
5340 With @option{-fprofile-arcs}, for each function of your program GCC
5341 creates a program flow graph, then finds a spanning tree for the graph.
5342 Only arcs that are not on the spanning tree have to be instrumented: the
5343 compiler adds code to count the number of times that these arcs are
5344 executed.  When an arc is the only exit or only entrance to a block, the
5345 instrumentation code can be added to the block; otherwise, a new basic
5346 block must be created to hold the instrumentation code.
5347
5348 @need 2000
5349 @item -ftest-coverage
5350 @opindex ftest-coverage
5351 Produce a notes file that the @command{gcov} code-coverage utility
5352 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5353 show program coverage.  Each source file's note file is called
5354 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5355 above for a description of @var{auxname} and instructions on how to
5356 generate test coverage data.  Coverage data matches the source files
5357 more closely if you do not optimize.
5358
5359 @item -fdbg-cnt-list
5360 @opindex fdbg-cnt-list
5361 Print the name and the counter upper bound for all debug counters.
5362
5363
5364 @item -fdbg-cnt=@var{counter-value-list}
5365 @opindex fdbg-cnt
5366 Set the internal debug counter upper bound.  @var{counter-value-list}
5367 is a comma-separated list of @var{name}:@var{value} pairs
5368 which sets the upper bound of each debug counter @var{name} to @var{value}.
5369 All debug counters have the initial upper bound of @code{UINT_MAX};
5370 thus @code{dbg_cnt()} returns true always unless the upper bound
5371 is set by this option.
5372 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5373 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5374
5375 @item -fenable-@var{kind}-@var{pass}
5376 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5377 @opindex fdisable-
5378 @opindex fenable-
5379
5380 This is a set of options that are used to explicitly disable/enable
5381 optimization passes.  These options are intended for use for debugging GCC.
5382 Compiler users should use regular options for enabling/disabling
5383 passes instead.
5384
5385 @table @gcctabopt
5386
5387 @item -fdisable-ipa-@var{pass}
5388 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5389 statically invoked in the compiler multiple times, the pass name should be
5390 appended with a sequential number starting from 1.
5391
5392 @item -fdisable-rtl-@var{pass}
5393 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5394 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5395 statically invoked in the compiler multiple times, the pass name should be
5396 appended with a sequential number starting from 1.  @var{range-list} is a 
5397 comma-separated list of function ranges or assembler names.  Each range is a number
5398 pair separated by a colon.  The range is inclusive in both ends.  If the range
5399 is trivial, the number pair can be simplified as a single number.  If the
5400 function's call graph node's @var{uid} falls within one of the specified ranges,
5401 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5402 function header of a dump file, and the pass names can be dumped by using
5403 option @option{-fdump-passes}.
5404
5405 @item -fdisable-tree-@var{pass}
5406 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5407 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5408 option arguments.
5409
5410 @item -fenable-ipa-@var{pass}
5411 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5412 statically invoked in the compiler multiple times, the pass name should be
5413 appended with a sequential number starting from 1.
5414
5415 @item -fenable-rtl-@var{pass}
5416 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5417 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5418 description and examples.
5419
5420 @item -fenable-tree-@var{pass}
5421 @itemx -fenable-tree-@var{pass}=@var{range-list}
5422 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5423 of option arguments.
5424
5425 @end table
5426
5427 Here are some examples showing uses of these options.
5428
5429 @smallexample
5430
5431 # disable ccp1 for all functions
5432    -fdisable-tree-ccp1
5433 # disable complete unroll for function whose cgraph node uid is 1
5434    -fenable-tree-cunroll=1
5435 # disable gcse2 for functions at the following ranges [1,1],
5436 # [300,400], and [400,1000]
5437 # disable gcse2 for functions foo and foo2
5438    -fdisable-rtl-gcse2=foo,foo2
5439 # disable early inlining
5440    -fdisable-tree-einline
5441 # disable ipa inlining
5442    -fdisable-ipa-inline
5443 # enable tree full unroll
5444    -fenable-tree-unroll
5445
5446 @end smallexample
5447
5448 @item -d@var{letters}
5449 @itemx -fdump-rtl-@var{pass}
5450 @itemx -fdump-rtl-@var{pass}=@var{filename}
5451 @opindex d
5452 Says to make debugging dumps during compilation at times specified by
5453 @var{letters}.  This is used for debugging the RTL-based passes of the
5454 compiler.  The file names for most of the dumps are made by appending
5455 a pass number and a word to the @var{dumpname}, and the files are
5456 created in the directory of the output file. In case of
5457 @option{=@var{filename}} option, the dump is output on the given file
5458 instead of the pass numbered dump files. Note that the pass number is
5459 computed statically as passes get registered into the pass manager.
5460 Thus the numbering is not related to the dynamic order of execution of
5461 passes.  In particular, a pass installed by a plugin could have a
5462 number over 200 even if it executed quite early.  @var{dumpname} is
5463 generated from the name of the output file, if explicitly specified
5464 and it is not an executable, otherwise it is the basename of the
5465 source file. These switches may have different effects when
5466 @option{-E} is used for preprocessing.
5467
5468 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5469 @option{-d} option @var{letters}.  Here are the possible
5470 letters for use in @var{pass} and @var{letters}, and their meanings:
5471
5472 @table @gcctabopt
5473
5474 @item -fdump-rtl-alignments
5475 @opindex fdump-rtl-alignments
5476 Dump after branch alignments have been computed.
5477
5478 @item -fdump-rtl-asmcons
5479 @opindex fdump-rtl-asmcons
5480 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5481
5482 @item -fdump-rtl-auto_inc_dec
5483 @opindex fdump-rtl-auto_inc_dec
5484 Dump after auto-inc-dec discovery.  This pass is only run on
5485 architectures that have auto inc or auto dec instructions.
5486
5487 @item -fdump-rtl-barriers
5488 @opindex fdump-rtl-barriers
5489 Dump after cleaning up the barrier instructions.
5490
5491 @item -fdump-rtl-bbpart
5492 @opindex fdump-rtl-bbpart
5493 Dump after partitioning hot and cold basic blocks.
5494
5495 @item -fdump-rtl-bbro
5496 @opindex fdump-rtl-bbro
5497 Dump after block reordering.
5498
5499 @item -fdump-rtl-btl1
5500 @itemx -fdump-rtl-btl2
5501 @opindex fdump-rtl-btl2
5502 @opindex fdump-rtl-btl2
5503 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5504 after the two branch
5505 target load optimization passes.
5506
5507 @item -fdump-rtl-bypass
5508 @opindex fdump-rtl-bypass
5509 Dump after jump bypassing and control flow optimizations.
5510
5511 @item -fdump-rtl-combine
5512 @opindex fdump-rtl-combine
5513 Dump after the RTL instruction combination pass.
5514
5515 @item -fdump-rtl-compgotos
5516 @opindex fdump-rtl-compgotos
5517 Dump after duplicating the computed gotos.
5518
5519 @item -fdump-rtl-ce1
5520 @itemx -fdump-rtl-ce2
5521 @itemx -fdump-rtl-ce3
5522 @opindex fdump-rtl-ce1
5523 @opindex fdump-rtl-ce2
5524 @opindex fdump-rtl-ce3
5525 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5526 @option{-fdump-rtl-ce3} enable dumping after the three
5527 if conversion passes.
5528
5529 @item -fdump-rtl-cprop_hardreg
5530 @opindex fdump-rtl-cprop_hardreg
5531 Dump after hard register copy propagation.
5532
5533 @item -fdump-rtl-csa
5534 @opindex fdump-rtl-csa
5535 Dump after combining stack adjustments.
5536
5537 @item -fdump-rtl-cse1
5538 @itemx -fdump-rtl-cse2
5539 @opindex fdump-rtl-cse1
5540 @opindex fdump-rtl-cse2
5541 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5542 the two common subexpression elimination passes.
5543
5544 @item -fdump-rtl-dce
5545 @opindex fdump-rtl-dce
5546 Dump after the standalone dead code elimination passes.
5547
5548 @item -fdump-rtl-dbr
5549 @opindex fdump-rtl-dbr
5550 Dump after delayed branch scheduling.
5551
5552 @item -fdump-rtl-dce1
5553 @itemx -fdump-rtl-dce2
5554 @opindex fdump-rtl-dce1
5555 @opindex fdump-rtl-dce2
5556 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5557 the two dead store elimination passes.
5558
5559 @item -fdump-rtl-eh
5560 @opindex fdump-rtl-eh
5561 Dump after finalization of EH handling code.
5562
5563 @item -fdump-rtl-eh_ranges
5564 @opindex fdump-rtl-eh_ranges
5565 Dump after conversion of EH handling range regions.
5566
5567 @item -fdump-rtl-expand
5568 @opindex fdump-rtl-expand
5569 Dump after RTL generation.
5570
5571 @item -fdump-rtl-fwprop1
5572 @itemx -fdump-rtl-fwprop2
5573 @opindex fdump-rtl-fwprop1
5574 @opindex fdump-rtl-fwprop2
5575 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5576 dumping after the two forward propagation passes.
5577
5578 @item -fdump-rtl-gcse1
5579 @itemx -fdump-rtl-gcse2
5580 @opindex fdump-rtl-gcse1
5581 @opindex fdump-rtl-gcse2
5582 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5583 after global common subexpression elimination.
5584
5585 @item -fdump-rtl-init-regs
5586 @opindex fdump-rtl-init-regs
5587 Dump after the initialization of the registers.
5588
5589 @item -fdump-rtl-initvals
5590 @opindex fdump-rtl-initvals
5591 Dump after the computation of the initial value sets.
5592
5593 @item -fdump-rtl-into_cfglayout
5594 @opindex fdump-rtl-into_cfglayout
5595 Dump after converting to cfglayout mode.
5596
5597 @item -fdump-rtl-ira
5598 @opindex fdump-rtl-ira
5599 Dump after iterated register allocation.
5600
5601 @item -fdump-rtl-jump
5602 @opindex fdump-rtl-jump
5603 Dump after the second jump optimization.
5604
5605 @item -fdump-rtl-loop2
5606 @opindex fdump-rtl-loop2
5607 @option{-fdump-rtl-loop2} enables dumping after the rtl
5608 loop optimization passes.
5609
5610 @item -fdump-rtl-mach
5611 @opindex fdump-rtl-mach
5612 Dump after performing the machine dependent reorganization pass, if that
5613 pass exists.
5614
5615 @item -fdump-rtl-mode_sw
5616 @opindex fdump-rtl-mode_sw
5617 Dump after removing redundant mode switches.
5618
5619 @item -fdump-rtl-rnreg
5620 @opindex fdump-rtl-rnreg
5621 Dump after register renumbering.
5622
5623 @item -fdump-rtl-outof_cfglayout
5624 @opindex fdump-rtl-outof_cfglayout
5625 Dump after converting from cfglayout mode.
5626
5627 @item -fdump-rtl-peephole2
5628 @opindex fdump-rtl-peephole2
5629 Dump after the peephole pass.
5630
5631 @item -fdump-rtl-postreload
5632 @opindex fdump-rtl-postreload
5633 Dump after post-reload optimizations.
5634
5635 @item -fdump-rtl-pro_and_epilogue
5636 @opindex fdump-rtl-pro_and_epilogue
5637 Dump after generating the function prologues and epilogues.
5638
5639 @item -fdump-rtl-regmove
5640 @opindex fdump-rtl-regmove
5641 Dump after the register move pass.
5642
5643 @item -fdump-rtl-sched1
5644 @itemx -fdump-rtl-sched2
5645 @opindex fdump-rtl-sched1
5646 @opindex fdump-rtl-sched2
5647 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5648 after the basic block scheduling passes.
5649
5650 @item -fdump-rtl-see
5651 @opindex fdump-rtl-see
5652 Dump after sign extension elimination.
5653
5654 @item -fdump-rtl-seqabstr
5655 @opindex fdump-rtl-seqabstr
5656 Dump after common sequence discovery.
5657
5658 @item -fdump-rtl-shorten
5659 @opindex fdump-rtl-shorten
5660 Dump after shortening branches.
5661
5662 @item -fdump-rtl-sibling
5663 @opindex fdump-rtl-sibling
5664 Dump after sibling call optimizations.
5665
5666 @item -fdump-rtl-split1
5667 @itemx -fdump-rtl-split2
5668 @itemx -fdump-rtl-split3
5669 @itemx -fdump-rtl-split4
5670 @itemx -fdump-rtl-split5
5671 @opindex fdump-rtl-split1
5672 @opindex fdump-rtl-split2
5673 @opindex fdump-rtl-split3
5674 @opindex fdump-rtl-split4
5675 @opindex fdump-rtl-split5
5676 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5677 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5678 @option{-fdump-rtl-split5} enable dumping after five rounds of
5679 instruction splitting.
5680
5681 @item -fdump-rtl-sms
5682 @opindex fdump-rtl-sms
5683 Dump after modulo scheduling.  This pass is only run on some
5684 architectures.
5685
5686 @item -fdump-rtl-stack
5687 @opindex fdump-rtl-stack
5688 Dump after conversion from GCC's ``flat register file'' registers to the
5689 x87's stack-like registers.  This pass is only run on x86 variants.
5690
5691 @item -fdump-rtl-subreg1
5692 @itemx -fdump-rtl-subreg2
5693 @opindex fdump-rtl-subreg1
5694 @opindex fdump-rtl-subreg2
5695 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5696 the two subreg expansion passes.
5697
5698 @item -fdump-rtl-unshare
5699 @opindex fdump-rtl-unshare
5700 Dump after all rtl has been unshared.
5701
5702 @item -fdump-rtl-vartrack
5703 @opindex fdump-rtl-vartrack
5704 Dump after variable tracking.
5705
5706 @item -fdump-rtl-vregs
5707 @opindex fdump-rtl-vregs
5708 Dump after converting virtual registers to hard registers.
5709
5710 @item -fdump-rtl-web
5711 @opindex fdump-rtl-web
5712 Dump after live range splitting.
5713
5714 @item -fdump-rtl-regclass
5715 @itemx -fdump-rtl-subregs_of_mode_init
5716 @itemx -fdump-rtl-subregs_of_mode_finish
5717 @itemx -fdump-rtl-dfinit
5718 @itemx -fdump-rtl-dfinish
5719 @opindex fdump-rtl-regclass
5720 @opindex fdump-rtl-subregs_of_mode_init
5721 @opindex fdump-rtl-subregs_of_mode_finish
5722 @opindex fdump-rtl-dfinit
5723 @opindex fdump-rtl-dfinish
5724 These dumps are defined but always produce empty files.
5725
5726 @item -da
5727 @itemx -fdump-rtl-all
5728 @opindex da
5729 @opindex fdump-rtl-all
5730 Produce all the dumps listed above.
5731
5732 @item -dA
5733 @opindex dA
5734 Annotate the assembler output with miscellaneous debugging information.
5735
5736 @item -dD
5737 @opindex dD
5738 Dump all macro definitions, at the end of preprocessing, in addition to
5739 normal output.
5740
5741 @item -dH
5742 @opindex dH
5743 Produce a core dump whenever an error occurs.
5744
5745 @item -dp
5746 @opindex dp
5747 Annotate the assembler output with a comment indicating which
5748 pattern and alternative is used.  The length of each instruction is
5749 also printed.
5750
5751 @item -dP
5752 @opindex dP
5753 Dump the RTL in the assembler output as a comment before each instruction.
5754 Also turns on @option{-dp} annotation.
5755
5756 @item -dx
5757 @opindex dx
5758 Just generate RTL for a function instead of compiling it.  Usually used
5759 with @option{-fdump-rtl-expand}.
5760 @end table
5761
5762 @item -fdump-noaddr
5763 @opindex fdump-noaddr
5764 When doing debugging dumps, suppress address output.  This makes it more
5765 feasible to use diff on debugging dumps for compiler invocations with
5766 different compiler binaries and/or different
5767 text / bss / data / heap / stack / dso start locations.
5768
5769 @item -fdump-unnumbered
5770 @opindex fdump-unnumbered
5771 When doing debugging dumps, suppress instruction numbers and address output.
5772 This makes it more feasible to use diff on debugging dumps for compiler
5773 invocations with different options, in particular with and without
5774 @option{-g}.
5775
5776 @item -fdump-unnumbered-links
5777 @opindex fdump-unnumbered-links
5778 When doing debugging dumps (see @option{-d} option above), suppress
5779 instruction numbers for the links to the previous and next instructions
5780 in a sequence.
5781
5782 @item -fdump-translation-unit @r{(C++ only)}
5783 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5784 @opindex fdump-translation-unit
5785 Dump a representation of the tree structure for the entire translation
5786 unit to a file.  The file name is made by appending @file{.tu} to the
5787 source file name, and the file is created in the same directory as the
5788 output file.  If the @samp{-@var{options}} form is used, @var{options}
5789 controls the details of the dump as described for the
5790 @option{-fdump-tree} options.
5791
5792 @item -fdump-class-hierarchy @r{(C++ only)}
5793 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5794 @opindex fdump-class-hierarchy
5795 Dump a representation of each class's hierarchy and virtual function
5796 table layout to a file.  The file name is made by appending
5797 @file{.class} to the source file name, and the file is created in the
5798 same directory as the output file.  If the @samp{-@var{options}} form
5799 is used, @var{options} controls the details of the dump as described
5800 for the @option{-fdump-tree} options.
5801
5802 @item -fdump-ipa-@var{switch}
5803 @opindex fdump-ipa
5804 Control the dumping at various stages of inter-procedural analysis
5805 language tree to a file.  The file name is generated by appending a
5806 switch specific suffix to the source file name, and the file is created
5807 in the same directory as the output file.  The following dumps are
5808 possible:
5809
5810 @table @samp
5811 @item all
5812 Enables all inter-procedural analysis dumps.
5813
5814 @item cgraph
5815 Dumps information about call-graph optimization, unused function removal,
5816 and inlining decisions.
5817
5818 @item inline
5819 Dump after function inlining.
5820
5821 @end table
5822
5823 @item -fdump-passes
5824 @opindex fdump-passes
5825 Dump the list of optimization passes that are turned on and off by
5826 the current command-line options.
5827
5828 @item -fdump-statistics-@var{option}
5829 @opindex fdump-statistics
5830 Enable and control dumping of pass statistics in a separate file.  The
5831 file name is generated by appending a suffix ending in
5832 @samp{.statistics} to the source file name, and the file is created in
5833 the same directory as the output file.  If the @samp{-@var{option}}
5834 form is used, @samp{-stats} causes counters to be summed over the
5835 whole compilation unit while @samp{-details} dumps every event as
5836 the passes generate them.  The default with no option is to sum
5837 counters for each function compiled.
5838
5839 @item -fdump-tree-@var{switch}
5840 @itemx -fdump-tree-@var{switch}-@var{options}
5841 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
5842 @opindex fdump-tree
5843 Control the dumping at various stages of processing the intermediate
5844 language tree to a file.  The file name is generated by appending a
5845 switch-specific suffix to the source file name, and the file is
5846 created in the same directory as the output file. In case of
5847 @option{=@var{filename}} option, the dump is output on the given file
5848 instead of the auto named dump files.  If the @samp{-@var{options}}
5849 form is used, @var{options} is a list of @samp{-} separated options
5850 which control the details of the dump.  Not all options are applicable
5851 to all dumps; those that are not meaningful are ignored.  The
5852 following options are available
5853
5854 @table @samp
5855 @item address
5856 Print the address of each node.  Usually this is not meaningful as it
5857 changes according to the environment and source file.  Its primary use
5858 is for tying up a dump file with a debug environment.
5859 @item asmname
5860 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5861 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5862 use working backward from mangled names in the assembly file.
5863 @item slim
5864 When dumping front-end intermediate representations, inhibit dumping
5865 of members of a scope or body of a function merely because that scope
5866 has been reached.  Only dump such items when they are directly reachable
5867 by some other path.
5868
5869 When dumping pretty-printed trees, this option inhibits dumping the
5870 bodies of control structures.
5871
5872 When dumping RTL, print the RTL in slim (condensed) form instead of
5873 the default LISP-like representation.
5874 @item raw
5875 Print a raw representation of the tree.  By default, trees are
5876 pretty-printed into a C-like representation.
5877 @item details
5878 Enable more detailed dumps (not honored by every dump option). Also
5879 include information from the optimization passes.
5880 @item stats
5881 Enable dumping various statistics about the pass (not honored by every dump
5882 option).
5883 @item blocks
5884 Enable showing basic block boundaries (disabled in raw dumps).
5885 @item graph
5886 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5887 dump a representation of the control flow graph suitable for viewing with
5888 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
5889 the file is pretty-printed as a subgraph, so that GraphViz can render them
5890 all in a single plot.
5891
5892 This option currently only works for RTL dumps, and the RTL is always
5893 dumped in slim form.
5894 @item vops
5895 Enable showing virtual operands for every statement.
5896 @item lineno
5897 Enable showing line numbers for statements.
5898 @item uid
5899 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5900 @item verbose
5901 Enable showing the tree dump for each statement.
5902 @item eh
5903 Enable showing the EH region number holding each statement.
5904 @item scev
5905 Enable showing scalar evolution analysis details.
5906 @item optimized
5907 Enable showing optimization information (only available in certain
5908 passes).
5909 @item missed
5910 Enable showing missed optimization information (only available in certain
5911 passes).
5912 @item notes
5913 Enable other detailed optimization information (only available in
5914 certain passes).
5915 @item =@var{filename}
5916 Instead of an auto named dump file, output into the given file
5917 name. The file names @file{stdout} and @file{stderr} are treated
5918 specially and are considered already open standard streams. For
5919 example,
5920
5921 @smallexample
5922 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
5923      -fdump-tree-pre=stderr file.c
5924 @end smallexample
5925
5926 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
5927 output on to @file{stderr}. If two conflicting dump filenames are
5928 given for the same pass, then the latter option overrides the earlier
5929 one.
5930
5931 @item all
5932 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5933 and @option{lineno}.
5934
5935 @item optall
5936 Turn on all optimization options, i.e., @option{optimized},
5937 @option{missed}, and @option{note}.
5938 @end table
5939
5940 The following tree dumps are possible:
5941 @table @samp
5942
5943 @item original
5944 @opindex fdump-tree-original
5945 Dump before any tree based optimization, to @file{@var{file}.original}.
5946
5947 @item optimized
5948 @opindex fdump-tree-optimized
5949 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5950
5951 @item gimple
5952 @opindex fdump-tree-gimple
5953 Dump each function before and after the gimplification pass to a file.  The
5954 file name is made by appending @file{.gimple} to the source file name.
5955
5956 @item cfg
5957 @opindex fdump-tree-cfg
5958 Dump the control flow graph of each function to a file.  The file name is
5959 made by appending @file{.cfg} to the source file name.
5960
5961 @item ch
5962 @opindex fdump-tree-ch
5963 Dump each function after copying loop headers.  The file name is made by
5964 appending @file{.ch} to the source file name.
5965
5966 @item ssa
5967 @opindex fdump-tree-ssa
5968 Dump SSA related information to a file.  The file name is made by appending
5969 @file{.ssa} to the source file name.
5970
5971 @item alias
5972 @opindex fdump-tree-alias
5973 Dump aliasing information for each function.  The file name is made by
5974 appending @file{.alias} to the source file name.
5975
5976 @item ccp
5977 @opindex fdump-tree-ccp
5978 Dump each function after CCP@.  The file name is made by appending
5979 @file{.ccp} to the source file name.
5980
5981 @item storeccp
5982 @opindex fdump-tree-storeccp
5983 Dump each function after STORE-CCP@.  The file name is made by appending
5984 @file{.storeccp} to the source file name.
5985
5986 @item pre
5987 @opindex fdump-tree-pre
5988 Dump trees after partial redundancy elimination.  The file name is made
5989 by appending @file{.pre} to the source file name.
5990
5991 @item fre
5992 @opindex fdump-tree-fre
5993 Dump trees after full redundancy elimination.  The file name is made
5994 by appending @file{.fre} to the source file name.
5995
5996 @item copyprop
5997 @opindex fdump-tree-copyprop
5998 Dump trees after copy propagation.  The file name is made
5999 by appending @file{.copyprop} to the source file name.
6000
6001 @item store_copyprop
6002 @opindex fdump-tree-store_copyprop
6003 Dump trees after store copy-propagation.  The file name is made
6004 by appending @file{.store_copyprop} to the source file name.
6005
6006 @item dce
6007 @opindex fdump-tree-dce
6008 Dump each function after dead code elimination.  The file name is made by
6009 appending @file{.dce} to the source file name.
6010
6011 @item mudflap
6012 @opindex fdump-tree-mudflap
6013 Dump each function after adding mudflap instrumentation.  The file name is
6014 made by appending @file{.mudflap} to the source file name.
6015
6016 @item sra
6017 @opindex fdump-tree-sra
6018 Dump each function after performing scalar replacement of aggregates.  The
6019 file name is made by appending @file{.sra} to the source file name.
6020
6021 @item sink
6022 @opindex fdump-tree-sink
6023 Dump each function after performing code sinking.  The file name is made
6024 by appending @file{.sink} to the source file name.
6025
6026 @item dom
6027 @opindex fdump-tree-dom
6028 Dump each function after applying dominator tree optimizations.  The file
6029 name is made by appending @file{.dom} to the source file name.
6030
6031 @item dse
6032 @opindex fdump-tree-dse
6033 Dump each function after applying dead store elimination.  The file
6034 name is made by appending @file{.dse} to the source file name.
6035
6036 @item phiopt
6037 @opindex fdump-tree-phiopt
6038 Dump each function after optimizing PHI nodes into straightline code.  The file
6039 name is made by appending @file{.phiopt} to the source file name.
6040
6041 @item forwprop
6042 @opindex fdump-tree-forwprop
6043 Dump each function after forward propagating single use variables.  The file
6044 name is made by appending @file{.forwprop} to the source file name.
6045
6046 @item copyrename
6047 @opindex fdump-tree-copyrename
6048 Dump each function after applying the copy rename optimization.  The file
6049 name is made by appending @file{.copyrename} to the source file name.
6050
6051 @item nrv
6052 @opindex fdump-tree-nrv
6053 Dump each function after applying the named return value optimization on
6054 generic trees.  The file name is made by appending @file{.nrv} to the source
6055 file name.
6056
6057 @item vect
6058 @opindex fdump-tree-vect
6059 Dump each function after applying vectorization of loops.  The file name is
6060 made by appending @file{.vect} to the source file name.
6061
6062 @item slp
6063 @opindex fdump-tree-slp
6064 Dump each function after applying vectorization of basic blocks.  The file name
6065 is made by appending @file{.slp} to the source file name.
6066
6067 @item vrp
6068 @opindex fdump-tree-vrp
6069 Dump each function after Value Range Propagation (VRP).  The file name
6070 is made by appending @file{.vrp} to the source file name.
6071
6072 @item all
6073 @opindex fdump-tree-all
6074 Enable all the available tree dumps with the flags provided in this option.
6075 @end table
6076
6077 @item -fopt-info
6078 @itemx -fopt-info-@var{options}
6079 @itemx -fopt-info-@var{options}=@var{filename}
6080 @opindex fopt-info
6081 Controls optimization dumps from various optimization passes. If the
6082 @samp{-@var{options}} form is used, @var{options} is a list of
6083 @samp{-} separated options to select the dump details and
6084 optimizations.  If @var{options} is not specified, it defaults to
6085 @option{all} for details and @option{optall} for optimization
6086 groups. If the @var{filename} is not specified, it defaults to
6087 @file{stderr}. Note that the output @var{filename} will be overwritten
6088 in case of multiple translation units. If a combined output from
6089 multiple translation units is desired, @file{stderr} should be used
6090 instead.
6091
6092 The options can be divided into two groups, 1) options describing the
6093 verbosity of the dump, and 2) options describing which optimizations
6094 should be included. The options from both the groups can be freely
6095 mixed as they are non-overlapping. However, in case of any conflicts,
6096 the latter options override the earlier options on the command
6097 line. Though multiple -fopt-info options are accepted, only one of
6098 them can have @option{=filename}. If other filenames are provided then
6099 all but the first one are ignored.
6100
6101 The dump verbosity has the following options
6102
6103 @table @samp
6104 @item optimized
6105 Print information when an optimization is successfully applied. It is
6106 up to a pass to decide which information is relevant. For example, the
6107 vectorizer passes print the source location of loops which got
6108 successfully vectorized.
6109 @item missed
6110 Print information about missed optimizations. Individual passes
6111 control which information to include in the output. For example,
6112
6113 @smallexample
6114 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
6115 @end smallexample
6116
6117 will print information about missed optimization opportunities from
6118 vectorization passes on stderr.
6119 @item note
6120 Print verbose information about optimizations, such as certain
6121 transformations, more detailed messages about decisions etc.
6122 @item all
6123 Print detailed optimization information. This includes
6124 @var{optimized}, @var{missed}, and @var{note}.
6125 @end table
6126
6127 The second set of options describes a group of optimizations and may
6128 include one or more of the following.
6129
6130 @table @samp
6131 @item ipa
6132 Enable dumps from all interprocedural optimizations.
6133 @item loop
6134 Enable dumps from all loop optimizations.
6135 @item inline
6136 Enable dumps from all inlining optimizations.
6137 @item vec
6138 Enable dumps from all vectorization optimizations.
6139 @end table
6140
6141 For example,
6142 @smallexample
6143 gcc -O3 -fopt-info-missed=missed.all
6144 @end smallexample
6145
6146 outputs missed optimization report from all the passes into
6147 @file{missed.all}.
6148
6149 As another example,
6150 @smallexample
6151 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
6152 @end smallexample
6153
6154 will output information about missed optimizations as well as
6155 optimized locations from all the inlining passes into
6156 @file{inline.txt}.
6157
6158 If the @var{filename} is provided, then the dumps from all the
6159 applicable optimizations are concatenated into the @file{filename}.
6160 Otherwise the dump is output onto @file{stderr}. If @var{options} is
6161 omitted, it defaults to @option{all-optall}, which means dump all
6162 available optimization info from all the passes. In the following
6163 example, all optimization info is output on to @file{stderr}.
6164
6165 @smallexample
6166 gcc -O3 -fopt-info
6167 @end smallexample
6168
6169 Note that @option{-fopt-info-vec-missed} behaves the same as
6170 @option{-fopt-info-missed-vec}.
6171
6172 As another example, consider
6173
6174 @smallexample
6175 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
6176 @end smallexample
6177
6178 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
6179 in conflict since only one output file is allowed. In this case, only
6180 the first option takes effect and the subsequent options are
6181 ignored. Thus only the @file{vec.miss} is produced which cotaints
6182 dumps from the vectorizer about missed opportunities.
6183
6184 @item -ftree-vectorizer-verbose=@var{n}
6185 @opindex ftree-vectorizer-verbose
6186 This option is deprecated and is implemented in terms of
6187 @option{-fopt-info}. Please use @option{-fopt-info-@var{kind}} form
6188 instead, where @var{kind} is one of the valid opt-info options. It
6189 prints additional optimization information.  For @var{n}=0 no
6190 diagnostic information is reported.  If @var{n}=1 the vectorizer
6191 reports each loop that got vectorized, and the total number of loops
6192 that got vectorized.  If @var{n}=2 the vectorizer reports locations
6193 which could not be vectorized and the reasons for those. For any
6194 higher verbosity levels all the analysis and transformation
6195 information from the vectorizer is reported.
6196
6197 Note that the information output by @option{-ftree-vectorizer-verbose}
6198 option is sent to @file{stderr}. If the equivalent form
6199 @option{-fopt-info-@var{options}=@var{filename}} is used then the
6200 output is sent into @var{filename} instead.
6201
6202 @item -frandom-seed=@var{string}
6203 @opindex frandom-seed
6204 This option provides a seed that GCC uses in place of
6205 random numbers in generating certain symbol names
6206 that have to be different in every compiled file.  It is also used to
6207 place unique stamps in coverage data files and the object files that
6208 produce them.  You can use the @option{-frandom-seed} option to produce
6209 reproducibly identical object files.
6210
6211 The @var{string} should be different for every file you compile.
6212
6213 @item -fsched-verbose=@var{n}
6214 @opindex fsched-verbose
6215 On targets that use instruction scheduling, this option controls the
6216 amount of debugging output the scheduler prints.  This information is
6217 written to standard error, unless @option{-fdump-rtl-sched1} or
6218 @option{-fdump-rtl-sched2} is specified, in which case it is output
6219 to the usual dump listing file, @file{.sched1} or @file{.sched2}
6220 respectively.  However for @var{n} greater than nine, the output is
6221 always printed to standard error.
6222
6223 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
6224 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
6225 For @var{n} greater than one, it also output basic block probabilities,
6226 detailed ready list information and unit/insn info.  For @var{n} greater
6227 than two, it includes RTL at abort point, control-flow and regions info.
6228 And for @var{n} over four, @option{-fsched-verbose} also includes
6229 dependence info.
6230
6231 @item -save-temps
6232 @itemx -save-temps=cwd
6233 @opindex save-temps
6234 Store the usual ``temporary'' intermediate files permanently; place them
6235 in the current directory and name them based on the source file.  Thus,
6236 compiling @file{foo.c} with @option{-c -save-temps} produces files
6237 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6238 preprocessed @file{foo.i} output file even though the compiler now
6239 normally uses an integrated preprocessor.
6240
6241 When used in combination with the @option{-x} command-line option,
6242 @option{-save-temps} is sensible enough to avoid over writing an
6243 input source file with the same extension as an intermediate file.
6244 The corresponding intermediate file may be obtained by renaming the
6245 source file before using @option{-save-temps}.
6246
6247 If you invoke GCC in parallel, compiling several different source
6248 files that share a common base name in different subdirectories or the
6249 same source file compiled for multiple output destinations, it is
6250 likely that the different parallel compilers will interfere with each
6251 other, and overwrite the temporary files.  For instance:
6252
6253 @smallexample
6254 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6255 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6256 @end smallexample
6257
6258 may result in @file{foo.i} and @file{foo.o} being written to
6259 simultaneously by both compilers.
6260
6261 @item -save-temps=obj
6262 @opindex save-temps=obj
6263 Store the usual ``temporary'' intermediate files permanently.  If the
6264 @option{-o} option is used, the temporary files are based on the
6265 object file.  If the @option{-o} option is not used, the
6266 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6267
6268 For example:
6269
6270 @smallexample
6271 gcc -save-temps=obj -c foo.c
6272 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6273 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6274 @end smallexample
6275
6276 @noindent
6277 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6278 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6279 @file{dir2/yfoobar.o}.
6280
6281 @item -time@r{[}=@var{file}@r{]}
6282 @opindex time
6283 Report the CPU time taken by each subprocess in the compilation
6284 sequence.  For C source files, this is the compiler proper and assembler
6285 (plus the linker if linking is done).
6286
6287 Without the specification of an output file, the output looks like this:
6288
6289 @smallexample
6290 # cc1 0.12 0.01
6291 # as 0.00 0.01
6292 @end smallexample
6293
6294 The first number on each line is the ``user time'', that is time spent
6295 executing the program itself.  The second number is ``system time'',
6296 time spent executing operating system routines on behalf of the program.
6297 Both numbers are in seconds.
6298
6299 With the specification of an output file, the output is appended to the
6300 named file, and it looks like this:
6301
6302 @smallexample
6303 0.12 0.01 cc1 @var{options}
6304 0.00 0.01 as @var{options}
6305 @end smallexample
6306
6307 The ``user time'' and the ``system time'' are moved before the program
6308 name, and the options passed to the program are displayed, so that one
6309 can later tell what file was being compiled, and with which options.
6310
6311 @item -fvar-tracking
6312 @opindex fvar-tracking
6313 Run variable tracking pass.  It computes where variables are stored at each
6314 position in code.  Better debugging information is then generated
6315 (if the debugging information format supports this information).
6316
6317 It is enabled by default when compiling with optimization (@option{-Os},
6318 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6319 the debug info format supports it.
6320
6321 @item -fvar-tracking-assignments
6322 @opindex fvar-tracking-assignments
6323 @opindex fno-var-tracking-assignments
6324 Annotate assignments to user variables early in the compilation and
6325 attempt to carry the annotations over throughout the compilation all the
6326 way to the end, in an attempt to improve debug information while
6327 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6328
6329 It can be enabled even if var-tracking is disabled, in which case
6330 annotations are created and maintained, but discarded at the end.
6331
6332 @item -fvar-tracking-assignments-toggle
6333 @opindex fvar-tracking-assignments-toggle
6334 @opindex fno-var-tracking-assignments-toggle
6335 Toggle @option{-fvar-tracking-assignments}, in the same way that
6336 @option{-gtoggle} toggles @option{-g}.
6337
6338 @item -print-file-name=@var{library}
6339 @opindex print-file-name
6340 Print the full absolute name of the library file @var{library} that
6341 would be used when linking---and don't do anything else.  With this
6342 option, GCC does not compile or link anything; it just prints the
6343 file name.
6344
6345 @item -print-multi-directory
6346 @opindex print-multi-directory
6347 Print the directory name corresponding to the multilib selected by any
6348 other switches present in the command line.  This directory is supposed
6349 to exist in @env{GCC_EXEC_PREFIX}.
6350
6351 @item -print-multi-lib
6352 @opindex print-multi-lib
6353 Print the mapping from multilib directory names to compiler switches
6354 that enable them.  The directory name is separated from the switches by
6355 @samp{;}, and each switch starts with an @samp{@@} instead of the
6356 @samp{-}, without spaces between multiple switches.  This is supposed to
6357 ease shell processing.
6358
6359 @item -print-multi-os-directory
6360 @opindex print-multi-os-directory
6361 Print the path to OS libraries for the selected
6362 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6363 present in the @file{lib} subdirectory and no multilibs are used, this is
6364 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6365 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6366 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6367 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6368
6369 @item -print-multiarch
6370 @opindex print-multiarch
6371 Print the path to OS libraries for the selected multiarch,
6372 relative to some @file{lib} subdirectory.
6373
6374 @item -print-prog-name=@var{program}
6375 @opindex print-prog-name
6376 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6377
6378 @item -print-libgcc-file-name
6379 @opindex print-libgcc-file-name
6380 Same as @option{-print-file-name=libgcc.a}.
6381
6382 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6383 but you do want to link with @file{libgcc.a}.  You can do:
6384
6385 @smallexample
6386 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6387 @end smallexample
6388
6389 @item -print-search-dirs
6390 @opindex print-search-dirs
6391 Print the name of the configured installation directory and a list of
6392 program and library directories @command{gcc} searches---and don't do anything else.
6393
6394 This is useful when @command{gcc} prints the error message
6395 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6396 To resolve this you either need to put @file{cpp0} and the other compiler
6397 components where @command{gcc} expects to find them, or you can set the environment
6398 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6399 Don't forget the trailing @samp{/}.
6400 @xref{Environment Variables}.
6401
6402 @item -print-sysroot
6403 @opindex print-sysroot
6404 Print the target sysroot directory that is used during
6405 compilation.  This is the target sysroot specified either at configure
6406 time or using the @option{--sysroot} option, possibly with an extra
6407 suffix that depends on compilation options.  If no target sysroot is
6408 specified, the option prints nothing.
6409
6410 @item -print-sysroot-headers-suffix
6411 @opindex print-sysroot-headers-suffix
6412 Print the suffix added to the target sysroot when searching for
6413 headers, or give an error if the compiler is not configured with such
6414 a suffix---and don't do anything else.
6415
6416 @item -dumpmachine
6417 @opindex dumpmachine
6418 Print the compiler's target machine (for example,
6419 @samp{i686-pc-linux-gnu})---and don't do anything else.
6420
6421 @item -dumpversion
6422 @opindex dumpversion
6423 Print the compiler version (for example, @samp{3.0})---and don't do
6424 anything else.
6425
6426 @item -dumpspecs
6427 @opindex dumpspecs
6428 Print the compiler's built-in specs---and don't do anything else.  (This
6429 is used when GCC itself is being built.)  @xref{Spec Files}.
6430
6431 @item -fno-eliminate-unused-debug-types
6432 @opindex feliminate-unused-debug-types
6433 @opindex fno-eliminate-unused-debug-types
6434 Normally, when producing DWARF 2 output, GCC avoids producing debug symbol 
6435 output for types that are nowhere used in the source file being compiled.
6436 Sometimes it is useful to have GCC emit debugging
6437 information for all types declared in a compilation
6438 unit, regardless of whether or not they are actually used
6439 in that compilation unit, for example 
6440 if, in the debugger, you want to cast a value to a type that is
6441 not actually used in your program (but is declared).  More often,
6442 however, this results in a significant amount of wasted space.
6443 @end table
6444
6445 @node Optimize Options
6446 @section Options That Control Optimization
6447 @cindex optimize options
6448 @cindex options, optimization
6449
6450 These options control various sorts of optimizations.
6451
6452 Without any optimization option, the compiler's goal is to reduce the
6453 cost of compilation and to make debugging produce the expected
6454 results.  Statements are independent: if you stop the program with a
6455 breakpoint between statements, you can then assign a new value to any
6456 variable or change the program counter to any other statement in the
6457 function and get exactly the results you expect from the source
6458 code.
6459
6460 Turning on optimization flags makes the compiler attempt to improve
6461 the performance and/or code size at the expense of compilation time
6462 and possibly the ability to debug the program.
6463
6464 The compiler performs optimization based on the knowledge it has of the
6465 program.  Compiling multiple files at once to a single output file mode allows
6466 the compiler to use information gained from all of the files when compiling
6467 each of them.
6468
6469 Not all optimizations are controlled directly by a flag.  Only
6470 optimizations that have a flag are listed in this section.
6471
6472 Most optimizations are only enabled if an @option{-O} level is set on
6473 the command line.  Otherwise they are disabled, even if individual
6474 optimization flags are specified.
6475
6476 Depending on the target and how GCC was configured, a slightly different
6477 set of optimizations may be enabled at each @option{-O} level than
6478 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6479 to find out the exact set of optimizations that are enabled at each level.
6480 @xref{Overall Options}, for examples.
6481
6482 @table @gcctabopt
6483 @item -O
6484 @itemx -O1
6485 @opindex O
6486 @opindex O1
6487 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6488 more memory for a large function.
6489
6490 With @option{-O}, the compiler tries to reduce code size and execution
6491 time, without performing any optimizations that take a great deal of
6492 compilation time.
6493
6494 @option{-O} turns on the following optimization flags:
6495 @gccoptlist{
6496 -fauto-inc-dec @gol
6497 -fcompare-elim @gol
6498 -fcprop-registers @gol
6499 -fdce @gol
6500 -fdefer-pop @gol
6501 -fdelayed-branch @gol
6502 -fdse @gol
6503 -fguess-branch-probability @gol
6504 -fif-conversion2 @gol
6505 -fif-conversion @gol
6506 -fipa-pure-const @gol
6507 -fipa-profile @gol
6508 -fipa-reference @gol
6509 -fmerge-constants
6510 -fsplit-wide-types @gol
6511 -ftree-bit-ccp @gol
6512 -ftree-builtin-call-dce @gol
6513 -ftree-ccp @gol
6514 -ftree-ch @gol
6515 -ftree-copyrename @gol
6516 -ftree-dce @gol
6517 -ftree-dominator-opts @gol
6518 -ftree-dse @gol
6519 -ftree-forwprop @gol
6520 -ftree-fre @gol
6521 -ftree-phiprop @gol
6522 -ftree-slsr @gol
6523 -ftree-sra @gol
6524 -ftree-pta @gol
6525 -ftree-ter @gol
6526 -funit-at-a-time}
6527
6528 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6529 where doing so does not interfere with debugging.
6530
6531 @item -O2
6532 @opindex O2
6533 Optimize even more.  GCC performs nearly all supported optimizations
6534 that do not involve a space-speed tradeoff.
6535 As compared to @option{-O}, this option increases both compilation time
6536 and the performance of the generated code.
6537
6538 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6539 also turns on the following optimization flags:
6540 @gccoptlist{-fthread-jumps @gol
6541 -falign-functions  -falign-jumps @gol
6542 -falign-loops  -falign-labels @gol
6543 -fcaller-saves @gol
6544 -fcrossjumping @gol
6545 -fcse-follow-jumps  -fcse-skip-blocks @gol
6546 -fdelete-null-pointer-checks @gol
6547 -fdevirtualize @gol
6548 -fexpensive-optimizations @gol
6549 -fgcse  -fgcse-lm  @gol
6550 -fhoist-adjacent-loads @gol
6551 -finline-small-functions @gol
6552 -findirect-inlining @gol
6553 -fipa-sra @gol
6554 -foptimize-sibling-calls @gol
6555 -fpartial-inlining @gol
6556 -fpeephole2 @gol
6557 -fregmove @gol
6558 -freorder-blocks  -freorder-functions @gol
6559 -frerun-cse-after-loop  @gol
6560 -fsched-interblock  -fsched-spec @gol
6561 -fschedule-insns  -fschedule-insns2 @gol
6562 -fstrict-aliasing -fstrict-overflow @gol
6563 -ftree-switch-conversion -ftree-tail-merge @gol
6564 -ftree-pre @gol
6565 -ftree-vrp}
6566
6567 Please note the warning under @option{-fgcse} about
6568 invoking @option{-O2} on programs that use computed gotos.
6569
6570 @item -O3
6571 @opindex O3
6572 Optimize yet more.  @option{-O3} turns on all optimizations specified
6573 by @option{-O2} and also turns on the @option{-finline-functions},
6574 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6575 @option{-fgcse-after-reload}, @option{-ftree-vectorize},
6576 @option{-fvect-cost-model},
6577 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
6578
6579 @item -O0
6580 @opindex O0
6581 Reduce compilation time and make debugging produce the expected
6582 results.  This is the default.
6583
6584 @item -Os
6585 @opindex Os
6586 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6587 do not typically increase code size.  It also performs further
6588 optimizations designed to reduce code size.
6589
6590 @option{-Os} disables the following optimization flags:
6591 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6592 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6593 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6594
6595 @item -Ofast
6596 @opindex Ofast
6597 Disregard strict standards compliance.  @option{-Ofast} enables all
6598 @option{-O3} optimizations.  It also enables optimizations that are not
6599 valid for all standard-compliant programs.
6600 It turns on @option{-ffast-math} and the Fortran-specific
6601 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6602
6603 @item -Og
6604 @opindex Og
6605 Optimize debugging experience.  @option{-Og} enables optimizations
6606 that do not interfere with debugging. It should be the optimization
6607 level of choice for the standard edit-compile-debug cycle, offering
6608 a reasonable level of optimization while maintaining fast compilation
6609 and a good debugging experience.
6610
6611 If you use multiple @option{-O} options, with or without level numbers,
6612 the last such option is the one that is effective.
6613 @end table
6614
6615 Options of the form @option{-f@var{flag}} specify machine-independent
6616 flags.  Most flags have both positive and negative forms; the negative
6617 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6618 below, only one of the forms is listed---the one you typically 
6619 use.  You can figure out the other form by either removing @samp{no-}
6620 or adding it.
6621
6622 The following options control specific optimizations.  They are either
6623 activated by @option{-O} options or are related to ones that are.  You
6624 can use the following flags in the rare cases when ``fine-tuning'' of
6625 optimizations to be performed is desired.
6626
6627 @table @gcctabopt
6628 @item -fno-default-inline
6629 @opindex fno-default-inline
6630 Do not make member functions inline by default merely because they are
6631 defined inside the class scope (C++ only).  Otherwise, when you specify
6632 @w{@option{-O}}, member functions defined inside class scope are compiled
6633 inline by default; i.e., you don't need to add @samp{inline} in front of
6634 the member function name.
6635
6636 @item -fno-defer-pop
6637 @opindex fno-defer-pop
6638 Always pop the arguments to each function call as soon as that function
6639 returns.  For machines that must pop arguments after a function call,
6640 the compiler normally lets arguments accumulate on the stack for several
6641 function calls and pops them all at once.
6642
6643 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6644
6645 @item -fforward-propagate
6646 @opindex fforward-propagate
6647 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6648 instructions and checks if the result can be simplified.  If loop unrolling
6649 is active, two passes are performed and the second is scheduled after
6650 loop unrolling.
6651
6652 This option is enabled by default at optimization levels @option{-O},
6653 @option{-O2}, @option{-O3}, @option{-Os}.
6654
6655 @item -ffp-contract=@var{style}
6656 @opindex ffp-contract
6657 @option{-ffp-contract=off} disables floating-point expression contraction.
6658 @option{-ffp-contract=fast} enables floating-point expression contraction
6659 such as forming of fused multiply-add operations if the target has
6660 native support for them.
6661 @option{-ffp-contract=on} enables floating-point expression contraction
6662 if allowed by the language standard.  This is currently not implemented
6663 and treated equal to @option{-ffp-contract=off}.
6664
6665 The default is @option{-ffp-contract=fast}.
6666
6667 @item -fomit-frame-pointer
6668 @opindex fomit-frame-pointer
6669 Don't keep the frame pointer in a register for functions that
6670 don't need one.  This avoids the instructions to save, set up and
6671 restore frame pointers; it also makes an extra register available
6672 in many functions.  @strong{It also makes debugging impossible on
6673 some machines.}
6674
6675 On some machines, such as the VAX, this flag has no effect, because
6676 the standard calling sequence automatically handles the frame pointer
6677 and nothing is saved by pretending it doesn't exist.  The
6678 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6679 whether a target machine supports this flag.  @xref{Registers,,Register
6680 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6681
6682 Starting with GCC version 4.6, the default setting (when not optimizing for
6683 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
6684 @option{-fomit-frame-pointer}.  The default can be reverted to
6685 @option{-fno-omit-frame-pointer} by configuring GCC with the
6686 @option{--enable-frame-pointer} configure option.
6687
6688 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6689
6690 @item -foptimize-sibling-calls
6691 @opindex foptimize-sibling-calls
6692 Optimize sibling and tail recursive calls.
6693
6694 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6695
6696 @item -fno-inline
6697 @opindex fno-inline
6698 Do not expand any functions inline apart from those marked with
6699 the @code{always_inline} attribute.  This is the default when not
6700 optimizing.
6701
6702 Single functions can be exempted from inlining by marking them
6703 with the @code{noinline} attribute.
6704
6705 @item -finline-small-functions
6706 @opindex finline-small-functions
6707 Integrate functions into their callers when their body is smaller than expected
6708 function call code (so overall size of program gets smaller).  The compiler
6709 heuristically decides which functions are simple enough to be worth integrating
6710 in this way.  This inlining applies to all functions, even those not declared
6711 inline.
6712
6713 Enabled at level @option{-O2}.
6714
6715 @item -findirect-inlining
6716 @opindex findirect-inlining
6717 Inline also indirect calls that are discovered to be known at compile
6718 time thanks to previous inlining.  This option has any effect only
6719 when inlining itself is turned on by the @option{-finline-functions}
6720 or @option{-finline-small-functions} options.
6721
6722 Enabled at level @option{-O2}.
6723
6724 @item -finline-functions
6725 @opindex finline-functions
6726 Consider all functions for inlining, even if they are not declared inline.
6727 The compiler heuristically decides which functions are worth integrating
6728 in this way.
6729
6730 If all calls to a given function are integrated, and the function is
6731 declared @code{static}, then the function is normally not output as
6732 assembler code in its own right.
6733
6734 Enabled at level @option{-O3}.
6735
6736 @item -finline-functions-called-once
6737 @opindex finline-functions-called-once
6738 Consider all @code{static} functions called once for inlining into their
6739 caller even if they are not marked @code{inline}.  If a call to a given
6740 function is integrated, then the function is not output as assembler code
6741 in its own right.
6742
6743 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6744
6745 @item -fearly-inlining
6746 @opindex fearly-inlining
6747 Inline functions marked by @code{always_inline} and functions whose body seems
6748 smaller than the function call overhead early before doing
6749 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6750 makes profiling significantly cheaper and usually inlining faster on programs
6751 having large chains of nested wrapper functions.
6752
6753 Enabled by default.
6754
6755 @item -fipa-sra
6756 @opindex fipa-sra
6757 Perform interprocedural scalar replacement of aggregates, removal of
6758 unused parameters and replacement of parameters passed by reference
6759 by parameters passed by value.
6760
6761 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6762
6763 @item -finline-limit=@var{n}
6764 @opindex finline-limit
6765 By default, GCC limits the size of functions that can be inlined.  This flag
6766 allows coarse control of this limit.  @var{n} is the size of functions that
6767 can be inlined in number of pseudo instructions.
6768
6769 Inlining is actually controlled by a number of parameters, which may be
6770 specified individually by using @option{--param @var{name}=@var{value}}.
6771 The @option{-finline-limit=@var{n}} option sets some of these parameters
6772 as follows:
6773
6774 @table @gcctabopt
6775 @item max-inline-insns-single
6776 is set to @var{n}/2.
6777 @item max-inline-insns-auto
6778 is set to @var{n}/2.
6779 @end table
6780
6781 See below for a documentation of the individual
6782 parameters controlling inlining and for the defaults of these parameters.
6783
6784 @emph{Note:} there may be no value to @option{-finline-limit} that results
6785 in default behavior.
6786
6787 @emph{Note:} pseudo instruction represents, in this particular context, an
6788 abstract measurement of function's size.  In no way does it represent a count
6789 of assembly instructions and as such its exact meaning might change from one
6790 release to an another.
6791
6792 @item -fno-keep-inline-dllexport
6793 @opindex -fno-keep-inline-dllexport
6794 This is a more fine-grained version of @option{-fkeep-inline-functions},
6795 which applies only to functions that are declared using the @code{dllexport}
6796 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6797 Functions}.)
6798
6799 @item -fkeep-inline-functions
6800 @opindex fkeep-inline-functions
6801 In C, emit @code{static} functions that are declared @code{inline}
6802 into the object file, even if the function has been inlined into all
6803 of its callers.  This switch does not affect functions using the
6804 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6805 inline functions into the object file.
6806
6807 @item -fkeep-static-consts
6808 @opindex fkeep-static-consts
6809 Emit variables declared @code{static const} when optimization isn't turned
6810 on, even if the variables aren't referenced.
6811
6812 GCC enables this option by default.  If you want to force the compiler to
6813 check if a variable is referenced, regardless of whether or not
6814 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6815
6816 @item -fmerge-constants
6817 @opindex fmerge-constants
6818 Attempt to merge identical constants (string constants and floating-point
6819 constants) across compilation units.
6820
6821 This option is the default for optimized compilation if the assembler and
6822 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6823 behavior.
6824
6825 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6826
6827 @item -fmerge-all-constants
6828 @opindex fmerge-all-constants
6829 Attempt to merge identical constants and identical variables.
6830
6831 This option implies @option{-fmerge-constants}.  In addition to
6832 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6833 arrays or initialized constant variables with integral or floating-point
6834 types.  Languages like C or C++ require each variable, including multiple
6835 instances of the same variable in recursive calls, to have distinct locations,
6836 so using this option results in non-conforming
6837 behavior.
6838
6839 @item -fmodulo-sched
6840 @opindex fmodulo-sched
6841 Perform swing modulo scheduling immediately before the first scheduling
6842 pass.  This pass looks at innermost loops and reorders their
6843 instructions by overlapping different iterations.
6844
6845 @item -fmodulo-sched-allow-regmoves
6846 @opindex fmodulo-sched-allow-regmoves
6847 Perform more aggressive SMS-based modulo scheduling with register moves
6848 allowed.  By setting this flag certain anti-dependences edges are
6849 deleted, which triggers the generation of reg-moves based on the
6850 life-range analysis.  This option is effective only with
6851 @option{-fmodulo-sched} enabled.
6852
6853 @item -fno-branch-count-reg
6854 @opindex fno-branch-count-reg
6855 Do not use ``decrement and branch'' instructions on a count register,
6856 but instead generate a sequence of instructions that decrement a
6857 register, compare it against zero, then branch based upon the result.
6858 This option is only meaningful on architectures that support such
6859 instructions, which include x86, PowerPC, IA-64 and S/390.
6860
6861 The default is @option{-fbranch-count-reg}.
6862
6863 @item -fno-function-cse
6864 @opindex fno-function-cse
6865 Do not put function addresses in registers; make each instruction that
6866 calls a constant function contain the function's address explicitly.
6867
6868 This option results in less efficient code, but some strange hacks
6869 that alter the assembler output may be confused by the optimizations
6870 performed when this option is not used.
6871
6872 The default is @option{-ffunction-cse}
6873
6874 @item -fno-zero-initialized-in-bss
6875 @opindex fno-zero-initialized-in-bss
6876 If the target supports a BSS section, GCC by default puts variables that
6877 are initialized to zero into BSS@.  This can save space in the resulting
6878 code.
6879
6880 This option turns off this behavior because some programs explicitly
6881 rely on variables going to the data section---e.g., so that the
6882 resulting executable can find the beginning of that section and/or make
6883 assumptions based on that.
6884
6885 The default is @option{-fzero-initialized-in-bss}.
6886
6887 @item -fmudflap -fmudflapth -fmudflapir
6888 @opindex fmudflap
6889 @opindex fmudflapth
6890 @opindex fmudflapir
6891 @cindex bounds checking
6892 @cindex mudflap
6893 For front-ends that support it (C and C++), instrument all risky
6894 pointer/array dereferencing operations, some standard library
6895 string/heap functions, and some other associated constructs with
6896 range/validity tests.  Modules so instrumented should be immune to
6897 buffer overflows, invalid heap use, and some other classes of C/C++
6898 programming errors.  The instrumentation relies on a separate runtime
6899 library (@file{libmudflap}), which is linked into a program if
6900 @option{-fmudflap} is given at link time.  Run-time behavior of the
6901 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6902 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6903 for its options.
6904
6905 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6906 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6907 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6908 instrumentation should ignore pointer reads.  This produces less
6909 instrumentation (and therefore faster execution) and still provides
6910 some protection against outright memory corrupting writes, but allows
6911 erroneously read data to propagate within a program.
6912
6913 @item -fthread-jumps
6914 @opindex fthread-jumps
6915 Perform optimizations that check to see if a jump branches to a
6916 location where another comparison subsumed by the first is found.  If
6917 so, the first branch is redirected to either the destination of the
6918 second branch or a point immediately following it, depending on whether
6919 the condition is known to be true or false.
6920
6921 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6922
6923 @item -fsplit-wide-types
6924 @opindex fsplit-wide-types
6925 When using a type that occupies multiple registers, such as @code{long
6926 long} on a 32-bit system, split the registers apart and allocate them
6927 independently.  This normally generates better code for those types,
6928 but may make debugging more difficult.
6929
6930 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6931 @option{-Os}.
6932
6933 @item -fcse-follow-jumps
6934 @opindex fcse-follow-jumps
6935 In common subexpression elimination (CSE), scan through jump instructions
6936 when the target of the jump is not reached by any other path.  For
6937 example, when CSE encounters an @code{if} statement with an
6938 @code{else} clause, CSE follows the jump when the condition
6939 tested is false.
6940
6941 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6942
6943 @item -fcse-skip-blocks
6944 @opindex fcse-skip-blocks
6945 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6946 follow jumps that conditionally skip over blocks.  When CSE
6947 encounters a simple @code{if} statement with no else clause,
6948 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6949 body of the @code{if}.
6950
6951 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6952
6953 @item -frerun-cse-after-loop
6954 @opindex frerun-cse-after-loop
6955 Re-run common subexpression elimination after loop optimizations are
6956 performed.
6957
6958 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6959
6960 @item -fgcse
6961 @opindex fgcse
6962 Perform a global common subexpression elimination pass.
6963 This pass also performs global constant and copy propagation.
6964
6965 @emph{Note:} When compiling a program using computed gotos, a GCC
6966 extension, you may get better run-time performance if you disable
6967 the global common subexpression elimination pass by adding
6968 @option{-fno-gcse} to the command line.
6969
6970 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6971
6972 @item -fgcse-lm
6973 @opindex fgcse-lm
6974 When @option{-fgcse-lm} is enabled, global common subexpression elimination
6975 attempts to move loads that are only killed by stores into themselves.  This
6976 allows a loop containing a load/store sequence to be changed to a load outside
6977 the loop, and a copy/store within the loop.
6978
6979 Enabled by default when @option{-fgcse} is enabled.
6980
6981 @item -fgcse-sm
6982 @opindex fgcse-sm
6983 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6984 global common subexpression elimination.  This pass attempts to move
6985 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6986 loops containing a load/store sequence can be changed to a load before
6987 the loop and a store after the loop.
6988
6989 Not enabled at any optimization level.
6990
6991 @item -fgcse-las
6992 @opindex fgcse-las
6993 When @option{-fgcse-las} is enabled, the global common subexpression
6994 elimination pass eliminates redundant loads that come after stores to the
6995 same memory location (both partial and full redundancies).
6996
6997 Not enabled at any optimization level.
6998
6999 @item -fgcse-after-reload
7000 @opindex fgcse-after-reload
7001 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7002 pass is performed after reload.  The purpose of this pass is to clean up
7003 redundant spilling.
7004
7005 @item -faggressive-loop-optimizations
7006 @opindex faggressive-loop-optimizations
7007 This option tells the loop optimizer to use language constraints to
7008 derive bounds for the number of iterations of a loop.  This assumes that
7009 loop code does not invoke undefined behavior by for example causing signed
7010 integer overflows or out-of-bound array accesses.  The bounds for the
7011 number of iterations of a loop are used to guide loop unrolling and peeling
7012 and loop exit test optimizations.
7013 This option is enabled by default.
7014
7015 @item -funsafe-loop-optimizations
7016 @opindex funsafe-loop-optimizations
7017 This option tells the loop optimizer to assume that loop indices do not
7018 overflow, and that loops with nontrivial exit condition are not
7019 infinite.  This enables a wider range of loop optimizations even if
7020 the loop optimizer itself cannot prove that these assumptions are valid.
7021 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
7022 if it finds this kind of loop.
7023
7024 @item -fcrossjumping
7025 @opindex fcrossjumping
7026 Perform cross-jumping transformation.
7027 This transformation unifies equivalent code and saves code size.  The
7028 resulting code may or may not perform better than without cross-jumping.
7029
7030 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7031
7032 @item -fauto-inc-dec
7033 @opindex fauto-inc-dec
7034 Combine increments or decrements of addresses with memory accesses.
7035 This pass is always skipped on architectures that do not have
7036 instructions to support this.  Enabled by default at @option{-O} and
7037 higher on architectures that support this.
7038
7039 @item -fdce
7040 @opindex fdce
7041 Perform dead code elimination (DCE) on RTL@.
7042 Enabled by default at @option{-O} and higher.
7043
7044 @item -fdse
7045 @opindex fdse
7046 Perform dead store elimination (DSE) on RTL@.
7047 Enabled by default at @option{-O} and higher.
7048
7049 @item -fif-conversion
7050 @opindex fif-conversion
7051 Attempt to transform conditional jumps into branch-less equivalents.  This
7052 includes use of conditional moves, min, max, set flags and abs instructions, and
7053 some tricks doable by standard arithmetics.  The use of conditional execution
7054 on chips where it is available is controlled by @code{if-conversion2}.
7055
7056 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7057
7058 @item -fif-conversion2
7059 @opindex fif-conversion2
7060 Use conditional execution (where available) to transform conditional jumps into
7061 branch-less equivalents.
7062
7063 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7064
7065 @item -fdelete-null-pointer-checks
7066 @opindex fdelete-null-pointer-checks
7067 Assume that programs cannot safely dereference null pointers, and that
7068 no code or data element resides there.  This enables simple constant
7069 folding optimizations at all optimization levels.  In addition, other
7070 optimization passes in GCC use this flag to control global dataflow
7071 analyses that eliminate useless checks for null pointers; these assume
7072 that if a pointer is checked after it has already been dereferenced,
7073 it cannot be null.
7074
7075 Note however that in some environments this assumption is not true.
7076 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7077 for programs that depend on that behavior.
7078
7079 Some targets, especially embedded ones, disable this option at all levels.
7080 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
7081 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
7082 are enabled independently at different optimization levels.
7083
7084 @item -fdevirtualize
7085 @opindex fdevirtualize
7086 Attempt to convert calls to virtual functions to direct calls.  This
7087 is done both within a procedure and interprocedurally as part of
7088 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
7089 propagation (@option{-fipa-cp}).
7090 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7091
7092 @item -fexpensive-optimizations
7093 @opindex fexpensive-optimizations
7094 Perform a number of minor optimizations that are relatively expensive.
7095
7096 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7097
7098 @item -free
7099 @opindex free
7100 Attempt to remove redundant extension instructions.  This is especially
7101 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7102 registers after writing to their lower 32-bit half.
7103
7104 Enabled for x86 at levels @option{-O2}, @option{-O3}.
7105
7106 @item -foptimize-register-move
7107 @itemx -fregmove
7108 @opindex foptimize-register-move
7109 @opindex fregmove
7110 Attempt to reassign register numbers in move instructions and as
7111 operands of other simple instructions in order to maximize the amount of
7112 register tying.  This is especially helpful on machines with two-operand
7113 instructions.
7114
7115 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
7116 optimization.
7117
7118 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7119
7120 @item -fira-algorithm=@var{algorithm}
7121 Use the specified coloring algorithm for the integrated register
7122 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7123 specifies Chow's priority coloring, or @samp{CB}, which specifies
7124 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7125 for all architectures, but for those targets that do support it, it is
7126 the default because it generates better code.
7127
7128 @item -fira-region=@var{region}
7129 Use specified regions for the integrated register allocator.  The
7130 @var{region} argument should be one of the following:
7131
7132 @table @samp
7133
7134 @item all
7135 Use all loops as register allocation regions.
7136 This can give the best results for machines with a small and/or
7137 irregular register set.
7138
7139 @item mixed
7140 Use all loops except for loops with small register pressure 
7141 as the regions.  This value usually gives
7142 the best results in most cases and for most architectures,
7143 and is enabled by default when compiling with optimization for speed
7144 (@option{-O}, @option{-O2}, @dots{}).
7145
7146 @item one
7147 Use all functions as a single region.  
7148 This typically results in the smallest code size, and is enabled by default for
7149 @option{-Os} or @option{-O0}.
7150
7151 @end table
7152
7153 @item -fira-hoist-pressure
7154 @opindex fira-hoist-pressure
7155 Use IRA to evaluate register pressure in the code hoisting pass for
7156 decisions to hoist expressions.  This option usually results in smaller
7157 code, but it can slow the compiler down.
7158
7159 This option is enabled at level @option{-Os} for all targets.
7160
7161 @item -fira-loop-pressure
7162 @opindex fira-loop-pressure
7163 Use IRA to evaluate register pressure in loops for decisions to move
7164 loop invariants.  This option usually results in generation
7165 of faster and smaller code on machines with large register files (>= 32
7166 registers), but it can slow the compiler down.
7167
7168 This option is enabled at level @option{-O3} for some targets.
7169
7170 @item -fno-ira-share-save-slots
7171 @opindex fno-ira-share-save-slots
7172 Disable sharing of stack slots used for saving call-used hard
7173 registers living through a call.  Each hard register gets a
7174 separate stack slot, and as a result function stack frames are
7175 larger.
7176
7177 @item -fno-ira-share-spill-slots
7178 @opindex fno-ira-share-spill-slots
7179 Disable sharing of stack slots allocated for pseudo-registers.  Each
7180 pseudo-register that does not get a hard register gets a separate
7181 stack slot, and as a result function stack frames are larger.
7182
7183 @item -fira-verbose=@var{n}
7184 @opindex fira-verbose
7185 Control the verbosity of the dump file for the integrated register allocator.
7186 The default value is 5.  If the value @var{n} is greater or equal to 10,
7187 the dump output is sent to stderr using the same format as @var{n} minus 10.
7188
7189 @item -fdelayed-branch
7190 @opindex fdelayed-branch
7191 If supported for the target machine, attempt to reorder instructions
7192 to exploit instruction slots available after delayed branch
7193 instructions.
7194
7195 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7196
7197 @item -fschedule-insns
7198 @opindex fschedule-insns
7199 If supported for the target machine, attempt to reorder instructions to
7200 eliminate execution stalls due to required data being unavailable.  This
7201 helps machines that have slow floating point or memory load instructions
7202 by allowing other instructions to be issued until the result of the load
7203 or floating-point instruction is required.
7204
7205 Enabled at levels @option{-O2}, @option{-O3}.
7206
7207 @item -fschedule-insns2
7208 @opindex fschedule-insns2
7209 Similar to @option{-fschedule-insns}, but requests an additional pass of
7210 instruction scheduling after register allocation has been done.  This is
7211 especially useful on machines with a relatively small number of
7212 registers and where memory load instructions take more than one cycle.
7213
7214 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7215
7216 @item -fno-sched-interblock
7217 @opindex fno-sched-interblock
7218 Don't schedule instructions across basic blocks.  This is normally
7219 enabled by default when scheduling before register allocation, i.e.@:
7220 with @option{-fschedule-insns} or at @option{-O2} or higher.
7221
7222 @item -fno-sched-spec
7223 @opindex fno-sched-spec
7224 Don't allow speculative motion of non-load instructions.  This is normally
7225 enabled by default when scheduling before register allocation, i.e.@:
7226 with @option{-fschedule-insns} or at @option{-O2} or higher.
7227
7228 @item -fsched-pressure
7229 @opindex fsched-pressure
7230 Enable register pressure sensitive insn scheduling before register
7231 allocation.  This only makes sense when scheduling before register
7232 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7233 @option{-O2} or higher.  Usage of this option can improve the
7234 generated code and decrease its size by preventing register pressure
7235 increase above the number of available hard registers and subsequent
7236 spills in register allocation.
7237
7238 @item -fsched-spec-load
7239 @opindex fsched-spec-load
7240 Allow speculative motion of some load instructions.  This only makes
7241 sense when scheduling before register allocation, i.e.@: with
7242 @option{-fschedule-insns} or at @option{-O2} or higher.
7243
7244 @item -fsched-spec-load-dangerous
7245 @opindex fsched-spec-load-dangerous
7246 Allow speculative motion of more load instructions.  This only makes
7247 sense when scheduling before register allocation, i.e.@: with
7248 @option{-fschedule-insns} or at @option{-O2} or higher.
7249
7250 @item -fsched-stalled-insns
7251 @itemx -fsched-stalled-insns=@var{n}
7252 @opindex fsched-stalled-insns
7253 Define how many insns (if any) can be moved prematurely from the queue
7254 of stalled insns into the ready list during the second scheduling pass.
7255 @option{-fno-sched-stalled-insns} means that no insns are moved
7256 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7257 on how many queued insns can be moved prematurely.
7258 @option{-fsched-stalled-insns} without a value is equivalent to
7259 @option{-fsched-stalled-insns=1}.
7260
7261 @item -fsched-stalled-insns-dep
7262 @itemx -fsched-stalled-insns-dep=@var{n}
7263 @opindex fsched-stalled-insns-dep
7264 Define how many insn groups (cycles) are examined for a dependency
7265 on a stalled insn that is a candidate for premature removal from the queue
7266 of stalled insns.  This has an effect only during the second scheduling pass,
7267 and only if @option{-fsched-stalled-insns} is used.
7268 @option{-fno-sched-stalled-insns-dep} is equivalent to
7269 @option{-fsched-stalled-insns-dep=0}.
7270 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7271 @option{-fsched-stalled-insns-dep=1}.
7272
7273 @item -fsched2-use-superblocks
7274 @opindex fsched2-use-superblocks
7275 When scheduling after register allocation, use superblock scheduling.
7276 This allows motion across basic block boundaries,
7277 resulting in faster schedules.  This option is experimental, as not all machine
7278 descriptions used by GCC model the CPU closely enough to avoid unreliable
7279 results from the algorithm.
7280
7281 This only makes sense when scheduling after register allocation, i.e.@: with
7282 @option{-fschedule-insns2} or at @option{-O2} or higher.
7283
7284 @item -fsched-group-heuristic
7285 @opindex fsched-group-heuristic
7286 Enable the group heuristic in the scheduler.  This heuristic favors
7287 the instruction that belongs to a schedule group.  This is enabled
7288 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7289 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7290
7291 @item -fsched-critical-path-heuristic
7292 @opindex fsched-critical-path-heuristic
7293 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7294 instructions on the critical path.  This is enabled by default when
7295 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7296 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7297
7298 @item -fsched-spec-insn-heuristic
7299 @opindex fsched-spec-insn-heuristic
7300 Enable the speculative instruction heuristic in the scheduler.  This
7301 heuristic favors speculative instructions with greater dependency weakness.
7302 This is enabled by default when scheduling is enabled, i.e.@:
7303 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7304 or at @option{-O2} or higher.
7305
7306 @item -fsched-rank-heuristic
7307 @opindex fsched-rank-heuristic
7308 Enable the rank heuristic in the scheduler.  This heuristic favors
7309 the instruction belonging to a basic block with greater size or frequency.
7310 This is enabled by default when scheduling is enabled, i.e.@:
7311 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7312 at @option{-O2} or higher.
7313
7314 @item -fsched-last-insn-heuristic
7315 @opindex fsched-last-insn-heuristic
7316 Enable the last-instruction heuristic in the scheduler.  This heuristic
7317 favors the instruction that is less dependent on the last instruction
7318 scheduled.  This is enabled by default when scheduling is enabled,
7319 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7320 at @option{-O2} or higher.
7321
7322 @item -fsched-dep-count-heuristic
7323 @opindex fsched-dep-count-heuristic
7324 Enable the dependent-count heuristic in the scheduler.  This heuristic
7325 favors the instruction that has more instructions depending on it.
7326 This is enabled by default when scheduling is enabled, i.e.@:
7327 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7328 at @option{-O2} or higher.
7329
7330 @item -freschedule-modulo-scheduled-loops
7331 @opindex freschedule-modulo-scheduled-loops
7332 Modulo scheduling is performed before traditional scheduling.  If a loop
7333 is modulo scheduled, later scheduling passes may change its schedule.  
7334 Use this option to control that behavior.
7335
7336 @item -fselective-scheduling
7337 @opindex fselective-scheduling
7338 Schedule instructions using selective scheduling algorithm.  Selective
7339 scheduling runs instead of the first scheduler pass.
7340
7341 @item -fselective-scheduling2
7342 @opindex fselective-scheduling2
7343 Schedule instructions using selective scheduling algorithm.  Selective
7344 scheduling runs instead of the second scheduler pass.
7345
7346 @item -fsel-sched-pipelining
7347 @opindex fsel-sched-pipelining
7348 Enable software pipelining of innermost loops during selective scheduling.
7349 This option has no effect unless one of @option{-fselective-scheduling} or
7350 @option{-fselective-scheduling2} is turned on.
7351
7352 @item -fsel-sched-pipelining-outer-loops
7353 @opindex fsel-sched-pipelining-outer-loops
7354 When pipelining loops during selective scheduling, also pipeline outer loops.
7355 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7356
7357 @item -fshrink-wrap
7358 @opindex fshrink-wrap
7359 Emit function prologues only before parts of the function that need it,
7360 rather than at the top of the function.  This flag is enabled by default at
7361 @option{-O} and higher.
7362
7363 @item -fcaller-saves
7364 @opindex fcaller-saves
7365 Enable allocation of values to registers that are clobbered by
7366 function calls, by emitting extra instructions to save and restore the
7367 registers around such calls.  Such allocation is done only when it
7368 seems to result in better code.
7369
7370 This option is always enabled by default on certain machines, usually
7371 those which have no call-preserved registers to use instead.
7372
7373 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7374
7375 @item -fcombine-stack-adjustments
7376 @opindex fcombine-stack-adjustments
7377 Tracks stack adjustments (pushes and pops) and stack memory references
7378 and then tries to find ways to combine them.
7379
7380 Enabled by default at @option{-O1} and higher.
7381
7382 @item -fconserve-stack
7383 @opindex fconserve-stack
7384 Attempt to minimize stack usage.  The compiler attempts to use less
7385 stack space, even if that makes the program slower.  This option
7386 implies setting the @option{large-stack-frame} parameter to 100
7387 and the @option{large-stack-frame-growth} parameter to 400.
7388
7389 @item -ftree-reassoc
7390 @opindex ftree-reassoc
7391 Perform reassociation on trees.  This flag is enabled by default
7392 at @option{-O} and higher.
7393
7394 @item -ftree-pre
7395 @opindex ftree-pre
7396 Perform partial redundancy elimination (PRE) on trees.  This flag is
7397 enabled by default at @option{-O2} and @option{-O3}.
7398
7399 @item -ftree-partial-pre
7400 @opindex ftree-partial-pre
7401 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7402 enabled by default at @option{-O3}.
7403
7404 @item -ftree-forwprop
7405 @opindex ftree-forwprop
7406 Perform forward propagation on trees.  This flag is enabled by default
7407 at @option{-O} and higher.
7408
7409 @item -ftree-fre
7410 @opindex ftree-fre
7411 Perform full redundancy elimination (FRE) on trees.  The difference
7412 between FRE and PRE is that FRE only considers expressions
7413 that are computed on all paths leading to the redundant computation.
7414 This analysis is faster than PRE, though it exposes fewer redundancies.
7415 This flag is enabled by default at @option{-O} and higher.
7416
7417 @item -ftree-phiprop
7418 @opindex ftree-phiprop
7419 Perform hoisting of loads from conditional pointers on trees.  This
7420 pass is enabled by default at @option{-O} and higher.
7421
7422 @item -fhoist-adjacent-loads
7423 @opindex hoist-adjacent-loads
7424 Speculatively hoist loads from both branches of an if-then-else if the
7425 loads are from adjacent locations in the same structure and the target
7426 architecture has a conditional move instruction.  This flag is enabled
7427 by default at @option{-O2} and higher.
7428
7429 @item -ftree-copy-prop
7430 @opindex ftree-copy-prop
7431 Perform copy propagation on trees.  This pass eliminates unnecessary
7432 copy operations.  This flag is enabled by default at @option{-O} and
7433 higher.
7434
7435 @item -fipa-pure-const
7436 @opindex fipa-pure-const
7437 Discover which functions are pure or constant.
7438 Enabled by default at @option{-O} and higher.
7439
7440 @item -fipa-reference
7441 @opindex fipa-reference
7442 Discover which static variables do not escape the
7443 compilation unit.
7444 Enabled by default at @option{-O} and higher.
7445
7446 @item -fipa-pta
7447 @opindex fipa-pta
7448 Perform interprocedural pointer analysis and interprocedural modification
7449 and reference analysis.  This option can cause excessive memory and
7450 compile-time usage on large compilation units.  It is not enabled by
7451 default at any optimization level.
7452
7453 @item -fipa-profile
7454 @opindex fipa-profile
7455 Perform interprocedural profile propagation.  The functions called only from
7456 cold functions are marked as cold. Also functions executed once (such as
7457 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7458 functions and loop less parts of functions executed once are then optimized for
7459 size.
7460 Enabled by default at @option{-O} and higher.
7461
7462 @item -fipa-cp
7463 @opindex fipa-cp
7464 Perform interprocedural constant propagation.
7465 This optimization analyzes the program to determine when values passed
7466 to functions are constants and then optimizes accordingly.
7467 This optimization can substantially increase performance
7468 if the application has constants passed to functions.
7469 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7470
7471 @item -fipa-cp-clone
7472 @opindex fipa-cp-clone
7473 Perform function cloning to make interprocedural constant propagation stronger.
7474 When enabled, interprocedural constant propagation performs function cloning
7475 when externally visible function can be called with constant arguments.
7476 Because this optimization can create multiple copies of functions,
7477 it may significantly increase code size
7478 (see @option{--param ipcp-unit-growth=@var{value}}).
7479 This flag is enabled by default at @option{-O3}.
7480
7481 @item -ftree-sink
7482 @opindex ftree-sink
7483 Perform forward store motion  on trees.  This flag is
7484 enabled by default at @option{-O} and higher.
7485
7486 @item -ftree-bit-ccp
7487 @opindex ftree-bit-ccp
7488 Perform sparse conditional bit constant propagation on trees and propagate
7489 pointer alignment information.
7490 This pass only operates on local scalar variables and is enabled by default
7491 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7492
7493 @item -ftree-ccp
7494 @opindex ftree-ccp
7495 Perform sparse conditional constant propagation (CCP) on trees.  This
7496 pass only operates on local scalar variables and is enabled by default
7497 at @option{-O} and higher.
7498
7499 @item -ftree-switch-conversion
7500 Perform conversion of simple initializations in a switch to
7501 initializations from a scalar array.  This flag is enabled by default
7502 at @option{-O2} and higher.
7503
7504 @item -ftree-tail-merge
7505 Look for identical code sequences.  When found, replace one with a jump to the
7506 other.  This optimization is known as tail merging or cross jumping.  This flag
7507 is enabled by default at @option{-O2} and higher.  The compilation time
7508 in this pass can
7509 be limited using @option{max-tail-merge-comparisons} parameter and
7510 @option{max-tail-merge-iterations} parameter.
7511
7512 @item -ftree-dce
7513 @opindex ftree-dce
7514 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7515 default at @option{-O} and higher.
7516
7517 @item -ftree-builtin-call-dce
7518 @opindex ftree-builtin-call-dce
7519 Perform conditional dead code elimination (DCE) for calls to built-in functions
7520 that may set @code{errno} but are otherwise side-effect free.  This flag is
7521 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7522 specified.
7523
7524 @item -ftree-dominator-opts
7525 @opindex ftree-dominator-opts
7526 Perform a variety of simple scalar cleanups (constant/copy
7527 propagation, redundancy elimination, range propagation and expression
7528 simplification) based on a dominator tree traversal.  This also
7529 performs jump threading (to reduce jumps to jumps). This flag is
7530 enabled by default at @option{-O} and higher.
7531
7532 @item -ftree-dse
7533 @opindex ftree-dse
7534 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7535 a memory location that is later overwritten by another store without
7536 any intervening loads.  In this case the earlier store can be deleted.  This
7537 flag is enabled by default at @option{-O} and higher.
7538
7539 @item -ftree-ch
7540 @opindex ftree-ch
7541 Perform loop header copying on trees.  This is beneficial since it increases
7542 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7543 is enabled by default at @option{-O} and higher.  It is not enabled
7544 for @option{-Os}, since it usually increases code size.
7545
7546 @item -ftree-loop-optimize
7547 @opindex ftree-loop-optimize
7548 Perform loop optimizations on trees.  This flag is enabled by default
7549 at @option{-O} and higher.
7550
7551 @item -ftree-loop-linear
7552 @opindex ftree-loop-linear
7553 Perform loop interchange transformations on tree.  Same as
7554 @option{-floop-interchange}.  To use this code transformation, GCC has
7555 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7556 enable the Graphite loop transformation infrastructure.
7557
7558 @item -floop-interchange
7559 @opindex floop-interchange
7560 Perform loop interchange transformations on loops.  Interchanging two
7561 nested loops switches the inner and outer loops.  For example, given a
7562 loop like:
7563 @smallexample
7564 DO J = 1, M
7565   DO I = 1, N
7566     A(J, I) = A(J, I) * C
7567   ENDDO
7568 ENDDO
7569 @end smallexample
7570 loop interchange transforms the loop as if it were written:
7571 @smallexample
7572 DO I = 1, N
7573   DO J = 1, M
7574     A(J, I) = A(J, I) * C
7575   ENDDO
7576 ENDDO
7577 @end smallexample
7578 which can be beneficial when @code{N} is larger than the caches,
7579 because in Fortran, the elements of an array are stored in memory
7580 contiguously by column, and the original loop iterates over rows,
7581 potentially creating at each access a cache miss.  This optimization
7582 applies to all the languages supported by GCC and is not limited to
7583 Fortran.  To use this code transformation, GCC has to be configured
7584 with @option{--with-ppl} and @option{--with-cloog} to enable the
7585 Graphite loop transformation infrastructure.
7586
7587 @item -floop-strip-mine
7588 @opindex floop-strip-mine
7589 Perform loop strip mining transformations on loops.  Strip mining
7590 splits a loop into two nested loops.  The outer loop has strides
7591 equal to the strip size and the inner loop has strides of the
7592 original loop within a strip.  The strip length can be changed
7593 using the @option{loop-block-tile-size} parameter.  For example,
7594 given a loop like:
7595 @smallexample
7596 DO I = 1, N
7597   A(I) = A(I) + C
7598 ENDDO
7599 @end smallexample
7600 loop strip mining transforms the loop as if it were written:
7601 @smallexample
7602 DO II = 1, N, 51
7603   DO I = II, min (II + 50, N)
7604     A(I) = A(I) + C
7605   ENDDO
7606 ENDDO
7607 @end smallexample
7608 This optimization applies to all the languages supported by GCC and is
7609 not limited to Fortran.  To use this code transformation, GCC has to
7610 be configured with @option{--with-ppl} and @option{--with-cloog} to
7611 enable the Graphite loop transformation infrastructure.
7612
7613 @item -floop-block
7614 @opindex floop-block
7615 Perform loop blocking transformations on loops.  Blocking strip mines
7616 each loop in the loop nest such that the memory accesses of the
7617 element loops fit inside caches.  The strip length can be changed
7618 using the @option{loop-block-tile-size} parameter.  For example, given
7619 a loop like:
7620 @smallexample
7621 DO I = 1, N
7622   DO J = 1, M
7623     A(J, I) = B(I) + C(J)
7624   ENDDO
7625 ENDDO
7626 @end smallexample
7627 loop blocking transforms the loop as if it were written:
7628 @smallexample
7629 DO II = 1, N, 51
7630   DO JJ = 1, M, 51
7631     DO I = II, min (II + 50, N)
7632       DO J = JJ, min (JJ + 50, M)
7633         A(J, I) = B(I) + C(J)
7634       ENDDO
7635     ENDDO
7636   ENDDO
7637 ENDDO
7638 @end smallexample
7639 which can be beneficial when @code{M} is larger than the caches,
7640 because the innermost loop iterates over a smaller amount of data
7641 which can be kept in the caches.  This optimization applies to all the
7642 languages supported by GCC and is not limited to Fortran.  To use this
7643 code transformation, GCC has to be configured with @option{--with-ppl}
7644 and @option{--with-cloog} to enable the Graphite loop transformation
7645 infrastructure.
7646
7647 @item -fgraphite-identity
7648 @opindex fgraphite-identity
7649 Enable the identity transformation for graphite.  For every SCoP we generate
7650 the polyhedral representation and transform it back to gimple.  Using
7651 @option{-fgraphite-identity} we can check the costs or benefits of the
7652 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7653 are also performed by the code generator CLooG, like index splitting and
7654 dead code elimination in loops.
7655
7656 @item -floop-nest-optimize
7657 @opindex floop-nest-optimize
7658 Enable the ISL based loop nest optimizer.  This is a generic loop nest
7659 optimizer based on the Pluto optimization algorithms.  It calculates a loop
7660 structure optimized for data-locality and parallelism.  This option
7661 is experimental.
7662
7663 @item -floop-parallelize-all
7664 @opindex floop-parallelize-all
7665 Use the Graphite data dependence analysis to identify loops that can
7666 be parallelized.  Parallelize all the loops that can be analyzed to
7667 not contain loop carried dependences without checking that it is
7668 profitable to parallelize the loops.
7669
7670 @item -fcheck-data-deps
7671 @opindex fcheck-data-deps
7672 Compare the results of several data dependence analyzers.  This option
7673 is used for debugging the data dependence analyzers.
7674
7675 @item -ftree-loop-if-convert
7676 Attempt to transform conditional jumps in the innermost loops to
7677 branch-less equivalents.  The intent is to remove control-flow from
7678 the innermost loops in order to improve the ability of the
7679 vectorization pass to handle these loops.  This is enabled by default
7680 if vectorization is enabled.
7681
7682 @item -ftree-loop-if-convert-stores
7683 Attempt to also if-convert conditional jumps containing memory writes.
7684 This transformation can be unsafe for multi-threaded programs as it
7685 transforms conditional memory writes into unconditional memory writes.
7686 For example,
7687 @smallexample
7688 for (i = 0; i < N; i++)
7689   if (cond)
7690     A[i] = expr;
7691 @end smallexample
7692 is transformed to
7693 @smallexample
7694 for (i = 0; i < N; i++)
7695   A[i] = cond ? expr : A[i];
7696 @end smallexample
7697 potentially producing data races.
7698
7699 @item -ftree-loop-distribution
7700 Perform loop distribution.  This flag can improve cache performance on
7701 big loop bodies and allow further loop optimizations, like
7702 parallelization or vectorization, to take place.  For example, the loop
7703 @smallexample
7704 DO I = 1, N
7705   A(I) = B(I) + C
7706   D(I) = E(I) * F
7707 ENDDO
7708 @end smallexample
7709 is transformed to
7710 @smallexample
7711 DO I = 1, N
7712    A(I) = B(I) + C
7713 ENDDO
7714 DO I = 1, N
7715    D(I) = E(I) * F
7716 ENDDO
7717 @end smallexample
7718
7719 @item -ftree-loop-distribute-patterns
7720 Perform loop distribution of patterns that can be code generated with
7721 calls to a library.  This flag is enabled by default at @option{-O3}.
7722
7723 This pass distributes the initialization loops and generates a call to
7724 memset zero.  For example, the loop
7725 @smallexample
7726 DO I = 1, N
7727   A(I) = 0
7728   B(I) = A(I) + I
7729 ENDDO
7730 @end smallexample
7731 is transformed to
7732 @smallexample
7733 DO I = 1, N
7734    A(I) = 0
7735 ENDDO
7736 DO I = 1, N
7737    B(I) = A(I) + I
7738 ENDDO
7739 @end smallexample
7740 and the initialization loop is transformed into a call to memset zero.
7741
7742 @item -ftree-loop-im
7743 @opindex ftree-loop-im
7744 Perform loop invariant motion on trees.  This pass moves only invariants that
7745 are hard to handle at RTL level (function calls, operations that expand to
7746 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7747 operands of conditions that are invariant out of the loop, so that we can use
7748 just trivial invariantness analysis in loop unswitching.  The pass also includes
7749 store motion.
7750
7751 @item -ftree-loop-ivcanon
7752 @opindex ftree-loop-ivcanon
7753 Create a canonical counter for number of iterations in loops for which
7754 determining number of iterations requires complicated analysis.  Later
7755 optimizations then may determine the number easily.  Useful especially
7756 in connection with unrolling.
7757
7758 @item -fivopts
7759 @opindex fivopts
7760 Perform induction variable optimizations (strength reduction, induction
7761 variable merging and induction variable elimination) on trees.
7762
7763 @item -ftree-parallelize-loops=n
7764 @opindex ftree-parallelize-loops
7765 Parallelize loops, i.e., split their iteration space to run in n threads.
7766 This is only possible for loops whose iterations are independent
7767 and can be arbitrarily reordered.  The optimization is only
7768 profitable on multiprocessor machines, for loops that are CPU-intensive,
7769 rather than constrained e.g.@: by memory bandwidth.  This option
7770 implies @option{-pthread}, and thus is only supported on targets
7771 that have support for @option{-pthread}.
7772
7773 @item -ftree-pta
7774 @opindex ftree-pta
7775 Perform function-local points-to analysis on trees.  This flag is
7776 enabled by default at @option{-O} and higher.
7777
7778 @item -ftree-sra
7779 @opindex ftree-sra
7780 Perform scalar replacement of aggregates.  This pass replaces structure
7781 references with scalars to prevent committing structures to memory too
7782 early.  This flag is enabled by default at @option{-O} and higher.
7783
7784 @item -ftree-copyrename
7785 @opindex ftree-copyrename
7786 Perform copy renaming on trees.  This pass attempts to rename compiler
7787 temporaries to other variables at copy locations, usually resulting in
7788 variable names which more closely resemble the original variables.  This flag
7789 is enabled by default at @option{-O} and higher.
7790
7791 @item -ftree-coalesce-inlined-vars
7792 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7793 combine small user-defined variables too, but only if they were inlined
7794 from other functions.  It is a more limited form of
7795 @option{-ftree-coalesce-vars}.  This may harm debug information of such
7796 inlined variables, but it will keep variables of the inlined-into
7797 function apart from each other, such that they are more likely to
7798 contain the expected values in a debugging session.  This was the
7799 default in GCC versions older than 4.7.
7800
7801 @item -ftree-coalesce-vars
7802 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7803 combine small user-defined variables too, instead of just compiler
7804 temporaries.  This may severely limit the ability to debug an optimized
7805 program compiled with @option{-fno-var-tracking-assignments}.  In the
7806 negated form, this flag prevents SSA coalescing of user variables,
7807 including inlined ones.  This option is enabled by default.
7808
7809 @item -ftree-ter
7810 @opindex ftree-ter
7811 Perform temporary expression replacement during the SSA->normal phase.  Single
7812 use/single def temporaries are replaced at their use location with their
7813 defining expression.  This results in non-GIMPLE code, but gives the expanders
7814 much more complex trees to work on resulting in better RTL generation.  This is
7815 enabled by default at @option{-O} and higher.
7816
7817 @item -ftree-slsr
7818 @opindex ftree-slsr
7819 Perform straight-line strength reduction on trees.  This recognizes related
7820 expressions involving multiplications and replaces them by less expensive
7821 calculations when possible.  This is enabled by default at @option{-O} and
7822 higher.
7823
7824 @item -ftree-vectorize
7825 @opindex ftree-vectorize
7826 Perform loop vectorization on trees. This flag is enabled by default at
7827 @option{-O3}.
7828
7829 @item -ftree-slp-vectorize
7830 @opindex ftree-slp-vectorize
7831 Perform basic block vectorization on trees. This flag is enabled by default at
7832 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7833
7834 @item -ftree-vect-loop-version
7835 @opindex ftree-vect-loop-version
7836 Perform loop versioning when doing loop vectorization on trees.  When a loop
7837 appears to be vectorizable except that data alignment or data dependence cannot
7838 be determined at compile time, then vectorized and non-vectorized versions of
7839 the loop are generated along with run-time checks for alignment or dependence
7840 to control which version is executed.  This option is enabled by default
7841 except at level @option{-Os} where it is disabled.
7842
7843 @item -fvect-cost-model
7844 @opindex fvect-cost-model
7845 Enable cost model for vectorization.  This option is enabled by default at
7846 @option{-O3}.
7847
7848 @item -ftree-vrp
7849 @opindex ftree-vrp
7850 Perform Value Range Propagation on trees.  This is similar to the
7851 constant propagation pass, but instead of values, ranges of values are
7852 propagated.  This allows the optimizers to remove unnecessary range
7853 checks like array bound checks and null pointer checks.  This is
7854 enabled by default at @option{-O2} and higher.  Null pointer check
7855 elimination is only done if @option{-fdelete-null-pointer-checks} is
7856 enabled.
7857
7858 @item -ftracer
7859 @opindex ftracer
7860 Perform tail duplication to enlarge superblock size.  This transformation
7861 simplifies the control flow of the function allowing other optimizations to do
7862 a better job.
7863
7864 @item -funroll-loops
7865 @opindex funroll-loops
7866 Unroll loops whose number of iterations can be determined at compile
7867 time or upon entry to the loop.  @option{-funroll-loops} implies
7868 @option{-frerun-cse-after-loop}.  This option makes code larger,
7869 and may or may not make it run faster.
7870
7871 @item -funroll-all-loops
7872 @opindex funroll-all-loops
7873 Unroll all loops, even if their number of iterations is uncertain when
7874 the loop is entered.  This usually makes programs run more slowly.
7875 @option{-funroll-all-loops} implies the same options as
7876 @option{-funroll-loops},
7877
7878 @item -fsplit-ivs-in-unroller
7879 @opindex fsplit-ivs-in-unroller
7880 Enables expression of values of induction variables in later iterations
7881 of the unrolled loop using the value in the first iteration.  This breaks
7882 long dependency chains, thus improving efficiency of the scheduling passes.
7883
7884 A combination of @option{-fweb} and CSE is often sufficient to obtain the
7885 same effect.  However, that is not reliable in cases where the loop body
7886 is more complicated than a single basic block.  It also does not work at all
7887 on some architectures due to restrictions in the CSE pass.
7888
7889 This optimization is enabled by default.
7890
7891 @item -fvariable-expansion-in-unroller
7892 @opindex fvariable-expansion-in-unroller
7893 With this option, the compiler creates multiple copies of some
7894 local variables when unrolling a loop, which can result in superior code.
7895
7896 @item -fpartial-inlining
7897 @opindex fpartial-inlining
7898 Inline parts of functions.  This option has any effect only
7899 when inlining itself is turned on by the @option{-finline-functions}
7900 or @option{-finline-small-functions} options.
7901
7902 Enabled at level @option{-O2}.
7903
7904 @item -fpredictive-commoning
7905 @opindex fpredictive-commoning
7906 Perform predictive commoning optimization, i.e., reusing computations
7907 (especially memory loads and stores) performed in previous
7908 iterations of loops.
7909
7910 This option is enabled at level @option{-O3}.
7911
7912 @item -fprefetch-loop-arrays
7913 @opindex fprefetch-loop-arrays
7914 If supported by the target machine, generate instructions to prefetch
7915 memory to improve the performance of loops that access large arrays.
7916
7917 This option may generate better or worse code; results are highly
7918 dependent on the structure of loops within the source code.
7919
7920 Disabled at level @option{-Os}.
7921
7922 @item -fno-peephole
7923 @itemx -fno-peephole2
7924 @opindex fno-peephole
7925 @opindex fno-peephole2
7926 Disable any machine-specific peephole optimizations.  The difference
7927 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7928 are implemented in the compiler; some targets use one, some use the
7929 other, a few use both.
7930
7931 @option{-fpeephole} is enabled by default.
7932 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7933
7934 @item -fno-guess-branch-probability
7935 @opindex fno-guess-branch-probability
7936 Do not guess branch probabilities using heuristics.
7937
7938 GCC uses heuristics to guess branch probabilities if they are
7939 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7940 heuristics are based on the control flow graph.  If some branch probabilities
7941 are specified by @samp{__builtin_expect}, then the heuristics are
7942 used to guess branch probabilities for the rest of the control flow graph,
7943 taking the @samp{__builtin_expect} info into account.  The interactions
7944 between the heuristics and @samp{__builtin_expect} can be complex, and in
7945 some cases, it may be useful to disable the heuristics so that the effects
7946 of @samp{__builtin_expect} are easier to understand.
7947
7948 The default is @option{-fguess-branch-probability} at levels
7949 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7950
7951 @item -freorder-blocks
7952 @opindex freorder-blocks
7953 Reorder basic blocks in the compiled function in order to reduce number of
7954 taken branches and improve code locality.
7955
7956 Enabled at levels @option{-O2}, @option{-O3}.
7957
7958 @item -freorder-blocks-and-partition
7959 @opindex freorder-blocks-and-partition
7960 In addition to reordering basic blocks in the compiled function, in order
7961 to reduce number of taken branches, partitions hot and cold basic blocks
7962 into separate sections of the assembly and .o files, to improve
7963 paging and cache locality performance.
7964
7965 This optimization is automatically turned off in the presence of
7966 exception handling, for linkonce sections, for functions with a user-defined
7967 section attribute and on any architecture that does not support named
7968 sections.
7969
7970 @item -freorder-functions
7971 @opindex freorder-functions
7972 Reorder functions in the object file in order to
7973 improve code locality.  This is implemented by using special
7974 subsections @code{.text.hot} for most frequently executed functions and
7975 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7976 the linker so object file format must support named sections and linker must
7977 place them in a reasonable way.
7978
7979 Also profile feedback must be available to make this option effective.  See
7980 @option{-fprofile-arcs} for details.
7981
7982 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7983
7984 @item -fstrict-aliasing
7985 @opindex fstrict-aliasing
7986 Allow the compiler to assume the strictest aliasing rules applicable to
7987 the language being compiled.  For C (and C++), this activates
7988 optimizations based on the type of expressions.  In particular, an
7989 object of one type is assumed never to reside at the same address as an
7990 object of a different type, unless the types are almost the same.  For
7991 example, an @code{unsigned int} can alias an @code{int}, but not a
7992 @code{void*} or a @code{double}.  A character type may alias any other
7993 type.
7994
7995 @anchor{Type-punning}Pay special attention to code like this:
7996 @smallexample
7997 union a_union @{
7998   int i;
7999   double d;
8000 @};
8001
8002 int f() @{
8003   union a_union t;
8004   t.d = 3.0;
8005   return t.i;
8006 @}
8007 @end smallexample
8008 The practice of reading from a different union member than the one most
8009 recently written to (called ``type-punning'') is common.  Even with
8010 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8011 is accessed through the union type.  So, the code above works as
8012 expected.  @xref{Structures unions enumerations and bit-fields
8013 implementation}.  However, this code might not:
8014 @smallexample
8015 int f() @{
8016   union a_union t;
8017   int* ip;
8018   t.d = 3.0;
8019   ip = &t.i;
8020   return *ip;
8021 @}
8022 @end smallexample
8023
8024 Similarly, access by taking the address, casting the resulting pointer
8025 and dereferencing the result has undefined behavior, even if the cast
8026 uses a union type, e.g.:
8027 @smallexample
8028 int f() @{
8029   double d = 3.0;
8030   return ((union a_union *) &d)->i;
8031 @}
8032 @end smallexample
8033
8034 The @option{-fstrict-aliasing} option is enabled at levels
8035 @option{-O2}, @option{-O3}, @option{-Os}.
8036
8037 @item -fstrict-overflow
8038 @opindex fstrict-overflow
8039 Allow the compiler to assume strict signed overflow rules, depending
8040 on the language being compiled.  For C (and C++) this means that
8041 overflow when doing arithmetic with signed numbers is undefined, which
8042 means that the compiler may assume that it does not happen.  This
8043 permits various optimizations.  For example, the compiler assumes
8044 that an expression like @code{i + 10 > i} is always true for
8045 signed @code{i}.  This assumption is only valid if signed overflow is
8046 undefined, as the expression is false if @code{i + 10} overflows when
8047 using twos complement arithmetic.  When this option is in effect any
8048 attempt to determine whether an operation on signed numbers 
8049 overflows must be written carefully to not actually involve overflow.
8050
8051 This option also allows the compiler to assume strict pointer
8052 semantics: given a pointer to an object, if adding an offset to that
8053 pointer does not produce a pointer to the same object, the addition is
8054 undefined.  This permits the compiler to conclude that @code{p + u >
8055 p} is always true for a pointer @code{p} and unsigned integer
8056 @code{u}.  This assumption is only valid because pointer wraparound is
8057 undefined, as the expression is false if @code{p + u} overflows using
8058 twos complement arithmetic.
8059
8060 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8061 that integer signed overflow is fully defined: it wraps.  When
8062 @option{-fwrapv} is used, there is no difference between
8063 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8064 integers.  With @option{-fwrapv} certain types of overflow are
8065 permitted.  For example, if the compiler gets an overflow when doing
8066 arithmetic on constants, the overflowed value can still be used with
8067 @option{-fwrapv}, but not otherwise.
8068
8069 The @option{-fstrict-overflow} option is enabled at levels
8070 @option{-O2}, @option{-O3}, @option{-Os}.
8071
8072 @item -falign-functions
8073 @itemx -falign-functions=@var{n}
8074 @opindex falign-functions
8075 Align the start of functions to the next power-of-two greater than
8076 @var{n}, skipping up to @var{n} bytes.  For instance,
8077 @option{-falign-functions=32} aligns functions to the next 32-byte
8078 boundary, but @option{-falign-functions=24} aligns to the next
8079 32-byte boundary only if this can be done by skipping 23 bytes or less.
8080
8081 @option{-fno-align-functions} and @option{-falign-functions=1} are
8082 equivalent and mean that functions are not aligned.
8083
8084 Some assemblers only support this flag when @var{n} is a power of two;
8085 in that case, it is rounded up.
8086
8087 If @var{n} is not specified or is zero, use a machine-dependent default.
8088
8089 Enabled at levels @option{-O2}, @option{-O3}.
8090
8091 @item -falign-labels
8092 @itemx -falign-labels=@var{n}
8093 @opindex falign-labels
8094 Align all branch targets to a power-of-two boundary, skipping up to
8095 @var{n} bytes like @option{-falign-functions}.  This option can easily
8096 make code slower, because it must insert dummy operations for when the
8097 branch target is reached in the usual flow of the code.
8098
8099 @option{-fno-align-labels} and @option{-falign-labels=1} are
8100 equivalent and mean that labels are not aligned.
8101
8102 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8103 are greater than this value, then their values are used instead.
8104
8105 If @var{n} is not specified or is zero, use a machine-dependent default
8106 which is very likely to be @samp{1}, meaning no alignment.
8107
8108 Enabled at levels @option{-O2}, @option{-O3}.
8109
8110 @item -falign-loops
8111 @itemx -falign-loops=@var{n}
8112 @opindex falign-loops
8113 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8114 like @option{-falign-functions}.  If the loops are
8115 executed many times, this makes up for any execution of the dummy
8116 operations.
8117
8118 @option{-fno-align-loops} and @option{-falign-loops=1} are
8119 equivalent and mean that loops are not aligned.
8120
8121 If @var{n} is not specified or is zero, use a machine-dependent default.
8122
8123 Enabled at levels @option{-O2}, @option{-O3}.
8124
8125 @item -falign-jumps
8126 @itemx -falign-jumps=@var{n}
8127 @opindex falign-jumps
8128 Align branch targets to a power-of-two boundary, for branch targets
8129 where the targets can only be reached by jumping, skipping up to @var{n}
8130 bytes like @option{-falign-functions}.  In this case, no dummy operations
8131 need be executed.
8132
8133 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8134 equivalent and mean that loops are not aligned.
8135
8136 If @var{n} is not specified or is zero, use a machine-dependent default.
8137
8138 Enabled at levels @option{-O2}, @option{-O3}.
8139
8140 @item -funit-at-a-time
8141 @opindex funit-at-a-time
8142 This option is left for compatibility reasons. @option{-funit-at-a-time}
8143 has no effect, while @option{-fno-unit-at-a-time} implies
8144 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8145
8146 Enabled by default.
8147
8148 @item -fno-toplevel-reorder
8149 @opindex fno-toplevel-reorder
8150 Do not reorder top-level functions, variables, and @code{asm}
8151 statements.  Output them in the same order that they appear in the
8152 input file.  When this option is used, unreferenced static variables
8153 are not removed.  This option is intended to support existing code
8154 that relies on a particular ordering.  For new code, it is better to
8155 use attributes.
8156
8157 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8158 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8159 targets.
8160
8161 @item -fweb
8162 @opindex fweb
8163 Constructs webs as commonly used for register allocation purposes and assign
8164 each web individual pseudo register.  This allows the register allocation pass
8165 to operate on pseudos directly, but also strengthens several other optimization
8166 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8167 however, make debugging impossible, since variables no longer stay in a
8168 ``home register''.
8169
8170 Enabled by default with @option{-funroll-loops}.
8171
8172 @item -fwhole-program
8173 @opindex fwhole-program
8174 Assume that the current compilation unit represents the whole program being
8175 compiled.  All public functions and variables with the exception of @code{main}
8176 and those merged by attribute @code{externally_visible} become static functions
8177 and in effect are optimized more aggressively by interprocedural optimizers.
8178
8179 This option should not be used in combination with @code{-flto}.
8180 Instead relying on a linker plugin should provide safer and more precise
8181 information.
8182
8183 @item -flto[=@var{n}]
8184 @opindex flto
8185 This option runs the standard link-time optimizer.  When invoked
8186 with source code, it generates GIMPLE (one of GCC's internal
8187 representations) and writes it to special ELF sections in the object
8188 file.  When the object files are linked together, all the function
8189 bodies are read from these ELF sections and instantiated as if they
8190 had been part of the same translation unit.
8191
8192 To use the link-time optimizer, @option{-flto} needs to be specified at
8193 compile time and during the final link.  For example:
8194
8195 @smallexample
8196 gcc -c -O2 -flto foo.c
8197 gcc -c -O2 -flto bar.c
8198 gcc -o myprog -flto -O2 foo.o bar.o
8199 @end smallexample
8200
8201 The first two invocations to GCC save a bytecode representation
8202 of GIMPLE into special ELF sections inside @file{foo.o} and
8203 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8204 @file{foo.o} and @file{bar.o}, merges the two files into a single
8205 internal image, and compiles the result as usual.  Since both
8206 @file{foo.o} and @file{bar.o} are merged into a single image, this
8207 causes all the interprocedural analyses and optimizations in GCC to
8208 work across the two files as if they were a single one.  This means,
8209 for example, that the inliner is able to inline functions in
8210 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8211
8212 Another (simpler) way to enable link-time optimization is:
8213
8214 @smallexample
8215 gcc -o myprog -flto -O2 foo.c bar.c
8216 @end smallexample
8217
8218 The above generates bytecode for @file{foo.c} and @file{bar.c},
8219 merges them together into a single GIMPLE representation and optimizes
8220 them as usual to produce @file{myprog}.
8221
8222 The only important thing to keep in mind is that to enable link-time
8223 optimizations the @option{-flto} flag needs to be passed to both the
8224 compile and the link commands.
8225
8226 To make whole program optimization effective, it is necessary to make
8227 certain whole program assumptions.  The compiler needs to know
8228 what functions and variables can be accessed by libraries and runtime
8229 outside of the link-time optimized unit.  When supported by the linker,
8230 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8231 to the compiler about used and externally visible symbols.  When
8232 the linker plugin is not available, @option{-fwhole-program} should be
8233 used to allow the compiler to make these assumptions, which leads
8234 to more aggressive optimization decisions.
8235
8236 Note that when a file is compiled with @option{-flto}, the generated
8237 object file is larger than a regular object file because it 
8238 contains GIMPLE bytecodes and the usual final code.  This means that
8239 object files with LTO information can be linked as normal object
8240 files; if @option{-flto} is not passed to the linker, no
8241 interprocedural optimizations are applied.
8242
8243 Additionally, the optimization flags used to compile individual files
8244 are not necessarily related to those used at link time.  For instance,
8245
8246 @smallexample
8247 gcc -c -O0 -flto foo.c
8248 gcc -c -O0 -flto bar.c
8249 gcc -o myprog -flto -O3 foo.o bar.o
8250 @end smallexample
8251
8252 This produces individual object files with unoptimized assembler
8253 code, but the resulting binary @file{myprog} is optimized at
8254 @option{-O3}.  If, instead, the final binary is generated without
8255 @option{-flto}, then @file{myprog} is not optimized.
8256
8257 When producing the final binary with @option{-flto}, GCC only
8258 applies link-time optimizations to those files that contain bytecode.
8259 Therefore, you can mix and match object files and libraries with
8260 GIMPLE bytecodes and final object code.  GCC automatically selects
8261 which files to optimize in LTO mode and which files to link without
8262 further processing.
8263
8264 There are some code generation flags preserved by GCC when
8265 generating bytecodes, as they need to be used during the final link
8266 stage.  Currently, the following options are saved into the GIMPLE
8267 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
8268 @option{-m} target flags.
8269
8270 At link time, these options are read in and reapplied.  Note that the
8271 current implementation makes no attempt to recognize conflicting
8272 values for these options.  If different files have conflicting option
8273 values (e.g., one file is compiled with @option{-fPIC} and another
8274 isn't), the compiler simply uses the last value read from the
8275 bytecode files.  It is recommended, then, that you compile all the files
8276 participating in the same link with the same options.
8277
8278 If LTO encounters objects with C linkage declared with incompatible
8279 types in separate translation units to be linked together (undefined
8280 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8281 issued.  The behavior is still undefined at run time.
8282
8283 Another feature of LTO is that it is possible to apply interprocedural
8284 optimizations on files written in different languages.  This requires
8285 support in the language front end.  Currently, the C, C++ and
8286 Fortran front ends are capable of emitting GIMPLE bytecodes, so
8287 something like this should work:
8288
8289 @smallexample
8290 gcc -c -flto foo.c
8291 g++ -c -flto bar.cc
8292 gfortran -c -flto baz.f90
8293 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8294 @end smallexample
8295
8296 Notice that the final link is done with @command{g++} to get the C++
8297 runtime libraries and @option{-lgfortran} is added to get the Fortran
8298 runtime libraries.  In general, when mixing languages in LTO mode, you
8299 should use the same link command options as when mixing languages in a
8300 regular (non-LTO) compilation; all you need to add is @option{-flto} to
8301 all the compile and link commands.
8302
8303 If object files containing GIMPLE bytecode are stored in a library archive, say
8304 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8305 are using a linker with plugin support.  To enable this feature, use
8306 the flag @option{-fuse-linker-plugin} at link time:
8307
8308 @smallexample
8309 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8310 @end smallexample
8311
8312 With the linker plugin enabled, the linker extracts the needed
8313 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8314 to make them part of the aggregated GIMPLE image to be optimized.
8315
8316 If you are not using a linker with plugin support and/or do not
8317 enable the linker plugin, then the objects inside @file{libfoo.a}
8318 are extracted and linked as usual, but they do not participate
8319 in the LTO optimization process.
8320
8321 Link-time optimizations do not require the presence of the whole program to
8322 operate.  If the program does not require any symbols to be exported, it is
8323 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8324 the interprocedural optimizers to use more aggressive assumptions which may
8325 lead to improved optimization opportunities.
8326 Use of @option{-fwhole-program} is not needed when linker plugin is
8327 active (see @option{-fuse-linker-plugin}).
8328
8329 The current implementation of LTO makes no
8330 attempt to generate bytecode that is portable between different
8331 types of hosts.  The bytecode files are versioned and there is a
8332 strict version check, so bytecode files generated in one version of
8333 GCC will not work with an older/newer version of GCC@.
8334
8335 Link-time optimization does not work well with generation of debugging
8336 information.  Combining @option{-flto} with
8337 @option{-g} is currently experimental and expected to produce wrong
8338 results.
8339
8340 If you specify the optional @var{n}, the optimization and code
8341 generation done at link time is executed in parallel using @var{n}
8342 parallel jobs by utilizing an installed @command{make} program.  The
8343 environment variable @env{MAKE} may be used to override the program
8344 used.  The default value for @var{n} is 1.
8345
8346 You can also specify @option{-flto=jobserver} to use GNU make's
8347 job server mode to determine the number of parallel jobs. This
8348 is useful when the Makefile calling GCC is already executing in parallel.
8349 You must prepend a @samp{+} to the command recipe in the parent Makefile
8350 for this to work.  This option likely only works if @env{MAKE} is
8351 GNU make.
8352
8353 This option is disabled by default.
8354
8355 @item -flto-partition=@var{alg}
8356 @opindex flto-partition
8357 Specify the partitioning algorithm used by the link-time optimizer.
8358 The value is either @code{1to1} to specify a partitioning mirroring
8359 the original source files or @code{balanced} to specify partitioning
8360 into equally sized chunks (whenever possible) or @code{max} to create
8361 new partition for every symbol where possible.  Specifying @code{none}
8362 as an algorithm disables partitioning and streaming completely. 
8363 The default value is @code{balanced}. While @code{1to1} can be used
8364 as an workaround for various code ordering issues, the @code{max}
8365 partitioning is intended for internal testing only.
8366
8367 @item -flto-compression-level=@var{n}
8368 This option specifies the level of compression used for intermediate
8369 language written to LTO object files, and is only meaningful in
8370 conjunction with LTO mode (@option{-flto}).  Valid
8371 values are 0 (no compression) to 9 (maximum compression).  Values
8372 outside this range are clamped to either 0 or 9.  If the option is not
8373 given, a default balanced compression setting is used.
8374
8375 @item -flto-report
8376 Prints a report with internal details on the workings of the link-time
8377 optimizer.  The contents of this report vary from version to version.
8378 It is meant to be useful to GCC developers when processing object
8379 files in LTO mode (via @option{-flto}).
8380
8381 Disabled by default.
8382
8383 @item -fuse-linker-plugin
8384 Enables the use of a linker plugin during link-time optimization.  This
8385 option relies on plugin support in the linker, which is available in gold
8386 or in GNU ld 2.21 or newer.
8387
8388 This option enables the extraction of object files with GIMPLE bytecode out
8389 of library archives. This improves the quality of optimization by exposing
8390 more code to the link-time optimizer.  This information specifies what
8391 symbols can be accessed externally (by non-LTO object or during dynamic
8392 linking).  Resulting code quality improvements on binaries (and shared
8393 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8394 See @option{-flto} for a description of the effect of this flag and how to
8395 use it.
8396
8397 This option is enabled by default when LTO support in GCC is enabled
8398 and GCC was configured for use with
8399 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8400
8401 @item -ffat-lto-objects
8402 @opindex ffat-lto-objects
8403 Fat LTO objects are object files that contain both the intermediate language
8404 and the object code. This makes them usable for both LTO linking and normal
8405 linking. This option is effective only when compiling with @option{-flto}
8406 and is ignored at link time.
8407
8408 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8409 requires the complete toolchain to be aware of LTO. It requires a linker with
8410 linker plugin support for basic functionality.  Additionally,
8411 @command{nm}, @command{ar} and @command{ranlib}
8412 need to support linker plugins to allow a full-featured build environment
8413 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8414 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8415 to these tools. With non fat LTO makefiles need to be modified to use them.
8416
8417 The default is @option{-ffat-lto-objects} but this default is intended to
8418 change in future releases when linker plugin enabled environments become more
8419 common.
8420
8421 @item -fcompare-elim
8422 @opindex fcompare-elim
8423 After register allocation and post-register allocation instruction splitting,
8424 identify arithmetic instructions that compute processor flags similar to a
8425 comparison operation based on that arithmetic.  If possible, eliminate the
8426 explicit comparison operation.
8427
8428 This pass only applies to certain targets that cannot explicitly represent
8429 the comparison operation before register allocation is complete.
8430
8431 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8432
8433 @item -fuse-ld=bfd
8434 Use the @command{bfd} linker instead of the default linker.
8435
8436 @item -fuse-ld=gold
8437 Use the @command{gold} linker instead of the default linker.
8438
8439 @item -fcprop-registers
8440 @opindex fcprop-registers
8441 After register allocation and post-register allocation instruction splitting,
8442 perform a copy-propagation pass to try to reduce scheduling dependencies
8443 and occasionally eliminate the copy.
8444
8445 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8446
8447 @item -fprofile-correction
8448 @opindex fprofile-correction
8449 Profiles collected using an instrumented binary for multi-threaded programs may
8450 be inconsistent due to missed counter updates. When this option is specified,
8451 GCC uses heuristics to correct or smooth out such inconsistencies. By
8452 default, GCC emits an error message when an inconsistent profile is detected.
8453
8454 @item -fprofile-dir=@var{path}
8455 @opindex fprofile-dir
8456
8457 Set the directory to search for the profile data files in to @var{path}.
8458 This option affects only the profile data generated by
8459 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8460 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8461 and its related options.  Both absolute and relative paths can be used.
8462 By default, GCC uses the current directory as @var{path}, thus the
8463 profile data file appears in the same directory as the object file.
8464
8465 @item -fprofile-generate
8466 @itemx -fprofile-generate=@var{path}
8467 @opindex fprofile-generate
8468
8469 Enable options usually used for instrumenting application to produce
8470 profile useful for later recompilation with profile feedback based
8471 optimization.  You must use @option{-fprofile-generate} both when
8472 compiling and when linking your program.
8473
8474 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8475
8476 If @var{path} is specified, GCC looks at the @var{path} to find
8477 the profile feedback data files. See @option{-fprofile-dir}.
8478
8479 @item -fprofile-use
8480 @itemx -fprofile-use=@var{path}
8481 @opindex fprofile-use
8482 Enable profile feedback directed optimizations, and optimizations
8483 generally profitable only with profile feedback available.
8484
8485 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8486 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}, @code{-ftree-vectorize},
8487 @code{ftree-loop-distribute-patterns}
8488
8489 By default, GCC emits an error message if the feedback profiles do not
8490 match the source code.  This error can be turned into a warning by using
8491 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8492 code.
8493
8494 If @var{path} is specified, GCC looks at the @var{path} to find
8495 the profile feedback data files. See @option{-fprofile-dir}.
8496 @end table
8497
8498 The following options control compiler behavior regarding floating-point 
8499 arithmetic.  These options trade off between speed and
8500 correctness.  All must be specifically enabled.
8501
8502 @table @gcctabopt
8503 @item -ffloat-store
8504 @opindex ffloat-store
8505 Do not store floating-point variables in registers, and inhibit other
8506 options that might change whether a floating-point value is taken from a
8507 register or memory.
8508
8509 @cindex floating-point precision
8510 This option prevents undesirable excess precision on machines such as
8511 the 68000 where the floating registers (of the 68881) keep more
8512 precision than a @code{double} is supposed to have.  Similarly for the
8513 x86 architecture.  For most programs, the excess precision does only
8514 good, but a few programs rely on the precise definition of IEEE floating
8515 point.  Use @option{-ffloat-store} for such programs, after modifying
8516 them to store all pertinent intermediate computations into variables.
8517
8518 @item -fexcess-precision=@var{style}
8519 @opindex fexcess-precision
8520 This option allows further control over excess precision on machines
8521 where floating-point registers have more precision than the IEEE
8522 @code{float} and @code{double} types and the processor does not
8523 support operations rounding to those types.  By default,
8524 @option{-fexcess-precision=fast} is in effect; this means that
8525 operations are carried out in the precision of the registers and that
8526 it is unpredictable when rounding to the types specified in the source
8527 code takes place.  When compiling C, if
8528 @option{-fexcess-precision=standard} is specified then excess
8529 precision follows the rules specified in ISO C99; in particular,
8530 both casts and assignments cause values to be rounded to their
8531 semantic types (whereas @option{-ffloat-store} only affects
8532 assignments).  This option is enabled by default for C if a strict
8533 conformance option such as @option{-std=c99} is used.
8534
8535 @opindex mfpmath
8536 @option{-fexcess-precision=standard} is not implemented for languages
8537 other than C, and has no effect if
8538 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8539 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8540 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8541 semantics apply without excess precision, and in the latter, rounding
8542 is unpredictable.
8543
8544 @item -ffast-math
8545 @opindex ffast-math
8546 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8547 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8548 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8549
8550 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8551
8552 This option is not turned on by any @option{-O} option besides
8553 @option{-Ofast} since it can result in incorrect output for programs
8554 that depend on an exact implementation of IEEE or ISO rules/specifications
8555 for math functions. It may, however, yield faster code for programs
8556 that do not require the guarantees of these specifications.
8557
8558 @item -fno-math-errno
8559 @opindex fno-math-errno
8560 Do not set @code{errno} after calling math functions that are executed
8561 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8562 IEEE exceptions for math error handling may want to use this flag
8563 for speed while maintaining IEEE arithmetic compatibility.
8564
8565 This option is not turned on by any @option{-O} option since
8566 it can result in incorrect output for programs that depend on
8567 an exact implementation of IEEE or ISO rules/specifications for
8568 math functions. It may, however, yield faster code for programs
8569 that do not require the guarantees of these specifications.
8570
8571 The default is @option{-fmath-errno}.
8572
8573 On Darwin systems, the math library never sets @code{errno}.  There is
8574 therefore no reason for the compiler to consider the possibility that
8575 it might, and @option{-fno-math-errno} is the default.
8576
8577 @item -funsafe-math-optimizations
8578 @opindex funsafe-math-optimizations
8579
8580 Allow optimizations for floating-point arithmetic that (a) assume
8581 that arguments and results are valid and (b) may violate IEEE or
8582 ANSI standards.  When used at link-time, it may include libraries
8583 or startup files that change the default FPU control word or other
8584 similar optimizations.
8585
8586 This option is not turned on by any @option{-O} option since
8587 it can result in incorrect output for programs that depend on
8588 an exact implementation of IEEE or ISO rules/specifications for
8589 math functions. It may, however, yield faster code for programs
8590 that do not require the guarantees of these specifications.
8591 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8592 @option{-fassociative-math} and @option{-freciprocal-math}.
8593
8594 The default is @option{-fno-unsafe-math-optimizations}.
8595
8596 @item -fassociative-math
8597 @opindex fassociative-math
8598
8599 Allow re-association of operands in series of floating-point operations.
8600 This violates the ISO C and C++ language standard by possibly changing
8601 computation result.  NOTE: re-ordering may change the sign of zero as
8602 well as ignore NaNs and inhibit or create underflow or overflow (and
8603 thus cannot be used on code that relies on rounding behavior like
8604 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8605 and thus may not be used when ordered comparisons are required.
8606 This option requires that both @option{-fno-signed-zeros} and
8607 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8608 much sense with @option{-frounding-math}. For Fortran the option
8609 is automatically enabled when both @option{-fno-signed-zeros} and
8610 @option{-fno-trapping-math} are in effect.
8611
8612 The default is @option{-fno-associative-math}.
8613
8614 @item -freciprocal-math
8615 @opindex freciprocal-math
8616
8617 Allow the reciprocal of a value to be used instead of dividing by
8618 the value if this enables optimizations.  For example @code{x / y}
8619 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8620 is subject to common subexpression elimination.  Note that this loses
8621 precision and increases the number of flops operating on the value.
8622
8623 The default is @option{-fno-reciprocal-math}.
8624
8625 @item -ffinite-math-only
8626 @opindex ffinite-math-only
8627 Allow optimizations for floating-point arithmetic that assume
8628 that arguments and results are not NaNs or +-Infs.
8629
8630 This option is not turned on by any @option{-O} option since
8631 it can result in incorrect output for programs that depend on
8632 an exact implementation of IEEE or ISO rules/specifications for
8633 math functions. It may, however, yield faster code for programs
8634 that do not require the guarantees of these specifications.
8635
8636 The default is @option{-fno-finite-math-only}.
8637
8638 @item -fno-signed-zeros
8639 @opindex fno-signed-zeros
8640 Allow optimizations for floating-point arithmetic that ignore the
8641 signedness of zero.  IEEE arithmetic specifies the behavior of
8642 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8643 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8644 This option implies that the sign of a zero result isn't significant.
8645
8646 The default is @option{-fsigned-zeros}.
8647
8648 @item -fno-trapping-math
8649 @opindex fno-trapping-math
8650 Compile code assuming that floating-point operations cannot generate
8651 user-visible traps.  These traps include division by zero, overflow,
8652 underflow, inexact result and invalid operation.  This option requires
8653 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8654 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8655
8656 This option should never be turned on by any @option{-O} option since
8657 it can result in incorrect output for programs that depend on
8658 an exact implementation of IEEE or ISO rules/specifications for
8659 math functions.
8660
8661 The default is @option{-ftrapping-math}.
8662
8663 @item -frounding-math
8664 @opindex frounding-math
8665 Disable transformations and optimizations that assume default floating-point
8666 rounding behavior.  This is round-to-zero for all floating point
8667 to integer conversions, and round-to-nearest for all other arithmetic
8668 truncations.  This option should be specified for programs that change
8669 the FP rounding mode dynamically, or that may be executed with a
8670 non-default rounding mode.  This option disables constant folding of
8671 floating-point expressions at compile time (which may be affected by
8672 rounding mode) and arithmetic transformations that are unsafe in the
8673 presence of sign-dependent rounding modes.
8674
8675 The default is @option{-fno-rounding-math}.
8676
8677 This option is experimental and does not currently guarantee to
8678 disable all GCC optimizations that are affected by rounding mode.
8679 Future versions of GCC may provide finer control of this setting
8680 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8681 will be used to specify the default state for @code{FENV_ACCESS}.
8682
8683 @item -fsignaling-nans
8684 @opindex fsignaling-nans
8685 Compile code assuming that IEEE signaling NaNs may generate user-visible
8686 traps during floating-point operations.  Setting this option disables
8687 optimizations that may change the number of exceptions visible with
8688 signaling NaNs.  This option implies @option{-ftrapping-math}.
8689
8690 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8691 be defined.
8692
8693 The default is @option{-fno-signaling-nans}.
8694
8695 This option is experimental and does not currently guarantee to
8696 disable all GCC optimizations that affect signaling NaN behavior.
8697
8698 @item -fsingle-precision-constant
8699 @opindex fsingle-precision-constant
8700 Treat floating-point constants as single precision instead of
8701 implicitly converting them to double-precision constants.
8702
8703 @item -fcx-limited-range
8704 @opindex fcx-limited-range
8705 When enabled, this option states that a range reduction step is not
8706 needed when performing complex division.  Also, there is no checking
8707 whether the result of a complex multiplication or division is @code{NaN
8708 + I*NaN}, with an attempt to rescue the situation in that case.  The
8709 default is @option{-fno-cx-limited-range}, but is enabled by
8710 @option{-ffast-math}.
8711
8712 This option controls the default setting of the ISO C99
8713 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8714 all languages.
8715
8716 @item -fcx-fortran-rules
8717 @opindex fcx-fortran-rules
8718 Complex multiplication and division follow Fortran rules.  Range
8719 reduction is done as part of complex division, but there is no checking
8720 whether the result of a complex multiplication or division is @code{NaN
8721 + I*NaN}, with an attempt to rescue the situation in that case.
8722
8723 The default is @option{-fno-cx-fortran-rules}.
8724
8725 @end table
8726
8727 The following options control optimizations that may improve
8728 performance, but are not enabled by any @option{-O} options.  This
8729 section includes experimental options that may produce broken code.
8730
8731 @table @gcctabopt
8732 @item -fbranch-probabilities
8733 @opindex fbranch-probabilities
8734 After running a program compiled with @option{-fprofile-arcs}
8735 (@pxref{Debugging Options,, Options for Debugging Your Program or
8736 @command{gcc}}), you can compile it a second time using
8737 @option{-fbranch-probabilities}, to improve optimizations based on
8738 the number of times each branch was taken.  When a program
8739 compiled with @option{-fprofile-arcs} exits, it saves arc execution
8740 counts to a file called @file{@var{sourcename}.gcda} for each source
8741 file.  The information in this data file is very dependent on the
8742 structure of the generated code, so you must use the same source code
8743 and the same optimization options for both compilations.
8744
8745 With @option{-fbranch-probabilities}, GCC puts a
8746 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8747 These can be used to improve optimization.  Currently, they are only
8748 used in one place: in @file{reorg.c}, instead of guessing which path a
8749 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8750 exactly determine which path is taken more often.
8751
8752 @item -fprofile-values
8753 @opindex fprofile-values
8754 If combined with @option{-fprofile-arcs}, it adds code so that some
8755 data about values of expressions in the program is gathered.
8756
8757 With @option{-fbranch-probabilities}, it reads back the data gathered
8758 from profiling values of expressions for usage in optimizations.
8759
8760 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8761
8762 @item -fvpt
8763 @opindex fvpt
8764 If combined with @option{-fprofile-arcs}, this option instructs the compiler
8765 to add code to gather information about values of expressions.
8766
8767 With @option{-fbranch-probabilities}, it reads back the data gathered
8768 and actually performs the optimizations based on them.
8769 Currently the optimizations include specialization of division operations
8770 using the knowledge about the value of the denominator.
8771
8772 @item -frename-registers
8773 @opindex frename-registers
8774 Attempt to avoid false dependencies in scheduled code by making use
8775 of registers left over after register allocation.  This optimization
8776 most benefits processors with lots of registers.  Depending on the
8777 debug information format adopted by the target, however, it can
8778 make debugging impossible, since variables no longer stay in
8779 a ``home register''.
8780
8781 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8782
8783 @item -ftracer
8784 @opindex ftracer
8785 Perform tail duplication to enlarge superblock size.  This transformation
8786 simplifies the control flow of the function allowing other optimizations to do
8787 a better job.
8788
8789 Enabled with @option{-fprofile-use}.
8790
8791 @item -funroll-loops
8792 @opindex funroll-loops
8793 Unroll loops whose number of iterations can be determined at compile time or
8794 upon entry to the loop.  @option{-funroll-loops} implies
8795 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8796 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8797 a small constant number of iterations).  This option makes code larger, and may
8798 or may not make it run faster.
8799
8800 Enabled with @option{-fprofile-use}.
8801
8802 @item -funroll-all-loops
8803 @opindex funroll-all-loops
8804 Unroll all loops, even if their number of iterations is uncertain when
8805 the loop is entered.  This usually makes programs run more slowly.
8806 @option{-funroll-all-loops} implies the same options as
8807 @option{-funroll-loops}.
8808
8809 @item -fpeel-loops
8810 @opindex fpeel-loops
8811 Peels loops for which there is enough information that they do not
8812 roll much (from profile feedback).  It also turns on complete loop peeling
8813 (i.e.@: complete removal of loops with small constant number of iterations).
8814
8815 Enabled with @option{-fprofile-use}.
8816
8817 @item -fmove-loop-invariants
8818 @opindex fmove-loop-invariants
8819 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8820 at level @option{-O1}
8821
8822 @item -funswitch-loops
8823 @opindex funswitch-loops
8824 Move branches with loop invariant conditions out of the loop, with duplicates
8825 of the loop on both branches (modified according to result of the condition).
8826
8827 @item -ffunction-sections
8828 @itemx -fdata-sections
8829 @opindex ffunction-sections
8830 @opindex fdata-sections
8831 Place each function or data item into its own section in the output
8832 file if the target supports arbitrary sections.  The name of the
8833 function or the name of the data item determines the section's name
8834 in the output file.
8835
8836 Use these options on systems where the linker can perform optimizations
8837 to improve locality of reference in the instruction space.  Most systems
8838 using the ELF object format and SPARC processors running Solaris 2 have
8839 linkers with such optimizations.  AIX may have these optimizations in
8840 the future.
8841
8842 Only use these options when there are significant benefits from doing
8843 so.  When you specify these options, the assembler and linker
8844 create larger object and executable files and are also slower.
8845 You cannot use @code{gprof} on all systems if you
8846 specify this option, and you may have problems with debugging if
8847 you specify both this option and @option{-g}.
8848
8849 @item -fbranch-target-load-optimize
8850 @opindex fbranch-target-load-optimize
8851 Perform branch target register load optimization before prologue / epilogue
8852 threading.
8853 The use of target registers can typically be exposed only during reload,
8854 thus hoisting loads out of loops and doing inter-block scheduling needs
8855 a separate optimization pass.
8856
8857 @item -fbranch-target-load-optimize2
8858 @opindex fbranch-target-load-optimize2
8859 Perform branch target register load optimization after prologue / epilogue
8860 threading.
8861
8862 @item -fbtr-bb-exclusive
8863 @opindex fbtr-bb-exclusive
8864 When performing branch target register load optimization, don't reuse
8865 branch target registers within any basic block.
8866
8867 @item -fstack-protector
8868 @opindex fstack-protector
8869 Emit extra code to check for buffer overflows, such as stack smashing
8870 attacks.  This is done by adding a guard variable to functions with
8871 vulnerable objects.  This includes functions that call @code{alloca}, and
8872 functions with buffers larger than 8 bytes.  The guards are initialized
8873 when a function is entered and then checked when the function exits.
8874 If a guard check fails, an error message is printed and the program exits.
8875
8876 @item -fstack-protector-all
8877 @opindex fstack-protector-all
8878 Like @option{-fstack-protector} except that all functions are protected.
8879
8880 @item -fsection-anchors
8881 @opindex fsection-anchors
8882 Try to reduce the number of symbolic address calculations by using
8883 shared ``anchor'' symbols to address nearby objects.  This transformation
8884 can help to reduce the number of GOT entries and GOT accesses on some
8885 targets.
8886
8887 For example, the implementation of the following function @code{foo}:
8888
8889 @smallexample
8890 static int a, b, c;
8891 int foo (void) @{ return a + b + c; @}
8892 @end smallexample
8893
8894 @noindent
8895 usually calculates the addresses of all three variables, but if you
8896 compile it with @option{-fsection-anchors}, it accesses the variables
8897 from a common anchor point instead.  The effect is similar to the
8898 following pseudocode (which isn't valid C):
8899
8900 @smallexample
8901 int foo (void)
8902 @{
8903   register int *xr = &x;
8904   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8905 @}
8906 @end smallexample
8907
8908 Not all targets support this option.
8909
8910 @item --param @var{name}=@var{value}
8911 @opindex param
8912 In some places, GCC uses various constants to control the amount of
8913 optimization that is done.  For example, GCC does not inline functions
8914 that contain more than a certain number of instructions.  You can
8915 control some of these constants on the command line using the
8916 @option{--param} option.
8917
8918 The names of specific parameters, and the meaning of the values, are
8919 tied to the internals of the compiler, and are subject to change
8920 without notice in future releases.
8921
8922 In each case, the @var{value} is an integer.  The allowable choices for
8923 @var{name} are:
8924
8925 @table @gcctabopt
8926 @item predictable-branch-outcome
8927 When branch is predicted to be taken with probability lower than this threshold
8928 (in percent), then it is considered well predictable. The default is 10.
8929
8930 @item max-crossjump-edges
8931 The maximum number of incoming edges to consider for cross-jumping.
8932 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8933 the number of edges incoming to each block.  Increasing values mean
8934 more aggressive optimization, making the compilation time increase with
8935 probably small improvement in executable size.
8936
8937 @item min-crossjump-insns
8938 The minimum number of instructions that must be matched at the end
8939 of two blocks before cross-jumping is performed on them.  This
8940 value is ignored in the case where all instructions in the block being
8941 cross-jumped from are matched.  The default value is 5.
8942
8943 @item max-grow-copy-bb-insns
8944 The maximum code size expansion factor when copying basic blocks
8945 instead of jumping.  The expansion is relative to a jump instruction.
8946 The default value is 8.
8947
8948 @item max-goto-duplication-insns
8949 The maximum number of instructions to duplicate to a block that jumps
8950 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8951 passes, GCC factors computed gotos early in the compilation process,
8952 and unfactors them as late as possible.  Only computed jumps at the
8953 end of a basic blocks with no more than max-goto-duplication-insns are
8954 unfactored.  The default value is 8.
8955
8956 @item max-delay-slot-insn-search
8957 The maximum number of instructions to consider when looking for an
8958 instruction to fill a delay slot.  If more than this arbitrary number of
8959 instructions are searched, the time savings from filling the delay slot
8960 are minimal, so stop searching.  Increasing values mean more
8961 aggressive optimization, making the compilation time increase with probably
8962 small improvement in execution time.
8963
8964 @item max-delay-slot-live-search
8965 When trying to fill delay slots, the maximum number of instructions to
8966 consider when searching for a block with valid live register
8967 information.  Increasing this arbitrarily chosen value means more
8968 aggressive optimization, increasing the compilation time.  This parameter
8969 should be removed when the delay slot code is rewritten to maintain the
8970 control-flow graph.
8971
8972 @item max-gcse-memory
8973 The approximate maximum amount of memory that can be allocated in
8974 order to perform the global common subexpression elimination
8975 optimization.  If more memory than specified is required, the
8976 optimization is not done.
8977
8978 @item max-gcse-insertion-ratio
8979 If the ratio of expression insertions to deletions is larger than this value
8980 for any expression, then RTL PRE inserts or removes the expression and thus
8981 leaves partially redundant computations in the instruction stream.  The default value is 20.
8982
8983 @item max-pending-list-length
8984 The maximum number of pending dependencies scheduling allows
8985 before flushing the current state and starting over.  Large functions
8986 with few branches or calls can create excessively large lists which
8987 needlessly consume memory and resources.
8988
8989 @item max-modulo-backtrack-attempts
8990 The maximum number of backtrack attempts the scheduler should make
8991 when modulo scheduling a loop.  Larger values can exponentially increase
8992 compilation time.
8993
8994 @item max-inline-insns-single
8995 Several parameters control the tree inliner used in GCC@.
8996 This number sets the maximum number of instructions (counted in GCC's
8997 internal representation) in a single function that the tree inliner
8998 considers for inlining.  This only affects functions declared
8999 inline and methods implemented in a class declaration (C++).
9000 The default value is 400.
9001
9002 @item max-inline-insns-auto
9003 When you use @option{-finline-functions} (included in @option{-O3}),
9004 a lot of functions that would otherwise not be considered for inlining
9005 by the compiler are investigated.  To those functions, a different
9006 (more restrictive) limit compared to functions declared inline can
9007 be applied.
9008 The default value is 40.
9009
9010 @item inline-min-speedup
9011 When estimated performance improvement of caller + callee runtime exceeds this
9012 threshold (in precent), the function can be inlined regardless the limit on
9013 @option{--param max-inline-insns-single} and @option{--param
9014 max-inline-insns-auto}.
9015
9016 @item large-function-insns
9017 The limit specifying really large functions.  For functions larger than this
9018 limit after inlining, inlining is constrained by
9019 @option{--param large-function-growth}.  This parameter is useful primarily
9020 to avoid extreme compilation time caused by non-linear algorithms used by the
9021 back end.
9022 The default value is 2700.
9023
9024 @item large-function-growth
9025 Specifies maximal growth of large function caused by inlining in percents.
9026 The default value is 100 which limits large function growth to 2.0 times
9027 the original size.
9028
9029 @item large-unit-insns
9030 The limit specifying large translation unit.  Growth caused by inlining of
9031 units larger than this limit is limited by @option{--param inline-unit-growth}.
9032 For small units this might be too tight.
9033 For example, consider a unit consisting of function A
9034 that is inline and B that just calls A three times.  If B is small relative to
9035 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9036 large units consisting of small inlineable functions, however, the overall unit
9037 growth limit is needed to avoid exponential explosion of code size.  Thus for
9038 smaller units, the size is increased to @option{--param large-unit-insns}
9039 before applying @option{--param inline-unit-growth}.  The default is 10000.
9040
9041 @item inline-unit-growth
9042 Specifies maximal overall growth of the compilation unit caused by inlining.
9043 The default value is 30 which limits unit growth to 1.3 times the original
9044 size.
9045
9046 @item ipcp-unit-growth
9047 Specifies maximal overall growth of the compilation unit caused by
9048 interprocedural constant propagation.  The default value is 10 which limits
9049 unit growth to 1.1 times the original size.
9050
9051 @item large-stack-frame
9052 The limit specifying large stack frames.  While inlining the algorithm is trying
9053 to not grow past this limit too much.  The default value is 256 bytes.
9054
9055 @item large-stack-frame-growth
9056 Specifies maximal growth of large stack frames caused by inlining in percents.
9057 The default value is 1000 which limits large stack frame growth to 11 times
9058 the original size.
9059
9060 @item max-inline-insns-recursive
9061 @itemx max-inline-insns-recursive-auto
9062 Specifies the maximum number of instructions an out-of-line copy of a
9063 self-recursive inline
9064 function can grow into by performing recursive inlining.
9065
9066 For functions declared inline, @option{--param max-inline-insns-recursive} is
9067 taken into account.  For functions not declared inline, recursive inlining
9068 happens only when @option{-finline-functions} (included in @option{-O3}) is
9069 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
9070 default value is 450.
9071
9072 @item max-inline-recursive-depth
9073 @itemx max-inline-recursive-depth-auto
9074 Specifies the maximum recursion depth used for recursive inlining.
9075
9076 For functions declared inline, @option{--param max-inline-recursive-depth} is
9077 taken into account.  For functions not declared inline, recursive inlining
9078 happens only when @option{-finline-functions} (included in @option{-O3}) is
9079 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
9080 default value is 8.
9081
9082 @item min-inline-recursive-probability
9083 Recursive inlining is profitable only for function having deep recursion
9084 in average and can hurt for function having little recursion depth by
9085 increasing the prologue size or complexity of function body to other
9086 optimizers.
9087
9088 When profile feedback is available (see @option{-fprofile-generate}) the actual
9089 recursion depth can be guessed from probability that function recurses via a
9090 given call expression.  This parameter limits inlining only to call expressions
9091 whose probability exceeds the given threshold (in percents).
9092 The default value is 10.
9093
9094 @item early-inlining-insns
9095 Specify growth that the early inliner can make.  In effect it increases
9096 the amount of inlining for code having a large abstraction penalty.
9097 The default value is 10.
9098
9099 @item max-early-inliner-iterations
9100 @itemx max-early-inliner-iterations
9101 Limit of iterations of the early inliner.  This basically bounds
9102 the number of nested indirect calls the early inliner can resolve.
9103 Deeper chains are still handled by late inlining.
9104
9105 @item comdat-sharing-probability
9106 @itemx comdat-sharing-probability
9107 Probability (in percent) that C++ inline function with comdat visibility
9108 are shared across multiple compilation units.  The default value is 20.
9109
9110 @item min-vect-loop-bound
9111 The minimum number of iterations under which loops are not vectorized
9112 when @option{-ftree-vectorize} is used.  The number of iterations after
9113 vectorization needs to be greater than the value specified by this option
9114 to allow vectorization.  The default value is 0.
9115
9116 @item gcse-cost-distance-ratio
9117 Scaling factor in calculation of maximum distance an expression
9118 can be moved by GCSE optimizations.  This is currently supported only in the
9119 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9120 is with simple expressions, i.e., the expressions that have cost
9121 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9122 hoisting of simple expressions.  The default value is 10.
9123
9124 @item gcse-unrestricted-cost
9125 Cost, roughly measured as the cost of a single typical machine
9126 instruction, at which GCSE optimizations do not constrain
9127 the distance an expression can travel.  This is currently
9128 supported only in the code hoisting pass.  The lesser the cost,
9129 the more aggressive code hoisting is.  Specifying 0 
9130 allows all expressions to travel unrestricted distances.
9131 The default value is 3.
9132
9133 @item max-hoist-depth
9134 The depth of search in the dominator tree for expressions to hoist.
9135 This is used to avoid quadratic behavior in hoisting algorithm.
9136 The value of 0 does not limit on the search, but may slow down compilation
9137 of huge functions.  The default value is 30.
9138
9139 @item max-tail-merge-comparisons
9140 The maximum amount of similar bbs to compare a bb with.  This is used to
9141 avoid quadratic behavior in tree tail merging.  The default value is 10.
9142
9143 @item max-tail-merge-iterations
9144 The maximum amount of iterations of the pass over the function.  This is used to
9145 limit compilation time in tree tail merging.  The default value is 2.
9146
9147 @item max-unrolled-insns
9148 The maximum number of instructions that a loop may have to be unrolled.
9149 If a loop is unrolled, this parameter also determines how many times
9150 the loop code is unrolled.
9151
9152 @item max-average-unrolled-insns
9153 The maximum number of instructions biased by probabilities of their execution
9154 that a loop may have to be unrolled.  If a loop is unrolled,
9155 this parameter also determines how many times the loop code is unrolled.
9156
9157 @item max-unroll-times
9158 The maximum number of unrollings of a single loop.
9159
9160 @item max-peeled-insns
9161 The maximum number of instructions that a loop may have to be peeled.
9162 If a loop is peeled, this parameter also determines how many times
9163 the loop code is peeled.
9164
9165 @item max-peel-times
9166 The maximum number of peelings of a single loop.
9167
9168 @item max-peel-branches
9169 The maximum number of branches on the hot path through the peeled sequence.
9170
9171 @item max-completely-peeled-insns
9172 The maximum number of insns of a completely peeled loop.
9173
9174 @item max-completely-peel-times
9175 The maximum number of iterations of a loop to be suitable for complete peeling.
9176
9177 @item max-completely-peel-loop-nest-depth
9178 The maximum depth of a loop nest suitable for complete peeling.
9179
9180 @item max-unswitch-insns
9181 The maximum number of insns of an unswitched loop.
9182
9183 @item max-unswitch-level
9184 The maximum number of branches unswitched in a single loop.
9185
9186 @item lim-expensive
9187 The minimum cost of an expensive expression in the loop invariant motion.
9188
9189 @item iv-consider-all-candidates-bound
9190 Bound on number of candidates for induction variables, below which
9191 all candidates are considered for each use in induction variable
9192 optimizations.  If there are more candidates than this,
9193 only the most relevant ones are considered to avoid quadratic time complexity.
9194
9195 @item iv-max-considered-uses
9196 The induction variable optimizations give up on loops that contain more
9197 induction variable uses.
9198
9199 @item iv-always-prune-cand-set-bound
9200 If the number of candidates in the set is smaller than this value,
9201 always try to remove unnecessary ivs from the set
9202 when adding a new one.
9203
9204 @item scev-max-expr-size
9205 Bound on size of expressions used in the scalar evolutions analyzer.
9206 Large expressions slow the analyzer.
9207
9208 @item scev-max-expr-complexity
9209 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9210 Complex expressions slow the analyzer.
9211
9212 @item omega-max-vars
9213 The maximum number of variables in an Omega constraint system.
9214 The default value is 128.
9215
9216 @item omega-max-geqs
9217 The maximum number of inequalities in an Omega constraint system.
9218 The default value is 256.
9219
9220 @item omega-max-eqs
9221 The maximum number of equalities in an Omega constraint system.
9222 The default value is 128.
9223
9224 @item omega-max-wild-cards
9225 The maximum number of wildcard variables that the Omega solver is
9226 able to insert.  The default value is 18.
9227
9228 @item omega-hash-table-size
9229 The size of the hash table in the Omega solver.  The default value is
9230 550.
9231
9232 @item omega-max-keys
9233 The maximal number of keys used by the Omega solver.  The default
9234 value is 500.
9235
9236 @item omega-eliminate-redundant-constraints
9237 When set to 1, use expensive methods to eliminate all redundant
9238 constraints.  The default value is 0.
9239
9240 @item vect-max-version-for-alignment-checks
9241 The maximum number of run-time checks that can be performed when
9242 doing loop versioning for alignment in the vectorizer.  See option
9243 @option{-ftree-vect-loop-version} for more information.
9244
9245 @item vect-max-version-for-alias-checks
9246 The maximum number of run-time checks that can be performed when
9247 doing loop versioning for alias in the vectorizer.  See option
9248 @option{-ftree-vect-loop-version} for more information.
9249
9250 @item max-iterations-to-track
9251 The maximum number of iterations of a loop the brute-force algorithm
9252 for analysis of the number of iterations of the loop tries to evaluate.
9253
9254 @item hot-bb-count-ws-permille
9255 A basic block profile count is considered hot if it contributes to 
9256 the given permillage (i.e. 0...1000) of the entire profiled execution.
9257
9258 @item hot-bb-frequency-fraction
9259 Select fraction of the entry block frequency of executions of basic block in
9260 function given basic block needs to have to be considered hot.
9261
9262 @item max-predicted-iterations
9263 The maximum number of loop iterations we predict statically.  This is useful
9264 in cases where a function contains a single loop with known bound and
9265 another loop with unknown bound.
9266 The known number of iterations is predicted correctly, while
9267 the unknown number of iterations average to roughly 10.  This means that the
9268 loop without bounds appears artificially cold relative to the other one.
9269
9270 @item align-threshold
9271
9272 Select fraction of the maximal frequency of executions of a basic block in
9273 a function to align the basic block.
9274
9275 @item align-loop-iterations
9276
9277 A loop expected to iterate at least the selected number of iterations is
9278 aligned.
9279
9280 @item tracer-dynamic-coverage
9281 @itemx tracer-dynamic-coverage-feedback
9282
9283 This value is used to limit superblock formation once the given percentage of
9284 executed instructions is covered.  This limits unnecessary code size
9285 expansion.
9286
9287 The @option{tracer-dynamic-coverage-feedback} is used only when profile
9288 feedback is available.  The real profiles (as opposed to statically estimated
9289 ones) are much less balanced allowing the threshold to be larger value.
9290
9291 @item tracer-max-code-growth
9292 Stop tail duplication once code growth has reached given percentage.  This is
9293 a rather artificial limit, as most of the duplicates are eliminated later in
9294 cross jumping, so it may be set to much higher values than is the desired code
9295 growth.
9296
9297 @item tracer-min-branch-ratio
9298
9299 Stop reverse growth when the reverse probability of best edge is less than this
9300 threshold (in percent).
9301
9302 @item tracer-min-branch-ratio
9303 @itemx tracer-min-branch-ratio-feedback
9304
9305 Stop forward growth if the best edge has probability lower than this
9306 threshold.
9307
9308 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
9309 compilation for profile feedback and one for compilation without.  The value
9310 for compilation with profile feedback needs to be more conservative (higher) in
9311 order to make tracer effective.
9312
9313 @item max-cse-path-length
9314
9315 The maximum number of basic blocks on path that CSE considers.
9316 The default is 10.
9317
9318 @item max-cse-insns
9319 The maximum number of instructions CSE processes before flushing.
9320 The default is 1000.
9321
9322 @item ggc-min-expand
9323
9324 GCC uses a garbage collector to manage its own memory allocation.  This
9325 parameter specifies the minimum percentage by which the garbage
9326 collector's heap should be allowed to expand between collections.
9327 Tuning this may improve compilation speed; it has no effect on code
9328 generation.
9329
9330 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9331 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9332 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9333 GCC is not able to calculate RAM on a particular platform, the lower
9334 bound of 30% is used.  Setting this parameter and
9335 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9336 every opportunity.  This is extremely slow, but can be useful for
9337 debugging.
9338
9339 @item ggc-min-heapsize
9340
9341 Minimum size of the garbage collector's heap before it begins bothering
9342 to collect garbage.  The first collection occurs after the heap expands
9343 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9344 tuning this may improve compilation speed, and has no effect on code
9345 generation.
9346
9347 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9348 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9349 with a lower bound of 4096 (four megabytes) and an upper bound of
9350 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9351 particular platform, the lower bound is used.  Setting this parameter
9352 very large effectively disables garbage collection.  Setting this
9353 parameter and @option{ggc-min-expand} to zero causes a full collection
9354 to occur at every opportunity.
9355
9356 @item max-reload-search-insns
9357 The maximum number of instruction reload should look backward for equivalent
9358 register.  Increasing values mean more aggressive optimization, making the
9359 compilation time increase with probably slightly better performance.
9360 The default value is 100.
9361
9362 @item max-cselib-memory-locations
9363 The maximum number of memory locations cselib should take into account.
9364 Increasing values mean more aggressive optimization, making the compilation time
9365 increase with probably slightly better performance.  The default value is 500.
9366
9367 @item reorder-blocks-duplicate
9368 @itemx reorder-blocks-duplicate-feedback
9369
9370 Used by the basic block reordering pass to decide whether to use unconditional
9371 branch or duplicate the code on its destination.  Code is duplicated when its
9372 estimated size is smaller than this value multiplied by the estimated size of
9373 unconditional jump in the hot spots of the program.
9374
9375 The @option{reorder-block-duplicate-feedback} is used only when profile
9376 feedback is available.  It may be set to higher values than
9377 @option{reorder-block-duplicate} since information about the hot spots is more
9378 accurate.
9379
9380 @item max-sched-ready-insns
9381 The maximum number of instructions ready to be issued the scheduler should
9382 consider at any given time during the first scheduling pass.  Increasing
9383 values mean more thorough searches, making the compilation time increase
9384 with probably little benefit.  The default value is 100.
9385
9386 @item max-sched-region-blocks
9387 The maximum number of blocks in a region to be considered for
9388 interblock scheduling.  The default value is 10.
9389
9390 @item max-pipeline-region-blocks
9391 The maximum number of blocks in a region to be considered for
9392 pipelining in the selective scheduler.  The default value is 15.
9393
9394 @item max-sched-region-insns
9395 The maximum number of insns in a region to be considered for
9396 interblock scheduling.  The default value is 100.
9397
9398 @item max-pipeline-region-insns
9399 The maximum number of insns in a region to be considered for
9400 pipelining in the selective scheduler.  The default value is 200.
9401
9402 @item min-spec-prob
9403 The minimum probability (in percents) of reaching a source block
9404 for interblock speculative scheduling.  The default value is 40.
9405
9406 @item max-sched-extend-regions-iters
9407 The maximum number of iterations through CFG to extend regions.
9408 A value of 0 (the default) disables region extensions.
9409
9410 @item max-sched-insn-conflict-delay
9411 The maximum conflict delay for an insn to be considered for speculative motion.
9412 The default value is 3.
9413
9414 @item sched-spec-prob-cutoff
9415 The minimal probability of speculation success (in percents), so that
9416 speculative insns are scheduled.
9417 The default value is 40.
9418
9419 @item sched-spec-state-edge-prob-cutoff
9420 The minimum probability an edge must have for the scheduler to save its
9421 state across it.
9422 The default value is 10.
9423
9424 @item sched-mem-true-dep-cost
9425 Minimal distance (in CPU cycles) between store and load targeting same
9426 memory locations.  The default value is 1.
9427
9428 @item selsched-max-lookahead
9429 The maximum size of the lookahead window of selective scheduling.  It is a
9430 depth of search for available instructions.
9431 The default value is 50.
9432
9433 @item selsched-max-sched-times
9434 The maximum number of times that an instruction is scheduled during
9435 selective scheduling.  This is the limit on the number of iterations
9436 through which the instruction may be pipelined.  The default value is 2.
9437
9438 @item selsched-max-insns-to-rename
9439 The maximum number of best instructions in the ready list that are considered
9440 for renaming in the selective scheduler.  The default value is 2.
9441
9442 @item sms-min-sc
9443 The minimum value of stage count that swing modulo scheduler
9444 generates.  The default value is 2.
9445
9446 @item max-last-value-rtl
9447 The maximum size measured as number of RTLs that can be recorded in an expression
9448 in combiner for a pseudo register as last known value of that register.  The default
9449 is 10000.
9450
9451 @item integer-share-limit
9452 Small integer constants can use a shared data structure, reducing the
9453 compiler's memory usage and increasing its speed.  This sets the maximum
9454 value of a shared integer constant.  The default value is 256.
9455
9456 @item ssp-buffer-size
9457 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9458 protection when @option{-fstack-protection} is used.
9459
9460 @item max-jump-thread-duplication-stmts
9461 Maximum number of statements allowed in a block that needs to be
9462 duplicated when threading jumps.
9463
9464 @item max-fields-for-field-sensitive
9465 Maximum number of fields in a structure treated in
9466 a field sensitive manner during pointer analysis.  The default is zero
9467 for @option{-O0} and @option{-O1},
9468 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9469
9470 @item prefetch-latency
9471 Estimate on average number of instructions that are executed before
9472 prefetch finishes.  The distance prefetched ahead is proportional
9473 to this constant.  Increasing this number may also lead to less
9474 streams being prefetched (see @option{simultaneous-prefetches}).
9475
9476 @item simultaneous-prefetches
9477 Maximum number of prefetches that can run at the same time.
9478
9479 @item l1-cache-line-size
9480 The size of cache line in L1 cache, in bytes.
9481
9482 @item l1-cache-size
9483 The size of L1 cache, in kilobytes.
9484
9485 @item l2-cache-size
9486 The size of L2 cache, in kilobytes.
9487
9488 @item min-insn-to-prefetch-ratio
9489 The minimum ratio between the number of instructions and the
9490 number of prefetches to enable prefetching in a loop.
9491
9492 @item prefetch-min-insn-to-mem-ratio
9493 The minimum ratio between the number of instructions and the
9494 number of memory references to enable prefetching in a loop.
9495
9496 @item use-canonical-types
9497 Whether the compiler should use the ``canonical'' type system.  By
9498 default, this should always be 1, which uses a more efficient internal
9499 mechanism for comparing types in C++ and Objective-C++.  However, if
9500 bugs in the canonical type system are causing compilation failures,
9501 set this value to 0 to disable canonical types.
9502
9503 @item switch-conversion-max-branch-ratio
9504 Switch initialization conversion refuses to create arrays that are
9505 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9506 branches in the switch.
9507
9508 @item max-partial-antic-length
9509 Maximum length of the partial antic set computed during the tree
9510 partial redundancy elimination optimization (@option{-ftree-pre}) when
9511 optimizing at @option{-O3} and above.  For some sorts of source code
9512 the enhanced partial redundancy elimination optimization can run away,
9513 consuming all of the memory available on the host machine.  This
9514 parameter sets a limit on the length of the sets that are computed,
9515 which prevents the runaway behavior.  Setting a value of 0 for
9516 this parameter allows an unlimited set length.
9517
9518 @item sccvn-max-scc-size
9519 Maximum size of a strongly connected component (SCC) during SCCVN
9520 processing.  If this limit is hit, SCCVN processing for the whole
9521 function is not done and optimizations depending on it are
9522 disabled.  The default maximum SCC size is 10000.
9523
9524 @item sccvn-max-alias-queries-per-access
9525 Maximum number of alias-oracle queries we perform when looking for
9526 redundancies for loads and stores.  If this limit is hit the search
9527 is aborted and the load or store is not considered redundant.  The
9528 number of queries is algorithmically limited to the number of
9529 stores on all paths from the load to the function entry.
9530 The default maxmimum number of queries is 1000.
9531
9532 @item ira-max-loops-num
9533 IRA uses regional register allocation by default.  If a function
9534 contains more loops than the number given by this parameter, only at most
9535 the given number of the most frequently-executed loops form regions
9536 for regional register allocation.  The default value of the
9537 parameter is 100.
9538
9539 @item ira-max-conflict-table-size 
9540 Although IRA uses a sophisticated algorithm to compress the conflict
9541 table, the table can still require excessive amounts of memory for
9542 huge functions.  If the conflict table for a function could be more
9543 than the size in MB given by this parameter, the register allocator
9544 instead uses a faster, simpler, and lower-quality
9545 algorithm that does not require building a pseudo-register conflict table.  
9546 The default value of the parameter is 2000.
9547
9548 @item ira-loop-reserved-regs
9549 IRA can be used to evaluate more accurate register pressure in loops
9550 for decisions to move loop invariants (see @option{-O3}).  The number
9551 of available registers reserved for some other purposes is given
9552 by this parameter.  The default value of the parameter is 2, which is
9553 the minimal number of registers needed by typical instructions.
9554 This value is the best found from numerous experiments.
9555
9556 @item loop-invariant-max-bbs-in-loop
9557 Loop invariant motion can be very expensive, both in compilation time and
9558 in amount of needed compile-time memory, with very large loops.  Loops
9559 with more basic blocks than this parameter won't have loop invariant
9560 motion optimization performed on them.  The default value of the
9561 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9562
9563 @item loop-max-datarefs-for-datadeps
9564 Building data dapendencies is expensive for very large loops.  This
9565 parameter limits the number of data references in loops that are
9566 considered for data dependence analysis.  These large loops are no
9567 handled by the optimizations using loop data dependencies.
9568 The default value is 1000.
9569
9570 @item max-vartrack-size
9571 Sets a maximum number of hash table slots to use during variable
9572 tracking dataflow analysis of any function.  If this limit is exceeded
9573 with variable tracking at assignments enabled, analysis for that
9574 function is retried without it, after removing all debug insns from
9575 the function.  If the limit is exceeded even without debug insns, var
9576 tracking analysis is completely disabled for the function.  Setting
9577 the parameter to zero makes it unlimited.
9578
9579 @item max-vartrack-expr-depth
9580 Sets a maximum number of recursion levels when attempting to map
9581 variable names or debug temporaries to value expressions.  This trades
9582 compilation time for more complete debug information.  If this is set too
9583 low, value expressions that are available and could be represented in
9584 debug information may end up not being used; setting this higher may
9585 enable the compiler to find more complex debug expressions, but compile
9586 time and memory use may grow.  The default is 12.
9587
9588 @item min-nondebug-insn-uid
9589 Use uids starting at this parameter for nondebug insns.  The range below
9590 the parameter is reserved exclusively for debug insns created by
9591 @option{-fvar-tracking-assignments}, but debug insns may get
9592 (non-overlapping) uids above it if the reserved range is exhausted.
9593
9594 @item ipa-sra-ptr-growth-factor
9595 IPA-SRA replaces a pointer to an aggregate with one or more new
9596 parameters only when their cumulative size is less or equal to
9597 @option{ipa-sra-ptr-growth-factor} times the size of the original
9598 pointer parameter.
9599
9600 @item tm-max-aggregate-size
9601 When making copies of thread-local variables in a transaction, this
9602 parameter specifies the size in bytes after which variables are
9603 saved with the logging functions as opposed to save/restore code
9604 sequence pairs.  This option only applies when using
9605 @option{-fgnu-tm}.
9606
9607 @item graphite-max-nb-scop-params
9608 To avoid exponential effects in the Graphite loop transforms, the
9609 number of parameters in a Static Control Part (SCoP) is bounded.  The
9610 default value is 10 parameters.  A variable whose value is unknown at
9611 compilation time and defined outside a SCoP is a parameter of the SCoP.
9612
9613 @item graphite-max-bbs-per-function
9614 To avoid exponential effects in the detection of SCoPs, the size of
9615 the functions analyzed by Graphite is bounded.  The default value is
9616 100 basic blocks.
9617
9618 @item loop-block-tile-size
9619 Loop blocking or strip mining transforms, enabled with
9620 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9621 loop in the loop nest by a given number of iterations.  The strip
9622 length can be changed using the @option{loop-block-tile-size}
9623 parameter.  The default value is 51 iterations.
9624
9625 @item ipa-cp-value-list-size
9626 IPA-CP attempts to track all possible values and types passed to a function's
9627 parameter in order to propagate them and perform devirtualization.
9628 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9629 stores per one formal parameter of a function.
9630
9631 @item lto-partitions
9632 Specify desired number of partitions produced during WHOPR compilation.
9633 The number of partitions should exceed the number of CPUs used for compilation.
9634 The default value is 32.
9635
9636 @item lto-minpartition
9637 Size of minimal partition for WHOPR (in estimated instructions).
9638 This prevents expenses of splitting very small programs into too many
9639 partitions.
9640
9641 @item cxx-max-namespaces-for-diagnostic-help
9642 The maximum number of namespaces to consult for suggestions when C++
9643 name lookup fails for an identifier.  The default is 1000.
9644
9645 @item sink-frequency-threshold
9646 The maximum relative execution frequency (in percents) of the target block
9647 relative to a statement's original block to allow statement sinking of a
9648 statement.  Larger numbers result in more aggressive statement sinking.
9649 The default value is 75.  A small positive adjustment is applied for
9650 statements with memory operands as those are even more profitable so sink.
9651
9652 @item max-stores-to-sink
9653 The maximum number of conditional stores paires that can be sunk.  Set to 0
9654 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9655 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9656
9657 @item allow-load-data-races
9658 Allow optimizers to introduce new data races on loads.
9659 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9660 unless implicitly set by the @option{-fmemory-model=} option.
9661
9662 @item allow-store-data-races
9663 Allow optimizers to introduce new data races on stores.
9664 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9665 unless implicitly set by the @option{-fmemory-model=} option.
9666
9667 @item allow-packed-load-data-races
9668 Allow optimizers to introduce new data races on packed data loads.
9669 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9670 unless implicitly set by the @option{-fmemory-model=} option.
9671
9672 @item allow-packed-store-data-races
9673 Allow optimizers to introduce new data races on packed data stores.
9674 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9675 unless implicitly set by the @option{-fmemory-model=} option.
9676
9677 @item case-values-threshold
9678 The smallest number of different values for which it is best to use a
9679 jump-table instead of a tree of conditional branches.  If the value is
9680 0, use the default for the machine.  The default is 0.
9681
9682 @item tree-reassoc-width
9683 Set the maximum number of instructions executed in parallel in
9684 reassociated tree. This parameter overrides target dependent
9685 heuristics used by default if has non zero value.
9686
9687 @item sched-pressure-algorithm
9688 Choose between the two available implementations of
9689 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
9690 and is the more likely to prevent instructions from being reordered.
9691 Algorithm 2 was designed to be a compromise between the relatively
9692 conservative approach taken by algorithm 1 and the rather aggressive
9693 approach taken by the default scheduler.  It relies more heavily on
9694 having a regular register file and accurate register pressure classes.
9695 See @file{haifa-sched.c} in the GCC sources for more details.
9696
9697 The default choice depends on the target.
9698
9699 @item max-slsr-cand-scan
9700 Set the maximum number of existing candidates that will be considered when
9701 seeking a basis for a new straight-line strength reduction candidate.
9702
9703 @end table
9704 @end table
9705
9706 @node Preprocessor Options
9707 @section Options Controlling the Preprocessor
9708 @cindex preprocessor options
9709 @cindex options, preprocessor
9710
9711 These options control the C preprocessor, which is run on each C source
9712 file before actual compilation.
9713
9714 If you use the @option{-E} option, nothing is done except preprocessing.
9715 Some of these options make sense only together with @option{-E} because
9716 they cause the preprocessor output to be unsuitable for actual
9717 compilation.
9718
9719 @table @gcctabopt
9720 @item -Wp,@var{option}
9721 @opindex Wp
9722 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9723 and pass @var{option} directly through to the preprocessor.  If
9724 @var{option} contains commas, it is split into multiple options at the
9725 commas.  However, many options are modified, translated or interpreted
9726 by the compiler driver before being passed to the preprocessor, and
9727 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9728 interface is undocumented and subject to change, so whenever possible
9729 you should avoid using @option{-Wp} and let the driver handle the
9730 options instead.
9731
9732 @item -Xpreprocessor @var{option}
9733 @opindex Xpreprocessor
9734 Pass @var{option} as an option to the preprocessor.  You can use this to
9735 supply system-specific preprocessor options that GCC does not 
9736 recognize.
9737
9738 If you want to pass an option that takes an argument, you must use
9739 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9740
9741 @item -no-integrated-cpp
9742 @opindex no-integrated-cpp
9743 Perform preprocessing as a separate pass before compilation.
9744 By default, GCC performs preprocessing as an integrated part of
9745 input tokenization and parsing.
9746 If this option is provided, the appropriate language front end
9747 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
9748 and Objective-C, respectively) is instead invoked twice,
9749 once for preprocessing only and once for actual compilation
9750 of the preprocessed input.
9751 This option may be useful in conjunction with the @option{-B} or
9752 @option{-wrapper} options to specify an alternate preprocessor or
9753 perform additional processing of the program source between
9754 normal preprocessing and compilation.
9755 @end table
9756
9757 @include cppopts.texi
9758
9759 @node Assembler Options
9760 @section Passing Options to the Assembler
9761
9762 @c prevent bad page break with this line
9763 You can pass options to the assembler.
9764
9765 @table @gcctabopt
9766 @item -Wa,@var{option}
9767 @opindex Wa
9768 Pass @var{option} as an option to the assembler.  If @var{option}
9769 contains commas, it is split into multiple options at the commas.
9770
9771 @item -Xassembler @var{option}
9772 @opindex Xassembler
9773 Pass @var{option} as an option to the assembler.  You can use this to
9774 supply system-specific assembler options that GCC does not
9775 recognize.
9776
9777 If you want to pass an option that takes an argument, you must use
9778 @option{-Xassembler} twice, once for the option and once for the argument.
9779
9780 @end table
9781
9782 @node Link Options
9783 @section Options for Linking
9784 @cindex link options
9785 @cindex options, linking
9786
9787 These options come into play when the compiler links object files into
9788 an executable output file.  They are meaningless if the compiler is
9789 not doing a link step.
9790
9791 @table @gcctabopt
9792 @cindex file names
9793 @item @var{object-file-name}
9794 A file name that does not end in a special recognized suffix is
9795 considered to name an object file or library.  (Object files are
9796 distinguished from libraries by the linker according to the file
9797 contents.)  If linking is done, these object files are used as input
9798 to the linker.
9799
9800 @item -c
9801 @itemx -S
9802 @itemx -E
9803 @opindex c
9804 @opindex S
9805 @opindex E
9806 If any of these options is used, then the linker is not run, and
9807 object file names should not be used as arguments.  @xref{Overall
9808 Options}.
9809
9810 @cindex Libraries
9811 @item -l@var{library}
9812 @itemx -l @var{library}
9813 @opindex l
9814 Search the library named @var{library} when linking.  (The second
9815 alternative with the library as a separate argument is only for
9816 POSIX compliance and is not recommended.)
9817
9818 It makes a difference where in the command you write this option; the
9819 linker searches and processes libraries and object files in the order they
9820 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9821 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9822 to functions in @samp{z}, those functions may not be loaded.
9823
9824 The linker searches a standard list of directories for the library,
9825 which is actually a file named @file{lib@var{library}.a}.  The linker
9826 then uses this file as if it had been specified precisely by name.
9827
9828 The directories searched include several standard system directories
9829 plus any that you specify with @option{-L}.
9830
9831 Normally the files found this way are library files---archive files
9832 whose members are object files.  The linker handles an archive file by
9833 scanning through it for members which define symbols that have so far
9834 been referenced but not defined.  But if the file that is found is an
9835 ordinary object file, it is linked in the usual fashion.  The only
9836 difference between using an @option{-l} option and specifying a file name
9837 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9838 and searches several directories.
9839
9840 @item -lobjc
9841 @opindex lobjc
9842 You need this special case of the @option{-l} option in order to
9843 link an Objective-C or Objective-C++ program.
9844
9845 @item -nostartfiles
9846 @opindex nostartfiles
9847 Do not use the standard system startup files when linking.
9848 The standard system libraries are used normally, unless @option{-nostdlib}
9849 or @option{-nodefaultlibs} is used.
9850
9851 @item -nodefaultlibs
9852 @opindex nodefaultlibs
9853 Do not use the standard system libraries when linking.
9854 Only the libraries you specify are passed to the linker, and options
9855 specifying linkage of the system libraries, such as @code{-static-libgcc}
9856 or @code{-shared-libgcc}, are ignored.  
9857 The standard startup files are used normally, unless @option{-nostartfiles}
9858 is used.  
9859
9860 The compiler may generate calls to @code{memcmp},
9861 @code{memset}, @code{memcpy} and @code{memmove}.
9862 These entries are usually resolved by entries in
9863 libc.  These entry points should be supplied through some other
9864 mechanism when this option is specified.
9865
9866 @item -nostdlib
9867 @opindex nostdlib
9868 Do not use the standard system startup files or libraries when linking.
9869 No startup files and only the libraries you specify are passed to
9870 the linker, and options specifying linkage of the system libraries, such as
9871 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
9872
9873 The compiler may generate calls to @code{memcmp}, @code{memset},
9874 @code{memcpy} and @code{memmove}.
9875 These entries are usually resolved by entries in
9876 libc.  These entry points should be supplied through some other
9877 mechanism when this option is specified.
9878
9879 @cindex @option{-lgcc}, use with @option{-nostdlib}
9880 @cindex @option{-nostdlib} and unresolved references
9881 @cindex unresolved references and @option{-nostdlib}
9882 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9883 @cindex @option{-nodefaultlibs} and unresolved references
9884 @cindex unresolved references and @option{-nodefaultlibs}
9885 One of the standard libraries bypassed by @option{-nostdlib} and
9886 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9887 which GCC uses to overcome shortcomings of particular machines, or special
9888 needs for some languages.
9889 (@xref{Interface,,Interfacing to GCC Output,@value{fngccint},GNU Compiler
9890 Collection (GCC) Internals},
9891 for more discussion of @file{libgcc.a}.)
9892 In most cases, you need @file{libgcc.a} even when you want to avoid
9893 other standard libraries.  In other words, when you specify @option{-nostdlib}
9894 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9895 This ensures that you have no unresolved references to internal GCC
9896 library subroutines.
9897 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
9898 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
9899 GNU Compiler Collection (GCC) Internals}.)
9900
9901 @item -pie
9902 @opindex pie
9903 Produce a position independent executable on targets that support it.
9904 For predictable results, you must also specify the same set of options
9905 used for compilation (@option{-fpie}, @option{-fPIE},
9906 or model suboptions) when you specify this linker option.
9907
9908 @item -rdynamic
9909 @opindex rdynamic
9910 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9911 that support it. This instructs the linker to add all symbols, not
9912 only used ones, to the dynamic symbol table. This option is needed
9913 for some uses of @code{dlopen} or to allow obtaining backtraces
9914 from within a program.
9915
9916 @item -s
9917 @opindex s
9918 Remove all symbol table and relocation information from the executable.
9919
9920 @item -static
9921 @opindex static
9922 On systems that support dynamic linking, this prevents linking with the shared
9923 libraries.  On other systems, this option has no effect.
9924
9925 @item -shared
9926 @opindex shared
9927 Produce a shared object which can then be linked with other objects to
9928 form an executable.  Not all systems support this option.  For predictable
9929 results, you must also specify the same set of options used for compilation
9930 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
9931 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
9932 needs to build supplementary stub code for constructors to work.  On
9933 multi-libbed systems, @samp{gcc -shared} must select the correct support
9934 libraries to link against.  Failing to supply the correct flags may lead
9935 to subtle defects.  Supplying them in cases where they are not necessary
9936 is innocuous.}
9937
9938 @item -shared-libgcc
9939 @itemx -static-libgcc
9940 @opindex shared-libgcc
9941 @opindex static-libgcc
9942 On systems that provide @file{libgcc} as a shared library, these options
9943 force the use of either the shared or static version, respectively.
9944 If no shared version of @file{libgcc} was built when the compiler was
9945 configured, these options have no effect.
9946
9947 There are several situations in which an application should use the
9948 shared @file{libgcc} instead of the static version.  The most common
9949 of these is when the application wishes to throw and catch exceptions
9950 across different shared libraries.  In that case, each of the libraries
9951 as well as the application itself should use the shared @file{libgcc}.
9952
9953 Therefore, the G++ and GCJ drivers automatically add
9954 @option{-shared-libgcc} whenever you build a shared library or a main
9955 executable, because C++ and Java programs typically use exceptions, so
9956 this is the right thing to do.
9957
9958 If, instead, you use the GCC driver to create shared libraries, you may
9959 find that they are not always linked with the shared @file{libgcc}.
9960 If GCC finds, at its configuration time, that you have a non-GNU linker
9961 or a GNU linker that does not support option @option{--eh-frame-hdr},
9962 it links the shared version of @file{libgcc} into shared libraries
9963 by default.  Otherwise, it takes advantage of the linker and optimizes
9964 away the linking with the shared version of @file{libgcc}, linking with
9965 the static version of libgcc by default.  This allows exceptions to
9966 propagate through such shared libraries, without incurring relocation
9967 costs at library load time.
9968
9969 However, if a library or main executable is supposed to throw or catch
9970 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9971 for the languages used in the program, or using the option
9972 @option{-shared-libgcc}, such that it is linked with the shared
9973 @file{libgcc}.
9974
9975 @item -static-libasan
9976 When the @option{-fsanitize=address} option is used to link a program,
9977 the GCC driver automatically links against @option{libasan}.  If
9978 @file{libasan} is available as a shared library, and the @option{-static}
9979 option is not used, then this links against the shared version of
9980 @file{libasan}.  The @option{-static-libasan} option directs the GCC
9981 driver to link @file{libasan} statically, without necessarily linking
9982 other libraries statically.
9983
9984 @item -static-libtsan
9985 When the @option{-fsanitize=thread} option is used to link a program,
9986 the GCC driver automatically links against @option{libtsan}.  If
9987 @file{libtsan} is available as a shared library, and the @option{-static}
9988 option is not used, then this links against the shared version of
9989 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
9990 driver to link @file{libtsan} statically, without necessarily linking
9991 other libraries statically.
9992
9993 @item -static-libstdc++
9994 When the @command{g++} program is used to link a C++ program, it
9995 normally automatically links against @option{libstdc++}.  If
9996 @file{libstdc++} is available as a shared library, and the
9997 @option{-static} option is not used, then this links against the
9998 shared version of @file{libstdc++}.  That is normally fine.  However, it
9999 is sometimes useful to freeze the version of @file{libstdc++} used by
10000 the program without going all the way to a fully static link.  The
10001 @option{-static-libstdc++} option directs the @command{g++} driver to
10002 link @file{libstdc++} statically, without necessarily linking other
10003 libraries statically.
10004
10005 @item -symbolic
10006 @opindex symbolic
10007 Bind references to global symbols when building a shared object.  Warn
10008 about any unresolved references (unless overridden by the link editor
10009 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10010 this option.
10011
10012 @item -T @var{script}
10013 @opindex T
10014 @cindex linker script
10015 Use @var{script} as the linker script.  This option is supported by most
10016 systems using the GNU linker.  On some targets, such as bare-board
10017 targets without an operating system, the @option{-T} option may be required
10018 when linking to avoid references to undefined symbols.
10019
10020 @item -Xlinker @var{option}
10021 @opindex Xlinker
10022 Pass @var{option} as an option to the linker.  You can use this to
10023 supply system-specific linker options that GCC does not recognize.
10024
10025 If you want to pass an option that takes a separate argument, you must use
10026 @option{-Xlinker} twice, once for the option and once for the argument.
10027 For example, to pass @option{-assert definitions}, you must write
10028 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10029 @option{-Xlinker "-assert definitions"}, because this passes the entire
10030 string as a single argument, which is not what the linker expects.
10031
10032 When using the GNU linker, it is usually more convenient to pass
10033 arguments to linker options using the @option{@var{option}=@var{value}}
10034 syntax than as separate arguments.  For example, you can specify
10035 @option{-Xlinker -Map=output.map} rather than
10036 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10037 this syntax for command-line options.
10038
10039 @item -Wl,@var{option}
10040 @opindex Wl
10041 Pass @var{option} as an option to the linker.  If @var{option} contains
10042 commas, it is split into multiple options at the commas.  You can use this
10043 syntax to pass an argument to the option.
10044 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10045 linker.  When using the GNU linker, you can also get the same effect with
10046 @option{-Wl,-Map=output.map}.
10047
10048 @item -u @var{symbol}
10049 @opindex u
10050 Pretend the symbol @var{symbol} is undefined, to force linking of
10051 library modules to define it.  You can use @option{-u} multiple times with
10052 different symbols to force loading of additional library modules.
10053 @end table
10054
10055 @node Directory Options
10056 @section Options for Directory Search
10057 @cindex directory options
10058 @cindex options, directory search
10059 @cindex search path
10060
10061 These options specify directories to search for header files, for
10062 libraries and for parts of the compiler:
10063
10064 @table @gcctabopt
10065 @item -I@var{dir}
10066 @opindex I
10067 Add the directory @var{dir} to the head of the list of directories to be
10068 searched for header files.  This can be used to override a system header
10069 file, substituting your own version, since these directories are
10070 searched before the system header file directories.  However, you should
10071 not use this option to add directories that contain vendor-supplied
10072 system header files (use @option{-isystem} for that).  If you use more than
10073 one @option{-I} option, the directories are scanned in left-to-right
10074 order; the standard system directories come after.
10075
10076 If a standard system include directory, or a directory specified with
10077 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10078 option is ignored.  The directory is still searched but as a
10079 system directory at its normal position in the system include chain.
10080 This is to ensure that GCC's procedure to fix buggy system headers and
10081 the ordering for the @code{include_next} directive are not inadvertently changed.
10082 If you really need to change the search order for system directories,
10083 use the @option{-nostdinc} and/or @option{-isystem} options.
10084
10085 @item -iplugindir=@var{dir}
10086 Set the directory to search for plugins that are passed
10087 by @option{-fplugin=@var{name}} instead of
10088 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10089 to be used by the user, but only passed by the driver.
10090
10091 @item -iquote@var{dir}
10092 @opindex iquote
10093 Add the directory @var{dir} to the head of the list of directories to
10094 be searched for header files only for the case of @samp{#include
10095 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
10096 otherwise just like @option{-I}.
10097
10098 @item -L@var{dir}
10099 @opindex L
10100 Add directory @var{dir} to the list of directories to be searched
10101 for @option{-l}.
10102
10103 @item -B@var{prefix}
10104 @opindex B
10105 This option specifies where to find the executables, libraries,
10106 include files, and data files of the compiler itself.
10107
10108 The compiler driver program runs one or more of the subprograms
10109 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10110 @var{prefix} as a prefix for each program it tries to run, both with and
10111 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
10112
10113 For each subprogram to be run, the compiler driver first tries the
10114 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10115 is not specified, the driver tries two standard prefixes, 
10116 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10117 those results in a file name that is found, the unmodified program
10118 name is searched for using the directories specified in your
10119 @env{PATH} environment variable.
10120
10121 The compiler checks to see if the path provided by the @option{-B}
10122 refers to a directory, and if necessary it adds a directory
10123 separator character at the end of the path.
10124
10125 @option{-B} prefixes that effectively specify directory names also apply
10126 to libraries in the linker, because the compiler translates these
10127 options into @option{-L} options for the linker.  They also apply to
10128 includes files in the preprocessor, because the compiler translates these
10129 options into @option{-isystem} options for the preprocessor.  In this case,
10130 the compiler appends @samp{include} to the prefix.
10131
10132 The runtime support file @file{libgcc.a} can also be searched for using
10133 the @option{-B} prefix, if needed.  If it is not found there, the two
10134 standard prefixes above are tried, and that is all.  The file is left
10135 out of the link if it is not found by those means.
10136
10137 Another way to specify a prefix much like the @option{-B} prefix is to use
10138 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10139 Variables}.
10140
10141 As a special kludge, if the path provided by @option{-B} is
10142 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10143 9, then it is replaced by @file{[dir/]include}.  This is to help
10144 with boot-strapping the compiler.
10145
10146 @item -specs=@var{file}
10147 @opindex specs
10148 Process @var{file} after the compiler reads in the standard @file{specs}
10149 file, in order to override the defaults which the @command{gcc} driver
10150 program uses when determining what switches to pass to @command{cc1},
10151 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
10152 @option{-specs=@var{file}} can be specified on the command line, and they
10153 are processed in order, from left to right.
10154
10155 @item --sysroot=@var{dir}
10156 @opindex sysroot
10157 Use @var{dir} as the logical root directory for headers and libraries.
10158 For example, if the compiler normally searches for headers in
10159 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
10160 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
10161
10162 If you use both this option and the @option{-isysroot} option, then
10163 the @option{--sysroot} option applies to libraries, but the
10164 @option{-isysroot} option applies to header files.
10165
10166 The GNU linker (beginning with version 2.16) has the necessary support
10167 for this option.  If your linker does not support this option, the
10168 header file aspect of @option{--sysroot} still works, but the
10169 library aspect does not.
10170
10171 @item --no-sysroot-suffix
10172 @opindex no-sysroot-suffix
10173 For some targets, a suffix is added to the root directory specified
10174 with @option{--sysroot}, depending on the other options used, so that
10175 headers may for example be found in
10176 @file{@var{dir}/@var{suffix}/usr/include} instead of
10177 @file{@var{dir}/usr/include}.  This option disables the addition of
10178 such a suffix.
10179
10180 @item -I-
10181 @opindex I-
10182 This option has been deprecated.  Please use @option{-iquote} instead for
10183 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
10184 Any directories you specify with @option{-I} options before the @option{-I-}
10185 option are searched only for the case of @samp{#include "@var{file}"};
10186 they are not searched for @samp{#include <@var{file}>}.
10187
10188 If additional directories are specified with @option{-I} options after
10189 the @option{-I-}, these directories are searched for all @samp{#include}
10190 directives.  (Ordinarily @emph{all} @option{-I} directories are used
10191 this way.)
10192
10193 In addition, the @option{-I-} option inhibits the use of the current
10194 directory (where the current input file came from) as the first search
10195 directory for @samp{#include "@var{file}"}.  There is no way to
10196 override this effect of @option{-I-}.  With @option{-I.} you can specify
10197 searching the directory that is current when the compiler is
10198 invoked.  That is not exactly the same as what the preprocessor does
10199 by default, but it is often satisfactory.
10200
10201 @option{-I-} does not inhibit the use of the standard system directories
10202 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
10203 independent.
10204 @end table
10205
10206 @c man end
10207
10208 @node Spec Files
10209 @section Specifying subprocesses and the switches to pass to them
10210 @cindex Spec Files
10211
10212 @command{gcc} is a driver program.  It performs its job by invoking a
10213 sequence of other programs to do the work of compiling, assembling and
10214 linking.  GCC interprets its command-line parameters and uses these to
10215 deduce which programs it should invoke, and which command-line options
10216 it ought to place on their command lines.  This behavior is controlled
10217 by @dfn{spec strings}.  In most cases there is one spec string for each
10218 program that GCC can invoke, but a few programs have multiple spec
10219 strings to control their behavior.  The spec strings built into GCC can
10220 be overridden by using the @option{-specs=} command-line switch to specify
10221 a spec file.
10222
10223 @dfn{Spec files} are plaintext files that are used to construct spec
10224 strings.  They consist of a sequence of directives separated by blank
10225 lines.  The type of directive is determined by the first non-whitespace
10226 character on the line, which can be one of the following:
10227
10228 @table @code
10229 @item %@var{command}
10230 Issues a @var{command} to the spec file processor.  The commands that can
10231 appear here are:
10232
10233 @table @code
10234 @item %include <@var{file}>
10235 @cindex @code{%include}
10236 Search for @var{file} and insert its text at the current point in the
10237 specs file.
10238
10239 @item %include_noerr <@var{file}>
10240 @cindex @code{%include_noerr}
10241 Just like @samp{%include}, but do not generate an error message if the include
10242 file cannot be found.
10243
10244 @item %rename @var{old_name} @var{new_name}
10245 @cindex @code{%rename}
10246 Rename the spec string @var{old_name} to @var{new_name}.
10247
10248 @end table
10249
10250 @item *[@var{spec_name}]:
10251 This tells the compiler to create, override or delete the named spec
10252 string.  All lines after this directive up to the next directive or
10253 blank line are considered to be the text for the spec string.  If this
10254 results in an empty string then the spec is deleted.  (Or, if the
10255 spec did not exist, then nothing happens.)  Otherwise, if the spec
10256 does not currently exist a new spec is created.  If the spec does
10257 exist then its contents are overridden by the text of this
10258 directive, unless the first character of that text is the @samp{+}
10259 character, in which case the text is appended to the spec.
10260
10261 @item [@var{suffix}]:
10262 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
10263 and up to the next directive or blank line are considered to make up the
10264 spec string for the indicated suffix.  When the compiler encounters an
10265 input file with the named suffix, it processes the spec string in
10266 order to work out how to compile that file.  For example:
10267
10268 @smallexample
10269 .ZZ:
10270 z-compile -input %i
10271 @end smallexample
10272
10273 This says that any input file whose name ends in @samp{.ZZ} should be
10274 passed to the program @samp{z-compile}, which should be invoked with the
10275 command-line switch @option{-input} and with the result of performing the
10276 @samp{%i} substitution.  (See below.)
10277
10278 As an alternative to providing a spec string, the text following a
10279 suffix directive can be one of the following:
10280
10281 @table @code
10282 @item @@@var{language}
10283 This says that the suffix is an alias for a known @var{language}.  This is
10284 similar to using the @option{-x} command-line switch to GCC to specify a
10285 language explicitly.  For example:
10286
10287 @smallexample
10288 .ZZ:
10289 @@c++
10290 @end smallexample
10291
10292 Says that .ZZ files are, in fact, C++ source files.
10293
10294 @item #@var{name}
10295 This causes an error messages saying:
10296
10297 @smallexample
10298 @var{name} compiler not installed on this system.
10299 @end smallexample
10300 @end table
10301
10302 GCC already has an extensive list of suffixes built into it.
10303 This directive adds an entry to the end of the list of suffixes, but
10304 since the list is searched from the end backwards, it is effectively
10305 possible to override earlier entries using this technique.
10306
10307 @end table
10308
10309 GCC has the following spec strings built into it.  Spec files can
10310 override these strings or create their own.  Note that individual
10311 targets can also add their own spec strings to this list.
10312
10313 @smallexample
10314 asm          Options to pass to the assembler
10315 asm_final    Options to pass to the assembler post-processor
10316 cpp          Options to pass to the C preprocessor
10317 cc1          Options to pass to the C compiler
10318 cc1plus      Options to pass to the C++ compiler
10319 endfile      Object files to include at the end of the link
10320 link         Options to pass to the linker
10321 lib          Libraries to include on the command line to the linker
10322 libgcc       Decides which GCC support library to pass to the linker
10323 linker       Sets the name of the linker
10324 predefines   Defines to be passed to the C preprocessor
10325 signed_char  Defines to pass to CPP to say whether @code{char} is signed
10326              by default
10327 startfile    Object files to include at the start of the link
10328 @end smallexample
10329
10330 Here is a small example of a spec file:
10331
10332 @smallexample
10333 %rename lib                 old_lib
10334
10335 *lib:
10336 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
10337 @end smallexample
10338
10339 This example renames the spec called @samp{lib} to @samp{old_lib} and
10340 then overrides the previous definition of @samp{lib} with a new one.
10341 The new definition adds in some extra command-line options before
10342 including the text of the old definition.
10343
10344 @dfn{Spec strings} are a list of command-line options to be passed to their
10345 corresponding program.  In addition, the spec strings can contain
10346 @samp{%}-prefixed sequences to substitute variable text or to
10347 conditionally insert text into the command line.  Using these constructs
10348 it is possible to generate quite complex command lines.
10349
10350 Here is a table of all defined @samp{%}-sequences for spec
10351 strings.  Note that spaces are not generated automatically around the
10352 results of expanding these sequences.  Therefore you can concatenate them
10353 together or combine them with constant text in a single argument.
10354
10355 @table @code
10356 @item %%
10357 Substitute one @samp{%} into the program name or argument.
10358
10359 @item %i
10360 Substitute the name of the input file being processed.
10361
10362 @item %b
10363 Substitute the basename of the input file being processed.
10364 This is the substring up to (and not including) the last period
10365 and not including the directory.
10366
10367 @item %B
10368 This is the same as @samp{%b}, but include the file suffix (text after
10369 the last period).
10370
10371 @item %d
10372 Marks the argument containing or following the @samp{%d} as a
10373 temporary file name, so that that file is deleted if GCC exits
10374 successfully.  Unlike @samp{%g}, this contributes no text to the
10375 argument.
10376
10377 @item %g@var{suffix}
10378 Substitute a file name that has suffix @var{suffix} and is chosen
10379 once per compilation, and mark the argument in the same way as
10380 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
10381 name is now chosen in a way that is hard to predict even when previously
10382 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
10383 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
10384 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
10385 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
10386 was simply substituted with a file name chosen once per compilation,
10387 without regard to any appended suffix (which was therefore treated
10388 just like ordinary text), making such attacks more likely to succeed.
10389
10390 @item %u@var{suffix}
10391 Like @samp{%g}, but generates a new temporary file name
10392 each time it appears instead of once per compilation.
10393
10394 @item %U@var{suffix}
10395 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
10396 new one if there is no such last file name.  In the absence of any
10397 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
10398 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
10399 involves the generation of two distinct file names, one
10400 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
10401 simply substituted with a file name chosen for the previous @samp{%u},
10402 without regard to any appended suffix.
10403
10404 @item %j@var{suffix}
10405 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
10406 writable, and if @option{-save-temps} is not used; 
10407 otherwise, substitute the name
10408 of a temporary file, just like @samp{%u}.  This temporary file is not
10409 meant for communication between processes, but rather as a junk
10410 disposal mechanism.
10411
10412 @item %|@var{suffix}
10413 @itemx %m@var{suffix}
10414 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
10415 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
10416 all.  These are the two most common ways to instruct a program that it
10417 should read from standard input or write to standard output.  If you
10418 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
10419 construct: see for example @file{f/lang-specs.h}.
10420
10421 @item %.@var{SUFFIX}
10422 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
10423 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
10424 terminated by the next space or %.
10425
10426 @item %w
10427 Marks the argument containing or following the @samp{%w} as the
10428 designated output file of this compilation.  This puts the argument
10429 into the sequence of arguments that @samp{%o} substitutes.
10430
10431 @item %o
10432 Substitutes the names of all the output files, with spaces
10433 automatically placed around them.  You should write spaces
10434 around the @samp{%o} as well or the results are undefined.
10435 @samp{%o} is for use in the specs for running the linker.
10436 Input files whose names have no recognized suffix are not compiled
10437 at all, but they are included among the output files, so they are
10438 linked.
10439
10440 @item %O
10441 Substitutes the suffix for object files.  Note that this is
10442 handled specially when it immediately follows @samp{%g, %u, or %U},
10443 because of the need for those to form complete file names.  The
10444 handling is such that @samp{%O} is treated exactly as if it had already
10445 been substituted, except that @samp{%g, %u, and %U} do not currently
10446 support additional @var{suffix} characters following @samp{%O} as they do
10447 following, for example, @samp{.o}.
10448
10449 @item %p
10450 Substitutes the standard macro predefinitions for the
10451 current target machine.  Use this when running @code{cpp}.
10452
10453 @item %P
10454 Like @samp{%p}, but puts @samp{__} before and after the name of each
10455 predefined macro, except for macros that start with @samp{__} or with
10456 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
10457 C@.
10458
10459 @item %I
10460 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
10461 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
10462 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
10463 and @option{-imultilib} as necessary.
10464
10465 @item %s
10466 Current argument is the name of a library or startup file of some sort.
10467 Search for that file in a standard list of directories and substitute
10468 the full name found.  The current working directory is included in the
10469 list of directories scanned.
10470
10471 @item %T
10472 Current argument is the name of a linker script.  Search for that file
10473 in the current list of directories to scan for libraries. If the file
10474 is located insert a @option{--script} option into the command line
10475 followed by the full path name found.  If the file is not found then
10476 generate an error message.  Note: the current working directory is not
10477 searched.
10478
10479 @item %e@var{str}
10480 Print @var{str} as an error message.  @var{str} is terminated by a newline.
10481 Use this when inconsistent options are detected.
10482
10483 @item %(@var{name})
10484 Substitute the contents of spec string @var{name} at this point.
10485
10486 @item %x@{@var{option}@}
10487 Accumulate an option for @samp{%X}.
10488
10489 @item %X
10490 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
10491 spec string.
10492
10493 @item %Y
10494 Output the accumulated assembler options specified by @option{-Wa}.
10495
10496 @item %Z
10497 Output the accumulated preprocessor options specified by @option{-Wp}.
10498
10499 @item %a
10500 Process the @code{asm} spec.  This is used to compute the
10501 switches to be passed to the assembler.
10502
10503 @item %A
10504 Process the @code{asm_final} spec.  This is a spec string for
10505 passing switches to an assembler post-processor, if such a program is
10506 needed.
10507
10508 @item %l
10509 Process the @code{link} spec.  This is the spec for computing the
10510 command line passed to the linker.  Typically it makes use of the
10511 @samp{%L %G %S %D and %E} sequences.
10512
10513 @item %D
10514 Dump out a @option{-L} option for each directory that GCC believes might
10515 contain startup files.  If the target supports multilibs then the
10516 current multilib directory is prepended to each of these paths.
10517
10518 @item %L
10519 Process the @code{lib} spec.  This is a spec string for deciding which
10520 libraries are included on the command line to the linker.
10521
10522 @item %G
10523 Process the @code{libgcc} spec.  This is a spec string for deciding
10524 which GCC support library is included on the command line to the linker.
10525
10526 @item %S
10527 Process the @code{startfile} spec.  This is a spec for deciding which
10528 object files are the first ones passed to the linker.  Typically
10529 this might be a file named @file{crt0.o}.
10530
10531 @item %E
10532 Process the @code{endfile} spec.  This is a spec string that specifies
10533 the last object files that are passed to the linker.
10534
10535 @item %C
10536 Process the @code{cpp} spec.  This is used to construct the arguments
10537 to be passed to the C preprocessor.
10538
10539 @item %1
10540 Process the @code{cc1} spec.  This is used to construct the options to be
10541 passed to the actual C compiler (@samp{cc1}).
10542
10543 @item %2
10544 Process the @code{cc1plus} spec.  This is used to construct the options to be
10545 passed to the actual C++ compiler (@samp{cc1plus}).
10546
10547 @item %*
10548 Substitute the variable part of a matched option.  See below.
10549 Note that each comma in the substituted string is replaced by
10550 a single space.
10551
10552 @item %<@code{S}
10553 Remove all occurrences of @code{-S} from the command line.  Note---this
10554 command is position dependent.  @samp{%} commands in the spec string
10555 before this one see @code{-S}, @samp{%} commands in the spec string
10556 after this one do not.
10557
10558 @item %:@var{function}(@var{args})
10559 Call the named function @var{function}, passing it @var{args}.
10560 @var{args} is first processed as a nested spec string, then split
10561 into an argument vector in the usual fashion.  The function returns
10562 a string which is processed as if it had appeared literally as part
10563 of the current spec.
10564
10565 The following built-in spec functions are provided:
10566
10567 @table @code
10568 @item @code{getenv}
10569 The @code{getenv} spec function takes two arguments: an environment
10570 variable name and a string.  If the environment variable is not
10571 defined, a fatal error is issued.  Otherwise, the return value is the
10572 value of the environment variable concatenated with the string.  For
10573 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
10574
10575 @smallexample
10576 %:getenv(TOPDIR /include)
10577 @end smallexample
10578
10579 expands to @file{/path/to/top/include}.
10580
10581 @item @code{if-exists}
10582 The @code{if-exists} spec function takes one argument, an absolute
10583 pathname to a file.  If the file exists, @code{if-exists} returns the
10584 pathname.  Here is a small example of its usage:
10585
10586 @smallexample
10587 *startfile:
10588 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10589 @end smallexample
10590
10591 @item @code{if-exists-else}
10592 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10593 spec function, except that it takes two arguments.  The first argument is
10594 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10595 returns the pathname.  If it does not exist, it returns the second argument.
10596 This way, @code{if-exists-else} can be used to select one file or another,
10597 based on the existence of the first.  Here is a small example of its usage:
10598
10599 @smallexample
10600 *startfile:
10601 crt0%O%s %:if-exists(crti%O%s) \
10602 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10603 @end smallexample
10604
10605 @item @code{replace-outfile}
10606 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10607 first argument in the outfiles array and replaces it with the second argument.  Here
10608 is a small example of its usage:
10609
10610 @smallexample
10611 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10612 @end smallexample
10613
10614 @item @code{remove-outfile}
10615 The @code{remove-outfile} spec function takes one argument.  It looks for the
10616 first argument in the outfiles array and removes it.  Here is a small example
10617 its usage:
10618
10619 @smallexample
10620 %:remove-outfile(-lm)
10621 @end smallexample
10622
10623 @item @code{pass-through-libs}
10624 The @code{pass-through-libs} spec function takes any number of arguments.  It
10625 finds any @option{-l} options and any non-options ending in @file{.a} (which it
10626 assumes are the names of linker input library archive files) and returns a
10627 result containing all the found arguments each prepended by
10628 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10629 intended to be passed to the LTO linker plugin.
10630
10631 @smallexample
10632 %:pass-through-libs(%G %L %G)
10633 @end smallexample
10634
10635 @item @code{print-asm-header}
10636 The @code{print-asm-header} function takes no arguments and simply
10637 prints a banner like:
10638
10639 @smallexample
10640 Assembler options
10641 =================
10642
10643 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10644 @end smallexample
10645
10646 It is used to separate compiler options from assembler options
10647 in the @option{--target-help} output.
10648 @end table
10649
10650 @item %@{@code{S}@}
10651 Substitutes the @code{-S} switch, if that switch is given to GCC@.
10652 If that switch is not specified, this substitutes nothing.  Note that
10653 the leading dash is omitted when specifying this option, and it is
10654 automatically inserted if the substitution is performed.  Thus the spec
10655 string @samp{%@{foo@}} matches the command-line option @option{-foo}
10656 and outputs the command-line option @option{-foo}.
10657
10658 @item %W@{@code{S}@}
10659 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10660 deleted on failure.
10661
10662 @item %@{@code{S}*@}
10663 Substitutes all the switches specified to GCC whose names start
10664 with @code{-S}, but which also take an argument.  This is used for
10665 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10666 GCC considers @option{-o foo} as being
10667 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
10668 text, including the space.  Thus two arguments are generated.
10669
10670 @item %@{@code{S}*&@code{T}*@}
10671 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10672 (the order of @code{S} and @code{T} in the spec is not significant).
10673 There can be any number of ampersand-separated variables; for each the
10674 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10675
10676 @item %@{@code{S}:@code{X}@}
10677 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
10678
10679 @item %@{!@code{S}:@code{X}@}
10680 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
10681
10682 @item %@{@code{S}*:@code{X}@}
10683 Substitutes @code{X} if one or more switches whose names start with
10684 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10685 once, no matter how many such switches appeared.  However, if @code{%*}
10686 appears somewhere in @code{X}, then @code{X} is substituted once
10687 for each matching switch, with the @code{%*} replaced by the part of
10688 that switch matching the @code{*}.
10689
10690 @item %@{.@code{S}:@code{X}@}
10691 Substitutes @code{X}, if processing a file with suffix @code{S}.
10692
10693 @item %@{!.@code{S}:@code{X}@}
10694 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10695
10696 @item %@{,@code{S}:@code{X}@}
10697 Substitutes @code{X}, if processing a file for language @code{S}.
10698
10699 @item %@{!,@code{S}:@code{X}@}
10700 Substitutes @code{X}, if not processing a file for language @code{S}.
10701
10702 @item %@{@code{S}|@code{P}:@code{X}@}
10703 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
10704 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10705 @code{*} sequences as well, although they have a stronger binding than
10706 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10707 alternatives must be starred, and only the first matching alternative
10708 is substituted.
10709
10710 For example, a spec string like this:
10711
10712 @smallexample
10713 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10714 @end smallexample
10715
10716 @noindent
10717 outputs the following command-line options from the following input
10718 command-line options:
10719
10720 @smallexample
10721 fred.c        -foo -baz
10722 jim.d         -bar -boggle
10723 -d fred.c     -foo -baz -boggle
10724 -d jim.d      -bar -baz -boggle
10725 @end smallexample
10726
10727 @item %@{S:X; T:Y; :D@}
10728
10729 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
10730 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10731 be as many clauses as you need.  This may be combined with @code{.},
10732 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10733
10734
10735 @end table
10736
10737 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10738 construct may contain other nested @samp{%} constructs or spaces, or
10739 even newlines.  They are processed as usual, as described above.
10740 Trailing white space in @code{X} is ignored.  White space may also
10741 appear anywhere on the left side of the colon in these constructs,
10742 except between @code{.} or @code{*} and the corresponding word.
10743
10744 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10745 handled specifically in these constructs.  If another value of
10746 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10747 @option{-W} switch is found later in the command line, the earlier
10748 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10749 just one letter, which passes all matching options.
10750
10751 The character @samp{|} at the beginning of the predicate text is used to
10752 indicate that a command should be piped to the following command, but
10753 only if @option{-pipe} is specified.
10754
10755 It is built into GCC which switches take arguments and which do not.
10756 (You might think it would be useful to generalize this to allow each
10757 compiler's spec to say which switches take arguments.  But this cannot
10758 be done in a consistent fashion.  GCC cannot even decide which input
10759 files have been specified without knowing which switches take arguments,
10760 and it must know which input files to compile in order to tell which
10761 compilers to run).
10762
10763 GCC also knows implicitly that arguments starting in @option{-l} are to be
10764 treated as compiler output files, and passed to the linker in their
10765 proper position among the other output files.
10766
10767 @c man begin OPTIONS
10768
10769 @node Target Options
10770 @section Specifying Target Machine and Compiler Version
10771 @cindex target options
10772 @cindex cross compiling
10773 @cindex specifying machine version
10774 @cindex specifying compiler version and target machine
10775 @cindex compiler version, specifying
10776 @cindex target machine, specifying
10777
10778 The usual way to run GCC is to run the executable called @command{gcc}, or
10779 @command{@var{machine}-gcc} when cross-compiling, or
10780 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10781 one that was installed last.
10782
10783 @node Submodel Options
10784 @section Hardware Models and Configurations
10785 @cindex submodel options
10786 @cindex specifying hardware config
10787 @cindex hardware models and configurations, specifying
10788 @cindex machine dependent options
10789
10790 Each target machine types can have its own
10791 special options, starting with @samp{-m}, to choose among various
10792 hardware models or configurations---for example, 68010 vs 68020,
10793 floating coprocessor or none.  A single installed version of the
10794 compiler can compile for any model or configuration, according to the
10795 options specified.
10796
10797 Some configurations of the compiler also support additional special
10798 options, usually for compatibility with other compilers on the same
10799 platform.
10800
10801 @c This list is ordered alphanumerically by subsection name.
10802 @c It should be the same order and spelling as these options are listed
10803 @c in Machine Dependent Options
10804
10805 @menu
10806 * AArch64 Options::
10807 * Adapteva Epiphany Options::
10808 * ARM Options::
10809 * AVR Options::
10810 * Blackfin Options::
10811 * C6X Options::
10812 * CRIS Options::
10813 * CR16 Options::
10814 * Darwin Options::
10815 * DEC Alpha Options::
10816 * FR30 Options::
10817 * FRV Options::
10818 * GNU/Linux Options::
10819 * H8/300 Options::
10820 * HPPA Options::
10821 * i386 and x86-64 Options::
10822 * i386 and x86-64 Windows Options::
10823 * IA-64 Options::
10824 * LM32 Options::
10825 * M32C Options::
10826 * M32R/D Options::
10827 * M680x0 Options::
10828 * MCore Options::
10829 * MeP Options::
10830 * MicroBlaze Options::
10831 * MIPS Options::
10832 * MMIX Options::
10833 * MN10300 Options::
10834 * Moxie Options::
10835 * PDP-11 Options::
10836 * picoChip Options::
10837 * PowerPC Options::
10838 * RL78 Options::
10839 * RS/6000 and PowerPC Options::
10840 * RX Options::
10841 * S/390 and zSeries Options::
10842 * Score Options::
10843 * SH Options::
10844 * Solaris 2 Options::
10845 * SPARC Options::
10846 * SPU Options::
10847 * System V Options::
10848 * TILE-Gx Options::
10849 * TILEPro Options::
10850 * V850 Options::
10851 * VAX Options::
10852 * VMS Options::
10853 * VxWorks Options::
10854 * x86-64 Options::
10855 * Xstormy16 Options::
10856 * Xtensa Options::
10857 * zSeries Options::
10858 @end menu
10859
10860 @node AArch64 Options
10861 @subsection AArch64 Options
10862 @cindex AArch64 Options
10863
10864 These options are defined for AArch64 implementations:
10865
10866 @table @gcctabopt
10867
10868 @item -mbig-endian
10869 @opindex mbig-endian
10870 Generate big-endian code.  This is the default when GCC is configured for an
10871 @samp{aarch64_be-*-*} target.
10872
10873 @item -mgeneral-regs-only
10874 @opindex mgeneral-regs-only
10875 Generate code which uses only the general registers.
10876
10877 @item -mlittle-endian
10878 @opindex mlittle-endian
10879 Generate little-endian code.  This is the default when GCC is configured for an
10880 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
10881
10882 @item -mcmodel=tiny
10883 @opindex mcmodel=tiny
10884 Generate code for the tiny code model.  The program and its statically defined
10885 symbols must be within 1GB of each other.  Pointers are 64 bits.  Programs can
10886 be statically or dynamically linked.  This model is not fully implemented and
10887 mostly treated as @samp{small}.
10888
10889 @item -mcmodel=small
10890 @opindex mcmodel=small
10891 Generate code for the small code model.  The program and its statically defined
10892 symbols must be within 4GB of each other.  Pointers are 64 bits.  Programs can
10893 be statically or dynamically linked.  This is the default code model.
10894
10895 @item -mcmodel=large
10896 @opindex mcmodel=large
10897 Generate code for the large code model.  This makes no assumptions about
10898 addresses and sizes of sections.  Pointers are 64 bits.  Programs can be
10899 statically linked only.
10900
10901 @item -mstrict-align
10902 @opindex mstrict-align
10903 Do not assume that unaligned memory references will be handled by the system.
10904
10905 @item -momit-leaf-frame-pointer
10906 @itemx -mno-omit-leaf-frame-pointer
10907 @opindex momit-leaf-frame-pointer
10908 @opindex mno-omit-leaf-frame-pointer
10909 Omit or keep the frame pointer in leaf functions.  The former behaviour is the
10910 default.
10911
10912 @item -mtls-dialect=desc
10913 @opindex mtls-dialect=desc
10914 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
10915 of TLS variables.  This is the default.
10916
10917 @item -mtls-dialect=traditional
10918 @opindex mtls-dialect=traditional
10919 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
10920 of TLS variables.
10921
10922 @item -march=@var{name}
10923 @opindex march
10924 Specify the name of the target architecture, optionally suffixed by one or
10925 more feature modifiers.  This option has the form
10926 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
10927 only value for @var{arch} is @samp{armv8-a}.  The possible values for
10928 @var{feature} are documented in the sub-section below.
10929
10930 Where conflicting feature modifiers are specified, the right-most feature is
10931 used.
10932
10933 GCC uses this name to determine what kind of instructions it can emit when
10934 generating assembly code.  This option can be used in conjunction with or
10935 instead of the @option{-mcpu=} option.
10936
10937 @item -mcpu=@var{name}
10938 @opindex mcpu
10939 Specify the name of the target processor, optionally suffixed by one or more
10940 feature modifiers.  This option has the form
10941 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where the
10942 possible values for @var{cpu} are @samp{generic}, @samp{large}.  The
10943 possible values for @var{feature} are documented in the sub-section
10944 below.
10945
10946 Where conflicting feature modifiers are specified, the right-most feature is
10947 used.
10948
10949 GCC uses this name to determine what kind of instructions it can emit when
10950 generating assembly code.
10951
10952 @item -mtune=@var{name}
10953 @opindex mtune
10954 Specify the name of the processor to tune the performance for.  The code will
10955 be tuned as if the target processor were of the type specified in this option,
10956 but still using instructions compatible with the target processor specified
10957 by a @option{-mcpu=} option.  This option cannot be suffixed by feature
10958 modifiers.
10959
10960 @end table
10961
10962 @subsubsection @option{-march} and @option{-mcpu} feature modifiers
10963 @cindex @option{-march} feature modifiers
10964 @cindex @option{-mcpu} feature modifiers
10965 Feature modifiers used with @option{-march} and @option{-mcpu} can be one
10966 the following:
10967
10968 @table @samp
10969 @item crypto
10970 Enable Crypto extension.  This implies Advanced SIMD is enabled.
10971 @item fp
10972 Enable floating-point instructions.
10973 @item simd
10974 Enable Advanced SIMD instructions.  This implies floating-point instructions
10975 are enabled.  This is the default for all current possible values for options
10976 @option{-march} and @option{-mcpu=}.
10977 @end table
10978
10979 @node Adapteva Epiphany Options
10980 @subsection Adapteva Epiphany Options
10981
10982 These @samp{-m} options are defined for Adapteva Epiphany:
10983
10984 @table @gcctabopt
10985 @item -mhalf-reg-file
10986 @opindex mhalf-reg-file
10987 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
10988 That allows code to run on hardware variants that lack these registers.
10989
10990 @item -mprefer-short-insn-regs
10991 @opindex mprefer-short-insn-regs
10992 Preferrentially allocate registers that allow short instruction generation.
10993 This can result in increased instruction count, so this may either reduce or
10994 increase overall code size.
10995
10996 @item -mbranch-cost=@var{num}
10997 @opindex mbranch-cost
10998 Set the cost of branches to roughly @var{num} ``simple'' instructions.
10999 This cost is only a heuristic and is not guaranteed to produce
11000 consistent results across releases.
11001
11002 @item -mcmove
11003 @opindex mcmove
11004 Enable the generation of conditional moves.
11005
11006 @item -mnops=@var{num}
11007 @opindex mnops
11008 Emit @var{num} NOPs before every other generated instruction.
11009
11010 @item -mno-soft-cmpsf
11011 @opindex mno-soft-cmpsf
11012 For single-precision floating-point comparisons, emit an @code{fsub} instruction
11013 and test the flags.  This is faster than a software comparison, but can
11014 get incorrect results in the presence of NaNs, or when two different small
11015 numbers are compared such that their difference is calculated as zero.
11016 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
11017 software comparisons.
11018
11019 @item -mstack-offset=@var{num}
11020 @opindex mstack-offset
11021 Set the offset between the top of the stack and the stack pointer.
11022 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
11023 can be used by leaf functions without stack allocation.
11024 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
11025 Note also that this option changes the ABI; compiling a program with a
11026 different stack offset than the libraries have been compiled with
11027 generally does not work.
11028 This option can be useful if you want to evaluate if a different stack
11029 offset would give you better code, but to actually use a different stack
11030 offset to build working programs, it is recommended to configure the
11031 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
11032
11033 @item -mno-round-nearest
11034 @opindex mno-round-nearest
11035 Make the scheduler assume that the rounding mode has been set to
11036 truncating.  The default is @option{-mround-nearest}.
11037
11038 @item -mlong-calls
11039 @opindex mlong-calls
11040 If not otherwise specified by an attribute, assume all calls might be beyond
11041 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
11042 function address into a register before performing a (otherwise direct) call.
11043 This is the default.
11044
11045 @item -mshort-calls
11046 @opindex short-calls
11047 If not otherwise specified by an attribute, assume all direct calls are
11048 in the range of the @code{b} / @code{bl} instructions, so use these instructions
11049 for direct calls.  The default is @option{-mlong-calls}.
11050
11051 @item -msmall16
11052 @opindex msmall16
11053 Assume addresses can be loaded as 16-bit unsigned values.  This does not
11054 apply to function addresses for which @option{-mlong-calls} semantics
11055 are in effect.
11056
11057 @item -mfp-mode=@var{mode}
11058 @opindex mfp-mode
11059 Set the prevailing mode of the floating-point unit.
11060 This determines the floating-point mode that is provided and expected
11061 at function call and return time.  Making this mode match the mode you
11062 predominantly need at function start can make your programs smaller and
11063 faster by avoiding unnecessary mode switches.
11064
11065 @var{mode} can be set to one the following values:
11066
11067 @table @samp
11068 @item caller
11069 Any mode at function entry is valid, and retained or restored when
11070 the function returns, and when it calls other functions.
11071 This mode is useful for compiling libraries or other compilation units
11072 you might want to incorporate into different programs with different
11073 prevailing FPU modes, and the convenience of being able to use a single
11074 object file outweighs the size and speed overhead for any extra
11075 mode switching that might be needed, compared with what would be needed
11076 with a more specific choice of prevailing FPU mode.
11077
11078 @item truncate
11079 This is the mode used for floating-point calculations with
11080 truncating (i.e.@: round towards zero) rounding mode.  That includes
11081 conversion from floating point to integer.
11082
11083 @item round-nearest
11084 This is the mode used for floating-point calculations with
11085 round-to-nearest-or-even rounding mode.
11086
11087 @item int
11088 This is the mode used to perform integer calculations in the FPU, e.g.@:
11089 integer multiply, or integer multiply-and-accumulate.
11090 @end table
11091
11092 The default is @option{-mfp-mode=caller}
11093
11094 @item -mnosplit-lohi
11095 @itemx -mno-postinc
11096 @itemx -mno-postmodify
11097 @opindex mnosplit-lohi
11098 @opindex mno-postinc
11099 @opindex mno-postmodify
11100 Code generation tweaks that disable, respectively, splitting of 32-bit
11101 loads, generation of post-increment addresses, and generation of
11102 post-modify addresses.  The defaults are @option{msplit-lohi},
11103 @option{-mpost-inc}, and @option{-mpost-modify}.
11104
11105 @item -mnovect-double
11106 @opindex mno-vect-double
11107 Change the preferred SIMD mode to SImode.  The default is
11108 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
11109
11110 @item -max-vect-align=@var{num}
11111 @opindex max-vect-align
11112 The maximum alignment for SIMD vector mode types.
11113 @var{num} may be 4 or 8.  The default is 8.
11114 Note that this is an ABI change, even though many library function
11115 interfaces are unaffected if they don't use SIMD vector modes
11116 in places that affect size and/or alignment of relevant types.
11117
11118 @item -msplit-vecmove-early
11119 @opindex msplit-vecmove-early
11120 Split vector moves into single word moves before reload.  In theory this
11121 can give better register allocation, but so far the reverse seems to be
11122 generally the case.
11123
11124 @item -m1reg-@var{reg}
11125 @opindex m1reg-
11126 Specify a register to hold the constant @minus{}1, which makes loading small negative
11127 constants and certain bitmasks faster.
11128 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
11129 which specify use of that register as a fixed register,
11130 and @samp{none}, which means that no register is used for this
11131 purpose.  The default is @option{-m1reg-none}.
11132
11133 @end table
11134
11135 @node ARM Options
11136 @subsection ARM Options
11137 @cindex ARM options
11138
11139 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
11140 architectures:
11141
11142 @table @gcctabopt
11143 @item -mabi=@var{name}
11144 @opindex mabi
11145 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
11146 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
11147
11148 @item -mapcs-frame
11149 @opindex mapcs-frame
11150 Generate a stack frame that is compliant with the ARM Procedure Call
11151 Standard for all functions, even if this is not strictly necessary for
11152 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
11153 with this option causes the stack frames not to be generated for
11154 leaf functions.  The default is @option{-mno-apcs-frame}.
11155
11156 @item -mapcs
11157 @opindex mapcs
11158 This is a synonym for @option{-mapcs-frame}.
11159
11160 @ignore
11161 @c not currently implemented
11162 @item -mapcs-stack-check
11163 @opindex mapcs-stack-check
11164 Generate code to check the amount of stack space available upon entry to
11165 every function (that actually uses some stack space).  If there is
11166 insufficient space available then either the function
11167 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
11168 called, depending upon the amount of stack space required.  The runtime
11169 system is required to provide these functions.  The default is
11170 @option{-mno-apcs-stack-check}, since this produces smaller code.
11171
11172 @c not currently implemented
11173 @item -mapcs-float
11174 @opindex mapcs-float
11175 Pass floating-point arguments using the floating-point registers.  This is
11176 one of the variants of the APCS@.  This option is recommended if the
11177 target hardware has a floating-point unit or if a lot of floating-point
11178 arithmetic is going to be performed by the code.  The default is
11179 @option{-mno-apcs-float}, since the size of integer-only code is 
11180 slightly increased if @option{-mapcs-float} is used.
11181
11182 @c not currently implemented
11183 @item -mapcs-reentrant
11184 @opindex mapcs-reentrant
11185 Generate reentrant, position-independent code.  The default is
11186 @option{-mno-apcs-reentrant}.
11187 @end ignore
11188
11189 @item -mthumb-interwork
11190 @opindex mthumb-interwork
11191 Generate code that supports calling between the ARM and Thumb
11192 instruction sets.  Without this option, on pre-v5 architectures, the
11193 two instruction sets cannot be reliably used inside one program.  The
11194 default is @option{-mno-thumb-interwork}, since slightly larger code
11195 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
11196 configurations this option is meaningless.
11197
11198 @item -mno-sched-prolog
11199 @opindex mno-sched-prolog
11200 Prevent the reordering of instructions in the function prologue, or the
11201 merging of those instruction with the instructions in the function's
11202 body.  This means that all functions start with a recognizable set
11203 of instructions (or in fact one of a choice from a small set of
11204 different function prologues), and this information can be used to
11205 locate the start of functions inside an executable piece of code.  The
11206 default is @option{-msched-prolog}.
11207
11208 @item -mfloat-abi=@var{name}
11209 @opindex mfloat-abi
11210 Specifies which floating-point ABI to use.  Permissible values
11211 are: @samp{soft}, @samp{softfp} and @samp{hard}.
11212
11213 Specifying @samp{soft} causes GCC to generate output containing
11214 library calls for floating-point operations.
11215 @samp{softfp} allows the generation of code using hardware floating-point
11216 instructions, but still uses the soft-float calling conventions.
11217 @samp{hard} allows generation of floating-point instructions
11218 and uses FPU-specific calling conventions.
11219
11220 The default depends on the specific target configuration.  Note that
11221 the hard-float and soft-float ABIs are not link-compatible; you must
11222 compile your entire program with the same ABI, and link with a
11223 compatible set of libraries.
11224
11225 @item -mlittle-endian
11226 @opindex mlittle-endian
11227 Generate code for a processor running in little-endian mode.  This is
11228 the default for all standard configurations.
11229
11230 @item -mbig-endian
11231 @opindex mbig-endian
11232 Generate code for a processor running in big-endian mode; the default is
11233 to compile code for a little-endian processor.
11234
11235 @item -mwords-little-endian
11236 @opindex mwords-little-endian
11237 This option only applies when generating code for big-endian processors.
11238 Generate code for a little-endian word order but a big-endian byte
11239 order.  That is, a byte order of the form @samp{32107654}.  Note: this
11240 option should only be used if you require compatibility with code for
11241 big-endian ARM processors generated by versions of the compiler prior to
11242 2.8.  This option is now deprecated.
11243
11244 @item -mcpu=@var{name}
11245 @opindex mcpu
11246 This specifies the name of the target ARM processor.  GCC uses this name
11247 to determine what kind of instructions it can emit when generating
11248 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
11249 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
11250 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
11251 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
11252 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
11253 @samp{arm720},
11254 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
11255 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
11256 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
11257 @samp{strongarm1110},
11258 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
11259 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
11260 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
11261 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
11262 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
11263 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
11264 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
11265 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
11266 @samp{cortex-a15}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
11267 @samp{cortex-m4}, @samp{cortex-m3},
11268 @samp{cortex-m1},
11269 @samp{cortex-m0},
11270 @samp{cortex-m0plus},
11271 @samp{marvell-pj4},
11272 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
11273 @samp{fa526}, @samp{fa626},
11274 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
11275
11276
11277 @option{-mcpu=generic-@var{arch}} is also permissible, and is
11278 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
11279 See @option{-mtune} for more information.
11280
11281 @option{-mcpu=native} causes the compiler to auto-detect the CPU
11282 of the build computer.  At present, this feature is only supported on
11283 Linux, and not all architectures are recognized.  If the auto-detect is
11284 unsuccessful the option has no effect.
11285
11286 @item -mtune=@var{name}
11287 @opindex mtune
11288 This option is very similar to the @option{-mcpu=} option, except that
11289 instead of specifying the actual target processor type, and hence
11290 restricting which instructions can be used, it specifies that GCC should
11291 tune the performance of the code as if the target were of the type
11292 specified in this option, but still choosing the instructions it
11293 generates based on the CPU specified by a @option{-mcpu=} option.
11294 For some ARM implementations better performance can be obtained by using
11295 this option.
11296
11297 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
11298 performance for a blend of processors within architecture @var{arch}.
11299 The aim is to generate code that run well on the current most popular
11300 processors, balancing between optimizations that benefit some CPUs in the
11301 range, and avoiding performance pitfalls of other CPUs.  The effects of
11302 this option may change in future GCC versions as CPU models come and go.
11303
11304 @option{-mtune=native} causes the compiler to auto-detect the CPU
11305 of the build computer.  At present, this feature is only supported on
11306 Linux, and not all architectures are recognized.  If the auto-detect is
11307 unsuccessful the option has no effect.
11308
11309 @item -march=@var{name}
11310 @opindex march
11311 This specifies the name of the target ARM architecture.  GCC uses this
11312 name to determine what kind of instructions it can emit when generating
11313 assembly code.  This option can be used in conjunction with or instead
11314 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
11315 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
11316 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
11317 @samp{armv6}, @samp{armv6j},
11318 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
11319 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
11320 @samp{armv8-a},
11321 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
11322
11323 @option{-march=native} causes the compiler to auto-detect the architecture
11324 of the build computer.  At present, this feature is only supported on
11325 Linux, and not all architectures are recognized.  If the auto-detect is
11326 unsuccessful the option has no effect.
11327
11328 @item -mfpu=@var{name}
11329 @opindex mfpu
11330 This specifies what floating-point hardware (or hardware emulation) is
11331 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
11332 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
11333 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
11334 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
11335 @samp{fp-armv8}, @samp{neon-fp-armv8}, and @samp{crypto-neon-fp-armv8}.
11336
11337 If @option{-msoft-float} is specified this specifies the format of
11338 floating-point values.
11339
11340 If the selected floating-point hardware includes the NEON extension
11341 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
11342 operations are not generated by GCC's auto-vectorization pass unless
11343 @option{-funsafe-math-optimizations} is also specified.  This is
11344 because NEON hardware does not fully implement the IEEE 754 standard for
11345 floating-point arithmetic (in particular denormal values are treated as
11346 zero), so the use of NEON instructions may lead to a loss of precision.
11347
11348 @item -mfp16-format=@var{name}
11349 @opindex mfp16-format
11350 Specify the format of the @code{__fp16} half-precision floating-point type.
11351 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
11352 the default is @samp{none}, in which case the @code{__fp16} type is not
11353 defined.  @xref{Half-Precision}, for more information.
11354
11355 @item -mstructure-size-boundary=@var{n}
11356 @opindex mstructure-size-boundary
11357 The sizes of all structures and unions are rounded up to a multiple
11358 of the number of bits set by this option.  Permissible values are 8, 32
11359 and 64.  The default value varies for different toolchains.  For the COFF
11360 targeted toolchain the default value is 8.  A value of 64 is only allowed
11361 if the underlying ABI supports it.
11362
11363 Specifying a larger number can produce faster, more efficient code, but
11364 can also increase the size of the program.  Different values are potentially
11365 incompatible.  Code compiled with one value cannot necessarily expect to
11366 work with code or libraries compiled with another value, if they exchange
11367 information using structures or unions.
11368
11369 @item -mabort-on-noreturn
11370 @opindex mabort-on-noreturn
11371 Generate a call to the function @code{abort} at the end of a
11372 @code{noreturn} function.  It is executed if the function tries to
11373 return.
11374
11375 @item -mlong-calls
11376 @itemx -mno-long-calls
11377 @opindex mlong-calls
11378 @opindex mno-long-calls
11379 Tells the compiler to perform function calls by first loading the
11380 address of the function into a register and then performing a subroutine
11381 call on this register.  This switch is needed if the target function
11382 lies outside of the 64-megabyte addressing range of the offset-based
11383 version of subroutine call instruction.
11384
11385 Even if this switch is enabled, not all function calls are turned
11386 into long calls.  The heuristic is that static functions, functions
11387 that have the @samp{short-call} attribute, functions that are inside
11388 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
11389 definitions have already been compiled within the current compilation
11390 unit are not turned into long calls.  The exceptions to this rule are
11391 that weak function definitions, functions with the @samp{long-call}
11392 attribute or the @samp{section} attribute, and functions that are within
11393 the scope of a @samp{#pragma long_calls} directive are always
11394 turned into long calls.
11395
11396 This feature is not enabled by default.  Specifying
11397 @option{-mno-long-calls} restores the default behavior, as does
11398 placing the function calls within the scope of a @samp{#pragma
11399 long_calls_off} directive.  Note these switches have no effect on how
11400 the compiler generates code to handle function calls via function
11401 pointers.
11402
11403 @item -msingle-pic-base
11404 @opindex msingle-pic-base
11405 Treat the register used for PIC addressing as read-only, rather than
11406 loading it in the prologue for each function.  The runtime system is
11407 responsible for initializing this register with an appropriate value
11408 before execution begins.
11409
11410 @item -mpic-register=@var{reg}
11411 @opindex mpic-register
11412 Specify the register to be used for PIC addressing.  The default is R10
11413 unless stack-checking is enabled, when R9 is used.
11414
11415 @item -mpoke-function-name
11416 @opindex mpoke-function-name
11417 Write the name of each function into the text section, directly
11418 preceding the function prologue.  The generated code is similar to this:
11419
11420 @smallexample
11421      t0
11422          .ascii "arm_poke_function_name", 0
11423          .align
11424      t1
11425          .word 0xff000000 + (t1 - t0)
11426      arm_poke_function_name
11427          mov     ip, sp
11428          stmfd   sp!, @{fp, ip, lr, pc@}
11429          sub     fp, ip, #4
11430 @end smallexample
11431
11432 When performing a stack backtrace, code can inspect the value of
11433 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
11434 location @code{pc - 12} and the top 8 bits are set, then we know that
11435 there is a function name embedded immediately preceding this location
11436 and has length @code{((pc[-3]) & 0xff000000)}.
11437
11438 @item -mthumb
11439 @itemx -marm
11440 @opindex marm
11441 @opindex mthumb
11442
11443 Select between generating code that executes in ARM and Thumb
11444 states.  The default for most configurations is to generate code
11445 that executes in ARM state, but the default can be changed by
11446 configuring GCC with the @option{--with-mode=}@var{state}
11447 configure option.
11448
11449 @item -mtpcs-frame
11450 @opindex mtpcs-frame
11451 Generate a stack frame that is compliant with the Thumb Procedure Call
11452 Standard for all non-leaf functions.  (A leaf function is one that does
11453 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
11454
11455 @item -mtpcs-leaf-frame
11456 @opindex mtpcs-leaf-frame
11457 Generate a stack frame that is compliant with the Thumb Procedure Call
11458 Standard for all leaf functions.  (A leaf function is one that does
11459 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
11460
11461 @item -mcallee-super-interworking
11462 @opindex mcallee-super-interworking
11463 Gives all externally visible functions in the file being compiled an ARM
11464 instruction set header which switches to Thumb mode before executing the
11465 rest of the function.  This allows these functions to be called from
11466 non-interworking code.  This option is not valid in AAPCS configurations
11467 because interworking is enabled by default.
11468
11469 @item -mcaller-super-interworking
11470 @opindex mcaller-super-interworking
11471 Allows calls via function pointers (including virtual functions) to
11472 execute correctly regardless of whether the target code has been
11473 compiled for interworking or not.  There is a small overhead in the cost
11474 of executing a function pointer if this option is enabled.  This option
11475 is not valid in AAPCS configurations because interworking is enabled
11476 by default.
11477
11478 @item -mtp=@var{name}
11479 @opindex mtp
11480 Specify the access model for the thread local storage pointer.  The valid
11481 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
11482 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
11483 (supported in the arm6k architecture), and @option{auto}, which uses the
11484 best available method for the selected processor.  The default setting is
11485 @option{auto}.
11486
11487 @item -mtls-dialect=@var{dialect}
11488 @opindex mtls-dialect
11489 Specify the dialect to use for accessing thread local storage.  Two
11490 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
11491 @samp{gnu} dialect selects the original GNU scheme for supporting
11492 local and global dynamic TLS models.  The @samp{gnu2} dialect
11493 selects the GNU descriptor scheme, which provides better performance
11494 for shared libraries.  The GNU descriptor scheme is compatible with
11495 the original scheme, but does require new assembler, linker and
11496 library support.  Initial and local exec TLS models are unaffected by
11497 this option and always use the original scheme.
11498
11499 @item -mword-relocations
11500 @opindex mword-relocations
11501 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
11502 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
11503 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
11504 is specified.
11505
11506 @item -mfix-cortex-m3-ldrd
11507 @opindex mfix-cortex-m3-ldrd
11508 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
11509 with overlapping destination and base registers are used.  This option avoids
11510 generating these instructions.  This option is enabled by default when
11511 @option{-mcpu=cortex-m3} is specified.
11512
11513 @item -munaligned-access
11514 @itemx -mno-unaligned-access
11515 @opindex munaligned-access
11516 @opindex mno-unaligned-access
11517 Enables (or disables) reading and writing of 16- and 32- bit values
11518 from addresses that are not 16- or 32- bit aligned.  By default
11519 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
11520 architectures, and enabled for all other architectures.  If unaligned
11521 access is not enabled then words in packed data structures will be
11522 accessed a byte at a time.
11523
11524 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
11525 generated object file to either true or false, depending upon the
11526 setting of this option.  If unaligned access is enabled then the
11527 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
11528 defined.
11529
11530 @end table
11531
11532 @node AVR Options
11533 @subsection AVR Options
11534 @cindex AVR Options
11535
11536 These options are defined for AVR implementations:
11537
11538 @table @gcctabopt
11539 @item -mmcu=@var{mcu}
11540 @opindex mmcu
11541 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
11542
11543 The default for this option is@tie{}@code{avr2}.
11544
11545 GCC supports the following AVR devices and ISAs:
11546
11547 @include avr-mmcu.texi
11548
11549 @item -maccumulate-args
11550 @opindex maccumulate-args
11551 Accumulate outgoing function arguments and acquire/release the needed
11552 stack space for outgoing function arguments once in function
11553 prologue/epilogue.  Without this option, outgoing arguments are pushed
11554 before calling a function and popped afterwards.
11555
11556 Popping the arguments after the function call can be expensive on
11557 AVR so that accumulating the stack space might lead to smaller
11558 executables because arguments need not to be removed from the
11559 stack after such a function call.
11560
11561 This option can lead to reduced code size for functions that perform
11562 several calls to functions that get their arguments on the stack like
11563 calls to printf-like functions.
11564
11565 @item -mbranch-cost=@var{cost}
11566 @opindex mbranch-cost
11567 Set the branch costs for conditional branch instructions to
11568 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
11569 integers. The default branch cost is 0.
11570
11571 @item -mcall-prologues
11572 @opindex mcall-prologues
11573 Functions prologues/epilogues are expanded as calls to appropriate
11574 subroutines.  Code size is smaller.
11575
11576 @item -mint8
11577 @opindex mint8
11578 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
11579 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
11580 and @code{long long} is 4 bytes.  Please note that this option does not
11581 conform to the C standards, but it results in smaller code
11582 size.
11583
11584 @item -mno-interrupts
11585 @opindex mno-interrupts
11586 Generated code is not compatible with hardware interrupts.
11587 Code size is smaller.
11588
11589 @item -mrelax
11590 @opindex mrelax
11591 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
11592 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
11593 Setting @code{-mrelax} just adds the @code{--relax} option to the
11594 linker command line when the linker is called.
11595
11596 Jump relaxing is performed by the linker because jump offsets are not
11597 known before code is located. Therefore, the assembler code generated by the
11598 compiler is the same, but the instructions in the executable may
11599 differ from instructions in the assembler code.
11600
11601 Relaxing must be turned on if linker stubs are needed, see the
11602 section on @code{EIND} and linker stubs below.
11603
11604 @item -msp8
11605 @opindex msp8
11606 Treat the stack pointer register as an 8-bit register,
11607 i.e.@: assume the high byte of the stack pointer is zero.
11608 In general, you don't need to set this option by hand.
11609
11610 This option is used internally by the compiler to select and
11611 build multilibs for architectures @code{avr2} and @code{avr25}.
11612 These architectures mix devices with and without @code{SPH}.
11613 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
11614 the compiler driver will add or remove this option from the compiler
11615 proper's command line, because the compiler then knows if the device
11616 or architecture has an 8-bit stack pointer and thus no @code{SPH}
11617 register or not.
11618
11619 @item -mstrict-X
11620 @opindex mstrict-X
11621 Use address register @code{X} in a way proposed by the hardware.  This means
11622 that @code{X} is only used in indirect, post-increment or
11623 pre-decrement addressing.
11624
11625 Without this option, the @code{X} register may be used in the same way
11626 as @code{Y} or @code{Z} which then is emulated by additional
11627 instructions.  
11628 For example, loading a value with @code{X+const} addressing with a
11629 small non-negative @code{const < 64} to a register @var{Rn} is
11630 performed as
11631
11632 @example
11633 adiw r26, const   ; X += const
11634 ld   @var{Rn}, X        ; @var{Rn} = *X
11635 sbiw r26, const   ; X -= const
11636 @end example
11637
11638 @item -mtiny-stack
11639 @opindex mtiny-stack
11640 Only change the lower 8@tie{}bits of the stack pointer.
11641
11642 @item -Waddr-space-convert
11643 @opindex Waddr-space-convert
11644 Warn about conversions between address spaces in the case where the
11645 resulting address space is not contained in the incoming address space.
11646 @end table
11647
11648 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
11649 @cindex @code{EIND}
11650 Pointers in the implementation are 16@tie{}bits wide.
11651 The address of a function or label is represented as word address so
11652 that indirect jumps and calls can target any code address in the
11653 range of 64@tie{}Ki words.
11654
11655 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
11656 bytes of program memory space, there is a special function register called
11657 @code{EIND} that serves as most significant part of the target address
11658 when @code{EICALL} or @code{EIJMP} instructions are used.
11659
11660 Indirect jumps and calls on these devices are handled as follows by
11661 the compiler and are subject to some limitations:
11662
11663 @itemize @bullet
11664
11665 @item
11666 The compiler never sets @code{EIND}.
11667
11668 @item
11669 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
11670 instructions or might read @code{EIND} directly in order to emulate an
11671 indirect call/jump by means of a @code{RET} instruction.
11672
11673 @item
11674 The compiler assumes that @code{EIND} never changes during the startup
11675 code or during the application. In particular, @code{EIND} is not
11676 saved/restored in function or interrupt service routine
11677 prologue/epilogue.
11678
11679 @item
11680 For indirect calls to functions and computed goto, the linker
11681 generates @emph{stubs}. Stubs are jump pads sometimes also called
11682 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
11683 The stub contains a direct jump to the desired address.
11684
11685 @item
11686 Linker relaxation must be turned on so that the linker will generate
11687 the stubs correctly an all situaltion. See the compiler option
11688 @code{-mrelax} and the linler option @code{--relax}.
11689 There are corner cases where the linker is supposed to generate stubs
11690 but aborts without relaxation and without a helpful error message.
11691
11692 @item
11693 The default linker script is arranged for code with @code{EIND = 0}.
11694 If code is supposed to work for a setup with @code{EIND != 0}, a custom
11695 linker script has to be used in order to place the sections whose
11696 name start with @code{.trampolines} into the segment where @code{EIND}
11697 points to.
11698
11699 @item
11700 The startup code from libgcc never sets @code{EIND}.
11701 Notice that startup code is a blend of code from libgcc and AVR-LibC.
11702 For the impact of AVR-LibC on @code{EIND}, see the
11703 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
11704
11705 @item
11706 It is legitimate for user-specific startup code to set up @code{EIND}
11707 early, for example by means of initialization code located in
11708 section @code{.init3}. Such code runs prior to general startup code
11709 that initializes RAM and calls constructors, but after the bit
11710 of startup code from AVR-LibC that sets @code{EIND} to the segment
11711 where the vector table is located.
11712 @example
11713 #include <avr/io.h>
11714
11715 static void
11716 __attribute__((section(".init3"),naked,used,no_instrument_function))
11717 init3_set_eind (void)
11718 @{
11719   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
11720                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
11721 @}
11722 @end example
11723
11724 @noindent
11725 The @code{__trampolines_start} symbol is defined in the linker script.
11726
11727 @item
11728 Stubs are generated automatically by the linker if
11729 the following two conditions are met:
11730 @itemize @minus
11731
11732 @item The address of a label is taken by means of the @code{gs} modifier
11733 (short for @emph{generate stubs}) like so:
11734 @example
11735 LDI r24, lo8(gs(@var{func}))
11736 LDI r25, hi8(gs(@var{func}))
11737 @end example
11738 @item The final location of that label is in a code segment
11739 @emph{outside} the segment where the stubs are located.
11740 @end itemize
11741
11742 @item
11743 The compiler emits such @code{gs} modifiers for code labels in the
11744 following situations:
11745 @itemize @minus
11746 @item Taking address of a function or code label.
11747 @item Computed goto.
11748 @item If prologue-save function is used, see @option{-mcall-prologues}
11749 command-line option.
11750 @item Switch/case dispatch tables. If you do not want such dispatch
11751 tables you can specify the @option{-fno-jump-tables} command-line option.
11752 @item C and C++ constructors/destructors called during startup/shutdown.
11753 @item If the tools hit a @code{gs()} modifier explained above.
11754 @end itemize
11755
11756 @item
11757 Jumping to non-symbolic addresses like so is @emph{not} supported:
11758
11759 @example
11760 int main (void)
11761 @{
11762     /* Call function at word address 0x2 */
11763     return ((int(*)(void)) 0x2)();
11764 @}
11765 @end example
11766
11767 Instead, a stub has to be set up, i.e.@: the function has to be called
11768 through a symbol (@code{func_4} in the example):
11769
11770 @example
11771 int main (void)
11772 @{
11773     extern int func_4 (void);
11774
11775     /* Call function at byte address 0x4 */
11776     return func_4();
11777 @}
11778 @end example
11779
11780 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
11781 Alternatively, @code{func_4} can be defined in the linker script.
11782 @end itemize
11783
11784 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
11785 @cindex @code{RAMPD}
11786 @cindex @code{RAMPX}
11787 @cindex @code{RAMPY}
11788 @cindex @code{RAMPZ}
11789 Some AVR devices support memories larger than the 64@tie{}KiB range
11790 that can be accessed with 16-bit pointers.  To access memory locations
11791 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
11792 register is used as high part of the address:
11793 The @code{X}, @code{Y}, @code{Z} address register is concatenated
11794 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
11795 register, respectively, to get a wide address. Similarly,
11796 @code{RAMPD} is used together with direct addressing.
11797
11798 @itemize
11799 @item
11800 The startup code initializes the @code{RAMP} special function
11801 registers with zero.
11802
11803 @item
11804 If a @ref{AVR Named Address Spaces,named address space} other than
11805 generic or @code{__flash} is used, then @code{RAMPZ} is set
11806 as needed before the operation.
11807
11808 @item
11809 If the device supports RAM larger than 64@tie{KiB} and the compiler
11810 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
11811 is reset to zero after the operation.
11812
11813 @item
11814 If the device comes with a specific @code{RAMP} register, the ISR
11815 prologue/epilogue saves/restores that SFR and initializes it with
11816 zero in case the ISR code might (implicitly) use it.
11817
11818 @item
11819 RAM larger than 64@tie{KiB} is not supported by GCC for AVR targets.
11820 If you use inline assembler to read from locations outside the
11821 16-bit address range and change one of the @code{RAMP} registers,
11822 you must reset it to zero after the access.
11823
11824 @end itemize
11825
11826 @subsubsection AVR Built-in Macros
11827
11828 GCC defines several built-in macros so that the user code can test
11829 for the presence or absence of features.  Almost any of the following
11830 built-in macros are deduced from device capabilities and thus
11831 triggered by the @code{-mmcu=} command-line option.
11832
11833 For even more AVR-specific built-in macros see
11834 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
11835
11836 @table @code
11837
11838 @item __AVR_ARCH__
11839 Build-in macro that resolves to a decimal number that identifies the
11840 architecture and depends on the @code{-mmcu=@var{mcu}} option.
11841 Possible values are:
11842
11843 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
11844 @code{4}, @code{5}, @code{51}, @code{6}, @code{102}, @code{104},
11845 @code{105}, @code{106}, @code{107}
11846
11847 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3},
11848 @code{avr31}, @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51},
11849 @code{avr6}, @code{avrxmega2}, @code{avrxmega4}, @code{avrxmega5},
11850 @code{avrxmega6}, @code{avrxmega7}, respectively.
11851 If @var{mcu} specifies a device, this built-in macro is set
11852 accordingly. For example, with @code{-mmcu=atmega8} the macro will be
11853 defined to @code{4}.
11854
11855 @item __AVR_@var{Device}__
11856 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
11857 the device's name. For example, @code{-mmcu=atmega8} defines the
11858 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
11859 @code{__AVR_ATtiny261A__}, etc.
11860
11861 The built-in macros' names follow
11862 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
11863 the device name as from the AVR user manual. The difference between
11864 @var{Device} in the built-in macro and @var{device} in
11865 @code{-mmcu=@var{device}} is that the latter is always lowercase.
11866
11867 If @var{device} is not a device but only a core architecture like
11868 @code{avr51}, this macro will not be defined.
11869
11870 @item __AVR_XMEGA__
11871 The device / architecture belongs to the XMEGA family of devices.
11872
11873 @item __AVR_HAVE_ELPM__
11874 The device has the the @code{ELPM} instruction.
11875
11876 @item __AVR_HAVE_ELPMX__
11877 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
11878 R@var{n},Z+} instructions.
11879
11880 @item __AVR_HAVE_MOVW__
11881 The device has the @code{MOVW} instruction to perform 16-bit
11882 register-register moves.
11883
11884 @item __AVR_HAVE_LPMX__
11885 The device has the @code{LPM R@var{n},Z} and
11886 @code{LPM R@var{n},Z+} instructions.
11887
11888 @item __AVR_HAVE_MUL__
11889 The device has a hardware multiplier. 
11890
11891 @item __AVR_HAVE_JMP_CALL__
11892 The device has the @code{JMP} and @code{CALL} instructions.
11893 This is the case for devices with at least 16@tie{}KiB of program
11894 memory.
11895
11896 @item __AVR_HAVE_EIJMP_EICALL__
11897 @itemx __AVR_3_BYTE_PC__
11898 The device has the @code{EIJMP} and @code{EICALL} instructions.
11899 This is the case for devices with more than 128@tie{}KiB of program memory.
11900 This also means that the program counter
11901 (PC) is 3@tie{}bytes wide.
11902
11903 @item __AVR_2_BYTE_PC__
11904 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
11905 with up to 128@tie{}KiB of program memory.
11906
11907 @item __AVR_HAVE_8BIT_SP__
11908 @itemx __AVR_HAVE_16BIT_SP__
11909 The stack pointer (SP) register is treated as 8-bit respectively
11910 16-bit register by the compiler.
11911 The definition of these macros is affected by @code{-mtiny-stack}.
11912
11913 @item __AVR_HAVE_SPH__
11914 @itemx __AVR_SP8__
11915 The device has the SPH (high part of stack pointer) special function
11916 register or has an 8-bit stack pointer, respectively.
11917 The definition of these macros is affected by @code{-mmcu=} and
11918 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
11919 by @code{-msp8}.
11920
11921 @item __AVR_HAVE_RAMPD__
11922 @itemx __AVR_HAVE_RAMPX__
11923 @itemx __AVR_HAVE_RAMPY__
11924 @itemx __AVR_HAVE_RAMPZ__
11925 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
11926 @code{RAMPZ} special function register, respectively.
11927
11928 @item __NO_INTERRUPTS__
11929 This macro reflects the @code{-mno-interrupts} command line option.
11930
11931 @item __AVR_ERRATA_SKIP__
11932 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
11933 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
11934 instructions because of a hardware erratum.  Skip instructions are
11935 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
11936 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
11937 set.
11938
11939 @item __AVR_SFR_OFFSET__=@var{offset}
11940 Instructions that can address I/O special function registers directly
11941 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
11942 address as if addressed by an instruction to access RAM like @code{LD}
11943 or @code{STS}. This offset depends on the device architecture and has
11944 to be subtracted from the RAM address in order to get the
11945 respective I/O@tie{}address.
11946
11947 @item __WITH_AVRLIBC__
11948 The compiler is configured to be used together with AVR-Libc.
11949 See the @code{--with-avrlibc} configure option.
11950
11951 @end table
11952
11953 @node Blackfin Options
11954 @subsection Blackfin Options
11955 @cindex Blackfin Options
11956
11957 @table @gcctabopt
11958 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
11959 @opindex mcpu=
11960 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
11961 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
11962 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
11963 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
11964 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
11965 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
11966 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
11967 @samp{bf561}, @samp{bf592}.
11968
11969 The optional @var{sirevision} specifies the silicon revision of the target
11970 Blackfin processor.  Any workarounds available for the targeted silicon revision
11971 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
11972 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
11973 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
11974 hexadecimal digits representing the major and minor numbers in the silicon
11975 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
11976 is not defined.  If @var{sirevision} is @samp{any}, the
11977 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
11978 If this optional @var{sirevision} is not used, GCC assumes the latest known
11979 silicon revision of the targeted Blackfin processor.
11980
11981 GCC defines a preprocessor macro for the specified @var{cpu}.
11982 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
11983 provided by libgloss to be linked in if @option{-msim} is not given.
11984
11985 Without this option, @samp{bf532} is used as the processor by default.
11986
11987 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
11988 only the preprocessor macro is defined.
11989
11990 @item -msim
11991 @opindex msim
11992 Specifies that the program will be run on the simulator.  This causes
11993 the simulator BSP provided by libgloss to be linked in.  This option
11994 has effect only for @samp{bfin-elf} toolchain.
11995 Certain other options, such as @option{-mid-shared-library} and
11996 @option{-mfdpic}, imply @option{-msim}.
11997
11998 @item -momit-leaf-frame-pointer
11999 @opindex momit-leaf-frame-pointer
12000 Don't keep the frame pointer in a register for leaf functions.  This
12001 avoids the instructions to save, set up and restore frame pointers and
12002 makes an extra register available in leaf functions.  The option
12003 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
12004 which might make debugging harder.
12005
12006 @item -mspecld-anomaly
12007 @opindex mspecld-anomaly
12008 When enabled, the compiler ensures that the generated code does not
12009 contain speculative loads after jump instructions. If this option is used,
12010 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
12011
12012 @item -mno-specld-anomaly
12013 @opindex mno-specld-anomaly
12014 Don't generate extra code to prevent speculative loads from occurring.
12015
12016 @item -mcsync-anomaly
12017 @opindex mcsync-anomaly
12018 When enabled, the compiler ensures that the generated code does not
12019 contain CSYNC or SSYNC instructions too soon after conditional branches.
12020 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
12021
12022 @item -mno-csync-anomaly
12023 @opindex mno-csync-anomaly
12024 Don't generate extra code to prevent CSYNC or SSYNC instructions from
12025 occurring too soon after a conditional branch.
12026
12027 @item -mlow-64k
12028 @opindex mlow-64k
12029 When enabled, the compiler is free to take advantage of the knowledge that
12030 the entire program fits into the low 64k of memory.
12031
12032 @item -mno-low-64k
12033 @opindex mno-low-64k
12034 Assume that the program is arbitrarily large.  This is the default.
12035
12036 @item -mstack-check-l1
12037 @opindex mstack-check-l1
12038 Do stack checking using information placed into L1 scratchpad memory by the
12039 uClinux kernel.
12040
12041 @item -mid-shared-library
12042 @opindex mid-shared-library
12043 Generate code that supports shared libraries via the library ID method.
12044 This allows for execute in place and shared libraries in an environment
12045 without virtual memory management.  This option implies @option{-fPIC}.
12046 With a @samp{bfin-elf} target, this option implies @option{-msim}.
12047
12048 @item -mno-id-shared-library
12049 @opindex mno-id-shared-library
12050 Generate code that doesn't assume ID-based shared libraries are being used.
12051 This is the default.
12052
12053 @item -mleaf-id-shared-library
12054 @opindex mleaf-id-shared-library
12055 Generate code that supports shared libraries via the library ID method,
12056 but assumes that this library or executable won't link against any other
12057 ID shared libraries.  That allows the compiler to use faster code for jumps
12058 and calls.
12059
12060 @item -mno-leaf-id-shared-library
12061 @opindex mno-leaf-id-shared-library
12062 Do not assume that the code being compiled won't link against any ID shared
12063 libraries.  Slower code is generated for jump and call insns.
12064
12065 @item -mshared-library-id=n
12066 @opindex mshared-library-id
12067 Specifies the identification number of the ID-based shared library being
12068 compiled.  Specifying a value of 0 generates more compact code; specifying
12069 other values forces the allocation of that number to the current
12070 library but is no more space- or time-efficient than omitting this option.
12071
12072 @item -msep-data
12073 @opindex msep-data
12074 Generate code that allows the data segment to be located in a different
12075 area of memory from the text segment.  This allows for execute in place in
12076 an environment without virtual memory management by eliminating relocations
12077 against the text section.
12078
12079 @item -mno-sep-data
12080 @opindex mno-sep-data
12081 Generate code that assumes that the data segment follows the text segment.
12082 This is the default.
12083
12084 @item -mlong-calls
12085 @itemx -mno-long-calls
12086 @opindex mlong-calls
12087 @opindex mno-long-calls
12088 Tells the compiler to perform function calls by first loading the
12089 address of the function into a register and then performing a subroutine
12090 call on this register.  This switch is needed if the target function
12091 lies outside of the 24-bit addressing range of the offset-based
12092 version of subroutine call instruction.
12093
12094 This feature is not enabled by default.  Specifying
12095 @option{-mno-long-calls} restores the default behavior.  Note these
12096 switches have no effect on how the compiler generates code to handle
12097 function calls via function pointers.
12098
12099 @item -mfast-fp
12100 @opindex mfast-fp
12101 Link with the fast floating-point library. This library relaxes some of
12102 the IEEE floating-point standard's rules for checking inputs against
12103 Not-a-Number (NAN), in the interest of performance.
12104
12105 @item -minline-plt
12106 @opindex minline-plt
12107 Enable inlining of PLT entries in function calls to functions that are
12108 not known to bind locally.  It has no effect without @option{-mfdpic}.
12109
12110 @item -mmulticore
12111 @opindex mmulticore
12112 Build a standalone application for multicore Blackfin processors. 
12113 This option causes proper start files and link scripts supporting 
12114 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
12115 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
12116
12117 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
12118 selects the one-application-per-core programming model.  Without
12119 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
12120 programming model is used. In this model, the main function of Core B
12121 should be named as @code{coreb_main}.
12122
12123 If this option is not used, the single-core application programming
12124 model is used.
12125
12126 @item -mcorea
12127 @opindex mcorea
12128 Build a standalone application for Core A of BF561 when using
12129 the one-application-per-core programming model. Proper start files
12130 and link scripts are used to support Core A, and the macro
12131 @code{__BFIN_COREA} is defined.
12132 This option can only be used in conjunction with @option{-mmulticore}.
12133
12134 @item -mcoreb
12135 @opindex mcoreb
12136 Build a standalone application for Core B of BF561 when using
12137 the one-application-per-core programming model. Proper start files
12138 and link scripts are used to support Core B, and the macro
12139 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
12140 should be used instead of @code{main}. 
12141 This option can only be used in conjunction with @option{-mmulticore}.
12142
12143 @item -msdram
12144 @opindex msdram
12145 Build a standalone application for SDRAM. Proper start files and
12146 link scripts are used to put the application into SDRAM, and the macro
12147 @code{__BFIN_SDRAM} is defined.
12148 The loader should initialize SDRAM before loading the application.
12149
12150 @item -micplb
12151 @opindex micplb
12152 Assume that ICPLBs are enabled at run time.  This has an effect on certain
12153 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
12154 are enabled; for standalone applications the default is off.
12155 @end table
12156
12157 @node C6X Options
12158 @subsection C6X Options
12159 @cindex C6X Options
12160
12161 @table @gcctabopt
12162 @item -march=@var{name}
12163 @opindex march
12164 This specifies the name of the target architecture.  GCC uses this
12165 name to determine what kind of instructions it can emit when generating
12166 assembly code.  Permissible names are: @samp{c62x},
12167 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
12168
12169 @item -mbig-endian
12170 @opindex mbig-endian
12171 Generate code for a big-endian target.
12172
12173 @item -mlittle-endian
12174 @opindex mlittle-endian
12175 Generate code for a little-endian target.  This is the default.
12176
12177 @item -msim
12178 @opindex msim
12179 Choose startup files and linker script suitable for the simulator.
12180
12181 @item -msdata=default
12182 @opindex msdata=default
12183 Put small global and static data in the @samp{.neardata} section,
12184 which is pointed to by register @code{B14}.  Put small uninitialized
12185 global and static data in the @samp{.bss} section, which is adjacent
12186 to the @samp{.neardata} section.  Put small read-only data into the
12187 @samp{.rodata} section.  The corresponding sections used for large
12188 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
12189
12190 @item -msdata=all
12191 @opindex msdata=all
12192 Put all data, not just small objects, into the sections reserved for
12193 small data, and use addressing relative to the @code{B14} register to
12194 access them.
12195
12196 @item -msdata=none
12197 @opindex msdata=none
12198 Make no use of the sections reserved for small data, and use absolute
12199 addresses to access all data.  Put all initialized global and static
12200 data in the @samp{.fardata} section, and all uninitialized data in the
12201 @samp{.far} section.  Put all constant data into the @samp{.const}
12202 section.
12203 @end table
12204
12205 @node CRIS Options
12206 @subsection CRIS Options
12207 @cindex CRIS Options
12208
12209 These options are defined specifically for the CRIS ports.
12210
12211 @table @gcctabopt
12212 @item -march=@var{architecture-type}
12213 @itemx -mcpu=@var{architecture-type}
12214 @opindex march
12215 @opindex mcpu
12216 Generate code for the specified architecture.  The choices for
12217 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
12218 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
12219 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
12220 @samp{v10}.
12221
12222 @item -mtune=@var{architecture-type}
12223 @opindex mtune
12224 Tune to @var{architecture-type} everything applicable about the generated
12225 code, except for the ABI and the set of available instructions.  The
12226 choices for @var{architecture-type} are the same as for
12227 @option{-march=@var{architecture-type}}.
12228
12229 @item -mmax-stack-frame=@var{n}
12230 @opindex mmax-stack-frame
12231 Warn when the stack frame of a function exceeds @var{n} bytes.
12232
12233 @item -metrax4
12234 @itemx -metrax100
12235 @opindex metrax4
12236 @opindex metrax100
12237 The options @option{-metrax4} and @option{-metrax100} are synonyms for
12238 @option{-march=v3} and @option{-march=v8} respectively.
12239
12240 @item -mmul-bug-workaround
12241 @itemx -mno-mul-bug-workaround
12242 @opindex mmul-bug-workaround
12243 @opindex mno-mul-bug-workaround
12244 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
12245 models where it applies.  This option is active by default.
12246
12247 @item -mpdebug
12248 @opindex mpdebug
12249 Enable CRIS-specific verbose debug-related information in the assembly
12250 code.  This option also has the effect of turning off the @samp{#NO_APP}
12251 formatted-code indicator to the assembler at the beginning of the
12252 assembly file.
12253
12254 @item -mcc-init
12255 @opindex mcc-init
12256 Do not use condition-code results from previous instruction; always emit
12257 compare and test instructions before use of condition codes.
12258
12259 @item -mno-side-effects
12260 @opindex mno-side-effects
12261 Do not emit instructions with side effects in addressing modes other than
12262 post-increment.
12263
12264 @item -mstack-align
12265 @itemx -mno-stack-align
12266 @itemx -mdata-align
12267 @itemx -mno-data-align
12268 @itemx -mconst-align
12269 @itemx -mno-const-align
12270 @opindex mstack-align
12271 @opindex mno-stack-align
12272 @opindex mdata-align
12273 @opindex mno-data-align
12274 @opindex mconst-align
12275 @opindex mno-const-align
12276 These options (@samp{no-} options) arrange (eliminate arrangements) for the
12277 stack frame, individual data and constants to be aligned for the maximum
12278 single data access size for the chosen CPU model.  The default is to
12279 arrange for 32-bit alignment.  ABI details such as structure layout are
12280 not affected by these options.
12281
12282 @item -m32-bit
12283 @itemx -m16-bit
12284 @itemx -m8-bit
12285 @opindex m32-bit
12286 @opindex m16-bit
12287 @opindex m8-bit
12288 Similar to the stack- data- and const-align options above, these options
12289 arrange for stack frame, writable data and constants to all be 32-bit,
12290 16-bit or 8-bit aligned.  The default is 32-bit alignment.
12291
12292 @item -mno-prologue-epilogue
12293 @itemx -mprologue-epilogue
12294 @opindex mno-prologue-epilogue
12295 @opindex mprologue-epilogue
12296 With @option{-mno-prologue-epilogue}, the normal function prologue and
12297 epilogue which set up the stack frame are omitted and no return
12298 instructions or return sequences are generated in the code.  Use this
12299 option only together with visual inspection of the compiled code: no
12300 warnings or errors are generated when call-saved registers must be saved,
12301 or storage for local variables needs to be allocated.
12302
12303 @item -mno-gotplt
12304 @itemx -mgotplt
12305 @opindex mno-gotplt
12306 @opindex mgotplt
12307 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
12308 instruction sequences that load addresses for functions from the PLT part
12309 of the GOT rather than (traditional on other architectures) calls to the
12310 PLT@.  The default is @option{-mgotplt}.
12311
12312 @item -melf
12313 @opindex melf
12314 Legacy no-op option only recognized with the cris-axis-elf and
12315 cris-axis-linux-gnu targets.
12316
12317 @item -mlinux
12318 @opindex mlinux
12319 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
12320
12321 @item -sim
12322 @opindex sim
12323 This option, recognized for the cris-axis-elf, arranges
12324 to link with input-output functions from a simulator library.  Code,
12325 initialized data and zero-initialized data are allocated consecutively.
12326
12327 @item -sim2
12328 @opindex sim2
12329 Like @option{-sim}, but pass linker options to locate initialized data at
12330 0x40000000 and zero-initialized data at 0x80000000.
12331 @end table
12332
12333 @node CR16 Options
12334 @subsection CR16 Options
12335 @cindex CR16 Options
12336
12337 These options are defined specifically for the CR16 ports.
12338
12339 @table @gcctabopt
12340
12341 @item -mmac
12342 @opindex mmac
12343 Enable the use of multiply-accumulate instructions. Disabled by default.
12344
12345 @item -mcr16cplus
12346 @itemx -mcr16c
12347 @opindex mcr16cplus
12348 @opindex mcr16c
12349 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
12350 is default.
12351
12352 @item -msim
12353 @opindex msim
12354 Links the library libsim.a which is in compatible with simulator. Applicable
12355 to ELF compiler only.
12356
12357 @item -mint32
12358 @opindex mint32
12359 Choose integer type as 32-bit wide.
12360
12361 @item -mbit-ops
12362 @opindex mbit-ops
12363 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
12364
12365 @item -mdata-model=@var{model}
12366 @opindex mdata-model
12367 Choose a data model. The choices for @var{model} are @samp{near},
12368 @samp{far} or @samp{medium}. @samp{medium} is default.
12369 However, @samp{far} is not valid with @option{-mcr16c}, as the
12370 CR16C architecture does not support the far data model.
12371 @end table
12372
12373 @node Darwin Options
12374 @subsection Darwin Options
12375 @cindex Darwin options
12376
12377 These options are defined for all architectures running the Darwin operating
12378 system.
12379
12380 FSF GCC on Darwin does not create ``fat'' object files; it creates
12381 an object file for the single architecture that GCC was built to
12382 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
12383 @option{-arch} options are used; it does so by running the compiler or
12384 linker multiple times and joining the results together with
12385 @file{lipo}.
12386
12387 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
12388 @samp{i686}) is determined by the flags that specify the ISA
12389 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
12390 @option{-force_cpusubtype_ALL} option can be used to override this.
12391
12392 The Darwin tools vary in their behavior when presented with an ISA
12393 mismatch.  The assembler, @file{as}, only permits instructions to
12394 be used that are valid for the subtype of the file it is generating,
12395 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
12396 The linker for shared libraries, @file{/usr/bin/libtool}, fails
12397 and prints an error if asked to create a shared library with a less
12398 restrictive subtype than its input files (for instance, trying to put
12399 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
12400 for executables, @command{ld}, quietly gives the executable the most
12401 restrictive subtype of any of its input files.
12402
12403 @table @gcctabopt
12404 @item -F@var{dir}
12405 @opindex F
12406 Add the framework directory @var{dir} to the head of the list of
12407 directories to be searched for header files.  These directories are
12408 interleaved with those specified by @option{-I} options and are
12409 scanned in a left-to-right order.
12410
12411 A framework directory is a directory with frameworks in it.  A
12412 framework is a directory with a @file{Headers} and/or
12413 @file{PrivateHeaders} directory contained directly in it that ends
12414 in @file{.framework}.  The name of a framework is the name of this
12415 directory excluding the @file{.framework}.  Headers associated with
12416 the framework are found in one of those two directories, with
12417 @file{Headers} being searched first.  A subframework is a framework
12418 directory that is in a framework's @file{Frameworks} directory.
12419 Includes of subframework headers can only appear in a header of a
12420 framework that contains the subframework, or in a sibling subframework
12421 header.  Two subframeworks are siblings if they occur in the same
12422 framework.  A subframework should not have the same name as a
12423 framework; a warning is issued if this is violated.  Currently a
12424 subframework cannot have subframeworks; in the future, the mechanism
12425 may be extended to support this.  The standard frameworks can be found
12426 in @file{/System/Library/Frameworks} and
12427 @file{/Library/Frameworks}.  An example include looks like
12428 @code{#include <Framework/header.h>}, where @file{Framework} denotes
12429 the name of the framework and @file{header.h} is found in the
12430 @file{PrivateHeaders} or @file{Headers} directory.
12431
12432 @item -iframework@var{dir}
12433 @opindex iframework
12434 Like @option{-F} except the directory is a treated as a system
12435 directory.  The main difference between this @option{-iframework} and
12436 @option{-F} is that with @option{-iframework} the compiler does not
12437 warn about constructs contained within header files found via
12438 @var{dir}.  This option is valid only for the C family of languages.
12439
12440 @item -gused
12441 @opindex gused
12442 Emit debugging information for symbols that are used.  For stabs
12443 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
12444 This is by default ON@.
12445
12446 @item -gfull
12447 @opindex gfull
12448 Emit debugging information for all symbols and types.
12449
12450 @item -mmacosx-version-min=@var{version}
12451 The earliest version of MacOS X that this executable will run on
12452 is @var{version}.  Typical values of @var{version} include @code{10.1},
12453 @code{10.2}, and @code{10.3.9}.
12454
12455 If the compiler was built to use the system's headers by default,
12456 then the default for this option is the system version on which the
12457 compiler is running, otherwise the default is to make choices that
12458 are compatible with as many systems and code bases as possible.
12459
12460 @item -mkernel
12461 @opindex mkernel
12462 Enable kernel development mode.  The @option{-mkernel} option sets
12463 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
12464 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
12465 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
12466 applicable.  This mode also sets @option{-mno-altivec},
12467 @option{-msoft-float}, @option{-fno-builtin} and
12468 @option{-mlong-branch} for PowerPC targets.
12469
12470 @item -mone-byte-bool
12471 @opindex mone-byte-bool
12472 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
12473 By default @samp{sizeof(bool)} is @samp{4} when compiling for
12474 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
12475 option has no effect on x86.
12476
12477 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
12478 to generate code that is not binary compatible with code generated
12479 without that switch.  Using this switch may require recompiling all
12480 other modules in a program, including system libraries.  Use this
12481 switch to conform to a non-default data model.
12482
12483 @item -mfix-and-continue
12484 @itemx -ffix-and-continue
12485 @itemx -findirect-data
12486 @opindex mfix-and-continue
12487 @opindex ffix-and-continue
12488 @opindex findirect-data
12489 Generate code suitable for fast turnaround development, such as to
12490 allow GDB to dynamically load @code{.o} files into already-running
12491 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
12492 are provided for backwards compatibility.
12493
12494 @item -all_load
12495 @opindex all_load
12496 Loads all members of static archive libraries.
12497 See man ld(1) for more information.
12498
12499 @item -arch_errors_fatal
12500 @opindex arch_errors_fatal
12501 Cause the errors having to do with files that have the wrong architecture
12502 to be fatal.
12503
12504 @item -bind_at_load
12505 @opindex bind_at_load
12506 Causes the output file to be marked such that the dynamic linker will
12507 bind all undefined references when the file is loaded or launched.
12508
12509 @item -bundle
12510 @opindex bundle
12511 Produce a Mach-o bundle format file.
12512 See man ld(1) for more information.
12513
12514 @item -bundle_loader @var{executable}
12515 @opindex bundle_loader
12516 This option specifies the @var{executable} that will load the build
12517 output file being linked.  See man ld(1) for more information.
12518
12519 @item -dynamiclib
12520 @opindex dynamiclib
12521 When passed this option, GCC produces a dynamic library instead of
12522 an executable when linking, using the Darwin @file{libtool} command.
12523
12524 @item -force_cpusubtype_ALL
12525 @opindex force_cpusubtype_ALL
12526 This causes GCC's output file to have the @var{ALL} subtype, instead of
12527 one controlled by the @option{-mcpu} or @option{-march} option.
12528
12529 @item -allowable_client  @var{client_name}
12530 @itemx -client_name
12531 @itemx -compatibility_version
12532 @itemx -current_version
12533 @itemx -dead_strip
12534 @itemx -dependency-file
12535 @itemx -dylib_file
12536 @itemx -dylinker_install_name
12537 @itemx -dynamic
12538 @itemx -exported_symbols_list
12539 @itemx -filelist
12540 @need 800
12541 @itemx -flat_namespace
12542 @itemx -force_flat_namespace
12543 @itemx -headerpad_max_install_names
12544 @itemx -image_base
12545 @itemx -init
12546 @itemx -install_name
12547 @itemx -keep_private_externs
12548 @itemx -multi_module
12549 @itemx -multiply_defined
12550 @itemx -multiply_defined_unused
12551 @need 800
12552 @itemx -noall_load
12553 @itemx -no_dead_strip_inits_and_terms
12554 @itemx -nofixprebinding
12555 @itemx -nomultidefs
12556 @itemx -noprebind
12557 @itemx -noseglinkedit
12558 @itemx -pagezero_size
12559 @itemx -prebind
12560 @itemx -prebind_all_twolevel_modules
12561 @itemx -private_bundle
12562 @need 800
12563 @itemx -read_only_relocs
12564 @itemx -sectalign
12565 @itemx -sectobjectsymbols
12566 @itemx -whyload
12567 @itemx -seg1addr
12568 @itemx -sectcreate
12569 @itemx -sectobjectsymbols
12570 @itemx -sectorder
12571 @itemx -segaddr
12572 @itemx -segs_read_only_addr
12573 @need 800
12574 @itemx -segs_read_write_addr
12575 @itemx -seg_addr_table
12576 @itemx -seg_addr_table_filename
12577 @itemx -seglinkedit
12578 @itemx -segprot
12579 @itemx -segs_read_only_addr
12580 @itemx -segs_read_write_addr
12581 @itemx -single_module
12582 @itemx -static
12583 @itemx -sub_library
12584 @need 800
12585 @itemx -sub_umbrella
12586 @itemx -twolevel_namespace
12587 @itemx -umbrella
12588 @itemx -undefined
12589 @itemx -unexported_symbols_list
12590 @itemx -weak_reference_mismatches
12591 @itemx -whatsloaded
12592 @opindex allowable_client
12593 @opindex client_name
12594 @opindex compatibility_version
12595 @opindex current_version
12596 @opindex dead_strip
12597 @opindex dependency-file
12598 @opindex dylib_file
12599 @opindex dylinker_install_name
12600 @opindex dynamic
12601 @opindex exported_symbols_list
12602 @opindex filelist
12603 @opindex flat_namespace
12604 @opindex force_flat_namespace
12605 @opindex headerpad_max_install_names
12606 @opindex image_base
12607 @opindex init
12608 @opindex install_name
12609 @opindex keep_private_externs
12610 @opindex multi_module
12611 @opindex multiply_defined
12612 @opindex multiply_defined_unused
12613 @opindex noall_load
12614 @opindex no_dead_strip_inits_and_terms
12615 @opindex nofixprebinding
12616 @opindex nomultidefs
12617 @opindex noprebind
12618 @opindex noseglinkedit
12619 @opindex pagezero_size
12620 @opindex prebind
12621 @opindex prebind_all_twolevel_modules
12622 @opindex private_bundle
12623 @opindex read_only_relocs
12624 @opindex sectalign
12625 @opindex sectobjectsymbols
12626 @opindex whyload
12627 @opindex seg1addr
12628 @opindex sectcreate
12629 @opindex sectobjectsymbols
12630 @opindex sectorder
12631 @opindex segaddr
12632 @opindex segs_read_only_addr
12633 @opindex segs_read_write_addr
12634 @opindex seg_addr_table
12635 @opindex seg_addr_table_filename
12636 @opindex seglinkedit
12637 @opindex segprot
12638 @opindex segs_read_only_addr
12639 @opindex segs_read_write_addr
12640 @opindex single_module
12641 @opindex static
12642 @opindex sub_library
12643 @opindex sub_umbrella
12644 @opindex twolevel_namespace
12645 @opindex umbrella
12646 @opindex undefined
12647 @opindex unexported_symbols_list
12648 @opindex weak_reference_mismatches
12649 @opindex whatsloaded
12650 These options are passed to the Darwin linker.  The Darwin linker man page
12651 describes them in detail.
12652 @end table
12653
12654 @node DEC Alpha Options
12655 @subsection DEC Alpha Options
12656
12657 These @samp{-m} options are defined for the DEC Alpha implementations:
12658
12659 @table @gcctabopt
12660 @item -mno-soft-float
12661 @itemx -msoft-float
12662 @opindex mno-soft-float
12663 @opindex msoft-float
12664 Use (do not use) the hardware floating-point instructions for
12665 floating-point operations.  When @option{-msoft-float} is specified,
12666 functions in @file{libgcc.a} are used to perform floating-point
12667 operations.  Unless they are replaced by routines that emulate the
12668 floating-point operations, or compiled in such a way as to call such
12669 emulations routines, these routines issue floating-point
12670 operations.   If you are compiling for an Alpha without floating-point
12671 operations, you must ensure that the library is built so as not to call
12672 them.
12673
12674 Note that Alpha implementations without floating-point operations are
12675 required to have floating-point registers.
12676
12677 @item -mfp-reg
12678 @itemx -mno-fp-regs
12679 @opindex mfp-reg
12680 @opindex mno-fp-regs
12681 Generate code that uses (does not use) the floating-point register set.
12682 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
12683 register set is not used, floating-point operands are passed in integer
12684 registers as if they were integers and floating-point results are passed
12685 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
12686 so any function with a floating-point argument or return value called by code
12687 compiled with @option{-mno-fp-regs} must also be compiled with that
12688 option.
12689
12690 A typical use of this option is building a kernel that does not use,
12691 and hence need not save and restore, any floating-point registers.
12692
12693 @item -mieee
12694 @opindex mieee
12695 The Alpha architecture implements floating-point hardware optimized for
12696 maximum performance.  It is mostly compliant with the IEEE floating-point
12697 standard.  However, for full compliance, software assistance is
12698 required.  This option generates code fully IEEE-compliant code
12699 @emph{except} that the @var{inexact-flag} is not maintained (see below).
12700 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
12701 defined during compilation.  The resulting code is less efficient but is
12702 able to correctly support denormalized numbers and exceptional IEEE
12703 values such as not-a-number and plus/minus infinity.  Other Alpha
12704 compilers call this option @option{-ieee_with_no_inexact}.
12705
12706 @item -mieee-with-inexact
12707 @opindex mieee-with-inexact
12708 This is like @option{-mieee} except the generated code also maintains
12709 the IEEE @var{inexact-flag}.  Turning on this option causes the
12710 generated code to implement fully-compliant IEEE math.  In addition to
12711 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
12712 macro.  On some Alpha implementations the resulting code may execute
12713 significantly slower than the code generated by default.  Since there is
12714 very little code that depends on the @var{inexact-flag}, you should
12715 normally not specify this option.  Other Alpha compilers call this
12716 option @option{-ieee_with_inexact}.
12717
12718 @item -mfp-trap-mode=@var{trap-mode}
12719 @opindex mfp-trap-mode
12720 This option controls what floating-point related traps are enabled.
12721 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
12722 The trap mode can be set to one of four values:
12723
12724 @table @samp
12725 @item n
12726 This is the default (normal) setting.  The only traps that are enabled
12727 are the ones that cannot be disabled in software (e.g., division by zero
12728 trap).
12729
12730 @item u
12731 In addition to the traps enabled by @samp{n}, underflow traps are enabled
12732 as well.
12733
12734 @item su
12735 Like @samp{u}, but the instructions are marked to be safe for software
12736 completion (see Alpha architecture manual for details).
12737
12738 @item sui
12739 Like @samp{su}, but inexact traps are enabled as well.
12740 @end table
12741
12742 @item -mfp-rounding-mode=@var{rounding-mode}
12743 @opindex mfp-rounding-mode
12744 Selects the IEEE rounding mode.  Other Alpha compilers call this option
12745 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
12746 of:
12747
12748 @table @samp
12749 @item n
12750 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
12751 the nearest machine number or towards the even machine number in case
12752 of a tie.
12753
12754 @item m
12755 Round towards minus infinity.
12756
12757 @item c
12758 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
12759
12760 @item d
12761 Dynamic rounding mode.  A field in the floating-point control register
12762 (@var{fpcr}, see Alpha architecture reference manual) controls the
12763 rounding mode in effect.  The C library initializes this register for
12764 rounding towards plus infinity.  Thus, unless your program modifies the
12765 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
12766 @end table
12767
12768 @item -mtrap-precision=@var{trap-precision}
12769 @opindex mtrap-precision
12770 In the Alpha architecture, floating-point traps are imprecise.  This
12771 means without software assistance it is impossible to recover from a
12772 floating trap and program execution normally needs to be terminated.
12773 GCC can generate code that can assist operating system trap handlers
12774 in determining the exact location that caused a floating-point trap.
12775 Depending on the requirements of an application, different levels of
12776 precisions can be selected:
12777
12778 @table @samp
12779 @item p
12780 Program precision.  This option is the default and means a trap handler
12781 can only identify which program caused a floating-point exception.
12782
12783 @item f
12784 Function precision.  The trap handler can determine the function that
12785 caused a floating-point exception.
12786
12787 @item i
12788 Instruction precision.  The trap handler can determine the exact
12789 instruction that caused a floating-point exception.
12790 @end table
12791
12792 Other Alpha compilers provide the equivalent options called
12793 @option{-scope_safe} and @option{-resumption_safe}.
12794
12795 @item -mieee-conformant
12796 @opindex mieee-conformant
12797 This option marks the generated code as IEEE conformant.  You must not
12798 use this option unless you also specify @option{-mtrap-precision=i} and either
12799 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
12800 is to emit the line @samp{.eflag 48} in the function prologue of the
12801 generated assembly file.
12802
12803 @item -mbuild-constants
12804 @opindex mbuild-constants
12805 Normally GCC examines a 32- or 64-bit integer constant to
12806 see if it can construct it from smaller constants in two or three
12807 instructions.  If it cannot, it outputs the constant as a literal and
12808 generates code to load it from the data segment at run time.
12809
12810 Use this option to require GCC to construct @emph{all} integer constants
12811 using code, even if it takes more instructions (the maximum is six).
12812
12813 You typically use this option to build a shared library dynamic
12814 loader.  Itself a shared library, it must relocate itself in memory
12815 before it can find the variables and constants in its own data segment.
12816
12817 @item -mbwx
12818 @itemx -mno-bwx
12819 @itemx -mcix
12820 @itemx -mno-cix
12821 @itemx -mfix
12822 @itemx -mno-fix
12823 @itemx -mmax
12824 @itemx -mno-max
12825 @opindex mbwx
12826 @opindex mno-bwx
12827 @opindex mcix
12828 @opindex mno-cix
12829 @opindex mfix
12830 @opindex mno-fix
12831 @opindex mmax
12832 @opindex mno-max
12833 Indicate whether GCC should generate code to use the optional BWX,
12834 CIX, FIX and MAX instruction sets.  The default is to use the instruction
12835 sets supported by the CPU type specified via @option{-mcpu=} option or that
12836 of the CPU on which GCC was built if none is specified.
12837
12838 @item -mfloat-vax
12839 @itemx -mfloat-ieee
12840 @opindex mfloat-vax
12841 @opindex mfloat-ieee
12842 Generate code that uses (does not use) VAX F and G floating-point
12843 arithmetic instead of IEEE single and double precision.
12844
12845 @item -mexplicit-relocs
12846 @itemx -mno-explicit-relocs
12847 @opindex mexplicit-relocs
12848 @opindex mno-explicit-relocs
12849 Older Alpha assemblers provided no way to generate symbol relocations
12850 except via assembler macros.  Use of these macros does not allow
12851 optimal instruction scheduling.  GNU binutils as of version 2.12
12852 supports a new syntax that allows the compiler to explicitly mark
12853 which relocations should apply to which instructions.  This option
12854 is mostly useful for debugging, as GCC detects the capabilities of
12855 the assembler when it is built and sets the default accordingly.
12856
12857 @item -msmall-data
12858 @itemx -mlarge-data
12859 @opindex msmall-data
12860 @opindex mlarge-data
12861 When @option{-mexplicit-relocs} is in effect, static data is
12862 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
12863 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
12864 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
12865 16-bit relocations off of the @code{$gp} register.  This limits the
12866 size of the small data area to 64KB, but allows the variables to be
12867 directly accessed via a single instruction.
12868
12869 The default is @option{-mlarge-data}.  With this option the data area
12870 is limited to just below 2GB@.  Programs that require more than 2GB of
12871 data must use @code{malloc} or @code{mmap} to allocate the data in the
12872 heap instead of in the program's data segment.
12873
12874 When generating code for shared libraries, @option{-fpic} implies
12875 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
12876
12877 @item -msmall-text
12878 @itemx -mlarge-text
12879 @opindex msmall-text
12880 @opindex mlarge-text
12881 When @option{-msmall-text} is used, the compiler assumes that the
12882 code of the entire program (or shared library) fits in 4MB, and is
12883 thus reachable with a branch instruction.  When @option{-msmall-data}
12884 is used, the compiler can assume that all local symbols share the
12885 same @code{$gp} value, and thus reduce the number of instructions
12886 required for a function call from 4 to 1.
12887
12888 The default is @option{-mlarge-text}.
12889
12890 @item -mcpu=@var{cpu_type}
12891 @opindex mcpu
12892 Set the instruction set and instruction scheduling parameters for
12893 machine type @var{cpu_type}.  You can specify either the @samp{EV}
12894 style name or the corresponding chip number.  GCC supports scheduling
12895 parameters for the EV4, EV5 and EV6 family of processors and
12896 chooses the default values for the instruction set from the processor
12897 you specify.  If you do not specify a processor type, GCC defaults
12898 to the processor on which the compiler was built.
12899
12900 Supported values for @var{cpu_type} are
12901
12902 @table @samp
12903 @item ev4
12904 @itemx ev45
12905 @itemx 21064
12906 Schedules as an EV4 and has no instruction set extensions.
12907
12908 @item ev5
12909 @itemx 21164
12910 Schedules as an EV5 and has no instruction set extensions.
12911
12912 @item ev56
12913 @itemx 21164a
12914 Schedules as an EV5 and supports the BWX extension.
12915
12916 @item pca56
12917 @itemx 21164pc
12918 @itemx 21164PC
12919 Schedules as an EV5 and supports the BWX and MAX extensions.
12920
12921 @item ev6
12922 @itemx 21264
12923 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
12924
12925 @item ev67
12926 @itemx 21264a
12927 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
12928 @end table
12929
12930 Native toolchains also support the value @samp{native},
12931 which selects the best architecture option for the host processor.
12932 @option{-mcpu=native} has no effect if GCC does not recognize
12933 the processor.
12934
12935 @item -mtune=@var{cpu_type}
12936 @opindex mtune
12937 Set only the instruction scheduling parameters for machine type
12938 @var{cpu_type}.  The instruction set is not changed.
12939
12940 Native toolchains also support the value @samp{native},
12941 which selects the best architecture option for the host processor.
12942 @option{-mtune=native} has no effect if GCC does not recognize
12943 the processor.
12944
12945 @item -mmemory-latency=@var{time}
12946 @opindex mmemory-latency
12947 Sets the latency the scheduler should assume for typical memory
12948 references as seen by the application.  This number is highly
12949 dependent on the memory access patterns used by the application
12950 and the size of the external cache on the machine.
12951
12952 Valid options for @var{time} are
12953
12954 @table @samp
12955 @item @var{number}
12956 A decimal number representing clock cycles.
12957
12958 @item L1
12959 @itemx L2
12960 @itemx L3
12961 @itemx main
12962 The compiler contains estimates of the number of clock cycles for
12963 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
12964 (also called Dcache, Scache, and Bcache), as well as to main memory.
12965 Note that L3 is only valid for EV5.
12966
12967 @end table
12968 @end table
12969
12970 @node FR30 Options
12971 @subsection FR30 Options
12972 @cindex FR30 Options
12973
12974 These options are defined specifically for the FR30 port.
12975
12976 @table @gcctabopt
12977
12978 @item -msmall-model
12979 @opindex msmall-model
12980 Use the small address space model.  This can produce smaller code, but
12981 it does assume that all symbolic values and addresses fit into a
12982 20-bit range.
12983
12984 @item -mno-lsim
12985 @opindex mno-lsim
12986 Assume that runtime support has been provided and so there is no need
12987 to include the simulator library (@file{libsim.a}) on the linker
12988 command line.
12989
12990 @end table
12991
12992 @node FRV Options
12993 @subsection FRV Options
12994 @cindex FRV Options
12995
12996 @table @gcctabopt
12997 @item -mgpr-32
12998 @opindex mgpr-32
12999
13000 Only use the first 32 general-purpose registers.
13001
13002 @item -mgpr-64
13003 @opindex mgpr-64
13004
13005 Use all 64 general-purpose registers.
13006
13007 @item -mfpr-32
13008 @opindex mfpr-32
13009
13010 Use only the first 32 floating-point registers.
13011
13012 @item -mfpr-64
13013 @opindex mfpr-64
13014
13015 Use all 64 floating-point registers.
13016
13017 @item -mhard-float
13018 @opindex mhard-float
13019
13020 Use hardware instructions for floating-point operations.
13021
13022 @item -msoft-float
13023 @opindex msoft-float
13024
13025 Use library routines for floating-point operations.
13026
13027 @item -malloc-cc
13028 @opindex malloc-cc
13029
13030 Dynamically allocate condition code registers.
13031
13032 @item -mfixed-cc
13033 @opindex mfixed-cc
13034
13035 Do not try to dynamically allocate condition code registers, only
13036 use @code{icc0} and @code{fcc0}.
13037
13038 @item -mdword
13039 @opindex mdword
13040
13041 Change ABI to use double word insns.
13042
13043 @item -mno-dword
13044 @opindex mno-dword
13045
13046 Do not use double word instructions.
13047
13048 @item -mdouble
13049 @opindex mdouble
13050
13051 Use floating-point double instructions.
13052
13053 @item -mno-double
13054 @opindex mno-double
13055
13056 Do not use floating-point double instructions.
13057
13058 @item -mmedia
13059 @opindex mmedia
13060
13061 Use media instructions.
13062
13063 @item -mno-media
13064 @opindex mno-media
13065
13066 Do not use media instructions.
13067
13068 @item -mmuladd
13069 @opindex mmuladd
13070
13071 Use multiply and add/subtract instructions.
13072
13073 @item -mno-muladd
13074 @opindex mno-muladd
13075
13076 Do not use multiply and add/subtract instructions.
13077
13078 @item -mfdpic
13079 @opindex mfdpic
13080
13081 Select the FDPIC ABI, which uses function descriptors to represent
13082 pointers to functions.  Without any PIC/PIE-related options, it
13083 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
13084 assumes GOT entries and small data are within a 12-bit range from the
13085 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
13086 are computed with 32 bits.
13087 With a @samp{bfin-elf} target, this option implies @option{-msim}.
13088
13089 @item -minline-plt
13090 @opindex minline-plt
13091
13092 Enable inlining of PLT entries in function calls to functions that are
13093 not known to bind locally.  It has no effect without @option{-mfdpic}.
13094 It's enabled by default if optimizing for speed and compiling for
13095 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
13096 optimization option such as @option{-O3} or above is present in the
13097 command line.
13098
13099 @item -mTLS
13100 @opindex mTLS
13101
13102 Assume a large TLS segment when generating thread-local code.
13103
13104 @item -mtls
13105 @opindex mtls
13106
13107 Do not assume a large TLS segment when generating thread-local code.
13108
13109 @item -mgprel-ro
13110 @opindex mgprel-ro
13111
13112 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
13113 that is known to be in read-only sections.  It's enabled by default,
13114 except for @option{-fpic} or @option{-fpie}: even though it may help
13115 make the global offset table smaller, it trades 1 instruction for 4.
13116 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
13117 one of which may be shared by multiple symbols, and it avoids the need
13118 for a GOT entry for the referenced symbol, so it's more likely to be a
13119 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
13120
13121 @item -multilib-library-pic
13122 @opindex multilib-library-pic
13123
13124 Link with the (library, not FD) pic libraries.  It's implied by
13125 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
13126 @option{-fpic} without @option{-mfdpic}.  You should never have to use
13127 it explicitly.
13128
13129 @item -mlinked-fp
13130 @opindex mlinked-fp
13131
13132 Follow the EABI requirement of always creating a frame pointer whenever
13133 a stack frame is allocated.  This option is enabled by default and can
13134 be disabled with @option{-mno-linked-fp}.
13135
13136 @item -mlong-calls
13137 @opindex mlong-calls
13138
13139 Use indirect addressing to call functions outside the current
13140 compilation unit.  This allows the functions to be placed anywhere
13141 within the 32-bit address space.
13142
13143 @item -malign-labels
13144 @opindex malign-labels
13145
13146 Try to align labels to an 8-byte boundary by inserting NOPs into the
13147 previous packet.  This option only has an effect when VLIW packing
13148 is enabled.  It doesn't create new packets; it merely adds NOPs to
13149 existing ones.
13150
13151 @item -mlibrary-pic
13152 @opindex mlibrary-pic
13153
13154 Generate position-independent EABI code.
13155
13156 @item -macc-4
13157 @opindex macc-4
13158
13159 Use only the first four media accumulator registers.
13160
13161 @item -macc-8
13162 @opindex macc-8
13163
13164 Use all eight media accumulator registers.
13165
13166 @item -mpack
13167 @opindex mpack
13168
13169 Pack VLIW instructions.
13170
13171 @item -mno-pack
13172 @opindex mno-pack
13173
13174 Do not pack VLIW instructions.
13175
13176 @item -mno-eflags
13177 @opindex mno-eflags
13178
13179 Do not mark ABI switches in e_flags.
13180
13181 @item -mcond-move
13182 @opindex mcond-move
13183
13184 Enable the use of conditional-move instructions (default).
13185
13186 This switch is mainly for debugging the compiler and will likely be removed
13187 in a future version.
13188
13189 @item -mno-cond-move
13190 @opindex mno-cond-move
13191
13192 Disable the use of conditional-move instructions.
13193
13194 This switch is mainly for debugging the compiler and will likely be removed
13195 in a future version.
13196
13197 @item -mscc
13198 @opindex mscc
13199
13200 Enable the use of conditional set instructions (default).
13201
13202 This switch is mainly for debugging the compiler and will likely be removed
13203 in a future version.
13204
13205 @item -mno-scc
13206 @opindex mno-scc
13207
13208 Disable the use of conditional set instructions.
13209
13210 This switch is mainly for debugging the compiler and will likely be removed
13211 in a future version.
13212
13213 @item -mcond-exec
13214 @opindex mcond-exec
13215
13216 Enable the use of conditional execution (default).
13217
13218 This switch is mainly for debugging the compiler and will likely be removed
13219 in a future version.
13220
13221 @item -mno-cond-exec
13222 @opindex mno-cond-exec
13223
13224 Disable the use of conditional execution.
13225
13226 This switch is mainly for debugging the compiler and will likely be removed
13227 in a future version.
13228
13229 @item -mvliw-branch
13230 @opindex mvliw-branch
13231
13232 Run a pass to pack branches into VLIW instructions (default).
13233
13234 This switch is mainly for debugging the compiler and will likely be removed
13235 in a future version.
13236
13237 @item -mno-vliw-branch
13238 @opindex mno-vliw-branch
13239
13240 Do not run a pass to pack branches into VLIW instructions.
13241
13242 This switch is mainly for debugging the compiler and will likely be removed
13243 in a future version.
13244
13245 @item -mmulti-cond-exec
13246 @opindex mmulti-cond-exec
13247
13248 Enable optimization of @code{&&} and @code{||} in conditional execution
13249 (default).
13250
13251 This switch is mainly for debugging the compiler and will likely be removed
13252 in a future version.
13253
13254 @item -mno-multi-cond-exec
13255 @opindex mno-multi-cond-exec
13256
13257 Disable optimization of @code{&&} and @code{||} in conditional execution.
13258
13259 This switch is mainly for debugging the compiler and will likely be removed
13260 in a future version.
13261
13262 @item -mnested-cond-exec
13263 @opindex mnested-cond-exec
13264
13265 Enable nested conditional execution optimizations (default).
13266
13267 This switch is mainly for debugging the compiler and will likely be removed
13268 in a future version.
13269
13270 @item -mno-nested-cond-exec
13271 @opindex mno-nested-cond-exec
13272
13273 Disable nested conditional execution optimizations.
13274
13275 This switch is mainly for debugging the compiler and will likely be removed
13276 in a future version.
13277
13278 @item -moptimize-membar
13279 @opindex moptimize-membar
13280
13281 This switch removes redundant @code{membar} instructions from the
13282 compiler-generated code.  It is enabled by default.
13283
13284 @item -mno-optimize-membar
13285 @opindex mno-optimize-membar
13286
13287 This switch disables the automatic removal of redundant @code{membar}
13288 instructions from the generated code.
13289
13290 @item -mtomcat-stats
13291 @opindex mtomcat-stats
13292
13293 Cause gas to print out tomcat statistics.
13294
13295 @item -mcpu=@var{cpu}
13296 @opindex mcpu
13297
13298 Select the processor type for which to generate code.  Possible values are
13299 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
13300 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
13301
13302 @end table
13303
13304 @node GNU/Linux Options
13305 @subsection GNU/Linux Options
13306
13307 These @samp{-m} options are defined for GNU/Linux targets:
13308
13309 @table @gcctabopt
13310 @item -mglibc
13311 @opindex mglibc
13312 Use the GNU C library.  This is the default except
13313 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
13314
13315 @item -muclibc
13316 @opindex muclibc
13317 Use uClibc C library.  This is the default on
13318 @samp{*-*-linux-*uclibc*} targets.
13319
13320 @item -mbionic
13321 @opindex mbionic
13322 Use Bionic C library.  This is the default on
13323 @samp{*-*-linux-*android*} targets.
13324
13325 @item -mandroid
13326 @opindex mandroid
13327 Compile code compatible with Android platform.  This is the default on
13328 @samp{*-*-linux-*android*} targets.
13329
13330 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
13331 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
13332 this option makes the GCC driver pass Android-specific options to the linker.
13333 Finally, this option causes the preprocessor macro @code{__ANDROID__}
13334 to be defined.
13335
13336 @item -tno-android-cc
13337 @opindex tno-android-cc
13338 Disable compilation effects of @option{-mandroid}, i.e., do not enable
13339 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
13340 @option{-fno-rtti} by default.
13341
13342 @item -tno-android-ld
13343 @opindex tno-android-ld
13344 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
13345 linking options to the linker.
13346
13347 @end table
13348
13349 @node H8/300 Options
13350 @subsection H8/300 Options
13351
13352 These @samp{-m} options are defined for the H8/300 implementations:
13353
13354 @table @gcctabopt
13355 @item -mrelax
13356 @opindex mrelax
13357 Shorten some address references at link time, when possible; uses the
13358 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
13359 ld, Using ld}, for a fuller description.
13360
13361 @item -mh
13362 @opindex mh
13363 Generate code for the H8/300H@.
13364
13365 @item -ms
13366 @opindex ms
13367 Generate code for the H8S@.
13368
13369 @item -mn
13370 @opindex mn
13371 Generate code for the H8S and H8/300H in the normal mode.  This switch
13372 must be used either with @option{-mh} or @option{-ms}.
13373
13374 @item -ms2600
13375 @opindex ms2600
13376 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
13377
13378 @item -mexr
13379 @opindex mexr
13380 Extended registers are stored on stack before execution of function
13381 with monitor attribute. Default option is @option{-mexr}.
13382 This option is valid only for H8S targets.
13383
13384 @item -mno-exr
13385 @opindex mno-exr
13386 Extended registers are not stored on stack before execution of function 
13387 with monitor attribute. Default option is @option{-mno-exr}. 
13388 This option is valid only for H8S targets.
13389
13390 @item -mint32
13391 @opindex mint32
13392 Make @code{int} data 32 bits by default.
13393
13394 @item -malign-300
13395 @opindex malign-300
13396 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
13397 The default for the H8/300H and H8S is to align longs and floats on
13398 4-byte boundaries.
13399 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
13400 This option has no effect on the H8/300.
13401 @end table
13402
13403 @node HPPA Options
13404 @subsection HPPA Options
13405 @cindex HPPA Options
13406
13407 These @samp{-m} options are defined for the HPPA family of computers:
13408
13409 @table @gcctabopt
13410 @item -march=@var{architecture-type}
13411 @opindex march
13412 Generate code for the specified architecture.  The choices for
13413 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
13414 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
13415 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
13416 architecture option for your machine.  Code compiled for lower numbered
13417 architectures runs on higher numbered architectures, but not the
13418 other way around.
13419
13420 @item -mpa-risc-1-0
13421 @itemx -mpa-risc-1-1
13422 @itemx -mpa-risc-2-0
13423 @opindex mpa-risc-1-0
13424 @opindex mpa-risc-1-1
13425 @opindex mpa-risc-2-0
13426 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
13427
13428 @item -mbig-switch
13429 @opindex mbig-switch
13430 Generate code suitable for big switch tables.  Use this option only if
13431 the assembler/linker complain about out-of-range branches within a switch
13432 table.
13433
13434 @item -mjump-in-delay
13435 @opindex mjump-in-delay
13436 Fill delay slots of function calls with unconditional jump instructions
13437 by modifying the return pointer for the function call to be the target
13438 of the conditional jump.
13439
13440 @item -mdisable-fpregs
13441 @opindex mdisable-fpregs
13442 Prevent floating-point registers from being used in any manner.  This is
13443 necessary for compiling kernels that perform lazy context switching of
13444 floating-point registers.  If you use this option and attempt to perform
13445 floating-point operations, the compiler aborts.
13446
13447 @item -mdisable-indexing
13448 @opindex mdisable-indexing
13449 Prevent the compiler from using indexing address modes.  This avoids some
13450 rather obscure problems when compiling MIG generated code under MACH@.
13451
13452 @item -mno-space-regs
13453 @opindex mno-space-regs
13454 Generate code that assumes the target has no space registers.  This allows
13455 GCC to generate faster indirect calls and use unscaled index address modes.
13456
13457 Such code is suitable for level 0 PA systems and kernels.
13458
13459 @item -mfast-indirect-calls
13460 @opindex mfast-indirect-calls
13461 Generate code that assumes calls never cross space boundaries.  This
13462 allows GCC to emit code that performs faster indirect calls.
13463
13464 This option does not work in the presence of shared libraries or nested
13465 functions.
13466
13467 @item -mfixed-range=@var{register-range}
13468 @opindex mfixed-range
13469 Generate code treating the given register range as fixed registers.
13470 A fixed register is one that the register allocator cannot use.  This is
13471 useful when compiling kernel code.  A register range is specified as
13472 two registers separated by a dash.  Multiple register ranges can be
13473 specified separated by a comma.
13474
13475 @item -mlong-load-store
13476 @opindex mlong-load-store
13477 Generate 3-instruction load and store sequences as sometimes required by
13478 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
13479 the HP compilers.
13480
13481 @item -mportable-runtime
13482 @opindex mportable-runtime
13483 Use the portable calling conventions proposed by HP for ELF systems.
13484
13485 @item -mgas
13486 @opindex mgas
13487 Enable the use of assembler directives only GAS understands.
13488
13489 @item -mschedule=@var{cpu-type}
13490 @opindex mschedule
13491 Schedule code according to the constraints for the machine type
13492 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
13493 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
13494 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
13495 proper scheduling option for your machine.  The default scheduling is
13496 @samp{8000}.
13497
13498 @item -mlinker-opt
13499 @opindex mlinker-opt
13500 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
13501 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
13502 linkers in which they give bogus error messages when linking some programs.
13503
13504 @item -msoft-float
13505 @opindex msoft-float
13506 Generate output containing library calls for floating point.
13507 @strong{Warning:} the requisite libraries are not available for all HPPA
13508 targets.  Normally the facilities of the machine's usual C compiler are
13509 used, but this cannot be done directly in cross-compilation.  You must make
13510 your own arrangements to provide suitable library functions for
13511 cross-compilation.
13512
13513 @option{-msoft-float} changes the calling convention in the output file;
13514 therefore, it is only useful if you compile @emph{all} of a program with
13515 this option.  In particular, you need to compile @file{libgcc.a}, the
13516 library that comes with GCC, with @option{-msoft-float} in order for
13517 this to work.
13518
13519 @item -msio
13520 @opindex msio
13521 Generate the predefine, @code{_SIO}, for server IO@.  The default is
13522 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
13523 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
13524 options are available under HP-UX and HI-UX@.
13525
13526 @item -mgnu-ld
13527 @opindex mgnu-ld
13528 Use options specific to GNU @command{ld}.
13529 This passes @option{-shared} to @command{ld} when
13530 building a shared library.  It is the default when GCC is configured,
13531 explicitly or implicitly, with the GNU linker.  This option does not
13532 affect which @command{ld} is called; it only changes what parameters
13533 are passed to that @command{ld}.
13534 The @command{ld} that is called is determined by the
13535 @option{--with-ld} configure option, GCC's program search path, and
13536 finally by the user's @env{PATH}.  The linker used by GCC can be printed
13537 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
13538 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13539
13540 @item -mhp-ld
13541 @opindex mhp-ld
13542 Use options specific to HP @command{ld}.
13543 This passes @option{-b} to @command{ld} when building
13544 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
13545 links.  It is the default when GCC is configured, explicitly or
13546 implicitly, with the HP linker.  This option does not affect
13547 which @command{ld} is called; it only changes what parameters are passed to that
13548 @command{ld}.
13549 The @command{ld} that is called is determined by the @option{--with-ld}
13550 configure option, GCC's program search path, and finally by the user's
13551 @env{PATH}.  The linker used by GCC can be printed using @samp{which
13552 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
13553 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13554
13555 @item -mlong-calls
13556 @opindex mno-long-calls
13557 Generate code that uses long call sequences.  This ensures that a call
13558 is always able to reach linker generated stubs.  The default is to generate
13559 long calls only when the distance from the call site to the beginning
13560 of the function or translation unit, as the case may be, exceeds a
13561 predefined limit set by the branch type being used.  The limits for
13562 normal calls are 7,600,000 and 240,000 bytes, respectively for the
13563 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
13564 240,000 bytes.
13565
13566 Distances are measured from the beginning of functions when using the
13567 @option{-ffunction-sections} option, or when using the @option{-mgas}
13568 and @option{-mno-portable-runtime} options together under HP-UX with
13569 the SOM linker.
13570
13571 It is normally not desirable to use this option as it degrades
13572 performance.  However, it may be useful in large applications,
13573 particularly when partial linking is used to build the application.
13574
13575 The types of long calls used depends on the capabilities of the
13576 assembler and linker, and the type of code being generated.  The
13577 impact on systems that support long absolute calls, and long pic
13578 symbol-difference or pc-relative calls should be relatively small.
13579 However, an indirect call is used on 32-bit ELF systems in pic code
13580 and it is quite long.
13581
13582 @item -munix=@var{unix-std}
13583 @opindex march
13584 Generate compiler predefines and select a startfile for the specified
13585 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
13586 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
13587 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
13588 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
13589 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
13590 and later.
13591
13592 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
13593 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
13594 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
13595 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
13596 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
13597 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
13598
13599 It is @emph{important} to note that this option changes the interfaces
13600 for various library routines.  It also affects the operational behavior
13601 of the C library.  Thus, @emph{extreme} care is needed in using this
13602 option.
13603
13604 Library code that is intended to operate with more than one UNIX
13605 standard must test, set and restore the variable @var{__xpg4_extended_mask}
13606 as appropriate.  Most GNU software doesn't provide this capability.
13607
13608 @item -nolibdld
13609 @opindex nolibdld
13610 Suppress the generation of link options to search libdld.sl when the
13611 @option{-static} option is specified on HP-UX 10 and later.
13612
13613 @item -static
13614 @opindex static
13615 The HP-UX implementation of setlocale in libc has a dependency on
13616 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
13617 when the @option{-static} option is specified, special link options
13618 are needed to resolve this dependency.
13619
13620 On HP-UX 10 and later, the GCC driver adds the necessary options to
13621 link with libdld.sl when the @option{-static} option is specified.
13622 This causes the resulting binary to be dynamic.  On the 64-bit port,
13623 the linkers generate dynamic binaries by default in any case.  The
13624 @option{-nolibdld} option can be used to prevent the GCC driver from
13625 adding these link options.
13626
13627 @item -threads
13628 @opindex threads
13629 Add support for multithreading with the @dfn{dce thread} library
13630 under HP-UX@.  This option sets flags for both the preprocessor and
13631 linker.
13632 @end table
13633
13634 @node i386 and x86-64 Options
13635 @subsection Intel 386 and AMD x86-64 Options
13636 @cindex i386 Options
13637 @cindex x86-64 Options
13638 @cindex Intel 386 Options
13639 @cindex AMD x86-64 Options
13640
13641 These @samp{-m} options are defined for the i386 and x86-64 family of
13642 computers:
13643
13644 @table @gcctabopt
13645
13646 @item -march=@var{cpu-type}
13647 @opindex march
13648 Generate instructions for the machine type @var{cpu-type}.  In contrast to
13649 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
13650 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
13651 to generate code that may not run at all on processors other than the one
13652 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
13653 @option{-mtune=@var{cpu-type}}.
13654
13655 The choices for @var{cpu-type} are:
13656
13657 @table @samp
13658 @item native
13659 This selects the CPU to generate code for at compilation time by determining
13660 the processor type of the compiling machine.  Using @option{-march=native}
13661 enables all instruction subsets supported by the local machine (hence
13662 the result might not run on different machines).  Using @option{-mtune=native}
13663 produces code optimized for the local machine under the constraints
13664 of the selected instruction set.  
13665
13666 @item i386
13667 Original Intel i386 CPU@.
13668
13669 @item i486
13670 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
13671
13672 @item i586
13673 @itemx pentium
13674 Intel Pentium CPU with no MMX support.
13675
13676 @item pentium-mmx
13677 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
13678
13679 @item pentiumpro
13680 Intel Pentium Pro CPU@.
13681
13682 @item i686
13683 When used with @option{-march}, the Pentium Pro
13684 instruction set is used, so the code runs on all i686 family chips.
13685 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
13686
13687 @item pentium2
13688 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
13689 support.
13690
13691 @item pentium3
13692 @itemx pentium3m
13693 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
13694 set support.
13695
13696 @item pentium-m
13697 Intel Pentium M; low-power version of Intel Pentium III CPU
13698 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
13699
13700 @item pentium4
13701 @itemx pentium4m
13702 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
13703
13704 @item prescott
13705 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
13706 set support.
13707
13708 @item nocona
13709 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
13710 SSE2 and SSE3 instruction set support.
13711
13712 @item core2
13713 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13714 instruction set support.
13715
13716 @item corei7
13717 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
13718 and SSE4.2 instruction set support.
13719
13720 @item corei7-avx
13721 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13722 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
13723
13724 @item core-avx-i
13725 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13726 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
13727 set support.
13728
13729 @item atom
13730 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13731 instruction set support.
13732
13733 @item k6
13734 AMD K6 CPU with MMX instruction set support.
13735
13736 @item k6-2
13737 @itemx k6-3
13738 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
13739
13740 @item athlon
13741 @itemx athlon-tbird
13742 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
13743 support.
13744
13745 @item athlon-4
13746 @itemx athlon-xp
13747 @itemx athlon-mp
13748 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
13749 instruction set support.
13750
13751 @item k8
13752 @itemx opteron
13753 @itemx athlon64
13754 @itemx athlon-fx
13755 Processors based on the AMD K8 core with x86-64 instruction set support,
13756 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
13757 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
13758 instruction set extensions.)
13759
13760 @item k8-sse3
13761 @itemx opteron-sse3
13762 @itemx athlon64-sse3
13763 Improved versions of AMD K8 cores with SSE3 instruction set support.
13764
13765 @item amdfam10
13766 @itemx barcelona
13767 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
13768 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
13769 instruction set extensions.)
13770
13771 @item bdver1
13772 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
13773 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
13774 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
13775 @item bdver2
13776 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
13777 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
13778 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
13779 extensions.)
13780 @item bdver3
13781 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
13782 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
13783 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
13784 extensions.
13785
13786 @item btver1
13787 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
13788 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
13789 instruction set extensions.)
13790
13791 @item btver2
13792 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
13793 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
13794 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
13795
13796 @item winchip-c6
13797 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
13798 set support.
13799
13800 @item winchip2
13801 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
13802 instruction set support.
13803
13804 @item c3
13805 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
13806 implemented for this chip.)
13807
13808 @item c3-2
13809 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
13810 (No scheduling is
13811 implemented for this chip.)
13812
13813 @item geode
13814 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
13815 @end table
13816
13817 @item -mtune=@var{cpu-type}
13818 @opindex mtune
13819 Tune to @var{cpu-type} everything applicable about the generated code, except
13820 for the ABI and the set of available instructions.  
13821 While picking a specific @var{cpu-type} schedules things appropriately
13822 for that particular chip, the compiler does not generate any code that
13823 cannot run on the default machine type unless you use a
13824 @option{-march=@var{cpu-type}} option.
13825 For example, if GCC is configured for i686-pc-linux-gnu
13826 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
13827 but still runs on i686 machines.
13828
13829 The choices for @var{cpu-type} are the same as for @option{-march}.
13830 In addition, @option{-mtune} supports an extra choice for @var{cpu-type}:
13831
13832 @table @samp
13833 @item generic
13834 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
13835 If you know the CPU on which your code will run, then you should use
13836 the corresponding @option{-mtune} or @option{-march} option instead of
13837 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
13838 of your application will have, then you should use this option.
13839
13840 As new processors are deployed in the marketplace, the behavior of this
13841 option will change.  Therefore, if you upgrade to a newer version of
13842 GCC, code generation controlled by this option will change to reflect
13843 the processors
13844 that are most common at the time that version of GCC is released.
13845
13846 There is no @option{-march=generic} option because @option{-march}
13847 indicates the instruction set the compiler can use, and there is no
13848 generic instruction set applicable to all processors.  In contrast,
13849 @option{-mtune} indicates the processor (or, in this case, collection of
13850 processors) for which the code is optimized.
13851 @end table
13852
13853 @item -mcpu=@var{cpu-type}
13854 @opindex mcpu
13855 A deprecated synonym for @option{-mtune}.
13856
13857 @item -mfpmath=@var{unit}
13858 @opindex mfpmath
13859 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
13860 for @var{unit} are:
13861
13862 @table @samp
13863 @item 387
13864 Use the standard 387 floating-point coprocessor present on the majority of chips and
13865 emulated otherwise.  Code compiled with this option runs almost everywhere.
13866 The temporary results are computed in 80-bit precision instead of the precision
13867 specified by the type, resulting in slightly different results compared to most
13868 of other chips.  See @option{-ffloat-store} for more detailed description.
13869
13870 This is the default choice for i386 compiler.
13871
13872 @item sse
13873 Use scalar floating-point instructions present in the SSE instruction set.
13874 This instruction set is supported by Pentium III and newer chips,
13875 and in the AMD line
13876 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
13877 instruction set supports only single-precision arithmetic, thus the double and
13878 extended-precision arithmetic are still done using 387.  A later version, present
13879 only in Pentium 4 and AMD x86-64 chips, supports double-precision
13880 arithmetic too.
13881
13882 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
13883 or @option{-msse2} switches to enable SSE extensions and make this option
13884 effective.  For the x86-64 compiler, these extensions are enabled by default.
13885
13886 The resulting code should be considerably faster in the majority of cases and avoid
13887 the numerical instability problems of 387 code, but may break some existing
13888 code that expects temporaries to be 80 bits.
13889
13890 This is the default choice for the x86-64 compiler.
13891
13892 @item sse,387
13893 @itemx sse+387
13894 @itemx both
13895 Attempt to utilize both instruction sets at once.  This effectively doubles the
13896 amount of available registers, and on chips with separate execution units for
13897 387 and SSE the execution resources too.  Use this option with care, as it is
13898 still experimental, because the GCC register allocator does not model separate
13899 functional units well, resulting in unstable performance.
13900 @end table
13901
13902 @item -masm=@var{dialect}
13903 @opindex masm=@var{dialect}
13904 Output assembly instructions using selected @var{dialect}.  Supported
13905 choices are @samp{intel} or @samp{att} (the default).  Darwin does
13906 not support @samp{intel}.
13907
13908 @item -mieee-fp
13909 @itemx -mno-ieee-fp
13910 @opindex mieee-fp
13911 @opindex mno-ieee-fp
13912 Control whether or not the compiler uses IEEE floating-point
13913 comparisons.  These correctly handle the case where the result of a
13914 comparison is unordered.
13915
13916 @item -msoft-float
13917 @opindex msoft-float
13918 Generate output containing library calls for floating point.
13919
13920 @strong{Warning:} the requisite libraries are not part of GCC@.
13921 Normally the facilities of the machine's usual C compiler are used, but
13922 this can't be done directly in cross-compilation.  You must make your
13923 own arrangements to provide suitable library functions for
13924 cross-compilation.
13925
13926 On machines where a function returns floating-point results in the 80387
13927 register stack, some floating-point opcodes may be emitted even if
13928 @option{-msoft-float} is used.
13929
13930 @item -mno-fp-ret-in-387
13931 @opindex mno-fp-ret-in-387
13932 Do not use the FPU registers for return values of functions.
13933
13934 The usual calling convention has functions return values of types
13935 @code{float} and @code{double} in an FPU register, even if there
13936 is no FPU@.  The idea is that the operating system should emulate
13937 an FPU@.
13938
13939 The option @option{-mno-fp-ret-in-387} causes such values to be returned
13940 in ordinary CPU registers instead.
13941
13942 @item -mno-fancy-math-387
13943 @opindex mno-fancy-math-387
13944 Some 387 emulators do not support the @code{sin}, @code{cos} and
13945 @code{sqrt} instructions for the 387.  Specify this option to avoid
13946 generating those instructions.  This option is the default on FreeBSD,
13947 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
13948 indicates that the target CPU always has an FPU and so the
13949 instruction does not need emulation.  These
13950 instructions are not generated unless you also use the
13951 @option{-funsafe-math-optimizations} switch.
13952
13953 @item -malign-double
13954 @itemx -mno-align-double
13955 @opindex malign-double
13956 @opindex mno-align-double
13957 Control whether GCC aligns @code{double}, @code{long double}, and
13958 @code{long long} variables on a two-word boundary or a one-word
13959 boundary.  Aligning @code{double} variables on a two-word boundary
13960 produces code that runs somewhat faster on a Pentium at the
13961 expense of more memory.
13962
13963 On x86-64, @option{-malign-double} is enabled by default.
13964
13965 @strong{Warning:} if you use the @option{-malign-double} switch,
13966 structures containing the above types are aligned differently than
13967 the published application binary interface specifications for the 386
13968 and are not binary compatible with structures in code compiled
13969 without that switch.
13970
13971 @item -m96bit-long-double
13972 @itemx -m128bit-long-double
13973 @opindex m96bit-long-double
13974 @opindex m128bit-long-double
13975 These switches control the size of @code{long double} type.  The i386
13976 application binary interface specifies the size to be 96 bits,
13977 so @option{-m96bit-long-double} is the default in 32-bit mode.
13978
13979 Modern architectures (Pentium and newer) prefer @code{long double}
13980 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
13981 conforming to the ABI, this is not possible.  So specifying
13982 @option{-m128bit-long-double} aligns @code{long double}
13983 to a 16-byte boundary by padding the @code{long double} with an additional
13984 32-bit zero.
13985
13986 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
13987 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
13988
13989 Notice that neither of these options enable any extra precision over the x87
13990 standard of 80 bits for a @code{long double}.
13991
13992 @strong{Warning:} if you override the default value for your target ABI, this
13993 changes the size of 
13994 structures and arrays containing @code{long double} variables,
13995 as well as modifying the function calling convention for functions taking
13996 @code{long double}.  Hence they are not binary-compatible
13997 with code compiled without that switch.
13998
13999 @item -mlong-double-64
14000 @itemx -mlong-double-80
14001 @opindex mlong-double-64
14002 @opindex mlong-double-80
14003 These switches control the size of @code{long double} type. A size
14004 of 64 bits makes the @code{long double} type equivalent to the @code{double}
14005 type. This is the default for Bionic C library.
14006
14007 @strong{Warning:} if you override the default value for your target ABI, this
14008 changes the size of
14009 structures and arrays containing @code{long double} variables,
14010 as well as modifying the function calling convention for functions taking
14011 @code{long double}.  Hence they are not binary-compatible
14012 with code compiled without that switch.
14013
14014 @item -mlarge-data-threshold=@var{threshold}
14015 @opindex mlarge-data-threshold
14016 When @option{-mcmodel=medium} is specified, data objects larger than
14017 @var{threshold} are placed in the large data section.  This value must be the
14018 same across all objects linked into the binary, and defaults to 65535.
14019
14020 @item -mrtd
14021 @opindex mrtd
14022 Use a different function-calling convention, in which functions that
14023 take a fixed number of arguments return with the @code{ret @var{num}}
14024 instruction, which pops their arguments while returning.  This saves one
14025 instruction in the caller since there is no need to pop the arguments
14026 there.
14027
14028 You can specify that an individual function is called with this calling
14029 sequence with the function attribute @samp{stdcall}.  You can also
14030 override the @option{-mrtd} option by using the function attribute
14031 @samp{cdecl}.  @xref{Function Attributes}.
14032
14033 @strong{Warning:} this calling convention is incompatible with the one
14034 normally used on Unix, so you cannot use it if you need to call
14035 libraries compiled with the Unix compiler.
14036
14037 Also, you must provide function prototypes for all functions that
14038 take variable numbers of arguments (including @code{printf});
14039 otherwise incorrect code is generated for calls to those
14040 functions.
14041
14042 In addition, seriously incorrect code results if you call a
14043 function with too many arguments.  (Normally, extra arguments are
14044 harmlessly ignored.)
14045
14046 @item -mregparm=@var{num}
14047 @opindex mregparm
14048 Control how many registers are used to pass integer arguments.  By
14049 default, no registers are used to pass arguments, and at most 3
14050 registers can be used.  You can control this behavior for a specific
14051 function by using the function attribute @samp{regparm}.
14052 @xref{Function Attributes}.
14053
14054 @strong{Warning:} if you use this switch, and
14055 @var{num} is nonzero, then you must build all modules with the same
14056 value, including any libraries.  This includes the system libraries and
14057 startup modules.
14058
14059 @item -msseregparm
14060 @opindex msseregparm
14061 Use SSE register passing conventions for float and double arguments
14062 and return values.  You can control this behavior for a specific
14063 function by using the function attribute @samp{sseregparm}.
14064 @xref{Function Attributes}.
14065
14066 @strong{Warning:} if you use this switch then you must build all
14067 modules with the same value, including any libraries.  This includes
14068 the system libraries and startup modules.
14069
14070 @item -mvect8-ret-in-mem
14071 @opindex mvect8-ret-in-mem
14072 Return 8-byte vectors in memory instead of MMX registers.  This is the
14073 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
14074 Studio compilers until version 12.  Later compiler versions (starting
14075 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
14076 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
14077 you need to remain compatible with existing code produced by those
14078 previous compiler versions or older versions of GCC@.
14079
14080 @item -mpc32
14081 @itemx -mpc64
14082 @itemx -mpc80
14083 @opindex mpc32
14084 @opindex mpc64
14085 @opindex mpc80
14086
14087 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
14088 is specified, the significands of results of floating-point operations are
14089 rounded to 24 bits (single precision); @option{-mpc64} rounds the
14090 significands of results of floating-point operations to 53 bits (double
14091 precision) and @option{-mpc80} rounds the significands of results of
14092 floating-point operations to 64 bits (extended double precision), which is
14093 the default.  When this option is used, floating-point operations in higher
14094 precisions are not available to the programmer without setting the FPU
14095 control word explicitly.
14096
14097 Setting the rounding of floating-point operations to less than the default
14098 80 bits can speed some programs by 2% or more.  Note that some mathematical
14099 libraries assume that extended-precision (80-bit) floating-point operations
14100 are enabled by default; routines in such libraries could suffer significant
14101 loss of accuracy, typically through so-called ``catastrophic cancellation'',
14102 when this option is used to set the precision to less than extended precision.
14103
14104 @item -mstackrealign
14105 @opindex mstackrealign
14106 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
14107 option generates an alternate prologue and epilogue that realigns the
14108 run-time stack if necessary.  This supports mixing legacy codes that keep
14109 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
14110 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
14111 applicable to individual functions.
14112
14113 @item -mpreferred-stack-boundary=@var{num}
14114 @opindex mpreferred-stack-boundary
14115 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
14116 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
14117 the default is 4 (16 bytes or 128 bits).
14118
14119 @strong{Warning:} When generating code for the x86-64 architecture with
14120 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
14121 used to keep the stack boundary aligned to 8 byte boundary.  Since
14122 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
14123 intended to be used in controlled environment where stack space is
14124 important limitation.  This option will lead to wrong code when functions
14125 compiled with 16 byte stack alignment (such as functions from a standard
14126 library) are called with misaligned stack.  In this case, SSE
14127 instructions may lead to misaligned memory access traps.  In addition,
14128 variable arguments will be handled incorrectly for 16 byte aligned
14129 objects (including x87 long double and __int128), leading to wrong
14130 results.  You must build all modules with
14131 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
14132 includes the system libraries and startup modules.
14133
14134 @item -mincoming-stack-boundary=@var{num}
14135 @opindex mincoming-stack-boundary
14136 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
14137 boundary.  If @option{-mincoming-stack-boundary} is not specified,
14138 the one specified by @option{-mpreferred-stack-boundary} is used.
14139
14140 On Pentium and Pentium Pro, @code{double} and @code{long double} values
14141 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
14142 suffer significant run time performance penalties.  On Pentium III, the
14143 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
14144 properly if it is not 16-byte aligned.
14145
14146 To ensure proper alignment of this values on the stack, the stack boundary
14147 must be as aligned as that required by any value stored on the stack.
14148 Further, every function must be generated such that it keeps the stack
14149 aligned.  Thus calling a function compiled with a higher preferred
14150 stack boundary from a function compiled with a lower preferred stack
14151 boundary most likely misaligns the stack.  It is recommended that
14152 libraries that use callbacks always use the default setting.
14153
14154 This extra alignment does consume extra stack space, and generally
14155 increases code size.  Code that is sensitive to stack space usage, such
14156 as embedded systems and operating system kernels, may want to reduce the
14157 preferred alignment to @option{-mpreferred-stack-boundary=2}.
14158
14159 @item -mmmx
14160 @itemx -mno-mmx
14161 @itemx -msse
14162 @itemx -mno-sse
14163 @itemx -msse2
14164 @itemx -mno-sse2
14165 @itemx -msse3
14166 @itemx -mno-sse3
14167 @itemx -mssse3
14168 @itemx -mno-ssse3
14169 @itemx -msse4.1
14170 @need 800
14171 @itemx -mno-sse4.1
14172 @itemx -msse4.2
14173 @itemx -mno-sse4.2
14174 @itemx -msse4
14175 @itemx -mno-sse4
14176 @itemx -mavx
14177 @itemx -mno-avx
14178 @itemx -mavx2
14179 @itemx -mno-avx2
14180 @itemx -maes
14181 @itemx -mno-aes
14182 @itemx -mpclmul
14183 @need 800
14184 @itemx -mno-pclmul
14185 @itemx -mfsgsbase
14186 @itemx -mno-fsgsbase
14187 @itemx -mrdrnd
14188 @itemx -mno-rdrnd
14189 @itemx -mf16c
14190 @itemx -mno-f16c
14191 @itemx -mfma
14192 @itemx -mno-fma
14193 @itemx -msse4a
14194 @itemx -mno-sse4a
14195 @itemx -mfma4
14196 @need 800
14197 @itemx -mno-fma4
14198 @itemx -mxop
14199 @itemx -mno-xop
14200 @itemx -mlwp
14201 @itemx -mno-lwp
14202 @itemx -m3dnow
14203 @itemx -mno-3dnow
14204 @itemx -mpopcnt
14205 @itemx -mno-popcnt
14206 @itemx -mabm
14207 @itemx -mno-abm
14208 @itemx -mbmi
14209 @itemx -mbmi2
14210 @itemx -mno-bmi
14211 @itemx -mno-bmi2
14212 @itemx -mlzcnt
14213 @itemx -mno-lzcnt
14214 @itemx -mrtm
14215 @itemx -mtbm
14216 @itemx -mno-tbm
14217 @opindex mmmx
14218 @opindex mno-mmx
14219 @opindex msse
14220 @opindex mno-sse
14221 @opindex m3dnow
14222 @opindex mno-3dnow
14223 These switches enable or disable the use of instructions in the MMX, SSE,
14224 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, F16C,
14225 FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2, LZCNT, RTM or 3DNow!@:
14226 extended instruction sets.
14227 These extensions are also available as built-in functions: see
14228 @ref{X86 Built-in Functions}, for details of the functions enabled and
14229 disabled by these switches.
14230
14231 To generate SSE/SSE2 instructions automatically from floating-point
14232 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
14233
14234 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
14235 generates new AVX instructions or AVX equivalence for all SSEx instructions
14236 when needed.
14237
14238 These options enable GCC to use these extended instructions in
14239 generated code, even without @option{-mfpmath=sse}.  Applications that
14240 perform run-time CPU detection must compile separate files for each
14241 supported architecture, using the appropriate flags.  In particular,
14242 the file containing the CPU detection code should be compiled without
14243 these options.
14244
14245 @item -mcld
14246 @opindex mcld
14247 This option instructs GCC to emit a @code{cld} instruction in the prologue
14248 of functions that use string instructions.  String instructions depend on
14249 the DF flag to select between autoincrement or autodecrement mode.  While the
14250 ABI specifies the DF flag to be cleared on function entry, some operating
14251 systems violate this specification by not clearing the DF flag in their
14252 exception dispatchers.  The exception handler can be invoked with the DF flag
14253 set, which leads to wrong direction mode when string instructions are used.
14254 This option can be enabled by default on 32-bit x86 targets by configuring
14255 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
14256 instructions can be suppressed with the @option{-mno-cld} compiler option
14257 in this case.
14258
14259 @item -mvzeroupper
14260 @opindex mvzeroupper
14261 This option instructs GCC to emit a @code{vzeroupper} instruction
14262 before a transfer of control flow out of the function to minimize
14263 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
14264 intrinsics.
14265
14266 @item -mprefer-avx128
14267 @opindex mprefer-avx128
14268 This option instructs GCC to use 128-bit AVX instructions instead of
14269 256-bit AVX instructions in the auto-vectorizer.
14270
14271 @item -mcx16
14272 @opindex mcx16
14273 This option enables GCC to generate @code{CMPXCHG16B} instructions.
14274 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
14275 (or oword) data types.  
14276 This is useful for high-resolution counters that can be updated
14277 by multiple processors (or cores).  This instruction is generated as part of
14278 atomic built-in functions: see @ref{__sync Builtins} or
14279 @ref{__atomic Builtins} for details.
14280
14281 @item -msahf
14282 @opindex msahf
14283 This option enables generation of @code{SAHF} instructions in 64-bit code.
14284 Early Intel Pentium 4 CPUs with Intel 64 support,
14285 prior to the introduction of Pentium 4 G1 step in December 2005,
14286 lacked the @code{LAHF} and @code{SAHF} instructions
14287 which were supported by AMD64.
14288 These are load and store instructions, respectively, for certain status flags.
14289 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
14290 @code{drem}, and @code{remainder} built-in functions;
14291 see @ref{Other Builtins} for details.
14292
14293 @item -mmovbe
14294 @opindex mmovbe
14295 This option enables use of the @code{movbe} instruction to implement
14296 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
14297
14298 @item -mcrc32
14299 @opindex mcrc32
14300 This option enables built-in functions @code{__builtin_ia32_crc32qi},
14301 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
14302 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
14303
14304 @item -mrecip
14305 @opindex mrecip
14306 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
14307 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
14308 with an additional Newton-Raphson step
14309 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
14310 (and their vectorized
14311 variants) for single-precision floating-point arguments.  These instructions
14312 are generated only when @option{-funsafe-math-optimizations} is enabled
14313 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
14314 Note that while the throughput of the sequence is higher than the throughput
14315 of the non-reciprocal instruction, the precision of the sequence can be
14316 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
14317
14318 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
14319 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
14320 combination), and doesn't need @option{-mrecip}.
14321
14322 Also note that GCC emits the above sequence with additional Newton-Raphson step
14323 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
14324 already with @option{-ffast-math} (or the above option combination), and
14325 doesn't need @option{-mrecip}.
14326
14327 @item -mrecip=@var{opt}
14328 @opindex mrecip=opt
14329 This option controls which reciprocal estimate instructions
14330 may be used.  @var{opt} is a comma-separated list of options, which may
14331 be preceded by a @samp{!} to invert the option:
14332
14333 @table @samp
14334 @item all
14335 Enable all estimate instructions.
14336
14337 @item default
14338 Enable the default instructions, equivalent to @option{-mrecip}.
14339
14340 @item none
14341 Disable all estimate instructions, equivalent to @option{-mno-recip}.
14342
14343 @item div
14344 Enable the approximation for scalar division.
14345
14346 @item vec-div
14347 Enable the approximation for vectorized division.
14348
14349 @item sqrt
14350 Enable the approximation for scalar square root.
14351
14352 @item vec-sqrt
14353 Enable the approximation for vectorized square root.
14354 @end table
14355
14356 So, for example, @option{-mrecip=all,!sqrt} enables
14357 all of the reciprocal approximations, except for square root.
14358
14359 @item -mveclibabi=@var{type}
14360 @opindex mveclibabi
14361 Specifies the ABI type to use for vectorizing intrinsics using an
14362 external library.  Supported values for @var{type} are @samp{svml} 
14363 for the Intel short
14364 vector math library and @samp{acml} for the AMD math core library.
14365 To use this option, both @option{-ftree-vectorize} and
14366 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
14367 ABI-compatible library must be specified at link time.
14368
14369 GCC currently emits calls to @code{vmldExp2},
14370 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
14371 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
14372 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
14373 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
14374 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
14375 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
14376 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
14377 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
14378 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
14379 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
14380 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
14381 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
14382 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
14383 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
14384 when @option{-mveclibabi=acml} is used.  
14385
14386 @item -mabi=@var{name}
14387 @opindex mabi
14388 Generate code for the specified calling convention.  Permissible values
14389 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
14390 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
14391 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
14392 You can control this behavior for a specific function by
14393 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
14394 @xref{Function Attributes}.
14395
14396 @item -mtls-dialect=@var{type}
14397 @opindex mtls-dialect
14398 Generate code to access thread-local storage using the @samp{gnu} or
14399 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
14400 @samp{gnu2} is more efficient, but it may add compile- and run-time
14401 requirements that cannot be satisfied on all systems.
14402
14403 @item -mpush-args
14404 @itemx -mno-push-args
14405 @opindex mpush-args
14406 @opindex mno-push-args
14407 Use PUSH operations to store outgoing parameters.  This method is shorter
14408 and usually equally fast as method using SUB/MOV operations and is enabled
14409 by default.  In some cases disabling it may improve performance because of
14410 improved scheduling and reduced dependencies.
14411
14412 @item -maccumulate-outgoing-args
14413 @opindex maccumulate-outgoing-args
14414 If enabled, the maximum amount of space required for outgoing arguments is
14415 computed in the function prologue.  This is faster on most modern CPUs
14416 because of reduced dependencies, improved scheduling and reduced stack usage
14417 when the preferred stack boundary is not equal to 2.  The drawback is a notable
14418 increase in code size.  This switch implies @option{-mno-push-args}.
14419
14420 @item -mthreads
14421 @opindex mthreads
14422 Support thread-safe exception handling on MinGW.  Programs that rely
14423 on thread-safe exception handling must compile and link all code with the
14424 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
14425 @code{-D_MT}; when linking, it links in a special thread helper library
14426 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
14427
14428 @item -mno-align-stringops
14429 @opindex mno-align-stringops
14430 Do not align the destination of inlined string operations.  This switch reduces
14431 code size and improves performance in case the destination is already aligned,
14432 but GCC doesn't know about it.
14433
14434 @item -minline-all-stringops
14435 @opindex minline-all-stringops
14436 By default GCC inlines string operations only when the destination is 
14437 known to be aligned to least a 4-byte boundary.  
14438 This enables more inlining and increases code
14439 size, but may improve performance of code that depends on fast
14440 @code{memcpy}, @code{strlen},
14441 and @code{memset} for short lengths.
14442
14443 @item -minline-stringops-dynamically
14444 @opindex minline-stringops-dynamically
14445 For string operations of unknown size, use run-time checks with
14446 inline code for small blocks and a library call for large blocks.
14447
14448 @item -mstringop-strategy=@var{alg}
14449 @opindex mstringop-strategy=@var{alg}
14450 Override the internal decision heuristic for the particular algorithm to use
14451 for inlining string operations.  The allowed values for @var{alg} are:
14452
14453 @table @samp
14454 @item rep_byte
14455 @itemx rep_4byte
14456 @itemx rep_8byte
14457 Expand using i386 @code{rep} prefix of the specified size.
14458
14459 @item byte_loop
14460 @itemx loop
14461 @itemx unrolled_loop
14462 Expand into an inline loop.
14463
14464 @item libcall
14465 Always use a library call.
14466 @end table
14467
14468 @item -momit-leaf-frame-pointer
14469 @opindex momit-leaf-frame-pointer
14470 Don't keep the frame pointer in a register for leaf functions.  This
14471 avoids the instructions to save, set up, and restore frame pointers and
14472 makes an extra register available in leaf functions.  The option
14473 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
14474 which might make debugging harder.
14475
14476 @item -mtls-direct-seg-refs
14477 @itemx -mno-tls-direct-seg-refs
14478 @opindex mtls-direct-seg-refs
14479 Controls whether TLS variables may be accessed with offsets from the
14480 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
14481 or whether the thread base pointer must be added.  Whether or not this
14482 is valid depends on the operating system, and whether it maps the
14483 segment to cover the entire TLS area.
14484
14485 For systems that use the GNU C Library, the default is on.
14486
14487 @item -msse2avx
14488 @itemx -mno-sse2avx
14489 @opindex msse2avx
14490 Specify that the assembler should encode SSE instructions with VEX
14491 prefix.  The option @option{-mavx} turns this on by default.
14492
14493 @item -mfentry
14494 @itemx -mno-fentry
14495 @opindex mfentry
14496 If profiling is active (@option{-pg}), put the profiling
14497 counter call before the prologue.
14498 Note: On x86 architectures the attribute @code{ms_hook_prologue}
14499 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
14500
14501 @item -m8bit-idiv
14502 @itemx -mno-8bit-idiv
14503 @opindex 8bit-idiv
14504 On some processors, like Intel Atom, 8-bit unsigned integer divide is
14505 much faster than 32-bit/64-bit integer divide.  This option generates a
14506 run-time check.  If both dividend and divisor are within range of 0
14507 to 255, 8-bit unsigned integer divide is used instead of
14508 32-bit/64-bit integer divide.
14509
14510 @item -mavx256-split-unaligned-load
14511 @itemx -mavx256-split-unaligned-store
14512 @opindex avx256-split-unaligned-load
14513 @opindex avx256-split-unaligned-store
14514 Split 32-byte AVX unaligned load and store.
14515
14516 @end table
14517
14518 These @samp{-m} switches are supported in addition to the above
14519 on x86-64 processors in 64-bit environments.
14520
14521 @table @gcctabopt
14522 @item -m32
14523 @itemx -m64
14524 @itemx -mx32
14525 @opindex m32
14526 @opindex m64
14527 @opindex mx32
14528 Generate code for a 32-bit or 64-bit environment.
14529 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
14530 to 32 bits, and
14531 generates code that runs on any i386 system.
14532
14533 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
14534 types to 64 bits, and generates code for the x86-64 architecture.
14535 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
14536 and @option{-mdynamic-no-pic} options.
14537
14538 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
14539 to 32 bits, and
14540 generates code for the x86-64 architecture.
14541
14542 @item -mno-red-zone
14543 @opindex mno-red-zone
14544 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
14545 by the x86-64 ABI; it is a 128-byte area beyond the location of the
14546 stack pointer that is not modified by signal or interrupt handlers
14547 and therefore can be used for temporary data without adjusting the stack
14548 pointer.  The flag @option{-mno-red-zone} disables this red zone.
14549
14550 @item -mcmodel=small
14551 @opindex mcmodel=small
14552 Generate code for the small code model: the program and its symbols must
14553 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
14554 Programs can be statically or dynamically linked.  This is the default
14555 code model.
14556
14557 @item -mcmodel=kernel
14558 @opindex mcmodel=kernel
14559 Generate code for the kernel code model.  The kernel runs in the
14560 negative 2 GB of the address space.
14561 This model has to be used for Linux kernel code.
14562
14563 @item -mcmodel=medium
14564 @opindex mcmodel=medium
14565 Generate code for the medium model: the program is linked in the lower 2
14566 GB of the address space.  Small symbols are also placed there.  Symbols
14567 with sizes larger than @option{-mlarge-data-threshold} are put into
14568 large data or BSS sections and can be located above 2GB.  Programs can
14569 be statically or dynamically linked.
14570
14571 @item -mcmodel=large
14572 @opindex mcmodel=large
14573 Generate code for the large model.  This model makes no assumptions
14574 about addresses and sizes of sections.
14575
14576 @item -maddress-mode=long
14577 @opindex maddress-mode=long
14578 Generate code for long address mode.  This is only supported for 64-bit
14579 and x32 environments.  It is the default address mode for 64-bit
14580 environments.
14581
14582 @item -maddress-mode=short
14583 @opindex maddress-mode=short
14584 Generate code for short address mode.  This is only supported for 32-bit
14585 and x32 environments.  It is the default address mode for 32-bit and
14586 x32 environments.
14587 @end table
14588
14589 @node i386 and x86-64 Windows Options
14590 @subsection i386 and x86-64 Windows Options
14591 @cindex i386 and x86-64 Windows Options
14592
14593 These additional options are available for Microsoft Windows targets:
14594
14595 @table @gcctabopt
14596 @item -mconsole
14597 @opindex mconsole
14598 This option
14599 specifies that a console application is to be generated, by
14600 instructing the linker to set the PE header subsystem type
14601 required for console applications.
14602 This option is available for Cygwin and MinGW targets and is
14603 enabled by default on those targets.
14604
14605 @item -mdll
14606 @opindex mdll
14607 This option is available for Cygwin and MinGW targets.  It
14608 specifies that a DLL---a dynamic link library---is to be
14609 generated, enabling the selection of the required runtime
14610 startup object and entry point.
14611
14612 @item -mnop-fun-dllimport
14613 @opindex mnop-fun-dllimport
14614 This option is available for Cygwin and MinGW targets.  It
14615 specifies that the @code{dllimport} attribute should be ignored.
14616
14617 @item -mthread
14618 @opindex mthread
14619 This option is available for MinGW targets. It specifies
14620 that MinGW-specific thread support is to be used.
14621
14622 @item -municode
14623 @opindex municode
14624 This option is available for MinGW-w64 targets.  It causes
14625 the @code{UNICODE} preprocessor macro to be predefined, and
14626 chooses Unicode-capable runtime startup code.
14627
14628 @item -mwin32
14629 @opindex mwin32
14630 This option is available for Cygwin and MinGW targets.  It
14631 specifies that the typical Microsoft Windows predefined macros are to
14632 be set in the pre-processor, but does not influence the choice
14633 of runtime library/startup code.
14634
14635 @item -mwindows
14636 @opindex mwindows
14637 This option is available for Cygwin and MinGW targets.  It
14638 specifies that a GUI application is to be generated by
14639 instructing the linker to set the PE header subsystem type
14640 appropriately.
14641
14642 @item -fno-set-stack-executable
14643 @opindex fno-set-stack-executable
14644 This option is available for MinGW targets. It specifies that
14645 the executable flag for the stack used by nested functions isn't
14646 set. This is necessary for binaries running in kernel mode of
14647 Microsoft Windows, as there the User32 API, which is used to set executable
14648 privileges, isn't available.
14649
14650 @item -fwritable-relocated-rdata
14651 @opindex fno-writable-relocated-rdata
14652 This option is available for MinGW and Cygwin targets.  It specifies
14653 that relocated-data in read-only section is put into .data
14654 section.  This is a necessary for older runtimes not supporting
14655 modification of .rdata sections for pseudo-relocation.
14656
14657 @item -mpe-aligned-commons
14658 @opindex mpe-aligned-commons
14659 This option is available for Cygwin and MinGW targets.  It
14660 specifies that the GNU extension to the PE file format that
14661 permits the correct alignment of COMMON variables should be
14662 used when generating code.  It is enabled by default if
14663 GCC detects that the target assembler found during configuration
14664 supports the feature.
14665 @end table
14666
14667 See also under @ref{i386 and x86-64 Options} for standard options.
14668
14669 @node IA-64 Options
14670 @subsection IA-64 Options
14671 @cindex IA-64 Options
14672
14673 These are the @samp{-m} options defined for the Intel IA-64 architecture.
14674
14675 @table @gcctabopt
14676 @item -mbig-endian
14677 @opindex mbig-endian
14678 Generate code for a big-endian target.  This is the default for HP-UX@.
14679
14680 @item -mlittle-endian
14681 @opindex mlittle-endian
14682 Generate code for a little-endian target.  This is the default for AIX5
14683 and GNU/Linux.
14684
14685 @item -mgnu-as
14686 @itemx -mno-gnu-as
14687 @opindex mgnu-as
14688 @opindex mno-gnu-as
14689 Generate (or don't) code for the GNU assembler.  This is the default.
14690 @c Also, this is the default if the configure option @option{--with-gnu-as}
14691 @c is used.
14692
14693 @item -mgnu-ld
14694 @itemx -mno-gnu-ld
14695 @opindex mgnu-ld
14696 @opindex mno-gnu-ld
14697 Generate (or don't) code for the GNU linker.  This is the default.
14698 @c Also, this is the default if the configure option @option{--with-gnu-ld}
14699 @c is used.
14700
14701 @item -mno-pic
14702 @opindex mno-pic
14703 Generate code that does not use a global pointer register.  The result
14704 is not position independent code, and violates the IA-64 ABI@.
14705
14706 @item -mvolatile-asm-stop
14707 @itemx -mno-volatile-asm-stop
14708 @opindex mvolatile-asm-stop
14709 @opindex mno-volatile-asm-stop
14710 Generate (or don't) a stop bit immediately before and after volatile asm
14711 statements.
14712
14713 @item -mregister-names
14714 @itemx -mno-register-names
14715 @opindex mregister-names
14716 @opindex mno-register-names
14717 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
14718 the stacked registers.  This may make assembler output more readable.
14719
14720 @item -mno-sdata
14721 @itemx -msdata
14722 @opindex mno-sdata
14723 @opindex msdata
14724 Disable (or enable) optimizations that use the small data section.  This may
14725 be useful for working around optimizer bugs.
14726
14727 @item -mconstant-gp
14728 @opindex mconstant-gp
14729 Generate code that uses a single constant global pointer value.  This is
14730 useful when compiling kernel code.
14731
14732 @item -mauto-pic
14733 @opindex mauto-pic
14734 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
14735 This is useful when compiling firmware code.
14736
14737 @item -minline-float-divide-min-latency
14738 @opindex minline-float-divide-min-latency
14739 Generate code for inline divides of floating-point values
14740 using the minimum latency algorithm.
14741
14742 @item -minline-float-divide-max-throughput
14743 @opindex minline-float-divide-max-throughput
14744 Generate code for inline divides of floating-point values
14745 using the maximum throughput algorithm.
14746
14747 @item -mno-inline-float-divide
14748 @opindex mno-inline-float-divide
14749 Do not generate inline code for divides of floating-point values.
14750
14751 @item -minline-int-divide-min-latency
14752 @opindex minline-int-divide-min-latency
14753 Generate code for inline divides of integer values
14754 using the minimum latency algorithm.
14755
14756 @item -minline-int-divide-max-throughput
14757 @opindex minline-int-divide-max-throughput
14758 Generate code for inline divides of integer values
14759 using the maximum throughput algorithm.
14760
14761 @item -mno-inline-int-divide
14762 @opindex mno-inline-int-divide
14763 Do not generate inline code for divides of integer values.
14764
14765 @item -minline-sqrt-min-latency
14766 @opindex minline-sqrt-min-latency
14767 Generate code for inline square roots
14768 using the minimum latency algorithm.
14769
14770 @item -minline-sqrt-max-throughput
14771 @opindex minline-sqrt-max-throughput
14772 Generate code for inline square roots
14773 using the maximum throughput algorithm.
14774
14775 @item -mno-inline-sqrt
14776 @opindex mno-inline-sqrt
14777 Do not generate inline code for @code{sqrt}.
14778
14779 @item -mfused-madd
14780 @itemx -mno-fused-madd
14781 @opindex mfused-madd
14782 @opindex mno-fused-madd
14783 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
14784 instructions.  The default is to use these instructions.
14785
14786 @item -mno-dwarf2-asm
14787 @itemx -mdwarf2-asm
14788 @opindex mno-dwarf2-asm
14789 @opindex mdwarf2-asm
14790 Don't (or do) generate assembler code for the DWARF 2 line number debugging
14791 info.  This may be useful when not using the GNU assembler.
14792
14793 @item -mearly-stop-bits
14794 @itemx -mno-early-stop-bits
14795 @opindex mearly-stop-bits
14796 @opindex mno-early-stop-bits
14797 Allow stop bits to be placed earlier than immediately preceding the
14798 instruction that triggered the stop bit.  This can improve instruction
14799 scheduling, but does not always do so.
14800
14801 @item -mfixed-range=@var{register-range}
14802 @opindex mfixed-range
14803 Generate code treating the given register range as fixed registers.
14804 A fixed register is one that the register allocator cannot use.  This is
14805 useful when compiling kernel code.  A register range is specified as
14806 two registers separated by a dash.  Multiple register ranges can be
14807 specified separated by a comma.
14808
14809 @item -mtls-size=@var{tls-size}
14810 @opindex mtls-size
14811 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
14812 64.
14813
14814 @item -mtune=@var{cpu-type}
14815 @opindex mtune
14816 Tune the instruction scheduling for a particular CPU, Valid values are
14817 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
14818 and @samp{mckinley}.
14819
14820 @item -milp32
14821 @itemx -mlp64
14822 @opindex milp32
14823 @opindex mlp64
14824 Generate code for a 32-bit or 64-bit environment.
14825 The 32-bit environment sets int, long and pointer to 32 bits.
14826 The 64-bit environment sets int to 32 bits and long and pointer
14827 to 64 bits.  These are HP-UX specific flags.
14828
14829 @item -mno-sched-br-data-spec
14830 @itemx -msched-br-data-spec
14831 @opindex mno-sched-br-data-spec
14832 @opindex msched-br-data-spec
14833 (Dis/En)able data speculative scheduling before reload.
14834 This results in generation of @code{ld.a} instructions and
14835 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14836 The default is 'disable'.
14837
14838 @item -msched-ar-data-spec
14839 @itemx -mno-sched-ar-data-spec
14840 @opindex msched-ar-data-spec
14841 @opindex mno-sched-ar-data-spec
14842 (En/Dis)able data speculative scheduling after reload.
14843 This results in generation of @code{ld.a} instructions and
14844 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14845 The default is 'enable'.
14846
14847 @item -mno-sched-control-spec
14848 @itemx -msched-control-spec
14849 @opindex mno-sched-control-spec
14850 @opindex msched-control-spec
14851 (Dis/En)able control speculative scheduling.  This feature is
14852 available only during region scheduling (i.e.@: before reload).
14853 This results in generation of the @code{ld.s} instructions and
14854 the corresponding check instructions @code{chk.s}.
14855 The default is 'disable'.
14856
14857 @item -msched-br-in-data-spec
14858 @itemx -mno-sched-br-in-data-spec
14859 @opindex msched-br-in-data-spec
14860 @opindex mno-sched-br-in-data-spec
14861 (En/Dis)able speculative scheduling of the instructions that
14862 are dependent on the data speculative loads before reload.
14863 This is effective only with @option{-msched-br-data-spec} enabled.
14864 The default is 'enable'.
14865
14866 @item -msched-ar-in-data-spec
14867 @itemx -mno-sched-ar-in-data-spec
14868 @opindex msched-ar-in-data-spec
14869 @opindex mno-sched-ar-in-data-spec
14870 (En/Dis)able speculative scheduling of the instructions that
14871 are dependent on the data speculative loads after reload.
14872 This is effective only with @option{-msched-ar-data-spec} enabled.
14873 The default is 'enable'.
14874
14875 @item -msched-in-control-spec
14876 @itemx -mno-sched-in-control-spec
14877 @opindex msched-in-control-spec
14878 @opindex mno-sched-in-control-spec
14879 (En/Dis)able speculative scheduling of the instructions that
14880 are dependent on the control speculative loads.
14881 This is effective only with @option{-msched-control-spec} enabled.
14882 The default is 'enable'.
14883
14884 @item -mno-sched-prefer-non-data-spec-insns
14885 @itemx -msched-prefer-non-data-spec-insns
14886 @opindex mno-sched-prefer-non-data-spec-insns
14887 @opindex msched-prefer-non-data-spec-insns
14888 If enabled, data-speculative instructions are chosen for schedule
14889 only if there are no other choices at the moment.  This makes
14890 the use of the data speculation much more conservative.
14891 The default is 'disable'.
14892
14893 @item -mno-sched-prefer-non-control-spec-insns
14894 @itemx -msched-prefer-non-control-spec-insns
14895 @opindex mno-sched-prefer-non-control-spec-insns
14896 @opindex msched-prefer-non-control-spec-insns
14897 If enabled, control-speculative instructions are chosen for schedule
14898 only if there are no other choices at the moment.  This makes
14899 the use of the control speculation much more conservative.
14900 The default is 'disable'.
14901
14902 @item -mno-sched-count-spec-in-critical-path
14903 @itemx -msched-count-spec-in-critical-path
14904 @opindex mno-sched-count-spec-in-critical-path
14905 @opindex msched-count-spec-in-critical-path
14906 If enabled, speculative dependencies are considered during
14907 computation of the instructions priorities.  This makes the use of the
14908 speculation a bit more conservative.
14909 The default is 'disable'.
14910
14911 @item -msched-spec-ldc
14912 @opindex msched-spec-ldc
14913 Use a simple data speculation check.  This option is on by default.
14914
14915 @item -msched-control-spec-ldc
14916 @opindex msched-spec-ldc
14917 Use a simple check for control speculation.  This option is on by default.
14918
14919 @item -msched-stop-bits-after-every-cycle
14920 @opindex msched-stop-bits-after-every-cycle
14921 Place a stop bit after every cycle when scheduling.  This option is on
14922 by default.
14923
14924 @item -msched-fp-mem-deps-zero-cost
14925 @opindex msched-fp-mem-deps-zero-cost
14926 Assume that floating-point stores and loads are not likely to cause a conflict
14927 when placed into the same instruction group.  This option is disabled by
14928 default.
14929
14930 @item -msel-sched-dont-check-control-spec
14931 @opindex msel-sched-dont-check-control-spec
14932 Generate checks for control speculation in selective scheduling.
14933 This flag is disabled by default.
14934
14935 @item -msched-max-memory-insns=@var{max-insns}
14936 @opindex msched-max-memory-insns
14937 Limit on the number of memory insns per instruction group, giving lower
14938 priority to subsequent memory insns attempting to schedule in the same
14939 instruction group. Frequently useful to prevent cache bank conflicts.
14940 The default value is 1.
14941
14942 @item -msched-max-memory-insns-hard-limit
14943 @opindex msched-max-memory-insns-hard-limit
14944 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
14945 disallowing more than that number in an instruction group.
14946 Otherwise, the limit is ``soft'', meaning that non-memory operations
14947 are preferred when the limit is reached, but memory operations may still
14948 be scheduled.
14949
14950 @end table
14951
14952 @node LM32 Options
14953 @subsection LM32 Options
14954 @cindex LM32 options
14955
14956 These @option{-m} options are defined for the LatticeMico32 architecture:
14957
14958 @table @gcctabopt
14959 @item -mbarrel-shift-enabled
14960 @opindex mbarrel-shift-enabled
14961 Enable barrel-shift instructions.
14962
14963 @item -mdivide-enabled
14964 @opindex mdivide-enabled
14965 Enable divide and modulus instructions.
14966
14967 @item -mmultiply-enabled
14968 @opindex multiply-enabled
14969 Enable multiply instructions.
14970
14971 @item -msign-extend-enabled
14972 @opindex msign-extend-enabled
14973 Enable sign extend instructions.
14974
14975 @item -muser-enabled
14976 @opindex muser-enabled
14977 Enable user-defined instructions.
14978
14979 @end table
14980
14981 @node M32C Options
14982 @subsection M32C Options
14983 @cindex M32C options
14984
14985 @table @gcctabopt
14986 @item -mcpu=@var{name}
14987 @opindex mcpu=
14988 Select the CPU for which code is generated.  @var{name} may be one of
14989 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
14990 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
14991 the M32C/80 series.
14992
14993 @item -msim
14994 @opindex msim
14995 Specifies that the program will be run on the simulator.  This causes
14996 an alternate runtime library to be linked in which supports, for
14997 example, file I/O@.  You must not use this option when generating
14998 programs that will run on real hardware; you must provide your own
14999 runtime library for whatever I/O functions are needed.
15000
15001 @item -memregs=@var{number}
15002 @opindex memregs=
15003 Specifies the number of memory-based pseudo-registers GCC uses
15004 during code generation.  These pseudo-registers are used like real
15005 registers, so there is a tradeoff between GCC's ability to fit the
15006 code into available registers, and the performance penalty of using
15007 memory instead of registers.  Note that all modules in a program must
15008 be compiled with the same value for this option.  Because of that, you
15009 must not use this option with GCC's default runtime libraries.
15010
15011 @end table
15012
15013 @node M32R/D Options
15014 @subsection M32R/D Options
15015 @cindex M32R/D options
15016
15017 These @option{-m} options are defined for Renesas M32R/D architectures:
15018
15019 @table @gcctabopt
15020 @item -m32r2
15021 @opindex m32r2
15022 Generate code for the M32R/2@.
15023
15024 @item -m32rx
15025 @opindex m32rx
15026 Generate code for the M32R/X@.
15027
15028 @item -m32r
15029 @opindex m32r
15030 Generate code for the M32R@.  This is the default.
15031
15032 @item -mmodel=small
15033 @opindex mmodel=small
15034 Assume all objects live in the lower 16MB of memory (so that their addresses
15035 can be loaded with the @code{ld24} instruction), and assume all subroutines
15036 are reachable with the @code{bl} instruction.
15037 This is the default.
15038
15039 The addressability of a particular object can be set with the
15040 @code{model} attribute.
15041
15042 @item -mmodel=medium
15043 @opindex mmodel=medium
15044 Assume objects may be anywhere in the 32-bit address space (the compiler
15045 generates @code{seth/add3} instructions to load their addresses), and
15046 assume all subroutines are reachable with the @code{bl} instruction.
15047
15048 @item -mmodel=large
15049 @opindex mmodel=large
15050 Assume objects may be anywhere in the 32-bit address space (the compiler
15051 generates @code{seth/add3} instructions to load their addresses), and
15052 assume subroutines may not be reachable with the @code{bl} instruction
15053 (the compiler generates the much slower @code{seth/add3/jl}
15054 instruction sequence).
15055
15056 @item -msdata=none
15057 @opindex msdata=none
15058 Disable use of the small data area.  Variables are put into
15059 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
15060 @code{section} attribute has been specified).
15061 This is the default.
15062
15063 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
15064 Objects may be explicitly put in the small data area with the
15065 @code{section} attribute using one of these sections.
15066
15067 @item -msdata=sdata
15068 @opindex msdata=sdata
15069 Put small global and static data in the small data area, but do not
15070 generate special code to reference them.
15071
15072 @item -msdata=use
15073 @opindex msdata=use
15074 Put small global and static data in the small data area, and generate
15075 special instructions to reference them.
15076
15077 @item -G @var{num}
15078 @opindex G
15079 @cindex smaller data references
15080 Put global and static objects less than or equal to @var{num} bytes
15081 into the small data or BSS sections instead of the normal data or BSS
15082 sections.  The default value of @var{num} is 8.
15083 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
15084 for this option to have any effect.
15085
15086 All modules should be compiled with the same @option{-G @var{num}} value.
15087 Compiling with different values of @var{num} may or may not work; if it
15088 doesn't the linker gives an error message---incorrect code is not
15089 generated.
15090
15091 @item -mdebug
15092 @opindex mdebug
15093 Makes the M32R-specific code in the compiler display some statistics
15094 that might help in debugging programs.
15095
15096 @item -malign-loops
15097 @opindex malign-loops
15098 Align all loops to a 32-byte boundary.
15099
15100 @item -mno-align-loops
15101 @opindex mno-align-loops
15102 Do not enforce a 32-byte alignment for loops.  This is the default.
15103
15104 @item -missue-rate=@var{number}
15105 @opindex missue-rate=@var{number}
15106 Issue @var{number} instructions per cycle.  @var{number} can only be 1
15107 or 2.
15108
15109 @item -mbranch-cost=@var{number}
15110 @opindex mbranch-cost=@var{number}
15111 @var{number} can only be 1 or 2.  If it is 1 then branches are
15112 preferred over conditional code, if it is 2, then the opposite applies.
15113
15114 @item -mflush-trap=@var{number}
15115 @opindex mflush-trap=@var{number}
15116 Specifies the trap number to use to flush the cache.  The default is
15117 12.  Valid numbers are between 0 and 15 inclusive.
15118
15119 @item -mno-flush-trap
15120 @opindex mno-flush-trap
15121 Specifies that the cache cannot be flushed by using a trap.
15122
15123 @item -mflush-func=@var{name}
15124 @opindex mflush-func=@var{name}
15125 Specifies the name of the operating system function to call to flush
15126 the cache.  The default is @emph{_flush_cache}, but a function call
15127 is only used if a trap is not available.
15128
15129 @item -mno-flush-func
15130 @opindex mno-flush-func
15131 Indicates that there is no OS function for flushing the cache.
15132
15133 @end table
15134
15135 @node M680x0 Options
15136 @subsection M680x0 Options
15137 @cindex M680x0 options
15138
15139 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
15140 The default settings depend on which architecture was selected when
15141 the compiler was configured; the defaults for the most common choices
15142 are given below.
15143
15144 @table @gcctabopt
15145 @item -march=@var{arch}
15146 @opindex march
15147 Generate code for a specific M680x0 or ColdFire instruction set
15148 architecture.  Permissible values of @var{arch} for M680x0
15149 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
15150 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
15151 architectures are selected according to Freescale's ISA classification
15152 and the permissible values are: @samp{isaa}, @samp{isaaplus},
15153 @samp{isab} and @samp{isac}.
15154
15155 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
15156 code for a ColdFire target.  The @var{arch} in this macro is one of the
15157 @option{-march} arguments given above.
15158
15159 When used together, @option{-march} and @option{-mtune} select code
15160 that runs on a family of similar processors but that is optimized
15161 for a particular microarchitecture.
15162
15163 @item -mcpu=@var{cpu}
15164 @opindex mcpu
15165 Generate code for a specific M680x0 or ColdFire processor.
15166 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
15167 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
15168 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
15169 below, which also classifies the CPUs into families:
15170
15171 @multitable @columnfractions 0.20 0.80
15172 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
15173 @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}
15174 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
15175 @item @samp{5206e} @tab @samp{5206e}
15176 @item @samp{5208} @tab @samp{5207} @samp{5208}
15177 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
15178 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
15179 @item @samp{5216} @tab @samp{5214} @samp{5216}
15180 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
15181 @item @samp{5225} @tab @samp{5224} @samp{5225}
15182 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
15183 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
15184 @item @samp{5249} @tab @samp{5249}
15185 @item @samp{5250} @tab @samp{5250}
15186 @item @samp{5271} @tab @samp{5270} @samp{5271}
15187 @item @samp{5272} @tab @samp{5272}
15188 @item @samp{5275} @tab @samp{5274} @samp{5275}
15189 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
15190 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
15191 @item @samp{5307} @tab @samp{5307}
15192 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
15193 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
15194 @item @samp{5407} @tab @samp{5407}
15195 @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}
15196 @end multitable
15197
15198 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
15199 @var{arch} is compatible with @var{cpu}.  Other combinations of
15200 @option{-mcpu} and @option{-march} are rejected.
15201
15202 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
15203 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
15204 where the value of @var{family} is given by the table above.
15205
15206 @item -mtune=@var{tune}
15207 @opindex mtune
15208 Tune the code for a particular microarchitecture within the
15209 constraints set by @option{-march} and @option{-mcpu}.
15210 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
15211 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
15212 and @samp{cpu32}.  The ColdFire microarchitectures
15213 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
15214
15215 You can also use @option{-mtune=68020-40} for code that needs
15216 to run relatively well on 68020, 68030 and 68040 targets.
15217 @option{-mtune=68020-60} is similar but includes 68060 targets
15218 as well.  These two options select the same tuning decisions as
15219 @option{-m68020-40} and @option{-m68020-60} respectively.
15220
15221 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
15222 when tuning for 680x0 architecture @var{arch}.  It also defines
15223 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
15224 option is used.  If GCC is tuning for a range of architectures,
15225 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
15226 it defines the macros for every architecture in the range.
15227
15228 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
15229 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
15230 of the arguments given above.
15231
15232 @item -m68000
15233 @itemx -mc68000
15234 @opindex m68000
15235 @opindex mc68000
15236 Generate output for a 68000.  This is the default
15237 when the compiler is configured for 68000-based systems.
15238 It is equivalent to @option{-march=68000}.
15239
15240 Use this option for microcontrollers with a 68000 or EC000 core,
15241 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
15242
15243 @item -m68010
15244 @opindex m68010
15245 Generate output for a 68010.  This is the default
15246 when the compiler is configured for 68010-based systems.
15247 It is equivalent to @option{-march=68010}.
15248
15249 @item -m68020
15250 @itemx -mc68020
15251 @opindex m68020
15252 @opindex mc68020
15253 Generate output for a 68020.  This is the default
15254 when the compiler is configured for 68020-based systems.
15255 It is equivalent to @option{-march=68020}.
15256
15257 @item -m68030
15258 @opindex m68030
15259 Generate output for a 68030.  This is the default when the compiler is
15260 configured for 68030-based systems.  It is equivalent to
15261 @option{-march=68030}.
15262
15263 @item -m68040
15264 @opindex m68040
15265 Generate output for a 68040.  This is the default when the compiler is
15266 configured for 68040-based systems.  It is equivalent to
15267 @option{-march=68040}.
15268
15269 This option inhibits the use of 68881/68882 instructions that have to be
15270 emulated by software on the 68040.  Use this option if your 68040 does not
15271 have code to emulate those instructions.
15272
15273 @item -m68060
15274 @opindex m68060
15275 Generate output for a 68060.  This is the default when the compiler is
15276 configured for 68060-based systems.  It is equivalent to
15277 @option{-march=68060}.
15278
15279 This option inhibits the use of 68020 and 68881/68882 instructions that
15280 have to be emulated by software on the 68060.  Use this option if your 68060
15281 does not have code to emulate those instructions.
15282
15283 @item -mcpu32
15284 @opindex mcpu32
15285 Generate output for a CPU32.  This is the default
15286 when the compiler is configured for CPU32-based systems.
15287 It is equivalent to @option{-march=cpu32}.
15288
15289 Use this option for microcontrollers with a
15290 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
15291 68336, 68340, 68341, 68349 and 68360.
15292
15293 @item -m5200
15294 @opindex m5200
15295 Generate output for a 520X ColdFire CPU@.  This is the default
15296 when the compiler is configured for 520X-based systems.
15297 It is equivalent to @option{-mcpu=5206}, and is now deprecated
15298 in favor of that option.
15299
15300 Use this option for microcontroller with a 5200 core, including
15301 the MCF5202, MCF5203, MCF5204 and MCF5206.
15302
15303 @item -m5206e
15304 @opindex m5206e
15305 Generate output for a 5206e ColdFire CPU@.  The option is now
15306 deprecated in favor of the equivalent @option{-mcpu=5206e}.
15307
15308 @item -m528x
15309 @opindex m528x
15310 Generate output for a member of the ColdFire 528X family.
15311 The option is now deprecated in favor of the equivalent
15312 @option{-mcpu=528x}.
15313
15314 @item -m5307
15315 @opindex m5307
15316 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
15317 in favor of the equivalent @option{-mcpu=5307}.
15318
15319 @item -m5407
15320 @opindex m5407
15321 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
15322 in favor of the equivalent @option{-mcpu=5407}.
15323
15324 @item -mcfv4e
15325 @opindex mcfv4e
15326 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
15327 This includes use of hardware floating-point instructions.
15328 The option is equivalent to @option{-mcpu=547x}, and is now
15329 deprecated in favor of that option.
15330
15331 @item -m68020-40
15332 @opindex m68020-40
15333 Generate output for a 68040, without using any of the new instructions.
15334 This results in code that can run relatively efficiently on either a
15335 68020/68881 or a 68030 or a 68040.  The generated code does use the
15336 68881 instructions that are emulated on the 68040.
15337
15338 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
15339
15340 @item -m68020-60
15341 @opindex m68020-60
15342 Generate output for a 68060, without using any of the new instructions.
15343 This results in code that can run relatively efficiently on either a
15344 68020/68881 or a 68030 or a 68040.  The generated code does use the
15345 68881 instructions that are emulated on the 68060.
15346
15347 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
15348
15349 @item -mhard-float
15350 @itemx -m68881
15351 @opindex mhard-float
15352 @opindex m68881
15353 Generate floating-point instructions.  This is the default for 68020
15354 and above, and for ColdFire devices that have an FPU@.  It defines the
15355 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
15356 on ColdFire targets.
15357
15358 @item -msoft-float
15359 @opindex msoft-float
15360 Do not generate floating-point instructions; use library calls instead.
15361 This is the default for 68000, 68010, and 68832 targets.  It is also
15362 the default for ColdFire devices that have no FPU.
15363
15364 @item -mdiv
15365 @itemx -mno-div
15366 @opindex mdiv
15367 @opindex mno-div
15368 Generate (do not generate) ColdFire hardware divide and remainder
15369 instructions.  If @option{-march} is used without @option{-mcpu},
15370 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
15371 architectures.  Otherwise, the default is taken from the target CPU
15372 (either the default CPU, or the one specified by @option{-mcpu}).  For
15373 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
15374 @option{-mcpu=5206e}.
15375
15376 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
15377
15378 @item -mshort
15379 @opindex mshort
15380 Consider type @code{int} to be 16 bits wide, like @code{short int}.
15381 Additionally, parameters passed on the stack are also aligned to a
15382 16-bit boundary even on targets whose API mandates promotion to 32-bit.
15383
15384 @item -mno-short
15385 @opindex mno-short
15386 Do not consider type @code{int} to be 16 bits wide.  This is the default.
15387
15388 @item -mnobitfield
15389 @itemx -mno-bitfield
15390 @opindex mnobitfield
15391 @opindex mno-bitfield
15392 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
15393 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
15394
15395 @item -mbitfield
15396 @opindex mbitfield
15397 Do use the bit-field instructions.  The @option{-m68020} option implies
15398 @option{-mbitfield}.  This is the default if you use a configuration
15399 designed for a 68020.
15400
15401 @item -mrtd
15402 @opindex mrtd
15403 Use a different function-calling convention, in which functions
15404 that take a fixed number of arguments return with the @code{rtd}
15405 instruction, which pops their arguments while returning.  This
15406 saves one instruction in the caller since there is no need to pop
15407 the arguments there.
15408
15409 This calling convention is incompatible with the one normally
15410 used on Unix, so you cannot use it if you need to call libraries
15411 compiled with the Unix compiler.
15412
15413 Also, you must provide function prototypes for all functions that
15414 take variable numbers of arguments (including @code{printf});
15415 otherwise incorrect code is generated for calls to those
15416 functions.
15417
15418 In addition, seriously incorrect code results if you call a
15419 function with too many arguments.  (Normally, extra arguments are
15420 harmlessly ignored.)
15421
15422 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
15423 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
15424
15425 @item -mno-rtd
15426 @opindex mno-rtd
15427 Do not use the calling conventions selected by @option{-mrtd}.
15428 This is the default.
15429
15430 @item -malign-int
15431 @itemx -mno-align-int
15432 @opindex malign-int
15433 @opindex mno-align-int
15434 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
15435 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
15436 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
15437 Aligning variables on 32-bit boundaries produces code that runs somewhat
15438 faster on processors with 32-bit busses at the expense of more memory.
15439
15440 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
15441 aligns structures containing the above types differently than
15442 most published application binary interface specifications for the m68k.
15443
15444 @item -mpcrel
15445 @opindex mpcrel
15446 Use the pc-relative addressing mode of the 68000 directly, instead of
15447 using a global offset table.  At present, this option implies @option{-fpic},
15448 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
15449 not presently supported with @option{-mpcrel}, though this could be supported for
15450 68020 and higher processors.
15451
15452 @item -mno-strict-align
15453 @itemx -mstrict-align
15454 @opindex mno-strict-align
15455 @opindex mstrict-align
15456 Do not (do) assume that unaligned memory references are handled by
15457 the system.
15458
15459 @item -msep-data
15460 Generate code that allows the data segment to be located in a different
15461 area of memory from the text segment.  This allows for execute-in-place in
15462 an environment without virtual memory management.  This option implies
15463 @option{-fPIC}.
15464
15465 @item -mno-sep-data
15466 Generate code that assumes that the data segment follows the text segment.
15467 This is the default.
15468
15469 @item -mid-shared-library
15470 Generate code that supports shared libraries via the library ID method.
15471 This allows for execute-in-place and shared libraries in an environment
15472 without virtual memory management.  This option implies @option{-fPIC}.
15473
15474 @item -mno-id-shared-library
15475 Generate code that doesn't assume ID-based shared libraries are being used.
15476 This is the default.
15477
15478 @item -mshared-library-id=n
15479 Specifies the identification number of the ID-based shared library being
15480 compiled.  Specifying a value of 0 generates more compact code; specifying
15481 other values forces the allocation of that number to the current
15482 library, but is no more space- or time-efficient than omitting this option.
15483
15484 @item -mxgot
15485 @itemx -mno-xgot
15486 @opindex mxgot
15487 @opindex mno-xgot
15488 When generating position-independent code for ColdFire, generate code
15489 that works if the GOT has more than 8192 entries.  This code is
15490 larger and slower than code generated without this option.  On M680x0
15491 processors, this option is not needed; @option{-fPIC} suffices.
15492
15493 GCC normally uses a single instruction to load values from the GOT@.
15494 While this is relatively efficient, it only works if the GOT
15495 is smaller than about 64k.  Anything larger causes the linker
15496 to report an error such as:
15497
15498 @cindex relocation truncated to fit (ColdFire)
15499 @smallexample
15500 relocation truncated to fit: R_68K_GOT16O foobar
15501 @end smallexample
15502
15503 If this happens, you should recompile your code with @option{-mxgot}.
15504 It should then work with very large GOTs.  However, code generated with
15505 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
15506 the value of a global symbol.
15507
15508 Note that some linkers, including newer versions of the GNU linker,
15509 can create multiple GOTs and sort GOT entries.  If you have such a linker,
15510 you should only need to use @option{-mxgot} when compiling a single
15511 object file that accesses more than 8192 GOT entries.  Very few do.
15512
15513 These options have no effect unless GCC is generating
15514 position-independent code.
15515
15516 @end table
15517
15518 @node MCore Options
15519 @subsection MCore Options
15520 @cindex MCore options
15521
15522 These are the @samp{-m} options defined for the Motorola M*Core
15523 processors.
15524
15525 @table @gcctabopt
15526
15527 @item -mhardlit
15528 @itemx -mno-hardlit
15529 @opindex mhardlit
15530 @opindex mno-hardlit
15531 Inline constants into the code stream if it can be done in two
15532 instructions or less.
15533
15534 @item -mdiv
15535 @itemx -mno-div
15536 @opindex mdiv
15537 @opindex mno-div
15538 Use the divide instruction.  (Enabled by default).
15539
15540 @item -mrelax-immediate
15541 @itemx -mno-relax-immediate
15542 @opindex mrelax-immediate
15543 @opindex mno-relax-immediate
15544 Allow arbitrary-sized immediates in bit operations.
15545
15546 @item -mwide-bitfields
15547 @itemx -mno-wide-bitfields
15548 @opindex mwide-bitfields
15549 @opindex mno-wide-bitfields
15550 Always treat bit-fields as @code{int}-sized.
15551
15552 @item -m4byte-functions
15553 @itemx -mno-4byte-functions
15554 @opindex m4byte-functions
15555 @opindex mno-4byte-functions
15556 Force all functions to be aligned to a 4-byte boundary.
15557
15558 @item -mcallgraph-data
15559 @itemx -mno-callgraph-data
15560 @opindex mcallgraph-data
15561 @opindex mno-callgraph-data
15562 Emit callgraph information.
15563
15564 @item -mslow-bytes
15565 @itemx -mno-slow-bytes
15566 @opindex mslow-bytes
15567 @opindex mno-slow-bytes
15568 Prefer word access when reading byte quantities.
15569
15570 @item -mlittle-endian
15571 @itemx -mbig-endian
15572 @opindex mlittle-endian
15573 @opindex mbig-endian
15574 Generate code for a little-endian target.
15575
15576 @item -m210
15577 @itemx -m340
15578 @opindex m210
15579 @opindex m340
15580 Generate code for the 210 processor.
15581
15582 @item -mno-lsim
15583 @opindex mno-lsim
15584 Assume that runtime support has been provided and so omit the
15585 simulator library (@file{libsim.a)} from the linker command line.
15586
15587 @item -mstack-increment=@var{size}
15588 @opindex mstack-increment
15589 Set the maximum amount for a single stack increment operation.  Large
15590 values can increase the speed of programs that contain functions
15591 that need a large amount of stack space, but they can also trigger a
15592 segmentation fault if the stack is extended too much.  The default
15593 value is 0x1000.
15594
15595 @end table
15596
15597 @node MeP Options
15598 @subsection MeP Options
15599 @cindex MeP options
15600
15601 @table @gcctabopt
15602
15603 @item -mabsdiff
15604 @opindex mabsdiff
15605 Enables the @code{abs} instruction, which is the absolute difference
15606 between two registers.
15607
15608 @item -mall-opts
15609 @opindex mall-opts
15610 Enables all the optional instructions---average, multiply, divide, bit
15611 operations, leading zero, absolute difference, min/max, clip, and
15612 saturation.
15613
15614
15615 @item -maverage
15616 @opindex maverage
15617 Enables the @code{ave} instruction, which computes the average of two
15618 registers.
15619
15620 @item -mbased=@var{n}
15621 @opindex mbased=
15622 Variables of size @var{n} bytes or smaller are placed in the
15623 @code{.based} section by default.  Based variables use the @code{$tp}
15624 register as a base register, and there is a 128-byte limit to the
15625 @code{.based} section.
15626
15627 @item -mbitops
15628 @opindex mbitops
15629 Enables the bit operation instructions---bit test (@code{btstm}), set
15630 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
15631 test-and-set (@code{tas}).
15632
15633 @item -mc=@var{name}
15634 @opindex mc=
15635 Selects which section constant data is placed in.  @var{name} may
15636 be @code{tiny}, @code{near}, or @code{far}.
15637
15638 @item -mclip
15639 @opindex mclip
15640 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
15641 useful unless you also provide @code{-mminmax}.
15642
15643 @item -mconfig=@var{name}
15644 @opindex mconfig=
15645 Selects one of the built-in core configurations.  Each MeP chip has
15646 one or more modules in it; each module has a core CPU and a variety of
15647 coprocessors, optional instructions, and peripherals.  The
15648 @code{MeP-Integrator} tool, not part of GCC, provides these
15649 configurations through this option; using this option is the same as
15650 using all the corresponding command-line options.  The default
15651 configuration is @code{default}.
15652
15653 @item -mcop
15654 @opindex mcop
15655 Enables the coprocessor instructions.  By default, this is a 32-bit
15656 coprocessor.  Note that the coprocessor is normally enabled via the
15657 @code{-mconfig=} option.
15658
15659 @item -mcop32
15660 @opindex mcop32
15661 Enables the 32-bit coprocessor's instructions.
15662
15663 @item -mcop64
15664 @opindex mcop64
15665 Enables the 64-bit coprocessor's instructions.
15666
15667 @item -mivc2
15668 @opindex mivc2
15669 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
15670
15671 @item -mdc
15672 @opindex mdc
15673 Causes constant variables to be placed in the @code{.near} section.
15674
15675 @item -mdiv
15676 @opindex mdiv
15677 Enables the @code{div} and @code{divu} instructions.
15678
15679 @item -meb
15680 @opindex meb
15681 Generate big-endian code.
15682
15683 @item -mel
15684 @opindex mel
15685 Generate little-endian code.
15686
15687 @item -mio-volatile
15688 @opindex mio-volatile
15689 Tells the compiler that any variable marked with the @code{io}
15690 attribute is to be considered volatile.
15691
15692 @item -ml
15693 @opindex ml
15694 Causes variables to be assigned to the @code{.far} section by default.
15695
15696 @item -mleadz
15697 @opindex mleadz
15698 Enables the @code{leadz} (leading zero) instruction.
15699
15700 @item -mm
15701 @opindex mm
15702 Causes variables to be assigned to the @code{.near} section by default.
15703
15704 @item -mminmax
15705 @opindex mminmax
15706 Enables the @code{min} and @code{max} instructions.
15707
15708 @item -mmult
15709 @opindex mmult
15710 Enables the multiplication and multiply-accumulate instructions.
15711
15712 @item -mno-opts
15713 @opindex mno-opts
15714 Disables all the optional instructions enabled by @code{-mall-opts}.
15715
15716 @item -mrepeat
15717 @opindex mrepeat
15718 Enables the @code{repeat} and @code{erepeat} instructions, used for
15719 low-overhead looping.
15720
15721 @item -ms
15722 @opindex ms
15723 Causes all variables to default to the @code{.tiny} section.  Note
15724 that there is a 65536-byte limit to this section.  Accesses to these
15725 variables use the @code{%gp} base register.
15726
15727 @item -msatur
15728 @opindex msatur
15729 Enables the saturation instructions.  Note that the compiler does not
15730 currently generate these itself, but this option is included for
15731 compatibility with other tools, like @code{as}.
15732
15733 @item -msdram
15734 @opindex msdram
15735 Link the SDRAM-based runtime instead of the default ROM-based runtime.
15736
15737 @item -msim
15738 @opindex msim
15739 Link the simulator runtime libraries.
15740
15741 @item -msimnovec
15742 @opindex msimnovec
15743 Link the simulator runtime libraries, excluding built-in support
15744 for reset and exception vectors and tables.
15745
15746 @item -mtf
15747 @opindex mtf
15748 Causes all functions to default to the @code{.far} section.  Without
15749 this option, functions default to the @code{.near} section.
15750
15751 @item -mtiny=@var{n}
15752 @opindex mtiny=
15753 Variables that are @var{n} bytes or smaller are allocated to the
15754 @code{.tiny} section.  These variables use the @code{$gp} base
15755 register.  The default for this option is 4, but note that there's a
15756 65536-byte limit to the @code{.tiny} section.
15757
15758 @end table
15759
15760 @node MicroBlaze Options
15761 @subsection MicroBlaze Options
15762 @cindex MicroBlaze Options
15763
15764 @table @gcctabopt
15765
15766 @item -msoft-float
15767 @opindex msoft-float
15768 Use software emulation for floating point (default).
15769
15770 @item -mhard-float
15771 @opindex mhard-float
15772 Use hardware floating-point instructions.
15773
15774 @item -mmemcpy
15775 @opindex mmemcpy
15776 Do not optimize block moves, use @code{memcpy}.
15777
15778 @item -mno-clearbss
15779 @opindex mno-clearbss
15780 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
15781
15782 @item -mcpu=@var{cpu-type}
15783 @opindex mcpu=
15784 Use features of, and schedule code for, the given CPU.
15785 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
15786 where @var{X} is a major version, @var{YY} is the minor version, and
15787 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
15788 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
15789
15790 @item -mxl-soft-mul
15791 @opindex mxl-soft-mul
15792 Use software multiply emulation (default).
15793
15794 @item -mxl-soft-div
15795 @opindex mxl-soft-div
15796 Use software emulation for divides (default).
15797
15798 @item -mxl-barrel-shift
15799 @opindex mxl-barrel-shift
15800 Use the hardware barrel shifter.
15801
15802 @item -mxl-pattern-compare
15803 @opindex mxl-pattern-compare
15804 Use pattern compare instructions.
15805
15806 @item -msmall-divides
15807 @opindex msmall-divides
15808 Use table lookup optimization for small signed integer divisions.
15809
15810 @item -mxl-stack-check
15811 @opindex mxl-stack-check
15812 This option is deprecated.  Use @option{-fstack-check} instead.
15813
15814 @item -mxl-gp-opt
15815 @opindex mxl-gp-opt
15816 Use GP-relative @code{.sdata}/@code{.sbss} sections.
15817
15818 @item -mxl-multiply-high
15819 @opindex mxl-multiply-high
15820 Use multiply high instructions for high part of 32x32 multiply.
15821
15822 @item -mxl-float-convert
15823 @opindex mxl-float-convert
15824 Use hardware floating-point conversion instructions.
15825
15826 @item -mxl-float-sqrt
15827 @opindex mxl-float-sqrt
15828 Use hardware floating-point square root instruction.
15829
15830 @item -mbig-endian
15831 @opindex mbig-endian
15832 Generate code for a big-endian target.
15833
15834 @item -mlittle-endian
15835 @opindex mlittle-endian
15836 Generate code for a little-endian target.
15837
15838 @item -mxl-reorder
15839 @opindex mxl-reorder
15840 Use reorder instructions (swap and byte reversed load/store).
15841
15842 @item -mxl-mode-@var{app-model}
15843 Select application model @var{app-model}.  Valid models are
15844 @table @samp
15845 @item executable
15846 normal executable (default), uses startup code @file{crt0.o}.
15847
15848 @item xmdstub
15849 for use with Xilinx Microprocessor Debugger (XMD) based
15850 software intrusive debug agent called xmdstub. This uses startup file
15851 @file{crt1.o} and sets the start address of the program to 0x800.
15852
15853 @item bootstrap
15854 for applications that are loaded using a bootloader.
15855 This model uses startup file @file{crt2.o} which does not contain a processor
15856 reset vector handler. This is suitable for transferring control on a
15857 processor reset to the bootloader rather than the application.
15858
15859 @item novectors
15860 for applications that do not require any of the
15861 MicroBlaze vectors. This option may be useful for applications running
15862 within a monitoring application. This model uses @file{crt3.o} as a startup file.
15863 @end table
15864
15865 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
15866 @option{-mxl-mode-@var{app-model}}.
15867
15868 @end table
15869
15870 @node MIPS Options
15871 @subsection MIPS Options
15872 @cindex MIPS options
15873
15874 @table @gcctabopt
15875
15876 @item -EB
15877 @opindex EB
15878 Generate big-endian code.
15879
15880 @item -EL
15881 @opindex EL
15882 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
15883 configurations.
15884
15885 @item -march=@var{arch}
15886 @opindex march
15887 Generate code that runs on @var{arch}, which can be the name of a
15888 generic MIPS ISA, or the name of a particular processor.
15889 The ISA names are:
15890 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
15891 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
15892 The processor names are:
15893 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
15894 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
15895 @samp{5kc}, @samp{5kf},
15896 @samp{20kc},
15897 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
15898 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
15899 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
15900 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
15901 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
15902 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
15903 @samp{m4k},
15904 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
15905 @samp{orion},
15906 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
15907 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
15908 @samp{rm7000}, @samp{rm9000},
15909 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
15910 @samp{sb1},
15911 @samp{sr71000},
15912 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
15913 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
15914 @samp{xlr} and @samp{xlp}.
15915 The special value @samp{from-abi} selects the
15916 most compatible architecture for the selected ABI (that is,
15917 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
15918
15919 The native Linux/GNU toolchain also supports the value @samp{native},
15920 which selects the best architecture option for the host processor.
15921 @option{-march=native} has no effect if GCC does not recognize
15922 the processor.
15923
15924 In processor names, a final @samp{000} can be abbreviated as @samp{k}
15925 (for example, @option{-march=r2k}).  Prefixes are optional, and
15926 @samp{vr} may be written @samp{r}.
15927
15928 Names of the form @samp{@var{n}f2_1} refer to processors with
15929 FPUs clocked at half the rate of the core, names of the form
15930 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
15931 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
15932 processors with FPUs clocked a ratio of 3:2 with respect to the core.
15933 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
15934 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
15935 accepted as synonyms for @samp{@var{n}f1_1}.
15936
15937 GCC defines two macros based on the value of this option.  The first
15938 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
15939 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
15940 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
15941 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
15942 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
15943
15944 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
15945 above.  In other words, it has the full prefix and does not
15946 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
15947 the macro names the resolved architecture (either @samp{"mips1"} or
15948 @samp{"mips3"}).  It names the default architecture when no
15949 @option{-march} option is given.
15950
15951 @item -mtune=@var{arch}
15952 @opindex mtune
15953 Optimize for @var{arch}.  Among other things, this option controls
15954 the way instructions are scheduled, and the perceived cost of arithmetic
15955 operations.  The list of @var{arch} values is the same as for
15956 @option{-march}.
15957
15958 When this option is not used, GCC optimizes for the processor
15959 specified by @option{-march}.  By using @option{-march} and
15960 @option{-mtune} together, it is possible to generate code that
15961 runs on a family of processors, but optimize the code for one
15962 particular member of that family.
15963
15964 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
15965 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
15966 @option{-march} ones described above.
15967
15968 @item -mips1
15969 @opindex mips1
15970 Equivalent to @option{-march=mips1}.
15971
15972 @item -mips2
15973 @opindex mips2
15974 Equivalent to @option{-march=mips2}.
15975
15976 @item -mips3
15977 @opindex mips3
15978 Equivalent to @option{-march=mips3}.
15979
15980 @item -mips4
15981 @opindex mips4
15982 Equivalent to @option{-march=mips4}.
15983
15984 @item -mips32
15985 @opindex mips32
15986 Equivalent to @option{-march=mips32}.
15987
15988 @item -mips32r2
15989 @opindex mips32r2
15990 Equivalent to @option{-march=mips32r2}.
15991
15992 @item -mips64
15993 @opindex mips64
15994 Equivalent to @option{-march=mips64}.
15995
15996 @item -mips64r2
15997 @opindex mips64r2
15998 Equivalent to @option{-march=mips64r2}.
15999
16000 @item -mips16
16001 @itemx -mno-mips16
16002 @opindex mips16
16003 @opindex mno-mips16
16004 Generate (do not generate) MIPS16 code.  If GCC is targeting a
16005 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
16006
16007 MIPS16 code generation can also be controlled on a per-function basis
16008 by means of @code{mips16} and @code{nomips16} attributes.
16009 @xref{Function Attributes}, for more information.
16010
16011 @item -mflip-mips16
16012 @opindex mflip-mips16
16013 Generate MIPS16 code on alternating functions.  This option is provided
16014 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
16015 not intended for ordinary use in compiling user code.
16016
16017 @item -minterlink-mips16
16018 @itemx -mno-interlink-mips16
16019 @opindex minterlink-mips16
16020 @opindex mno-interlink-mips16
16021 Require (do not require) that non-MIPS16 code be link-compatible with
16022 MIPS16 code.
16023
16024 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
16025 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
16026 therefore disables direct jumps unless GCC knows that the target of the
16027 jump is not MIPS16.
16028
16029 @item -mabi=32
16030 @itemx -mabi=o64
16031 @itemx -mabi=n32
16032 @itemx -mabi=64
16033 @itemx -mabi=eabi
16034 @opindex mabi=32
16035 @opindex mabi=o64
16036 @opindex mabi=n32
16037 @opindex mabi=64
16038 @opindex mabi=eabi
16039 Generate code for the given ABI@.
16040
16041 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
16042 generates 64-bit code when you select a 64-bit architecture, but you
16043 can use @option{-mgp32} to get 32-bit code instead.
16044
16045 For information about the O64 ABI, see
16046 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
16047
16048 GCC supports a variant of the o32 ABI in which floating-point registers
16049 are 64 rather than 32 bits wide.  You can select this combination with
16050 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
16051 and @code{mfhc1} instructions and is therefore only supported for
16052 MIPS32R2 processors.
16053
16054 The register assignments for arguments and return values remain the
16055 same, but each scalar value is passed in a single 64-bit register
16056 rather than a pair of 32-bit registers.  For example, scalar
16057 floating-point values are returned in @samp{$f0} only, not a
16058 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
16059 remains the same, but all 64 bits are saved.
16060
16061 @item -mabicalls
16062 @itemx -mno-abicalls
16063 @opindex mabicalls
16064 @opindex mno-abicalls
16065 Generate (do not generate) code that is suitable for SVR4-style
16066 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
16067 systems.
16068
16069 @item -mshared
16070 @itemx -mno-shared
16071 Generate (do not generate) code that is fully position-independent,
16072 and that can therefore be linked into shared libraries.  This option
16073 only affects @option{-mabicalls}.
16074
16075 All @option{-mabicalls} code has traditionally been position-independent,
16076 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
16077 as an extension, the GNU toolchain allows executables to use absolute
16078 accesses for locally-binding symbols.  It can also use shorter GP
16079 initialization sequences and generate direct calls to locally-defined
16080 functions.  This mode is selected by @option{-mno-shared}.
16081
16082 @option{-mno-shared} depends on binutils 2.16 or higher and generates
16083 objects that can only be linked by the GNU linker.  However, the option
16084 does not affect the ABI of the final executable; it only affects the ABI
16085 of relocatable objects.  Using @option{-mno-shared} generally makes
16086 executables both smaller and quicker.
16087
16088 @option{-mshared} is the default.
16089
16090 @item -mplt
16091 @itemx -mno-plt
16092 @opindex mplt
16093 @opindex mno-plt
16094 Assume (do not assume) that the static and dynamic linkers
16095 support PLTs and copy relocations.  This option only affects
16096 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
16097 has no effect without @option{-msym32}.
16098
16099 You can make @option{-mplt} the default by configuring
16100 GCC with @option{--with-mips-plt}.  The default is
16101 @option{-mno-plt} otherwise.
16102
16103 @item -mxgot
16104 @itemx -mno-xgot
16105 @opindex mxgot
16106 @opindex mno-xgot
16107 Lift (do not lift) the usual restrictions on the size of the global
16108 offset table.
16109
16110 GCC normally uses a single instruction to load values from the GOT@.
16111 While this is relatively efficient, it only works if the GOT
16112 is smaller than about 64k.  Anything larger causes the linker
16113 to report an error such as:
16114
16115 @cindex relocation truncated to fit (MIPS)
16116 @smallexample
16117 relocation truncated to fit: R_MIPS_GOT16 foobar
16118 @end smallexample
16119
16120 If this happens, you should recompile your code with @option{-mxgot}.
16121 This works with very large GOTs, although the code is also
16122 less efficient, since it takes three instructions to fetch the
16123 value of a global symbol.
16124
16125 Note that some linkers can create multiple GOTs.  If you have such a
16126 linker, you should only need to use @option{-mxgot} when a single object
16127 file accesses more than 64k's worth of GOT entries.  Very few do.
16128
16129 These options have no effect unless GCC is generating position
16130 independent code.
16131
16132 @item -mgp32
16133 @opindex mgp32
16134 Assume that general-purpose registers are 32 bits wide.
16135
16136 @item -mgp64
16137 @opindex mgp64
16138 Assume that general-purpose registers are 64 bits wide.
16139
16140 @item -mfp32
16141 @opindex mfp32
16142 Assume that floating-point registers are 32 bits wide.
16143
16144 @item -mfp64
16145 @opindex mfp64
16146 Assume that floating-point registers are 64 bits wide.
16147
16148 @item -mhard-float
16149 @opindex mhard-float
16150 Use floating-point coprocessor instructions.
16151
16152 @item -msoft-float
16153 @opindex msoft-float
16154 Do not use floating-point coprocessor instructions.  Implement
16155 floating-point calculations using library calls instead.
16156
16157 @item -mno-float
16158 @opindex mno-float
16159 Equivalent to @option{-msoft-float}, but additionally asserts that the
16160 program being compiled does not perform any floating-point operations.
16161 This option is presently supported only by some bare-metal MIPS
16162 configurations, where it may select a special set of libraries
16163 that lack all floating-point support (including, for example, the
16164 floating-point @code{printf} formats).  
16165 If code compiled with @code{-mno-float} accidentally contains
16166 floating-point operations, it is likely to suffer a link-time
16167 or run-time failure.
16168
16169 @item -msingle-float
16170 @opindex msingle-float
16171 Assume that the floating-point coprocessor only supports single-precision
16172 operations.
16173
16174 @item -mdouble-float
16175 @opindex mdouble-float
16176 Assume that the floating-point coprocessor supports double-precision
16177 operations.  This is the default.
16178
16179 @item -mllsc
16180 @itemx -mno-llsc
16181 @opindex mllsc
16182 @opindex mno-llsc
16183 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
16184 implement atomic memory built-in functions.  When neither option is
16185 specified, GCC uses the instructions if the target architecture
16186 supports them.
16187
16188 @option{-mllsc} is useful if the runtime environment can emulate the
16189 instructions and @option{-mno-llsc} can be useful when compiling for
16190 nonstandard ISAs.  You can make either option the default by
16191 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
16192 respectively.  @option{--with-llsc} is the default for some
16193 configurations; see the installation documentation for details.
16194
16195 @item -mdsp
16196 @itemx -mno-dsp
16197 @opindex mdsp
16198 @opindex mno-dsp
16199 Use (do not use) revision 1 of the MIPS DSP ASE@.
16200 @xref{MIPS DSP Built-in Functions}.  This option defines the
16201 preprocessor macro @samp{__mips_dsp}.  It also defines
16202 @samp{__mips_dsp_rev} to 1.
16203
16204 @item -mdspr2
16205 @itemx -mno-dspr2
16206 @opindex mdspr2
16207 @opindex mno-dspr2
16208 Use (do not use) revision 2 of the MIPS DSP ASE@.
16209 @xref{MIPS DSP Built-in Functions}.  This option defines the
16210 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
16211 It also defines @samp{__mips_dsp_rev} to 2.
16212
16213 @item -msmartmips
16214 @itemx -mno-smartmips
16215 @opindex msmartmips
16216 @opindex mno-smartmips
16217 Use (do not use) the MIPS SmartMIPS ASE.
16218
16219 @item -mpaired-single
16220 @itemx -mno-paired-single
16221 @opindex mpaired-single
16222 @opindex mno-paired-single
16223 Use (do not use) paired-single floating-point instructions.
16224 @xref{MIPS Paired-Single Support}.  This option requires
16225 hardware floating-point support to be enabled.
16226
16227 @item -mdmx
16228 @itemx -mno-mdmx
16229 @opindex mdmx
16230 @opindex mno-mdmx
16231 Use (do not use) MIPS Digital Media Extension instructions.
16232 This option can only be used when generating 64-bit code and requires
16233 hardware floating-point support to be enabled.
16234
16235 @item -mips3d
16236 @itemx -mno-mips3d
16237 @opindex mips3d
16238 @opindex mno-mips3d
16239 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
16240 The option @option{-mips3d} implies @option{-mpaired-single}.
16241
16242 @item -mmt
16243 @itemx -mno-mt
16244 @opindex mmt
16245 @opindex mno-mt
16246 Use (do not use) MT Multithreading instructions.
16247
16248 @item -mmcu
16249 @itemx -mno-mcu
16250 @opindex mmcu
16251 @opindex mno-mcu
16252 Use (do not use) the MIPS MCU ASE instructions.
16253
16254 @item -mlong64
16255 @opindex mlong64
16256 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
16257 an explanation of the default and the way that the pointer size is
16258 determined.
16259
16260 @item -mlong32
16261 @opindex mlong32
16262 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
16263
16264 The default size of @code{int}s, @code{long}s and pointers depends on
16265 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
16266 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
16267 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
16268 or the same size as integer registers, whichever is smaller.
16269
16270 @item -msym32
16271 @itemx -mno-sym32
16272 @opindex msym32
16273 @opindex mno-sym32
16274 Assume (do not assume) that all symbols have 32-bit values, regardless
16275 of the selected ABI@.  This option is useful in combination with
16276 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
16277 to generate shorter and faster references to symbolic addresses.
16278
16279 @item -G @var{num}
16280 @opindex G
16281 Put definitions of externally-visible data in a small data section
16282 if that data is no bigger than @var{num} bytes.  GCC can then generate
16283 more efficient accesses to the data; see @option{-mgpopt} for details.
16284
16285 The default @option{-G} option depends on the configuration.
16286
16287 @item -mlocal-sdata
16288 @itemx -mno-local-sdata
16289 @opindex mlocal-sdata
16290 @opindex mno-local-sdata
16291 Extend (do not extend) the @option{-G} behavior to local data too,
16292 such as to static variables in C@.  @option{-mlocal-sdata} is the
16293 default for all configurations.
16294
16295 If the linker complains that an application is using too much small data,
16296 you might want to try rebuilding the less performance-critical parts with
16297 @option{-mno-local-sdata}.  You might also want to build large
16298 libraries with @option{-mno-local-sdata}, so that the libraries leave
16299 more room for the main program.
16300
16301 @item -mextern-sdata
16302 @itemx -mno-extern-sdata
16303 @opindex mextern-sdata
16304 @opindex mno-extern-sdata
16305 Assume (do not assume) that externally-defined data is in
16306 a small data section if the size of that data is within the @option{-G} limit.
16307 @option{-mextern-sdata} is the default for all configurations.
16308
16309 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
16310 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
16311 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
16312 is placed in a small data section.  If @var{Var} is defined by another
16313 module, you must either compile that module with a high-enough
16314 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
16315 definition.  If @var{Var} is common, you must link the application
16316 with a high-enough @option{-G} setting.
16317
16318 The easiest way of satisfying these restrictions is to compile
16319 and link every module with the same @option{-G} option.  However,
16320 you may wish to build a library that supports several different
16321 small data limits.  You can do this by compiling the library with
16322 the highest supported @option{-G} setting and additionally using
16323 @option{-mno-extern-sdata} to stop the library from making assumptions
16324 about externally-defined data.
16325
16326 @item -mgpopt
16327 @itemx -mno-gpopt
16328 @opindex mgpopt
16329 @opindex mno-gpopt
16330 Use (do not use) GP-relative accesses for symbols that are known to be
16331 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
16332 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
16333 configurations.
16334
16335 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
16336 might not hold the value of @code{_gp}.  For example, if the code is
16337 part of a library that might be used in a boot monitor, programs that
16338 call boot monitor routines pass an unknown value in @code{$gp}.
16339 (In such situations, the boot monitor itself is usually compiled
16340 with @option{-G0}.)
16341
16342 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
16343 @option{-mno-extern-sdata}.
16344
16345 @item -membedded-data
16346 @itemx -mno-embedded-data
16347 @opindex membedded-data
16348 @opindex mno-embedded-data
16349 Allocate variables to the read-only data section first if possible, then
16350 next in the small data section if possible, otherwise in data.  This gives
16351 slightly slower code than the default, but reduces the amount of RAM required
16352 when executing, and thus may be preferred for some embedded systems.
16353
16354 @item -muninit-const-in-rodata
16355 @itemx -mno-uninit-const-in-rodata
16356 @opindex muninit-const-in-rodata
16357 @opindex mno-uninit-const-in-rodata
16358 Put uninitialized @code{const} variables in the read-only data section.
16359 This option is only meaningful in conjunction with @option{-membedded-data}.
16360
16361 @item -mcode-readable=@var{setting}
16362 @opindex mcode-readable
16363 Specify whether GCC may generate code that reads from executable sections.
16364 There are three possible settings:
16365
16366 @table @gcctabopt
16367 @item -mcode-readable=yes
16368 Instructions may freely access executable sections.  This is the
16369 default setting.
16370
16371 @item -mcode-readable=pcrel
16372 MIPS16 PC-relative load instructions can access executable sections,
16373 but other instructions must not do so.  This option is useful on 4KSc
16374 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
16375 It is also useful on processors that can be configured to have a dual
16376 instruction/data SRAM interface and that, like the M4K, automatically
16377 redirect PC-relative loads to the instruction RAM.
16378
16379 @item -mcode-readable=no
16380 Instructions must not access executable sections.  This option can be
16381 useful on targets that are configured to have a dual instruction/data
16382 SRAM interface but that (unlike the M4K) do not automatically redirect
16383 PC-relative loads to the instruction RAM.
16384 @end table
16385
16386 @item -msplit-addresses
16387 @itemx -mno-split-addresses
16388 @opindex msplit-addresses
16389 @opindex mno-split-addresses
16390 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
16391 relocation operators.  This option has been superseded by
16392 @option{-mexplicit-relocs} but is retained for backwards compatibility.
16393
16394 @item -mexplicit-relocs
16395 @itemx -mno-explicit-relocs
16396 @opindex mexplicit-relocs
16397 @opindex mno-explicit-relocs
16398 Use (do not use) assembler relocation operators when dealing with symbolic
16399 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
16400 is to use assembler macros instead.
16401
16402 @option{-mexplicit-relocs} is the default if GCC was configured
16403 to use an assembler that supports relocation operators.
16404
16405 @item -mcheck-zero-division
16406 @itemx -mno-check-zero-division
16407 @opindex mcheck-zero-division
16408 @opindex mno-check-zero-division
16409 Trap (do not trap) on integer division by zero.
16410
16411 The default is @option{-mcheck-zero-division}.
16412
16413 @item -mdivide-traps
16414 @itemx -mdivide-breaks
16415 @opindex mdivide-traps
16416 @opindex mdivide-breaks
16417 MIPS systems check for division by zero by generating either a
16418 conditional trap or a break instruction.  Using traps results in
16419 smaller code, but is only supported on MIPS II and later.  Also, some
16420 versions of the Linux kernel have a bug that prevents trap from
16421 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
16422 allow conditional traps on architectures that support them and
16423 @option{-mdivide-breaks} to force the use of breaks.
16424
16425 The default is usually @option{-mdivide-traps}, but this can be
16426 overridden at configure time using @option{--with-divide=breaks}.
16427 Divide-by-zero checks can be completely disabled using
16428 @option{-mno-check-zero-division}.
16429
16430 @item -mmemcpy
16431 @itemx -mno-memcpy
16432 @opindex mmemcpy
16433 @opindex mno-memcpy
16434 Force (do not force) the use of @code{memcpy()} for non-trivial block
16435 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
16436 most constant-sized copies.
16437
16438 @item -mlong-calls
16439 @itemx -mno-long-calls
16440 @opindex mlong-calls
16441 @opindex mno-long-calls
16442 Disable (do not disable) use of the @code{jal} instruction.  Calling
16443 functions using @code{jal} is more efficient but requires the caller
16444 and callee to be in the same 256 megabyte segment.
16445
16446 This option has no effect on abicalls code.  The default is
16447 @option{-mno-long-calls}.
16448
16449 @item -mmad
16450 @itemx -mno-mad
16451 @opindex mmad
16452 @opindex mno-mad
16453 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
16454 instructions, as provided by the R4650 ISA@.
16455
16456 @item -mfused-madd
16457 @itemx -mno-fused-madd
16458 @opindex mfused-madd
16459 @opindex mno-fused-madd
16460 Enable (disable) use of the floating-point multiply-accumulate
16461 instructions, when they are available.  The default is
16462 @option{-mfused-madd}.
16463
16464 On the R8000 CPU when multiply-accumulate instructions are used,
16465 the intermediate product is calculated to infinite precision
16466 and is not subject to the FCSR Flush to Zero bit.  This may be
16467 undesirable in some circumstances.  On other processors the result
16468 is numerically identical to the equivalent computation using
16469 separate multiply, add, subtract and negate instructions.
16470
16471 @item -nocpp
16472 @opindex nocpp
16473 Tell the MIPS assembler to not run its preprocessor over user
16474 assembler files (with a @samp{.s} suffix) when assembling them.
16475
16476 @item -mfix-24k
16477 @item -mno-fix-24k
16478 @opindex mfix-24k
16479 @opindex mno-fix-24k
16480 Work around the 24K E48 (lost data on stores during refill) errata.
16481 The workarounds are implemented by the assembler rather than by GCC@.
16482
16483 @item -mfix-r4000
16484 @itemx -mno-fix-r4000
16485 @opindex mfix-r4000
16486 @opindex mno-fix-r4000
16487 Work around certain R4000 CPU errata:
16488 @itemize @minus
16489 @item
16490 A double-word or a variable shift may give an incorrect result if executed
16491 immediately after starting an integer division.
16492 @item
16493 A double-word or a variable shift may give an incorrect result if executed
16494 while an integer multiplication is in progress.
16495 @item
16496 An integer division may give an incorrect result if started in a delay slot
16497 of a taken branch or a jump.
16498 @end itemize
16499
16500 @item -mfix-r4400
16501 @itemx -mno-fix-r4400
16502 @opindex mfix-r4400
16503 @opindex mno-fix-r4400
16504 Work around certain R4400 CPU errata:
16505 @itemize @minus
16506 @item
16507 A double-word or a variable shift may give an incorrect result if executed
16508 immediately after starting an integer division.
16509 @end itemize
16510
16511 @item -mfix-r10000
16512 @itemx -mno-fix-r10000
16513 @opindex mfix-r10000
16514 @opindex mno-fix-r10000
16515 Work around certain R10000 errata:
16516 @itemize @minus
16517 @item
16518 @code{ll}/@code{sc} sequences may not behave atomically on revisions
16519 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
16520 @end itemize
16521
16522 This option can only be used if the target architecture supports
16523 branch-likely instructions.  @option{-mfix-r10000} is the default when
16524 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
16525 otherwise.
16526
16527 @item -mfix-vr4120
16528 @itemx -mno-fix-vr4120
16529 @opindex mfix-vr4120
16530 Work around certain VR4120 errata:
16531 @itemize @minus
16532 @item
16533 @code{dmultu} does not always produce the correct result.
16534 @item
16535 @code{div} and @code{ddiv} do not always produce the correct result if one
16536 of the operands is negative.
16537 @end itemize
16538 The workarounds for the division errata rely on special functions in
16539 @file{libgcc.a}.  At present, these functions are only provided by
16540 the @code{mips64vr*-elf} configurations.
16541
16542 Other VR4120 errata require a NOP to be inserted between certain pairs of
16543 instructions.  These errata are handled by the assembler, not by GCC itself.
16544
16545 @item -mfix-vr4130
16546 @opindex mfix-vr4130
16547 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
16548 workarounds are implemented by the assembler rather than by GCC,
16549 although GCC avoids using @code{mflo} and @code{mfhi} if the
16550 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
16551 instructions are available instead.
16552
16553 @item -mfix-sb1
16554 @itemx -mno-fix-sb1
16555 @opindex mfix-sb1
16556 Work around certain SB-1 CPU core errata.
16557 (This flag currently works around the SB-1 revision 2
16558 ``F1'' and ``F2'' floating-point errata.)
16559
16560 @item -mr10k-cache-barrier=@var{setting}
16561 @opindex mr10k-cache-barrier
16562 Specify whether GCC should insert cache barriers to avoid the
16563 side-effects of speculation on R10K processors.
16564
16565 In common with many processors, the R10K tries to predict the outcome
16566 of a conditional branch and speculatively executes instructions from
16567 the ``taken'' branch.  It later aborts these instructions if the
16568 predicted outcome is wrong.  However, on the R10K, even aborted
16569 instructions can have side effects.
16570
16571 This problem only affects kernel stores and, depending on the system,
16572 kernel loads.  As an example, a speculatively-executed store may load
16573 the target memory into cache and mark the cache line as dirty, even if
16574 the store itself is later aborted.  If a DMA operation writes to the
16575 same area of memory before the ``dirty'' line is flushed, the cached
16576 data overwrites the DMA-ed data.  See the R10K processor manual
16577 for a full description, including other potential problems.
16578
16579 One workaround is to insert cache barrier instructions before every memory
16580 access that might be speculatively executed and that might have side
16581 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
16582 controls GCC's implementation of this workaround.  It assumes that
16583 aborted accesses to any byte in the following regions does not have
16584 side effects:
16585
16586 @enumerate
16587 @item
16588 the memory occupied by the current function's stack frame;
16589
16590 @item
16591 the memory occupied by an incoming stack argument;
16592
16593 @item
16594 the memory occupied by an object with a link-time-constant address.
16595 @end enumerate
16596
16597 It is the kernel's responsibility to ensure that speculative
16598 accesses to these regions are indeed safe.
16599
16600 If the input program contains a function declaration such as:
16601
16602 @smallexample
16603 void foo (void);
16604 @end smallexample
16605
16606 then the implementation of @code{foo} must allow @code{j foo} and
16607 @code{jal foo} to be executed speculatively.  GCC honors this
16608 restriction for functions it compiles itself.  It expects non-GCC
16609 functions (such as hand-written assembly code) to do the same.
16610
16611 The option has three forms:
16612
16613 @table @gcctabopt
16614 @item -mr10k-cache-barrier=load-store
16615 Insert a cache barrier before a load or store that might be
16616 speculatively executed and that might have side effects even
16617 if aborted.
16618
16619 @item -mr10k-cache-barrier=store
16620 Insert a cache barrier before a store that might be speculatively
16621 executed and that might have side effects even if aborted.
16622
16623 @item -mr10k-cache-barrier=none
16624 Disable the insertion of cache barriers.  This is the default setting.
16625 @end table
16626
16627 @item -mflush-func=@var{func}
16628 @itemx -mno-flush-func
16629 @opindex mflush-func
16630 Specifies the function to call to flush the I and D caches, or to not
16631 call any such function.  If called, the function must take the same
16632 arguments as the common @code{_flush_func()}, that is, the address of the
16633 memory range for which the cache is being flushed, the size of the
16634 memory range, and the number 3 (to flush both caches).  The default
16635 depends on the target GCC was configured for, but commonly is either
16636 @samp{_flush_func} or @samp{__cpu_flush}.
16637
16638 @item mbranch-cost=@var{num}
16639 @opindex mbranch-cost
16640 Set the cost of branches to roughly @var{num} ``simple'' instructions.
16641 This cost is only a heuristic and is not guaranteed to produce
16642 consistent results across releases.  A zero cost redundantly selects
16643 the default, which is based on the @option{-mtune} setting.
16644
16645 @item -mbranch-likely
16646 @itemx -mno-branch-likely
16647 @opindex mbranch-likely
16648 @opindex mno-branch-likely
16649 Enable or disable use of Branch Likely instructions, regardless of the
16650 default for the selected architecture.  By default, Branch Likely
16651 instructions may be generated if they are supported by the selected
16652 architecture.  An exception is for the MIPS32 and MIPS64 architectures
16653 and processors that implement those architectures; for those, Branch
16654 Likely instructions are not be generated by default because the MIPS32
16655 and MIPS64 architectures specifically deprecate their use.
16656
16657 @item -mfp-exceptions
16658 @itemx -mno-fp-exceptions
16659 @opindex mfp-exceptions
16660 Specifies whether FP exceptions are enabled.  This affects how
16661 FP instructions are scheduled for some processors.
16662 The default is that FP exceptions are
16663 enabled.
16664
16665 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
16666 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
16667 FP pipe.
16668
16669 @item -mvr4130-align
16670 @itemx -mno-vr4130-align
16671 @opindex mvr4130-align
16672 The VR4130 pipeline is two-way superscalar, but can only issue two
16673 instructions together if the first one is 8-byte aligned.  When this
16674 option is enabled, GCC aligns pairs of instructions that it
16675 thinks should execute in parallel.
16676
16677 This option only has an effect when optimizing for the VR4130.
16678 It normally makes code faster, but at the expense of making it bigger.
16679 It is enabled by default at optimization level @option{-O3}.
16680
16681 @item -msynci
16682 @itemx -mno-synci
16683 @opindex msynci
16684 Enable (disable) generation of @code{synci} instructions on
16685 architectures that support it.  The @code{synci} instructions (if
16686 enabled) are generated when @code{__builtin___clear_cache()} is
16687 compiled.
16688
16689 This option defaults to @code{-mno-synci}, but the default can be
16690 overridden by configuring with @code{--with-synci}.
16691
16692 When compiling code for single processor systems, it is generally safe
16693 to use @code{synci}.  However, on many multi-core (SMP) systems, it
16694 does not invalidate the instruction caches on all cores and may lead
16695 to undefined behavior.
16696
16697 @item -mrelax-pic-calls
16698 @itemx -mno-relax-pic-calls
16699 @opindex mrelax-pic-calls
16700 Try to turn PIC calls that are normally dispatched via register
16701 @code{$25} into direct calls.  This is only possible if the linker can
16702 resolve the destination at link-time and if the destination is within
16703 range for a direct call.
16704
16705 @option{-mrelax-pic-calls} is the default if GCC was configured to use
16706 an assembler and a linker that support the @code{.reloc} assembly
16707 directive and @code{-mexplicit-relocs} is in effect.  With
16708 @code{-mno-explicit-relocs}, this optimization can be performed by the
16709 assembler and the linker alone without help from the compiler.
16710
16711 @item -mmcount-ra-address
16712 @itemx -mno-mcount-ra-address
16713 @opindex mmcount-ra-address
16714 @opindex mno-mcount-ra-address
16715 Emit (do not emit) code that allows @code{_mcount} to modify the
16716 calling function's return address.  When enabled, this option extends
16717 the usual @code{_mcount} interface with a new @var{ra-address}
16718 parameter, which has type @code{intptr_t *} and is passed in register
16719 @code{$12}.  @code{_mcount} can then modify the return address by
16720 doing both of the following:
16721 @itemize
16722 @item
16723 Returning the new address in register @code{$31}.
16724 @item
16725 Storing the new address in @code{*@var{ra-address}},
16726 if @var{ra-address} is nonnull.
16727 @end itemize
16728
16729 The default is @option{-mno-mcount-ra-address}.
16730
16731 @end table
16732
16733 @node MMIX Options
16734 @subsection MMIX Options
16735 @cindex MMIX Options
16736
16737 These options are defined for the MMIX:
16738
16739 @table @gcctabopt
16740 @item -mlibfuncs
16741 @itemx -mno-libfuncs
16742 @opindex mlibfuncs
16743 @opindex mno-libfuncs
16744 Specify that intrinsic library functions are being compiled, passing all
16745 values in registers, no matter the size.
16746
16747 @item -mepsilon
16748 @itemx -mno-epsilon
16749 @opindex mepsilon
16750 @opindex mno-epsilon
16751 Generate floating-point comparison instructions that compare with respect
16752 to the @code{rE} epsilon register.
16753
16754 @item -mabi=mmixware
16755 @itemx -mabi=gnu
16756 @opindex mabi=mmixware
16757 @opindex mabi=gnu
16758 Generate code that passes function parameters and return values that (in
16759 the called function) are seen as registers @code{$0} and up, as opposed to
16760 the GNU ABI which uses global registers @code{$231} and up.
16761
16762 @item -mzero-extend
16763 @itemx -mno-zero-extend
16764 @opindex mzero-extend
16765 @opindex mno-zero-extend
16766 When reading data from memory in sizes shorter than 64 bits, use (do not
16767 use) zero-extending load instructions by default, rather than
16768 sign-extending ones.
16769
16770 @item -mknuthdiv
16771 @itemx -mno-knuthdiv
16772 @opindex mknuthdiv
16773 @opindex mno-knuthdiv
16774 Make the result of a division yielding a remainder have the same sign as
16775 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
16776 remainder follows the sign of the dividend.  Both methods are
16777 arithmetically valid, the latter being almost exclusively used.
16778
16779 @item -mtoplevel-symbols
16780 @itemx -mno-toplevel-symbols
16781 @opindex mtoplevel-symbols
16782 @opindex mno-toplevel-symbols
16783 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
16784 code can be used with the @code{PREFIX} assembly directive.
16785
16786 @item -melf
16787 @opindex melf
16788 Generate an executable in the ELF format, rather than the default
16789 @samp{mmo} format used by the @command{mmix} simulator.
16790
16791 @item -mbranch-predict
16792 @itemx -mno-branch-predict
16793 @opindex mbranch-predict
16794 @opindex mno-branch-predict
16795 Use (do not use) the probable-branch instructions, when static branch
16796 prediction indicates a probable branch.
16797
16798 @item -mbase-addresses
16799 @itemx -mno-base-addresses
16800 @opindex mbase-addresses
16801 @opindex mno-base-addresses
16802 Generate (do not generate) code that uses @emph{base addresses}.  Using a
16803 base address automatically generates a request (handled by the assembler
16804 and the linker) for a constant to be set up in a global register.  The
16805 register is used for one or more base address requests within the range 0
16806 to 255 from the value held in the register.  The generally leads to short
16807 and fast code, but the number of different data items that can be
16808 addressed is limited.  This means that a program that uses lots of static
16809 data may require @option{-mno-base-addresses}.
16810
16811 @item -msingle-exit
16812 @itemx -mno-single-exit
16813 @opindex msingle-exit
16814 @opindex mno-single-exit
16815 Force (do not force) generated code to have a single exit point in each
16816 function.
16817 @end table
16818
16819 @node MN10300 Options
16820 @subsection MN10300 Options
16821 @cindex MN10300 options
16822
16823 These @option{-m} options are defined for Matsushita MN10300 architectures:
16824
16825 @table @gcctabopt
16826 @item -mmult-bug
16827 @opindex mmult-bug
16828 Generate code to avoid bugs in the multiply instructions for the MN10300
16829 processors.  This is the default.
16830
16831 @item -mno-mult-bug
16832 @opindex mno-mult-bug
16833 Do not generate code to avoid bugs in the multiply instructions for the
16834 MN10300 processors.
16835
16836 @item -mam33
16837 @opindex mam33
16838 Generate code using features specific to the AM33 processor.
16839
16840 @item -mno-am33
16841 @opindex mno-am33
16842 Do not generate code using features specific to the AM33 processor.  This
16843 is the default.
16844
16845 @item -mam33-2
16846 @opindex mam33-2
16847 Generate code using features specific to the AM33/2.0 processor.
16848
16849 @item -mam34
16850 @opindex mam34
16851 Generate code using features specific to the AM34 processor.
16852
16853 @item -mtune=@var{cpu-type}
16854 @opindex mtune
16855 Use the timing characteristics of the indicated CPU type when
16856 scheduling instructions.  This does not change the targeted processor
16857 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
16858 @samp{am33-2} or @samp{am34}.
16859
16860 @item -mreturn-pointer-on-d0
16861 @opindex mreturn-pointer-on-d0
16862 When generating a function that returns a pointer, return the pointer
16863 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
16864 only in @code{a0}, and attempts to call such functions without a prototype
16865 result in errors.  Note that this option is on by default; use
16866 @option{-mno-return-pointer-on-d0} to disable it.
16867
16868 @item -mno-crt0
16869 @opindex mno-crt0
16870 Do not link in the C run-time initialization object file.
16871
16872 @item -mrelax
16873 @opindex mrelax
16874 Indicate to the linker that it should perform a relaxation optimization pass
16875 to shorten branches, calls and absolute memory addresses.  This option only
16876 has an effect when used on the command line for the final link step.
16877
16878 This option makes symbolic debugging impossible.
16879
16880 @item -mliw
16881 @opindex mliw
16882 Allow the compiler to generate @emph{Long Instruction Word}
16883 instructions if the target is the @samp{AM33} or later.  This is the
16884 default.  This option defines the preprocessor macro @samp{__LIW__}.
16885
16886 @item -mnoliw
16887 @opindex mnoliw
16888 Do not allow the compiler to generate @emph{Long Instruction Word}
16889 instructions.  This option defines the preprocessor macro
16890 @samp{__NO_LIW__}.
16891
16892 @item -msetlb
16893 @opindex msetlb
16894 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
16895 instructions if the target is the @samp{AM33} or later.  This is the
16896 default.  This option defines the preprocessor macro @samp{__SETLB__}.
16897
16898 @item -mnosetlb
16899 @opindex mnosetlb
16900 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
16901 instructions.  This option defines the preprocessor macro
16902 @samp{__NO_SETLB__}.
16903
16904 @end table
16905
16906 @node Moxie Options
16907 @subsection Moxie Options
16908 @cindex Moxie Options
16909
16910 @table @gcctabopt
16911
16912 @item -meb
16913 @opindex meb
16914 Generate big-endian code.  This is the default for @samp{moxie-*-*}
16915 configurations.
16916
16917 @item -mel
16918 @opindex mel
16919 Generate little-endian code.
16920
16921 @item -mno-crt0
16922 @opindex mno-crt0
16923 Do not link in the C run-time initialization object file.
16924
16925 @end table
16926
16927 @node PDP-11 Options
16928 @subsection PDP-11 Options
16929 @cindex PDP-11 Options
16930
16931 These options are defined for the PDP-11:
16932
16933 @table @gcctabopt
16934 @item -mfpu
16935 @opindex mfpu
16936 Use hardware FPP floating point.  This is the default.  (FIS floating
16937 point on the PDP-11/40 is not supported.)
16938
16939 @item -msoft-float
16940 @opindex msoft-float
16941 Do not use hardware floating point.
16942
16943 @item -mac0
16944 @opindex mac0
16945 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
16946
16947 @item -mno-ac0
16948 @opindex mno-ac0
16949 Return floating-point results in memory.  This is the default.
16950
16951 @item -m40
16952 @opindex m40
16953 Generate code for a PDP-11/40.
16954
16955 @item -m45
16956 @opindex m45
16957 Generate code for a PDP-11/45.  This is the default.
16958
16959 @item -m10
16960 @opindex m10
16961 Generate code for a PDP-11/10.
16962
16963 @item -mbcopy-builtin
16964 @opindex mbcopy-builtin
16965 Use inline @code{movmemhi} patterns for copying memory.  This is the
16966 default.
16967
16968 @item -mbcopy
16969 @opindex mbcopy
16970 Do not use inline @code{movmemhi} patterns for copying memory.
16971
16972 @item -mint16
16973 @itemx -mno-int32
16974 @opindex mint16
16975 @opindex mno-int32
16976 Use 16-bit @code{int}.  This is the default.
16977
16978 @item -mint32
16979 @itemx -mno-int16
16980 @opindex mint32
16981 @opindex mno-int16
16982 Use 32-bit @code{int}.
16983
16984 @item -mfloat64
16985 @itemx -mno-float32
16986 @opindex mfloat64
16987 @opindex mno-float32
16988 Use 64-bit @code{float}.  This is the default.
16989
16990 @item -mfloat32
16991 @itemx -mno-float64
16992 @opindex mfloat32
16993 @opindex mno-float64
16994 Use 32-bit @code{float}.
16995
16996 @item -mabshi
16997 @opindex mabshi
16998 Use @code{abshi2} pattern.  This is the default.
16999
17000 @item -mno-abshi
17001 @opindex mno-abshi
17002 Do not use @code{abshi2} pattern.
17003
17004 @item -mbranch-expensive
17005 @opindex mbranch-expensive
17006 Pretend that branches are expensive.  This is for experimenting with
17007 code generation only.
17008
17009 @item -mbranch-cheap
17010 @opindex mbranch-cheap
17011 Do not pretend that branches are expensive.  This is the default.
17012
17013 @item -munix-asm
17014 @opindex munix-asm
17015 Use Unix assembler syntax.  This is the default when configured for
17016 @samp{pdp11-*-bsd}.
17017
17018 @item -mdec-asm
17019 @opindex mdec-asm
17020 Use DEC assembler syntax.  This is the default when configured for any
17021 PDP-11 target other than @samp{pdp11-*-bsd}.
17022 @end table
17023
17024 @node picoChip Options
17025 @subsection picoChip Options
17026 @cindex picoChip options
17027
17028 These @samp{-m} options are defined for picoChip implementations:
17029
17030 @table @gcctabopt
17031
17032 @item -mae=@var{ae_type}
17033 @opindex mcpu
17034 Set the instruction set, register set, and instruction scheduling
17035 parameters for array element type @var{ae_type}.  Supported values
17036 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
17037
17038 @option{-mae=ANY} selects a completely generic AE type.  Code
17039 generated with this option runs on any of the other AE types.  The
17040 code is not as efficient as it would be if compiled for a specific
17041 AE type, and some types of operation (e.g., multiplication) do not
17042 work properly on all types of AE.
17043
17044 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
17045 for compiled code, and is the default.
17046
17047 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
17048 option may suffer from poor performance of byte (char) manipulation,
17049 since the DSP AE does not provide hardware support for byte load/stores.
17050
17051 @item -msymbol-as-address
17052 Enable the compiler to directly use a symbol name as an address in a
17053 load/store instruction, without first loading it into a
17054 register.  Typically, the use of this option generates larger
17055 programs, which run faster than when the option isn't used.  However, the
17056 results vary from program to program, so it is left as a user option,
17057 rather than being permanently enabled.
17058
17059 @item -mno-inefficient-warnings
17060 Disables warnings about the generation of inefficient code.  These
17061 warnings can be generated, for example, when compiling code that
17062 performs byte-level memory operations on the MAC AE type.  The MAC AE has
17063 no hardware support for byte-level memory operations, so all byte
17064 load/stores must be synthesized from word load/store operations.  This is
17065 inefficient and a warning is generated to indicate
17066 that you should rewrite the code to avoid byte operations, or to target
17067 an AE type that has the necessary hardware support.  This option disables
17068 these warnings.
17069
17070 @end table
17071
17072 @node PowerPC Options
17073 @subsection PowerPC Options
17074 @cindex PowerPC options
17075
17076 These are listed under @xref{RS/6000 and PowerPC Options}.
17077
17078 @node RL78 Options
17079 @subsection RL78 Options
17080 @cindex RL78 Options
17081
17082 @table @gcctabopt
17083
17084 @item -msim
17085 @opindex msim
17086 Links in additional target libraries to support operation within a
17087 simulator.
17088
17089 @item -mmul=none
17090 @itemx -mmul=g13
17091 @itemx -mmul=rl78
17092 @opindex mmul
17093 Specifies the type of hardware multiplication support to be used.  The
17094 default is @code{none}, which uses software multiplication functions.
17095 The @code{g13} option is for the hardware multiply/divide peripheral
17096 only on the RL78/G13 targets.  The @code{rl78} option is for the
17097 standard hardware multiplication defined in the RL78 software manual.
17098
17099 @end table
17100
17101 @node RS/6000 and PowerPC Options
17102 @subsection IBM RS/6000 and PowerPC Options
17103 @cindex RS/6000 and PowerPC Options
17104 @cindex IBM RS/6000 and PowerPC Options
17105
17106 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
17107 @table @gcctabopt
17108 @item -mpowerpc-gpopt
17109 @itemx -mno-powerpc-gpopt
17110 @itemx -mpowerpc-gfxopt
17111 @itemx -mno-powerpc-gfxopt
17112 @need 800
17113 @itemx -mpowerpc64
17114 @itemx -mno-powerpc64
17115 @itemx -mmfcrf
17116 @itemx -mno-mfcrf
17117 @itemx -mpopcntb
17118 @itemx -mno-popcntb
17119 @itemx -mpopcntd
17120 @itemx -mno-popcntd
17121 @itemx -mfprnd
17122 @itemx -mno-fprnd
17123 @need 800
17124 @itemx -mcmpb
17125 @itemx -mno-cmpb
17126 @itemx -mmfpgpr
17127 @itemx -mno-mfpgpr
17128 @itemx -mhard-dfp
17129 @itemx -mno-hard-dfp
17130 @opindex mpowerpc-gpopt
17131 @opindex mno-powerpc-gpopt
17132 @opindex mpowerpc-gfxopt
17133 @opindex mno-powerpc-gfxopt
17134 @opindex mpowerpc64
17135 @opindex mno-powerpc64
17136 @opindex mmfcrf
17137 @opindex mno-mfcrf
17138 @opindex mpopcntb
17139 @opindex mno-popcntb
17140 @opindex mpopcntd
17141 @opindex mno-popcntd
17142 @opindex mfprnd
17143 @opindex mno-fprnd
17144 @opindex mcmpb
17145 @opindex mno-cmpb
17146 @opindex mmfpgpr
17147 @opindex mno-mfpgpr
17148 @opindex mhard-dfp
17149 @opindex mno-hard-dfp
17150 You use these options to specify which instructions are available on the
17151 processor you are using.  The default value of these options is
17152 determined when configuring GCC@.  Specifying the
17153 @option{-mcpu=@var{cpu_type}} overrides the specification of these
17154 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
17155 rather than the options listed above.
17156
17157 Specifying @option{-mpowerpc-gpopt} allows
17158 GCC to use the optional PowerPC architecture instructions in the
17159 General Purpose group, including floating-point square root.  Specifying
17160 @option{-mpowerpc-gfxopt} allows GCC to
17161 use the optional PowerPC architecture instructions in the Graphics
17162 group, including floating-point select.
17163
17164 The @option{-mmfcrf} option allows GCC to generate the move from
17165 condition register field instruction implemented on the POWER4
17166 processor and other processors that support the PowerPC V2.01
17167 architecture.
17168 The @option{-mpopcntb} option allows GCC to generate the popcount and
17169 double-precision FP reciprocal estimate instruction implemented on the
17170 POWER5 processor and other processors that support the PowerPC V2.02
17171 architecture.
17172 The @option{-mpopcntd} option allows GCC to generate the popcount
17173 instruction implemented on the POWER7 processor and other processors
17174 that support the PowerPC V2.06 architecture.
17175 The @option{-mfprnd} option allows GCC to generate the FP round to
17176 integer instructions implemented on the POWER5+ processor and other
17177 processors that support the PowerPC V2.03 architecture.
17178 The @option{-mcmpb} option allows GCC to generate the compare bytes
17179 instruction implemented on the POWER6 processor and other processors
17180 that support the PowerPC V2.05 architecture.
17181 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
17182 general-purpose register instructions implemented on the POWER6X
17183 processor and other processors that support the extended PowerPC V2.05
17184 architecture.
17185 The @option{-mhard-dfp} option allows GCC to generate the decimal
17186 floating-point instructions implemented on some POWER processors.
17187
17188 The @option{-mpowerpc64} option allows GCC to generate the additional
17189 64-bit instructions that are found in the full PowerPC64 architecture
17190 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
17191 @option{-mno-powerpc64}.
17192
17193 @item -mcpu=@var{cpu_type}
17194 @opindex mcpu
17195 Set architecture type, register usage, and
17196 instruction scheduling parameters for machine type @var{cpu_type}.
17197 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
17198 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
17199 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
17200 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
17201 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
17202 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
17203 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
17204 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
17205 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
17206 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8}, @samp{powerpc},
17207 @samp{powerpc64}, and @samp{rs64}.
17208
17209 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
17210 PowerPC and 64-bit PowerPC architecture machine
17211 types, with an appropriate, generic processor model assumed for
17212 scheduling purposes.
17213
17214 The other options specify a specific processor.  Code generated under
17215 those options runs best on that processor, and may not run at all on
17216 others.
17217
17218 The @option{-mcpu} options automatically enable or disable the
17219 following options:
17220
17221 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
17222 -mpopcntb -mpopcntd  -mpowerpc64 @gol
17223 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
17224 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
17225
17226 The particular options set for any particular CPU varies between
17227 compiler versions, depending on what setting seems to produce optimal
17228 code for that CPU; it doesn't necessarily reflect the actual hardware's
17229 capabilities.  If you wish to set an individual option to a particular
17230 value, you may specify it after the @option{-mcpu} option, like
17231 @option{-mcpu=970 -mno-altivec}.
17232
17233 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
17234 not enabled or disabled by the @option{-mcpu} option at present because
17235 AIX does not have full support for these options.  You may still
17236 enable or disable them individually if you're sure it'll work in your
17237 environment.
17238
17239 @item -mtune=@var{cpu_type}
17240 @opindex mtune
17241 Set the instruction scheduling parameters for machine type
17242 @var{cpu_type}, but do not set the architecture type or register usage,
17243 as @option{-mcpu=@var{cpu_type}} does.  The same
17244 values for @var{cpu_type} are used for @option{-mtune} as for
17245 @option{-mcpu}.  If both are specified, the code generated uses the
17246 architecture and registers set by @option{-mcpu}, but the
17247 scheduling parameters set by @option{-mtune}.
17248
17249 @item -mcmodel=small
17250 @opindex mcmodel=small
17251 Generate PowerPC64 code for the small model: The TOC is limited to
17252 64k.
17253
17254 @item -mcmodel=medium
17255 @opindex mcmodel=medium
17256 Generate PowerPC64 code for the medium model: The TOC and other static
17257 data may be up to a total of 4G in size.
17258
17259 @item -mcmodel=large
17260 @opindex mcmodel=large
17261 Generate PowerPC64 code for the large model: The TOC may be up to 4G
17262 in size.  Other data and code is only limited by the 64-bit address
17263 space.
17264
17265 @item -maltivec
17266 @itemx -mno-altivec
17267 @opindex maltivec
17268 @opindex mno-altivec
17269 Generate code that uses (does not use) AltiVec instructions, and also
17270 enable the use of built-in functions that allow more direct access to
17271 the AltiVec instruction set.  You may also need to set
17272 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
17273 enhancements.
17274
17275 @item -mvrsave
17276 @itemx -mno-vrsave
17277 @opindex mvrsave
17278 @opindex mno-vrsave
17279 Generate VRSAVE instructions when generating AltiVec code.
17280
17281 @item -mgen-cell-microcode
17282 @opindex mgen-cell-microcode
17283 Generate Cell microcode instructions.
17284
17285 @item -mwarn-cell-microcode
17286 @opindex mwarn-cell-microcode
17287 Warn when a Cell microcode instruction is emitted.  An example
17288 of a Cell microcode instruction is a variable shift.
17289
17290 @item -msecure-plt
17291 @opindex msecure-plt
17292 Generate code that allows @command{ld} and @command{ld.so}
17293 to build executables and shared
17294 libraries with non-executable @code{.plt} and @code{.got} sections.
17295 This is a PowerPC
17296 32-bit SYSV ABI option.
17297
17298 @item -mbss-plt
17299 @opindex mbss-plt
17300 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
17301 fills in, and
17302 requires @code{.plt} and @code{.got}
17303 sections that are both writable and executable.
17304 This is a PowerPC 32-bit SYSV ABI option.
17305
17306 @item -misel
17307 @itemx -mno-isel
17308 @opindex misel
17309 @opindex mno-isel
17310 This switch enables or disables the generation of ISEL instructions.
17311
17312 @item -misel=@var{yes/no}
17313 This switch has been deprecated.  Use @option{-misel} and
17314 @option{-mno-isel} instead.
17315
17316 @item -mspe
17317 @itemx -mno-spe
17318 @opindex mspe
17319 @opindex mno-spe
17320 This switch enables or disables the generation of SPE simd
17321 instructions.
17322
17323 @item -mpaired
17324 @itemx -mno-paired
17325 @opindex mpaired
17326 @opindex mno-paired
17327 This switch enables or disables the generation of PAIRED simd
17328 instructions.
17329
17330 @item -mspe=@var{yes/no}
17331 This option has been deprecated.  Use @option{-mspe} and
17332 @option{-mno-spe} instead.
17333
17334 @item -mvsx
17335 @itemx -mno-vsx
17336 @opindex mvsx
17337 @opindex mno-vsx
17338 Generate code that uses (does not use) vector/scalar (VSX)
17339 instructions, and also enable the use of built-in functions that allow
17340 more direct access to the VSX instruction set.
17341
17342 @item -mfloat-gprs=@var{yes/single/double/no}
17343 @itemx -mfloat-gprs
17344 @opindex mfloat-gprs
17345 This switch enables or disables the generation of floating-point
17346 operations on the general-purpose registers for architectures that
17347 support it.
17348
17349 The argument @var{yes} or @var{single} enables the use of
17350 single-precision floating-point operations.
17351
17352 The argument @var{double} enables the use of single and
17353 double-precision floating-point operations.
17354
17355 The argument @var{no} disables floating-point operations on the
17356 general-purpose registers.
17357
17358 This option is currently only available on the MPC854x.
17359
17360 @item -m32
17361 @itemx -m64
17362 @opindex m32
17363 @opindex m64
17364 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
17365 targets (including GNU/Linux).  The 32-bit environment sets int, long
17366 and pointer to 32 bits and generates code that runs on any PowerPC
17367 variant.  The 64-bit environment sets int to 32 bits and long and
17368 pointer to 64 bits, and generates code for PowerPC64, as for
17369 @option{-mpowerpc64}.
17370
17371 @item -mfull-toc
17372 @itemx -mno-fp-in-toc
17373 @itemx -mno-sum-in-toc
17374 @itemx -mminimal-toc
17375 @opindex mfull-toc
17376 @opindex mno-fp-in-toc
17377 @opindex mno-sum-in-toc
17378 @opindex mminimal-toc
17379 Modify generation of the TOC (Table Of Contents), which is created for
17380 every executable file.  The @option{-mfull-toc} option is selected by
17381 default.  In that case, GCC allocates at least one TOC entry for
17382 each unique non-automatic variable reference in your program.  GCC
17383 also places floating-point constants in the TOC@.  However, only
17384 16,384 entries are available in the TOC@.
17385
17386 If you receive a linker error message that saying you have overflowed
17387 the available TOC space, you can reduce the amount of TOC space used
17388 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
17389 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
17390 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
17391 generate code to calculate the sum of an address and a constant at
17392 run time instead of putting that sum into the TOC@.  You may specify one
17393 or both of these options.  Each causes GCC to produce very slightly
17394 slower and larger code at the expense of conserving TOC space.
17395
17396 If you still run out of space in the TOC even when you specify both of
17397 these options, specify @option{-mminimal-toc} instead.  This option causes
17398 GCC to make only one TOC entry for every file.  When you specify this
17399 option, GCC produces code that is slower and larger but which
17400 uses extremely little TOC space.  You may wish to use this option
17401 only on files that contain less frequently-executed code.
17402
17403 @item -maix64
17404 @itemx -maix32
17405 @opindex maix64
17406 @opindex maix32
17407 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
17408 @code{long} type, and the infrastructure needed to support them.
17409 Specifying @option{-maix64} implies @option{-mpowerpc64},
17410 while @option{-maix32} disables the 64-bit ABI and
17411 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
17412
17413 @item -mxl-compat
17414 @itemx -mno-xl-compat
17415 @opindex mxl-compat
17416 @opindex mno-xl-compat
17417 Produce code that conforms more closely to IBM XL compiler semantics
17418 when using AIX-compatible ABI@.  Pass floating-point arguments to
17419 prototyped functions beyond the register save area (RSA) on the stack
17420 in addition to argument FPRs.  Do not assume that most significant
17421 double in 128-bit long double value is properly rounded when comparing
17422 values and converting to double.  Use XL symbol names for long double
17423 support routines.
17424
17425 The AIX calling convention was extended but not initially documented to
17426 handle an obscure K&R C case of calling a function that takes the
17427 address of its arguments with fewer arguments than declared.  IBM XL
17428 compilers access floating-point arguments that do not fit in the
17429 RSA from the stack when a subroutine is compiled without
17430 optimization.  Because always storing floating-point arguments on the
17431 stack is inefficient and rarely needed, this option is not enabled by
17432 default and only is necessary when calling subroutines compiled by IBM
17433 XL compilers without optimization.
17434
17435 @item -mpe
17436 @opindex mpe
17437 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
17438 application written to use message passing with special startup code to
17439 enable the application to run.  The system must have PE installed in the
17440 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
17441 must be overridden with the @option{-specs=} option to specify the
17442 appropriate directory location.  The Parallel Environment does not
17443 support threads, so the @option{-mpe} option and the @option{-pthread}
17444 option are incompatible.
17445
17446 @item -malign-natural
17447 @itemx -malign-power
17448 @opindex malign-natural
17449 @opindex malign-power
17450 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
17451 @option{-malign-natural} overrides the ABI-defined alignment of larger
17452 types, such as floating-point doubles, on their natural size-based boundary.
17453 The option @option{-malign-power} instructs GCC to follow the ABI-specified
17454 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
17455
17456 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
17457 is not supported.
17458
17459 @item -msoft-float
17460 @itemx -mhard-float
17461 @opindex msoft-float
17462 @opindex mhard-float
17463 Generate code that does not use (uses) the floating-point register set.
17464 Software floating-point emulation is provided if you use the
17465 @option{-msoft-float} option, and pass the option to GCC when linking.
17466
17467 @item -msingle-float
17468 @itemx -mdouble-float
17469 @opindex msingle-float
17470 @opindex mdouble-float
17471 Generate code for single- or double-precision floating-point operations.
17472 @option{-mdouble-float} implies @option{-msingle-float}.
17473
17474 @item -msimple-fpu
17475 @opindex msimple-fpu
17476 Do not generate @code{sqrt} and @code{div} instructions for hardware
17477 floating-point unit.
17478
17479 @item -mfpu=@var{name}
17480 @opindex mfpu
17481 Specify type of floating-point unit.  Valid values for @var{name} are
17482 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
17483 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
17484 @samp{sp_full} (equivalent to @option{-msingle-float}),
17485 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
17486
17487 @item -mxilinx-fpu
17488 @opindex mxilinx-fpu
17489 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
17490
17491 @item -mmultiple
17492 @itemx -mno-multiple
17493 @opindex mmultiple
17494 @opindex mno-multiple
17495 Generate code that uses (does not use) the load multiple word
17496 instructions and the store multiple word instructions.  These
17497 instructions are generated by default on POWER systems, and not
17498 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
17499 PowerPC systems, since those instructions do not work when the
17500 processor is in little-endian mode.  The exceptions are PPC740 and
17501 PPC750 which permit these instructions in little-endian mode.
17502
17503 @item -mstring
17504 @itemx -mno-string
17505 @opindex mstring
17506 @opindex mno-string
17507 Generate code that uses (does not use) the load string instructions
17508 and the store string word instructions to save multiple registers and
17509 do small block moves.  These instructions are generated by default on
17510 POWER systems, and not generated on PowerPC systems.  Do not use
17511 @option{-mstring} on little-endian PowerPC systems, since those
17512 instructions do not work when the processor is in little-endian mode.
17513 The exceptions are PPC740 and PPC750 which permit these instructions
17514 in little-endian mode.
17515
17516 @item -mupdate
17517 @itemx -mno-update
17518 @opindex mupdate
17519 @opindex mno-update
17520 Generate code that uses (does not use) the load or store instructions
17521 that update the base register to the address of the calculated memory
17522 location.  These instructions are generated by default.  If you use
17523 @option{-mno-update}, there is a small window between the time that the
17524 stack pointer is updated and the address of the previous frame is
17525 stored, which means code that walks the stack frame across interrupts or
17526 signals may get corrupted data.
17527
17528 @item -mavoid-indexed-addresses
17529 @itemx -mno-avoid-indexed-addresses
17530 @opindex mavoid-indexed-addresses
17531 @opindex mno-avoid-indexed-addresses
17532 Generate code that tries to avoid (not avoid) the use of indexed load
17533 or store instructions. These instructions can incur a performance
17534 penalty on Power6 processors in certain situations, such as when
17535 stepping through large arrays that cross a 16M boundary.  This option
17536 is enabled by default when targeting Power6 and disabled otherwise.
17537
17538 @item -mfused-madd
17539 @itemx -mno-fused-madd
17540 @opindex mfused-madd
17541 @opindex mno-fused-madd
17542 Generate code that uses (does not use) the floating-point multiply and
17543 accumulate instructions.  These instructions are generated by default
17544 if hardware floating point is used.  The machine-dependent
17545 @option{-mfused-madd} option is now mapped to the machine-independent
17546 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
17547 mapped to @option{-ffp-contract=off}.
17548
17549 @item -mmulhw
17550 @itemx -mno-mulhw
17551 @opindex mmulhw
17552 @opindex mno-mulhw
17553 Generate code that uses (does not use) the half-word multiply and
17554 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
17555 These instructions are generated by default when targeting those
17556 processors.
17557
17558 @item -mdlmzb
17559 @itemx -mno-dlmzb
17560 @opindex mdlmzb
17561 @opindex mno-dlmzb
17562 Generate code that uses (does not use) the string-search @samp{dlmzb}
17563 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
17564 generated by default when targeting those processors.
17565
17566 @item -mno-bit-align
17567 @itemx -mbit-align
17568 @opindex mno-bit-align
17569 @opindex mbit-align
17570 On System V.4 and embedded PowerPC systems do not (do) force structures
17571 and unions that contain bit-fields to be aligned to the base type of the
17572 bit-field.
17573
17574 For example, by default a structure containing nothing but 8
17575 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
17576 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
17577 the structure is aligned to a 1-byte boundary and is 1 byte in
17578 size.
17579
17580 @item -mno-strict-align
17581 @itemx -mstrict-align
17582 @opindex mno-strict-align
17583 @opindex mstrict-align
17584 On System V.4 and embedded PowerPC systems do not (do) assume that
17585 unaligned memory references are handled by the system.
17586
17587 @item -mrelocatable
17588 @itemx -mno-relocatable
17589 @opindex mrelocatable
17590 @opindex mno-relocatable
17591 Generate code that allows (does not allow) a static executable to be
17592 relocated to a different address at run time.  A simple embedded
17593 PowerPC system loader should relocate the entire contents of
17594 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
17595 a table of 32-bit addresses generated by this option.  For this to
17596 work, all objects linked together must be compiled with
17597 @option{-mrelocatable} or @option{-mrelocatable-lib}.
17598 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
17599
17600 @item -mrelocatable-lib
17601 @itemx -mno-relocatable-lib
17602 @opindex mrelocatable-lib
17603 @opindex mno-relocatable-lib
17604 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
17605 @code{.fixup} section to allow static executables to be relocated at
17606 run time, but @option{-mrelocatable-lib} does not use the smaller stack
17607 alignment of @option{-mrelocatable}.  Objects compiled with
17608 @option{-mrelocatable-lib} may be linked with objects compiled with
17609 any combination of the @option{-mrelocatable} options.
17610
17611 @item -mno-toc
17612 @itemx -mtoc
17613 @opindex mno-toc
17614 @opindex mtoc
17615 On System V.4 and embedded PowerPC systems do not (do) assume that
17616 register 2 contains a pointer to a global area pointing to the addresses
17617 used in the program.
17618
17619 @item -mlittle
17620 @itemx -mlittle-endian
17621 @opindex mlittle
17622 @opindex mlittle-endian
17623 On System V.4 and embedded PowerPC systems compile code for the
17624 processor in little-endian mode.  The @option{-mlittle-endian} option is
17625 the same as @option{-mlittle}.
17626
17627 @item -mbig
17628 @itemx -mbig-endian
17629 @opindex mbig
17630 @opindex mbig-endian
17631 On System V.4 and embedded PowerPC systems compile code for the
17632 processor in big-endian mode.  The @option{-mbig-endian} option is
17633 the same as @option{-mbig}.
17634
17635 @item -mdynamic-no-pic
17636 @opindex mdynamic-no-pic
17637 On Darwin and Mac OS X systems, compile code so that it is not
17638 relocatable, but that its external references are relocatable.  The
17639 resulting code is suitable for applications, but not shared
17640 libraries.
17641
17642 @item -msingle-pic-base
17643 @opindex msingle-pic-base
17644 Treat the register used for PIC addressing as read-only, rather than
17645 loading it in the prologue for each function.  The runtime system is
17646 responsible for initializing this register with an appropriate value
17647 before execution begins.
17648
17649 @item -mprioritize-restricted-insns=@var{priority}
17650 @opindex mprioritize-restricted-insns
17651 This option controls the priority that is assigned to
17652 dispatch-slot restricted instructions during the second scheduling
17653 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
17654 or @samp{2} to assign no, highest, or second-highest (respectively) 
17655 priority to dispatch-slot restricted
17656 instructions.
17657
17658 @item -msched-costly-dep=@var{dependence_type}
17659 @opindex msched-costly-dep
17660 This option controls which dependences are considered costly
17661 by the target during instruction scheduling.  The argument
17662 @var{dependence_type} takes one of the following values:
17663
17664 @table @asis
17665 @item @samp{no}
17666 No dependence is costly.
17667
17668 @item @samp{all}
17669 All dependences are costly.
17670
17671 @item @samp{true_store_to_load}
17672 A true dependence from store to load is costly.
17673
17674 @item @samp{store_to_load}
17675 Any dependence from store to load is costly.
17676
17677 @item @var{number}
17678 Any dependence for which the latency is greater than or equal to 
17679 @var{number} is costly.
17680 @end table
17681
17682 @item -minsert-sched-nops=@var{scheme}
17683 @opindex minsert-sched-nops
17684 This option controls which NOP insertion scheme is used during
17685 the second scheduling pass.  The argument @var{scheme} takes one of the
17686 following values:
17687
17688 @table @asis
17689 @item @samp{no}
17690 Don't insert NOPs.
17691
17692 @item @samp{pad}
17693 Pad with NOPs any dispatch group that has vacant issue slots,
17694 according to the scheduler's grouping.
17695
17696 @item @samp{regroup_exact}
17697 Insert NOPs to force costly dependent insns into
17698 separate groups.  Insert exactly as many NOPs as needed to force an insn
17699 to a new group, according to the estimated processor grouping.
17700
17701 @item @var{number}
17702 Insert NOPs to force costly dependent insns into
17703 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
17704 @end table
17705
17706 @item -mcall-sysv
17707 @opindex mcall-sysv
17708 On System V.4 and embedded PowerPC systems compile code using calling
17709 conventions that adhere to the March 1995 draft of the System V
17710 Application Binary Interface, PowerPC processor supplement.  This is the
17711 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
17712
17713 @item -mcall-sysv-eabi
17714 @itemx -mcall-eabi
17715 @opindex mcall-sysv-eabi
17716 @opindex mcall-eabi
17717 Specify both @option{-mcall-sysv} and @option{-meabi} options.
17718
17719 @item -mcall-sysv-noeabi
17720 @opindex mcall-sysv-noeabi
17721 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
17722
17723 @item -mcall-aixdesc
17724 @opindex m
17725 On System V.4 and embedded PowerPC systems compile code for the AIX
17726 operating system.
17727
17728 @item -mcall-linux
17729 @opindex mcall-linux
17730 On System V.4 and embedded PowerPC systems compile code for the
17731 Linux-based GNU system.
17732
17733 @item -mcall-freebsd
17734 @opindex mcall-freebsd
17735 On System V.4 and embedded PowerPC systems compile code for the
17736 FreeBSD operating system.
17737
17738 @item -mcall-netbsd
17739 @opindex mcall-netbsd
17740 On System V.4 and embedded PowerPC systems compile code for the
17741 NetBSD operating system.
17742
17743 @item -mcall-openbsd
17744 @opindex mcall-netbsd
17745 On System V.4 and embedded PowerPC systems compile code for the
17746 OpenBSD operating system.
17747
17748 @item -maix-struct-return
17749 @opindex maix-struct-return
17750 Return all structures in memory (as specified by the AIX ABI)@.
17751
17752 @item -msvr4-struct-return
17753 @opindex msvr4-struct-return
17754 Return structures smaller than 8 bytes in registers (as specified by the
17755 SVR4 ABI)@.
17756
17757 @item -mabi=@var{abi-type}
17758 @opindex mabi
17759 Extend the current ABI with a particular extension, or remove such extension.
17760 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
17761 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
17762
17763 @item -mabi=spe
17764 @opindex mabi=spe
17765 Extend the current ABI with SPE ABI extensions.  This does not change
17766 the default ABI, instead it adds the SPE ABI extensions to the current
17767 ABI@.
17768
17769 @item -mabi=no-spe
17770 @opindex mabi=no-spe
17771 Disable Book-E SPE ABI extensions for the current ABI@.
17772
17773 @item -mabi=ibmlongdouble
17774 @opindex mabi=ibmlongdouble
17775 Change the current ABI to use IBM extended-precision long double.
17776 This is a PowerPC 32-bit SYSV ABI option.
17777
17778 @item -mabi=ieeelongdouble
17779 @opindex mabi=ieeelongdouble
17780 Change the current ABI to use IEEE extended-precision long double.
17781 This is a PowerPC 32-bit Linux ABI option.
17782
17783 @item -mprototype
17784 @itemx -mno-prototype
17785 @opindex mprototype
17786 @opindex mno-prototype
17787 On System V.4 and embedded PowerPC systems assume that all calls to
17788 variable argument functions are properly prototyped.  Otherwise, the
17789 compiler must insert an instruction before every non-prototyped call to
17790 set or clear bit 6 of the condition code register (@var{CR}) to
17791 indicate whether floating-point values are passed in the floating-point
17792 registers in case the function takes variable arguments.  With
17793 @option{-mprototype}, only calls to prototyped variable argument functions
17794 set or clear the bit.
17795
17796 @item -msim
17797 @opindex msim
17798 On embedded PowerPC systems, assume that the startup module is called
17799 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
17800 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
17801 configurations.
17802
17803 @item -mmvme
17804 @opindex mmvme
17805 On embedded PowerPC systems, assume that the startup module is called
17806 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
17807 @file{libc.a}.
17808
17809 @item -mads
17810 @opindex mads
17811 On embedded PowerPC systems, assume that the startup module is called
17812 @file{crt0.o} and the standard C libraries are @file{libads.a} and
17813 @file{libc.a}.
17814
17815 @item -myellowknife
17816 @opindex myellowknife
17817 On embedded PowerPC systems, assume that the startup module is called
17818 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
17819 @file{libc.a}.
17820
17821 @item -mvxworks
17822 @opindex mvxworks
17823 On System V.4 and embedded PowerPC systems, specify that you are
17824 compiling for a VxWorks system.
17825
17826 @item -memb
17827 @opindex memb
17828 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
17829 header to indicate that @samp{eabi} extended relocations are used.
17830
17831 @item -meabi
17832 @itemx -mno-eabi
17833 @opindex meabi
17834 @opindex mno-eabi
17835 On System V.4 and embedded PowerPC systems do (do not) adhere to the
17836 Embedded Applications Binary Interface (EABI), which is a set of
17837 modifications to the System V.4 specifications.  Selecting @option{-meabi}
17838 means that the stack is aligned to an 8-byte boundary, a function
17839 @code{__eabi} is called from @code{main} to set up the EABI
17840 environment, and the @option{-msdata} option can use both @code{r2} and
17841 @code{r13} to point to two separate small data areas.  Selecting
17842 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
17843 no EABI initialization function is called from @code{main}, and the
17844 @option{-msdata} option only uses @code{r13} to point to a single
17845 small data area.  The @option{-meabi} option is on by default if you
17846 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
17847
17848 @item -msdata=eabi
17849 @opindex msdata=eabi
17850 On System V.4 and embedded PowerPC systems, put small initialized
17851 @code{const} global and static data in the @samp{.sdata2} section, which
17852 is pointed to by register @code{r2}.  Put small initialized
17853 non-@code{const} global and static data in the @samp{.sdata} section,
17854 which is pointed to by register @code{r13}.  Put small uninitialized
17855 global and static data in the @samp{.sbss} section, which is adjacent to
17856 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
17857 incompatible with the @option{-mrelocatable} option.  The
17858 @option{-msdata=eabi} option also sets the @option{-memb} option.
17859
17860 @item -msdata=sysv
17861 @opindex msdata=sysv
17862 On System V.4 and embedded PowerPC systems, put small global and static
17863 data in the @samp{.sdata} section, which is pointed to by register
17864 @code{r13}.  Put small uninitialized global and static data in the
17865 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
17866 The @option{-msdata=sysv} option is incompatible with the
17867 @option{-mrelocatable} option.
17868
17869 @item -msdata=default
17870 @itemx -msdata
17871 @opindex msdata=default
17872 @opindex msdata
17873 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
17874 compile code the same as @option{-msdata=eabi}, otherwise compile code the
17875 same as @option{-msdata=sysv}.
17876
17877 @item -msdata=data
17878 @opindex msdata=data
17879 On System V.4 and embedded PowerPC systems, put small global
17880 data in the @samp{.sdata} section.  Put small uninitialized global
17881 data in the @samp{.sbss} section.  Do not use register @code{r13}
17882 to address small data however.  This is the default behavior unless
17883 other @option{-msdata} options are used.
17884
17885 @item -msdata=none
17886 @itemx -mno-sdata
17887 @opindex msdata=none
17888 @opindex mno-sdata
17889 On embedded PowerPC systems, put all initialized global and static data
17890 in the @samp{.data} section, and all uninitialized data in the
17891 @samp{.bss} section.
17892
17893 @item -mblock-move-inline-limit=@var{num}
17894 @opindex mblock-move-inline-limit
17895 Inline all block moves (such as calls to @code{memcpy} or structure
17896 copies) less than or equal to @var{num} bytes.  The minimum value for
17897 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
17898 targets.  The default value is target-specific.
17899
17900 @item -G @var{num}
17901 @opindex G
17902 @cindex smaller data references (PowerPC)
17903 @cindex .sdata/.sdata2 references (PowerPC)
17904 On embedded PowerPC systems, put global and static items less than or
17905 equal to @var{num} bytes into the small data or BSS sections instead of
17906 the normal data or BSS section.  By default, @var{num} is 8.  The
17907 @option{-G @var{num}} switch is also passed to the linker.
17908 All modules should be compiled with the same @option{-G @var{num}} value.
17909
17910 @item -mregnames
17911 @itemx -mno-regnames
17912 @opindex mregnames
17913 @opindex mno-regnames
17914 On System V.4 and embedded PowerPC systems do (do not) emit register
17915 names in the assembly language output using symbolic forms.
17916
17917 @item -mlongcall
17918 @itemx -mno-longcall
17919 @opindex mlongcall
17920 @opindex mno-longcall
17921 By default assume that all calls are far away so that a longer and more
17922 expensive calling sequence is required.  This is required for calls
17923 farther than 32 megabytes (33,554,432 bytes) from the current location.
17924 A short call is generated if the compiler knows
17925 the call cannot be that far away.  This setting can be overridden by
17926 the @code{shortcall} function attribute, or by @code{#pragma
17927 longcall(0)}.
17928
17929 Some linkers are capable of detecting out-of-range calls and generating
17930 glue code on the fly.  On these systems, long calls are unnecessary and
17931 generate slower code.  As of this writing, the AIX linker can do this,
17932 as can the GNU linker for PowerPC/64.  It is planned to add this feature
17933 to the GNU linker for 32-bit PowerPC systems as well.
17934
17935 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
17936 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
17937 addresses represent the callee and the branch island.  The
17938 Darwin/PPC linker prefers the first address and generates a @code{bl
17939 callee} if the PPC @code{bl} instruction reaches the callee directly;
17940 otherwise, the linker generates @code{bl L42} to call the branch
17941 island.  The branch island is appended to the body of the
17942 calling function; it computes the full 32-bit address of the callee
17943 and jumps to it.
17944
17945 On Mach-O (Darwin) systems, this option directs the compiler emit to
17946 the glue for every direct call, and the Darwin linker decides whether
17947 to use or discard it.
17948
17949 In the future, GCC may ignore all longcall specifications
17950 when the linker is known to generate glue.
17951
17952 @item -mtls-markers
17953 @itemx -mno-tls-markers
17954 @opindex mtls-markers
17955 @opindex mno-tls-markers
17956 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
17957 specifying the function argument.  The relocation allows the linker to
17958 reliably associate function call with argument setup instructions for
17959 TLS optimization, which in turn allows GCC to better schedule the
17960 sequence.
17961
17962 @item -pthread
17963 @opindex pthread
17964 Adds support for multithreading with the @dfn{pthreads} library.
17965 This option sets flags for both the preprocessor and linker.
17966
17967 @item -mrecip
17968 @itemx -mno-recip
17969 @opindex mrecip
17970 This option enables use of the reciprocal estimate and
17971 reciprocal square root estimate instructions with additional
17972 Newton-Raphson steps to increase precision instead of doing a divide or
17973 square root and divide for floating-point arguments.  You should use
17974 the @option{-ffast-math} option when using @option{-mrecip} (or at
17975 least @option{-funsafe-math-optimizations},
17976 @option{-finite-math-only}, @option{-freciprocal-math} and
17977 @option{-fno-trapping-math}).  Note that while the throughput of the
17978 sequence is generally higher than the throughput of the non-reciprocal
17979 instruction, the precision of the sequence can be decreased by up to 2
17980 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
17981 roots.
17982
17983 @item -mrecip=@var{opt}
17984 @opindex mrecip=opt
17985 This option controls which reciprocal estimate instructions
17986 may be used.  @var{opt} is a comma-separated list of options, which may
17987 be preceded by a @code{!} to invert the option:
17988 @code{all}: enable all estimate instructions,
17989 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
17990 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
17991 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
17992 @code{divf}: enable the single-precision reciprocal approximation instructions;
17993 @code{divd}: enable the double-precision reciprocal approximation instructions;
17994 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
17995 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
17996 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
17997
17998 So, for example, @option{-mrecip=all,!rsqrtd} enables
17999 all of the reciprocal estimate instructions, except for the
18000 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
18001 which handle the double-precision reciprocal square root calculations.
18002
18003 @item -mrecip-precision
18004 @itemx -mno-recip-precision
18005 @opindex mrecip-precision
18006 Assume (do not assume) that the reciprocal estimate instructions
18007 provide higher-precision estimates than is mandated by the PowerPC
18008 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
18009 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
18010 The double-precision square root estimate instructions are not generated by
18011 default on low-precision machines, since they do not provide an
18012 estimate that converges after three steps.
18013
18014 @item -mveclibabi=@var{type}
18015 @opindex mveclibabi
18016 Specifies the ABI type to use for vectorizing intrinsics using an
18017 external library.  The only type supported at present is @code{mass},
18018 which specifies to use IBM's Mathematical Acceleration Subsystem
18019 (MASS) libraries for vectorizing intrinsics using external libraries.
18020 GCC currently emits calls to @code{acosd2}, @code{acosf4},
18021 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
18022 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
18023 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
18024 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
18025 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
18026 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
18027 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
18028 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
18029 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
18030 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
18031 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
18032 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
18033 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
18034 for power7.  Both @option{-ftree-vectorize} and
18035 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
18036 libraries must be specified at link time.
18037
18038 @item -mfriz
18039 @itemx -mno-friz
18040 @opindex mfriz
18041 Generate (do not generate) the @code{friz} instruction when the
18042 @option{-funsafe-math-optimizations} option is used to optimize
18043 rounding of floating-point values to 64-bit integer and back to floating
18044 point.  The @code{friz} instruction does not return the same value if
18045 the floating-point number is too large to fit in an integer.
18046
18047 @item -mpointers-to-nested-functions
18048 @itemx -mno-pointers-to-nested-functions
18049 @opindex mpointers-to-nested-functions
18050 Generate (do not generate) code to load up the static chain register
18051 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
18052 systems where a function pointer points to a 3-word descriptor giving
18053 the function address, TOC value to be loaded in register @var{r2}, and
18054 static chain value to be loaded in register @var{r11}.  The
18055 @option{-mpointers-to-nested-functions} is on by default.  You cannot
18056 call through pointers to nested functions or pointers
18057 to functions compiled in other languages that use the static chain if
18058 you use the @option{-mno-pointers-to-nested-functions}.
18059
18060 @item -msave-toc-indirect
18061 @itemx -mno-save-toc-indirect
18062 @opindex msave-toc-indirect
18063 Generate (do not generate) code to save the TOC value in the reserved
18064 stack location in the function prologue if the function calls through
18065 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
18066 saved in the prologue, it is saved just before the call through the
18067 pointer.  The @option{-mno-save-toc-indirect} option is the default.
18068 @end table
18069
18070 @node RX Options
18071 @subsection RX Options
18072 @cindex RX Options
18073
18074 These command-line options are defined for RX targets:
18075
18076 @table @gcctabopt
18077 @item -m64bit-doubles
18078 @itemx -m32bit-doubles
18079 @opindex m64bit-doubles
18080 @opindex m32bit-doubles
18081 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
18082 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
18083 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
18084 works on 32-bit values, which is why the default is
18085 @option{-m32bit-doubles}.
18086
18087 @item -fpu
18088 @itemx -nofpu
18089 @opindex fpu
18090 @opindex nofpu
18091 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
18092 floating-point hardware.  The default is enabled for the @var{RX600}
18093 series and disabled for the @var{RX200} series.
18094
18095 Floating-point instructions are only generated for 32-bit floating-point 
18096 values, however, so the FPU hardware is not used for doubles if the
18097 @option{-m64bit-doubles} option is used.
18098
18099 @emph{Note} If the @option{-fpu} option is enabled then
18100 @option{-funsafe-math-optimizations} is also enabled automatically.
18101 This is because the RX FPU instructions are themselves unsafe.
18102
18103 @item -mcpu=@var{name}
18104 @opindex -mcpu
18105 Selects the type of RX CPU to be targeted.  Currently three types are
18106 supported, the generic @var{RX600} and @var{RX200} series hardware and
18107 the specific @var{RX610} CPU.  The default is @var{RX600}.
18108
18109 The only difference between @var{RX600} and @var{RX610} is that the
18110 @var{RX610} does not support the @code{MVTIPL} instruction.
18111
18112 The @var{RX200} series does not have a hardware floating-point unit
18113 and so @option{-nofpu} is enabled by default when this type is
18114 selected.
18115
18116 @item -mbig-endian-data
18117 @itemx -mlittle-endian-data
18118 @opindex mbig-endian-data
18119 @opindex mlittle-endian-data
18120 Store data (but not code) in the big-endian format.  The default is
18121 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
18122 format.
18123
18124 @item -msmall-data-limit=@var{N}
18125 @opindex msmall-data-limit
18126 Specifies the maximum size in bytes of global and static variables
18127 which can be placed into the small data area.  Using the small data
18128 area can lead to smaller and faster code, but the size of area is
18129 limited and it is up to the programmer to ensure that the area does
18130 not overflow.  Also when the small data area is used one of the RX's
18131 registers (usually @code{r13}) is reserved for use pointing to this
18132 area, so it is no longer available for use by the compiler.  This
18133 could result in slower and/or larger code if variables are pushed onto
18134 the stack instead of being held in this register.
18135
18136 Note, common variables (variables that have not been initialized) and
18137 constants are not placed into the small data area as they are assigned
18138 to other sections in the output executable.
18139
18140 The default value is zero, which disables this feature.  Note, this
18141 feature is not enabled by default with higher optimization levels
18142 (@option{-O2} etc) because of the potentially detrimental effects of
18143 reserving a register.  It is up to the programmer to experiment and
18144 discover whether this feature is of benefit to their program.  See the
18145 description of the @option{-mpid} option for a description of how the
18146 actual register to hold the small data area pointer is chosen.
18147
18148 @item -msim
18149 @itemx -mno-sim
18150 @opindex msim
18151 @opindex mno-sim
18152 Use the simulator runtime.  The default is to use the libgloss
18153 board-specific runtime.
18154
18155 @item -mas100-syntax
18156 @itemx -mno-as100-syntax
18157 @opindex mas100-syntax
18158 @opindex mno-as100-syntax
18159 When generating assembler output use a syntax that is compatible with
18160 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
18161 assembler, but it has some restrictions so it is not generated by default.
18162
18163 @item -mmax-constant-size=@var{N}
18164 @opindex mmax-constant-size
18165 Specifies the maximum size, in bytes, of a constant that can be used as
18166 an operand in a RX instruction.  Although the RX instruction set does
18167 allow constants of up to 4 bytes in length to be used in instructions,
18168 a longer value equates to a longer instruction.  Thus in some
18169 circumstances it can be beneficial to restrict the size of constants
18170 that are used in instructions.  Constants that are too big are instead
18171 placed into a constant pool and referenced via register indirection.
18172
18173 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
18174 or 4 means that constants of any size are allowed.
18175
18176 @item -mrelax
18177 @opindex mrelax
18178 Enable linker relaxation.  Linker relaxation is a process whereby the
18179 linker attempts to reduce the size of a program by finding shorter
18180 versions of various instructions.  Disabled by default.
18181
18182 @item -mint-register=@var{N}
18183 @opindex mint-register
18184 Specify the number of registers to reserve for fast interrupt handler
18185 functions.  The value @var{N} can be between 0 and 4.  A value of 1
18186 means that register @code{r13} is reserved for the exclusive use
18187 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
18188 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
18189 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
18190 A value of 0, the default, does not reserve any registers.
18191
18192 @item -msave-acc-in-interrupts
18193 @opindex msave-acc-in-interrupts
18194 Specifies that interrupt handler functions should preserve the
18195 accumulator register.  This is only necessary if normal code might use
18196 the accumulator register, for example because it performs 64-bit
18197 multiplications.  The default is to ignore the accumulator as this
18198 makes the interrupt handlers faster.
18199
18200 @item -mpid
18201 @itemx -mno-pid
18202 @opindex mpid
18203 @opindex mno-pid
18204 Enables the generation of position independent data.  When enabled any
18205 access to constant data is done via an offset from a base address
18206 held in a register.  This allows the location of constant data to be
18207 determined at run time without requiring the executable to be
18208 relocated, which is a benefit to embedded applications with tight
18209 memory constraints.  Data that can be modified is not affected by this
18210 option.
18211
18212 Note, using this feature reserves a register, usually @code{r13}, for
18213 the constant data base address.  This can result in slower and/or
18214 larger code, especially in complicated functions.
18215
18216 The actual register chosen to hold the constant data base address
18217 depends upon whether the @option{-msmall-data-limit} and/or the
18218 @option{-mint-register} command-line options are enabled.  Starting
18219 with register @code{r13} and proceeding downwards, registers are
18220 allocated first to satisfy the requirements of @option{-mint-register},
18221 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
18222 is possible for the small data area register to be @code{r8} if both
18223 @option{-mint-register=4} and @option{-mpid} are specified on the
18224 command line.
18225
18226 By default this feature is not enabled.  The default can be restored
18227 via the @option{-mno-pid} command-line option.
18228
18229 @item -mno-warn-multiple-fast-interrupts
18230 @itemx -mwarn-multiple-fast-interrupts
18231 @opindex mno-warn-multiple-fast-interrupts
18232 @opindex mwarn-multiple-fast-interrupts
18233 Prevents GCC from issuing a warning message if it finds more than one
18234 fast interrupt handler when it is compiling a file.  The default is to
18235 issue a warning for each extra fast interrupt handler found, as the RX
18236 only supports one such interrupt.
18237
18238 @end table
18239
18240 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
18241 has special significance to the RX port when used with the
18242 @code{interrupt} function attribute.  This attribute indicates a
18243 function intended to process fast interrupts.  GCC ensures
18244 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
18245 and/or @code{r13} and only provided that the normal use of the
18246 corresponding registers have been restricted via the
18247 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
18248 options.
18249
18250 @node S/390 and zSeries Options
18251 @subsection S/390 and zSeries Options
18252 @cindex S/390 and zSeries Options
18253
18254 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
18255
18256 @table @gcctabopt
18257 @item -mhard-float
18258 @itemx -msoft-float
18259 @opindex mhard-float
18260 @opindex msoft-float
18261 Use (do not use) the hardware floating-point instructions and registers
18262 for floating-point operations.  When @option{-msoft-float} is specified,
18263 functions in @file{libgcc.a} are used to perform floating-point
18264 operations.  When @option{-mhard-float} is specified, the compiler
18265 generates IEEE floating-point instructions.  This is the default.
18266
18267 @item -mhard-dfp
18268 @itemx -mno-hard-dfp
18269 @opindex mhard-dfp
18270 @opindex mno-hard-dfp
18271 Use (do not use) the hardware decimal-floating-point instructions for
18272 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
18273 specified, functions in @file{libgcc.a} are used to perform
18274 decimal-floating-point operations.  When @option{-mhard-dfp} is
18275 specified, the compiler generates decimal-floating-point hardware
18276 instructions.  This is the default for @option{-march=z9-ec} or higher.
18277
18278 @item -mlong-double-64
18279 @itemx -mlong-double-128
18280 @opindex mlong-double-64
18281 @opindex mlong-double-128
18282 These switches control the size of @code{long double} type. A size
18283 of 64 bits makes the @code{long double} type equivalent to the @code{double}
18284 type. This is the default.
18285
18286 @item -mbackchain
18287 @itemx -mno-backchain
18288 @opindex mbackchain
18289 @opindex mno-backchain
18290 Store (do not store) the address of the caller's frame as backchain pointer
18291 into the callee's stack frame.
18292 A backchain may be needed to allow debugging using tools that do not understand
18293 DWARF 2 call frame information.
18294 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
18295 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
18296 the backchain is placed into the topmost word of the 96/160 byte register
18297 save area.
18298
18299 In general, code compiled with @option{-mbackchain} is call-compatible with
18300 code compiled with @option{-mmo-backchain}; however, use of the backchain
18301 for debugging purposes usually requires that the whole binary is built with
18302 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
18303 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18304 to build a linux kernel use @option{-msoft-float}.
18305
18306 The default is to not maintain the backchain.
18307
18308 @item -mpacked-stack
18309 @itemx -mno-packed-stack
18310 @opindex mpacked-stack
18311 @opindex mno-packed-stack
18312 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
18313 specified, the compiler uses the all fields of the 96/160 byte register save
18314 area only for their default purpose; unused fields still take up stack space.
18315 When @option{-mpacked-stack} is specified, register save slots are densely
18316 packed at the top of the register save area; unused space is reused for other
18317 purposes, allowing for more efficient use of the available stack space.
18318 However, when @option{-mbackchain} is also in effect, the topmost word of
18319 the save area is always used to store the backchain, and the return address
18320 register is always saved two words below the backchain.
18321
18322 As long as the stack frame backchain is not used, code generated with
18323 @option{-mpacked-stack} is call-compatible with code generated with
18324 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
18325 S/390 or zSeries generated code that uses the stack frame backchain at run
18326 time, not just for debugging purposes.  Such code is not call-compatible
18327 with code compiled with @option{-mpacked-stack}.  Also, note that the
18328 combination of @option{-mbackchain},
18329 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
18330 to build a linux kernel use @option{-msoft-float}.
18331
18332 The default is to not use the packed stack layout.
18333
18334 @item -msmall-exec
18335 @itemx -mno-small-exec
18336 @opindex msmall-exec
18337 @opindex mno-small-exec
18338 Generate (or do not generate) code using the @code{bras} instruction
18339 to do subroutine calls.
18340 This only works reliably if the total executable size does not
18341 exceed 64k.  The default is to use the @code{basr} instruction instead,
18342 which does not have this limitation.
18343
18344 @item -m64
18345 @itemx -m31
18346 @opindex m64
18347 @opindex m31
18348 When @option{-m31} is specified, generate code compliant to the
18349 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
18350 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
18351 particular to generate 64-bit instructions.  For the @samp{s390}
18352 targets, the default is @option{-m31}, while the @samp{s390x}
18353 targets default to @option{-m64}.
18354
18355 @item -mzarch
18356 @itemx -mesa
18357 @opindex mzarch
18358 @opindex mesa
18359 When @option{-mzarch} is specified, generate code using the
18360 instructions available on z/Architecture.
18361 When @option{-mesa} is specified, generate code using the
18362 instructions available on ESA/390.  Note that @option{-mesa} is
18363 not possible with @option{-m64}.
18364 When generating code compliant to the GNU/Linux for S/390 ABI,
18365 the default is @option{-mesa}.  When generating code compliant
18366 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
18367
18368 @item -mmvcle
18369 @itemx -mno-mvcle
18370 @opindex mmvcle
18371 @opindex mno-mvcle
18372 Generate (or do not generate) code using the @code{mvcle} instruction
18373 to perform block moves.  When @option{-mno-mvcle} is specified,
18374 use a @code{mvc} loop instead.  This is the default unless optimizing for
18375 size.
18376
18377 @item -mdebug
18378 @itemx -mno-debug
18379 @opindex mdebug
18380 @opindex mno-debug
18381 Print (or do not print) additional debug information when compiling.
18382 The default is to not print debug information.
18383
18384 @item -march=@var{cpu-type}
18385 @opindex march
18386 Generate code that runs on @var{cpu-type}, which is the name of a system
18387 representing a certain processor type.  Possible values for
18388 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
18389 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
18390 When generating code using the instructions available on z/Architecture,
18391 the default is @option{-march=z900}.  Otherwise, the default is
18392 @option{-march=g5}.
18393
18394 @item -mtune=@var{cpu-type}
18395 @opindex mtune
18396 Tune to @var{cpu-type} everything applicable about the generated code,
18397 except for the ABI and the set of available instructions.
18398 The list of @var{cpu-type} values is the same as for @option{-march}.
18399 The default is the value used for @option{-march}.
18400
18401 @item -mtpf-trace
18402 @itemx -mno-tpf-trace
18403 @opindex mtpf-trace
18404 @opindex mno-tpf-trace
18405 Generate code that adds (does not add) in TPF OS specific branches to trace
18406 routines in the operating system.  This option is off by default, even
18407 when compiling for the TPF OS@.
18408
18409 @item -mfused-madd
18410 @itemx -mno-fused-madd
18411 @opindex mfused-madd
18412 @opindex mno-fused-madd
18413 Generate code that uses (does not use) the floating-point multiply and
18414 accumulate instructions.  These instructions are generated by default if
18415 hardware floating point is used.
18416
18417 @item -mwarn-framesize=@var{framesize}
18418 @opindex mwarn-framesize
18419 Emit a warning if the current function exceeds the given frame size.  Because
18420 this is a compile-time check it doesn't need to be a real problem when the program
18421 runs.  It is intended to identify functions that most probably cause
18422 a stack overflow.  It is useful to be used in an environment with limited stack
18423 size e.g.@: the linux kernel.
18424
18425 @item -mwarn-dynamicstack
18426 @opindex mwarn-dynamicstack
18427 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
18428 arrays.  This is generally a bad idea with a limited stack size.
18429
18430 @item -mstack-guard=@var{stack-guard}
18431 @itemx -mstack-size=@var{stack-size}
18432 @opindex mstack-guard
18433 @opindex mstack-size
18434 If these options are provided the S/390 back end emits additional instructions in
18435 the function prologue that trigger a trap if the stack size is @var{stack-guard}
18436 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
18437 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
18438 the frame size of the compiled function is chosen.
18439 These options are intended to be used to help debugging stack overflow problems.
18440 The additionally emitted code causes only little overhead and hence can also be
18441 used in production-like systems without greater performance degradation.  The given
18442 values have to be exact powers of 2 and @var{stack-size} has to be greater than
18443 @var{stack-guard} without exceeding 64k.
18444 In order to be efficient the extra code makes the assumption that the stack starts
18445 at an address aligned to the value given by @var{stack-size}.
18446 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
18447 @end table
18448
18449 @node Score Options
18450 @subsection Score Options
18451 @cindex Score Options
18452
18453 These options are defined for Score implementations:
18454
18455 @table @gcctabopt
18456 @item -meb
18457 @opindex meb
18458 Compile code for big-endian mode.  This is the default.
18459
18460 @item -mel
18461 @opindex mel
18462 Compile code for little-endian mode.
18463
18464 @item -mnhwloop
18465 @opindex mnhwloop
18466 Disable generation of @code{bcnz} instructions.
18467
18468 @item -muls
18469 @opindex muls
18470 Enable generation of unaligned load and store instructions.
18471
18472 @item -mmac
18473 @opindex mmac
18474 Enable the use of multiply-accumulate instructions. Disabled by default.
18475
18476 @item -mscore5
18477 @opindex mscore5
18478 Specify the SCORE5 as the target architecture.
18479
18480 @item -mscore5u
18481 @opindex mscore5u
18482 Specify the SCORE5U of the target architecture.
18483
18484 @item -mscore7
18485 @opindex mscore7
18486 Specify the SCORE7 as the target architecture. This is the default.
18487
18488 @item -mscore7d
18489 @opindex mscore7d
18490 Specify the SCORE7D as the target architecture.
18491 @end table
18492
18493 @node SH Options
18494 @subsection SH Options
18495
18496 These @samp{-m} options are defined for the SH implementations:
18497
18498 @table @gcctabopt
18499 @item -m1
18500 @opindex m1
18501 Generate code for the SH1.
18502
18503 @item -m2
18504 @opindex m2
18505 Generate code for the SH2.
18506
18507 @item -m2e
18508 Generate code for the SH2e.
18509
18510 @item -m2a-nofpu
18511 @opindex m2a-nofpu
18512 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
18513 that the floating-point unit is not used.
18514
18515 @item -m2a-single-only
18516 @opindex m2a-single-only
18517 Generate code for the SH2a-FPU, in such a way that no double-precision
18518 floating-point operations are used.
18519
18520 @item -m2a-single
18521 @opindex m2a-single
18522 Generate code for the SH2a-FPU assuming the floating-point unit is in
18523 single-precision mode by default.
18524
18525 @item -m2a
18526 @opindex m2a
18527 Generate code for the SH2a-FPU assuming the floating-point unit is in
18528 double-precision mode by default.
18529
18530 @item -m3
18531 @opindex m3
18532 Generate code for the SH3.
18533
18534 @item -m3e
18535 @opindex m3e
18536 Generate code for the SH3e.
18537
18538 @item -m4-nofpu
18539 @opindex m4-nofpu
18540 Generate code for the SH4 without a floating-point unit.
18541
18542 @item -m4-single-only
18543 @opindex m4-single-only
18544 Generate code for the SH4 with a floating-point unit that only
18545 supports single-precision arithmetic.
18546
18547 @item -m4-single
18548 @opindex m4-single
18549 Generate code for the SH4 assuming the floating-point unit is in
18550 single-precision mode by default.
18551
18552 @item -m4
18553 @opindex m4
18554 Generate code for the SH4.
18555
18556 @item -m4a-nofpu
18557 @opindex m4a-nofpu
18558 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
18559 floating-point unit is not used.
18560
18561 @item -m4a-single-only
18562 @opindex m4a-single-only
18563 Generate code for the SH4a, in such a way that no double-precision
18564 floating-point operations are used.
18565
18566 @item -m4a-single
18567 @opindex m4a-single
18568 Generate code for the SH4a assuming the floating-point unit is in
18569 single-precision mode by default.
18570
18571 @item -m4a
18572 @opindex m4a
18573 Generate code for the SH4a.
18574
18575 @item -m4al
18576 @opindex m4al
18577 Same as @option{-m4a-nofpu}, except that it implicitly passes
18578 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
18579 instructions at the moment.
18580
18581 @item -mb
18582 @opindex mb
18583 Compile code for the processor in big-endian mode.
18584
18585 @item -ml
18586 @opindex ml
18587 Compile code for the processor in little-endian mode.
18588
18589 @item -mdalign
18590 @opindex mdalign
18591 Align doubles at 64-bit boundaries.  Note that this changes the calling
18592 conventions, and thus some functions from the standard C library do
18593 not work unless you recompile it first with @option{-mdalign}.
18594
18595 @item -mrelax
18596 @opindex mrelax
18597 Shorten some address references at link time, when possible; uses the
18598 linker option @option{-relax}.
18599
18600 @item -mbigtable
18601 @opindex mbigtable
18602 Use 32-bit offsets in @code{switch} tables.  The default is to use
18603 16-bit offsets.
18604
18605 @item -mbitops
18606 @opindex mbitops
18607 Enable the use of bit manipulation instructions on SH2A.
18608
18609 @item -mfmovd
18610 @opindex mfmovd
18611 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
18612 alignment constraints.
18613
18614 @item -mhitachi
18615 @opindex mhitachi
18616 Comply with the calling conventions defined by Renesas.
18617
18618 @item -mrenesas
18619 @opindex mhitachi
18620 Comply with the calling conventions defined by Renesas.
18621
18622 @item -mno-renesas
18623 @opindex mhitachi
18624 Comply with the calling conventions defined for GCC before the Renesas
18625 conventions were available.  This option is the default for all
18626 targets of the SH toolchain.
18627
18628 @item -mnomacsave
18629 @opindex mnomacsave
18630 Mark the @code{MAC} register as call-clobbered, even if
18631 @option{-mhitachi} is given.
18632
18633 @item -mieee
18634 @itemx -mno-ieee
18635 @opindex mieee
18636 @opindex mnoieee
18637 Control the IEEE compliance of floating-point comparisons, which affects the
18638 handling of cases where the result of a comparison is unordered.  By default
18639 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
18640 enabled @option{-mno-ieee} is implicitly set, which results in faster
18641 floating-point greater-equal and less-equal comparisons.  The implcit settings
18642 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
18643
18644 @item -minline-ic_invalidate
18645 @opindex minline-ic_invalidate
18646 Inline code to invalidate instruction cache entries after setting up
18647 nested function trampolines.
18648 This option has no effect if @option{-musermode} is in effect and the selected
18649 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
18650 instruction.
18651 If the selected code generation option does not allow the use of the @code{icbi}
18652 instruction, and @option{-musermode} is not in effect, the inlined code
18653 manipulates the instruction cache address array directly with an associative
18654 write.  This not only requires privileged mode at run time, but it also
18655 fails if the cache line had been mapped via the TLB and has become unmapped.
18656
18657 @item -misize
18658 @opindex misize
18659 Dump instruction size and location in the assembly code.
18660
18661 @item -mpadstruct
18662 @opindex mpadstruct
18663 This option is deprecated.  It pads structures to multiple of 4 bytes,
18664 which is incompatible with the SH ABI@.
18665
18666 @item -matomic-model=@var{model}
18667 @opindex matomic-model=@var{model}
18668 Sets the model of atomic operations and additional parameters as a comma
18669 separated list.  For details on the atomic built-in functions see
18670 @ref{__atomic Builtins}.  The following models and parameters are supported:
18671
18672 @table @samp
18673
18674 @item none
18675 Disable compiler generated atomic sequences and emit library calls for atomic
18676 operations.  This is the default if the target is not @code{sh-*-linux*}.
18677
18678 @item soft-gusa
18679 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
18680 built-in functions.  The generated atomic sequences require additional support
18681 from the interrupt/exception handling code of the system and are only suitable
18682 for SH3* and SH4* single-core systems.  This option is enabled by default when
18683 the target is @code{sh-*-linux*} and SH3* or SH4*.  When the target is SH4A,
18684 this option will also partially utilize the hardware atomic instructions
18685 @code{movli.l} and @code{movco.l} to create more efficient code, unless
18686 @samp{strict} is specified.  
18687
18688 @item soft-tcb
18689 Generate software atomic sequences that use a variable in the thread control
18690 block.  This is a variation of the gUSA sequences which can also be used on
18691 SH1* and SH2* targets.  The generated atomic sequences require additional
18692 support from the interrupt/exception handling code of the system and are only
18693 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
18694 parameter has to be specified as well.
18695
18696 @item soft-imask
18697 Generate software atomic sequences that temporarily disable interrupts by
18698 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
18699 in privileged mode and is only suitable for single-core systems.  Additional
18700 support from the interrupt/exception handling code of the system is not
18701 required.  This model is enabled by default when the target is
18702 @code{sh-*-linux*} and SH1* or SH2*.
18703
18704 @item hard-llcs
18705 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
18706 instructions only.  This is only available on SH4A and is suitable for
18707 multi-core systems.  Since the hardware instructions support only 32 bit atomic
18708 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
18709 Code compiled with this option will also be compatible with other software
18710 atomic model interrupt/exception handling systems if executed on an SH4A
18711 system.  Additional support from the interrupt/exception handling code of the
18712 system is not required for this model.
18713
18714 @item gbr-offset=
18715 This parameter specifies the offset in bytes of the variable in the thread
18716 control block structure that should be used by the generated atomic sequences
18717 when the @samp{soft-tcb} model has been selected.  For other models this
18718 parameter is ignored.  The specified value must be an integer multiple of four
18719 and in the range 0-1020.
18720
18721 @item strict
18722 This parameter prevents mixed usage of multiple atomic models, even though they
18723 would be compatible, and will make the compiler generate atomic sequences of the
18724 specified model only.
18725
18726 @end table
18727
18728 @item -mtas
18729 @opindex mtas
18730 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
18731 Notice that depending on the particular hardware and software configuration
18732 this can degrade overall performance due to the operand cache line flushes
18733 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
18734 processors the @code{tas.b} instruction must be used with caution since it
18735 can result in data corruption for certain cache configurations.
18736
18737 @item -mspace
18738 @opindex mspace
18739 Optimize for space instead of speed.  Implied by @option{-Os}.
18740
18741 @item -mprefergot
18742 @opindex mprefergot
18743 When generating position-independent code, emit function calls using
18744 the Global Offset Table instead of the Procedure Linkage Table.
18745
18746 @item -musermode
18747 @opindex musermode
18748 Don't generate privileged mode only code.  This option
18749 implies @option{-mno-inline-ic_invalidate}
18750 if the inlined code would not work in user mode.
18751 This is the default when the target is @code{sh-*-linux*}.
18752
18753 @item -multcost=@var{number}
18754 @opindex multcost=@var{number}
18755 Set the cost to assume for a multiply insn.
18756
18757 @item -mdiv=@var{strategy}
18758 @opindex mdiv=@var{strategy}
18759 Set the division strategy to be used for integer division operations.
18760 For SHmedia @var{strategy} can be one of: 
18761
18762 @table @samp
18763
18764 @item fp 
18765 Performs the operation in floating point.  This has a very high latency,
18766 but needs only a few instructions, so it might be a good choice if
18767 your code has enough easily-exploitable ILP to allow the compiler to
18768 schedule the floating-point instructions together with other instructions.
18769 Division by zero causes a floating-point exception.
18770
18771 @item inv
18772 Uses integer operations to calculate the inverse of the divisor,
18773 and then multiplies the dividend with the inverse.  This strategy allows
18774 CSE and hoisting of the inverse calculation.  Division by zero calculates
18775 an unspecified result, but does not trap.
18776
18777 @item inv:minlat
18778 A variant of @samp{inv} where, if no CSE or hoisting opportunities
18779 have been found, or if the entire operation has been hoisted to the same
18780 place, the last stages of the inverse calculation are intertwined with the
18781 final multiply to reduce the overall latency, at the expense of using a few
18782 more instructions, and thus offering fewer scheduling opportunities with
18783 other code.
18784
18785 @item call
18786 Calls a library function that usually implements the @samp{inv:minlat}
18787 strategy.
18788 This gives high code density for @code{m5-*media-nofpu} compilations.
18789
18790 @item call2
18791 Uses a different entry point of the same library function, where it
18792 assumes that a pointer to a lookup table has already been set up, which
18793 exposes the pointer load to CSE and code hoisting optimizations.
18794
18795 @item inv:call
18796 @itemx inv:call2
18797 @itemx inv:fp
18798 Use the @samp{inv} algorithm for initial
18799 code generation, but if the code stays unoptimized, revert to the @samp{call},
18800 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
18801 potentially-trapping side effect of division by zero is carried by a
18802 separate instruction, so it is possible that all the integer instructions
18803 are hoisted out, but the marker for the side effect stays where it is.
18804 A recombination to floating-point operations or a call is not possible
18805 in that case.
18806
18807 @item inv20u
18808 @itemx inv20l
18809 Variants of the @samp{inv:minlat} strategy.  In the case
18810 that the inverse calculation is not separated from the multiply, they speed
18811 up division where the dividend fits into 20 bits (plus sign where applicable)
18812 by inserting a test to skip a number of operations in this case; this test
18813 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
18814 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
18815
18816 @end table
18817
18818 For targets other than SHmedia @var{strategy} can be one of:
18819
18820 @table @samp
18821
18822 @item call-div1
18823 Calls a library function that uses the single-step division instruction
18824 @code{div1} to perform the operation.  Division by zero calculates an
18825 unspecified result and does not trap.  This is the default except for SH4,
18826 SH2A and SHcompact.
18827
18828 @item call-fp
18829 Calls a library function that performs the operation in double precision
18830 floating point.  Division by zero causes a floating-point exception.  This is
18831 the default for SHcompact with FPU.  Specifying this for targets that do not
18832 have a double precision FPU will default to @code{call-div1}.
18833
18834 @item call-table
18835 Calls a library function that uses a lookup table for small divisors and
18836 the @code{div1} instruction with case distinction for larger divisors.  Division
18837 by zero calculates an unspecified result and does not trap.  This is the default
18838 for SH4.  Specifying this for targets that do not have dynamic shift
18839 instructions will default to @code{call-div1}.
18840
18841 @end table
18842
18843 When a division strategy has not been specified the default strategy will be
18844 selected based on the current target.  For SH2A the default strategy is to
18845 use the @code{divs} and @code{divu} instructions instead of library function
18846 calls.
18847
18848 @item -maccumulate-outgoing-args
18849 @opindex maccumulate-outgoing-args
18850 Reserve space once for outgoing arguments in the function prologue rather
18851 than around each call.  Generally beneficial for performance and size.  Also
18852 needed for unwinding to avoid changing the stack frame around conditional code.
18853
18854 @item -mdivsi3_libfunc=@var{name}
18855 @opindex mdivsi3_libfunc=@var{name}
18856 Set the name of the library function used for 32-bit signed division to
18857 @var{name}.
18858 This only affects the name used in the @samp{call} and @samp{inv:call}
18859 division strategies, and the compiler still expects the same
18860 sets of input/output/clobbered registers as if this option were not present.
18861
18862 @item -mfixed-range=@var{register-range}
18863 @opindex mfixed-range
18864 Generate code treating the given register range as fixed registers.
18865 A fixed register is one that the register allocator can not use.  This is
18866 useful when compiling kernel code.  A register range is specified as
18867 two registers separated by a dash.  Multiple register ranges can be
18868 specified separated by a comma.
18869
18870 @item -mindexed-addressing
18871 @opindex mindexed-addressing
18872 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
18873 This is only safe if the hardware and/or OS implement 32-bit wrap-around
18874 semantics for the indexed addressing mode.  The architecture allows the
18875 implementation of processors with 64-bit MMU, which the OS could use to
18876 get 32-bit addressing, but since no current hardware implementation supports
18877 this or any other way to make the indexed addressing mode safe to use in
18878 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
18879
18880 @item -mgettrcost=@var{number}
18881 @opindex mgettrcost=@var{number}
18882 Set the cost assumed for the @code{gettr} instruction to @var{number}.
18883 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
18884
18885 @item -mpt-fixed
18886 @opindex mpt-fixed
18887 Assume @code{pt*} instructions won't trap.  This generally generates
18888 better-scheduled code, but is unsafe on current hardware.
18889 The current architecture
18890 definition says that @code{ptabs} and @code{ptrel} trap when the target 
18891 anded with 3 is 3.
18892 This has the unintentional effect of making it unsafe to schedule these
18893 instructions before a branch, or hoist them out of a loop.  For example,
18894 @code{__do_global_ctors}, a part of @file{libgcc}
18895 that runs constructors at program
18896 startup, calls functions in a list which is delimited by @minus{}1.  With the
18897 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
18898 That means that all the constructors run a bit more quickly, but when
18899 the loop comes to the end of the list, the program crashes because @code{ptabs}
18900 loads @minus{}1 into a target register.  
18901
18902 Since this option is unsafe for any
18903 hardware implementing the current architecture specification, the default
18904 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
18905 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
18906 this deters register allocation from using target registers for storing
18907 ordinary integers.
18908
18909 @item -minvalid-symbols
18910 @opindex minvalid-symbols
18911 Assume symbols might be invalid.  Ordinary function symbols generated by
18912 the compiler are always valid to load with
18913 @code{movi}/@code{shori}/@code{ptabs} or
18914 @code{movi}/@code{shori}/@code{ptrel},
18915 but with assembler and/or linker tricks it is possible
18916 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
18917 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
18918 It prevents cross-basic-block CSE, hoisting and most scheduling
18919 of symbol loads.  The default is @option{-mno-invalid-symbols}.
18920
18921 @item -mbranch-cost=@var{num}
18922 @opindex mbranch-cost=@var{num}
18923 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
18924 make the compiler try to generate more branch-free code if possible.  
18925 If not specified the value is selected depending on the processor type that
18926 is being compiled for.
18927
18928 @item -mzdcbranch
18929 @itemx -mno-zdcbranch
18930 @opindex mzdcbranch
18931 @opindex mno-zdcbranch
18932 Assume (do not assume) that zero displacement conditional branch instructions
18933 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
18934 compiler will try to prefer zero displacement branch code sequences.  This is
18935 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
18936 disabled by specifying @option{-mno-zdcbranch}.
18937
18938 @item -mcbranchdi
18939 @opindex mcbranchdi
18940 Enable the @code{cbranchdi4} instruction pattern.
18941
18942 @item -mcmpeqdi
18943 @opindex mcmpeqdi
18944 Emit the @code{cmpeqdi_t} instruction pattern even when @option{-mcbranchdi}
18945 is in effect.
18946
18947 @item -mfused-madd
18948 @itemx -mno-fused-madd
18949 @opindex mfused-madd
18950 @opindex mno-fused-madd
18951 Generate code that uses (does not use) the floating-point multiply and
18952 accumulate instructions.  These instructions are generated by default
18953 if hardware floating point is used.  The machine-dependent
18954 @option{-mfused-madd} option is now mapped to the machine-independent
18955 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
18956 mapped to @option{-ffp-contract=off}.
18957
18958 @item -mfsca
18959 @itemx -mno-fsca
18960 @opindex mfsca
18961 @opindex mno-fsca
18962 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
18963 and cosine approximations.  The option @code{-mfsca} must be used in
18964 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
18965 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
18966 approximations even if @code{-funsafe-math-optimizations} is in effect.
18967
18968 @item -mfsrra
18969 @itemx -mno-fsrra
18970 @opindex mfsrra
18971 @opindex mno-fsrra
18972 Allow or disallow the compiler to emit the @code{fsrra} instruction for
18973 reciprocal square root approximations.  The option @code{-mfsrra} must be used
18974 in combination with @code{-funsafe-math-optimizations} and
18975 @code{-ffinite-math-only}.  It is enabled by default when generating code for
18976 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
18977 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
18978 in effect.
18979
18980 @item -mpretend-cmove
18981 @opindex mpretend-cmove
18982 Prefer zero-displacement conditional branches for conditional move instruction
18983 patterns.  This can result in faster code on the SH4 processor.
18984
18985 @end table
18986
18987 @node Solaris 2 Options
18988 @subsection Solaris 2 Options
18989 @cindex Solaris 2 options
18990
18991 These @samp{-m} options are supported on Solaris 2:
18992
18993 @table @gcctabopt
18994 @item -mimpure-text
18995 @opindex mimpure-text
18996 @option{-mimpure-text}, used in addition to @option{-shared}, tells
18997 the compiler to not pass @option{-z text} to the linker when linking a
18998 shared object.  Using this option, you can link position-dependent
18999 code into a shared object.
19000
19001 @option{-mimpure-text} suppresses the ``relocations remain against
19002 allocatable but non-writable sections'' linker error message.
19003 However, the necessary relocations trigger copy-on-write, and the
19004 shared object is not actually shared across processes.  Instead of
19005 using @option{-mimpure-text}, you should compile all source code with
19006 @option{-fpic} or @option{-fPIC}.
19007
19008 @end table
19009
19010 These switches are supported in addition to the above on Solaris 2:
19011
19012 @table @gcctabopt
19013 @item -pthreads
19014 @opindex pthreads
19015 Add support for multithreading using the POSIX threads library.  This
19016 option sets flags for both the preprocessor and linker.  This option does
19017 not affect the thread safety of object code produced  by the compiler or
19018 that of libraries supplied with it.
19019
19020 @item -pthread
19021 @opindex pthread
19022 This is a synonym for @option{-pthreads}.
19023 @end table
19024
19025 @node SPARC Options
19026 @subsection SPARC Options
19027 @cindex SPARC options
19028
19029 These @samp{-m} options are supported on the SPARC:
19030
19031 @table @gcctabopt
19032 @item -mno-app-regs
19033 @itemx -mapp-regs
19034 @opindex mno-app-regs
19035 @opindex mapp-regs
19036 Specify @option{-mapp-regs} to generate output using the global registers
19037 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
19038 is the default.
19039
19040 To be fully SVR4 ABI-compliant at the cost of some performance loss,
19041 specify @option{-mno-app-regs}.  You should compile libraries and system
19042 software with this option.
19043
19044 @item -mflat
19045 @itemx -mno-flat
19046 @opindex mflat
19047 @opindex mno-flat
19048 With @option{-mflat}, the compiler does not generate save/restore instructions
19049 and uses a ``flat'' or single register window model.  This model is compatible
19050 with the regular register window model.  The local registers and the input
19051 registers (0--5) are still treated as ``call-saved'' registers and are
19052 saved on the stack as needed.
19053
19054 With @option{-mno-flat} (the default), the compiler generates save/restore
19055 instructions (except for leaf functions).  This is the normal operating mode.
19056
19057 @item -mfpu
19058 @itemx -mhard-float
19059 @opindex mfpu
19060 @opindex mhard-float
19061 Generate output containing floating-point instructions.  This is the
19062 default.
19063
19064 @item -mno-fpu
19065 @itemx -msoft-float
19066 @opindex mno-fpu
19067 @opindex msoft-float
19068 Generate output containing library calls for floating point.
19069 @strong{Warning:} the requisite libraries are not available for all SPARC
19070 targets.  Normally the facilities of the machine's usual C compiler are
19071 used, but this cannot be done directly in cross-compilation.  You must make
19072 your own arrangements to provide suitable library functions for
19073 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
19074 @samp{sparclite-*-*} do provide software floating-point support.
19075
19076 @option{-msoft-float} changes the calling convention in the output file;
19077 therefore, it is only useful if you compile @emph{all} of a program with
19078 this option.  In particular, you need to compile @file{libgcc.a}, the
19079 library that comes with GCC, with @option{-msoft-float} in order for
19080 this to work.
19081
19082 @item -mhard-quad-float
19083 @opindex mhard-quad-float
19084 Generate output containing quad-word (long double) floating-point
19085 instructions.
19086
19087 @item -msoft-quad-float
19088 @opindex msoft-quad-float
19089 Generate output containing library calls for quad-word (long double)
19090 floating-point instructions.  The functions called are those specified
19091 in the SPARC ABI@.  This is the default.
19092
19093 As of this writing, there are no SPARC implementations that have hardware
19094 support for the quad-word floating-point instructions.  They all invoke
19095 a trap handler for one of these instructions, and then the trap handler
19096 emulates the effect of the instruction.  Because of the trap handler overhead,
19097 this is much slower than calling the ABI library routines.  Thus the
19098 @option{-msoft-quad-float} option is the default.
19099
19100 @item -mno-unaligned-doubles
19101 @itemx -munaligned-doubles
19102 @opindex mno-unaligned-doubles
19103 @opindex munaligned-doubles
19104 Assume that doubles have 8-byte alignment.  This is the default.
19105
19106 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
19107 alignment only if they are contained in another type, or if they have an
19108 absolute address.  Otherwise, it assumes they have 4-byte alignment.
19109 Specifying this option avoids some rare compatibility problems with code
19110 generated by other compilers.  It is not the default because it results
19111 in a performance loss, especially for floating-point code.
19112
19113 @item -mno-faster-structs
19114 @itemx -mfaster-structs
19115 @opindex mno-faster-structs
19116 @opindex mfaster-structs
19117 With @option{-mfaster-structs}, the compiler assumes that structures
19118 should have 8-byte alignment.  This enables the use of pairs of
19119 @code{ldd} and @code{std} instructions for copies in structure
19120 assignment, in place of twice as many @code{ld} and @code{st} pairs.
19121 However, the use of this changed alignment directly violates the SPARC
19122 ABI@.  Thus, it's intended only for use on targets where the developer
19123 acknowledges that their resulting code is not directly in line with
19124 the rules of the ABI@.
19125
19126 @item -mcpu=@var{cpu_type}
19127 @opindex mcpu
19128 Set the instruction set, register set, and instruction scheduling parameters
19129 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
19130 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
19131 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
19132 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
19133 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
19134 and @samp{niagara4}.
19135
19136 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
19137 which selects the best architecture option for the host processor.
19138 @option{-mcpu=native} has no effect if GCC does not recognize
19139 the processor.
19140
19141 Default instruction scheduling parameters are used for values that select
19142 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
19143 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
19144
19145 Here is a list of each supported architecture and their supported
19146 implementations.
19147
19148 @table @asis
19149 @item v7
19150 cypress
19151
19152 @item v8
19153 supersparc, hypersparc, leon
19154
19155 @item sparclite
19156 f930, f934, sparclite86x
19157
19158 @item sparclet
19159 tsc701
19160
19161 @item v9
19162 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
19163 @end table
19164
19165 By default (unless configured otherwise), GCC generates code for the V7
19166 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
19167 additionally optimizes it for the Cypress CY7C602 chip, as used in the
19168 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
19169 SPARCStation 1, 2, IPX etc.
19170
19171 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
19172 architecture.  The only difference from V7 code is that the compiler emits
19173 the integer multiply and integer divide instructions which exist in SPARC-V8
19174 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
19175 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
19176 2000 series.
19177
19178 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
19179 the SPARC architecture.  This adds the integer multiply, integer divide step
19180 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
19181 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
19182 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
19183 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
19184 MB86934 chip, which is the more recent SPARClite with FPU@.
19185
19186 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
19187 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
19188 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
19189 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
19190 optimizes it for the TEMIC SPARClet chip.
19191
19192 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
19193 architecture.  This adds 64-bit integer and floating-point move instructions,
19194 3 additional floating-point condition code registers and conditional move
19195 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
19196 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
19197 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
19198 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
19199 @option{-mcpu=niagara}, the compiler additionally optimizes it for
19200 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
19201 additionally optimizes it for Sun UltraSPARC T2 chips. With
19202 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
19203 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
19204 additionally optimizes it for Sun UltraSPARC T4 chips.
19205
19206 @item -mtune=@var{cpu_type}
19207 @opindex mtune
19208 Set the instruction scheduling parameters for machine type
19209 @var{cpu_type}, but do not set the instruction set or register set that the
19210 option @option{-mcpu=@var{cpu_type}} does.
19211
19212 The same values for @option{-mcpu=@var{cpu_type}} can be used for
19213 @option{-mtune=@var{cpu_type}}, but the only useful values are those
19214 that select a particular CPU implementation.  Those are @samp{cypress},
19215 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
19216 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
19217 @samp{niagara}, @samp{niagara2}, @samp{niagara3} and @samp{niagara4}.  With
19218 native Solaris and GNU/Linux toolchains, @samp{native} can also be used.
19219
19220 @item -mv8plus
19221 @itemx -mno-v8plus
19222 @opindex mv8plus
19223 @opindex mno-v8plus
19224 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
19225 difference from the V8 ABI is that the global and out registers are
19226 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
19227 mode for all SPARC-V9 processors.
19228
19229 @item -mvis
19230 @itemx -mno-vis
19231 @opindex mvis
19232 @opindex mno-vis
19233 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
19234 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
19235
19236 @item -mvis2
19237 @itemx -mno-vis2
19238 @opindex mvis2
19239 @opindex mno-vis2
19240 With @option{-mvis2}, GCC generates code that takes advantage of
19241 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
19242 default is @option{-mvis2} when targeting a cpu that supports such
19243 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
19244 also sets @option{-mvis}.
19245
19246 @item -mvis3
19247 @itemx -mno-vis3
19248 @opindex mvis3
19249 @opindex mno-vis3
19250 With @option{-mvis3}, GCC generates code that takes advantage of
19251 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
19252 default is @option{-mvis3} when targeting a cpu that supports such
19253 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
19254 also sets @option{-mvis2} and @option{-mvis}.
19255
19256 @item -mcbcond
19257 @itemx -mno-cbcond
19258 @opindex mcbcond
19259 @opindex mno-cbcond
19260 With @option{-mcbcond}, GCC generates code that takes advantage of
19261 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
19262 The default is @option{-mcbcond} when targeting a cpu that supports such
19263 instructions, such as niagara-4 and later.
19264
19265 @item -mpopc
19266 @itemx -mno-popc
19267 @opindex mpopc
19268 @opindex mno-popc
19269 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
19270 population count instruction.  The default is @option{-mpopc}
19271 when targeting a cpu that supports such instructions, such as Niagara-2 and
19272 later.
19273
19274 @item -mfmaf
19275 @itemx -mno-fmaf
19276 @opindex mfmaf
19277 @opindex mno-fmaf
19278 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
19279 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
19280 when targeting a cpu that supports such instructions, such as Niagara-3 and
19281 later.
19282
19283 @item -mfix-at697f
19284 @opindex mfix-at697f
19285 Enable the documented workaround for the single erratum of the Atmel AT697F
19286 processor (which corresponds to erratum #13 of the AT697E processor).
19287 @end table
19288
19289 These @samp{-m} options are supported in addition to the above
19290 on SPARC-V9 processors in 64-bit environments:
19291
19292 @table @gcctabopt
19293 @item -m32
19294 @itemx -m64
19295 @opindex m32
19296 @opindex m64
19297 Generate code for a 32-bit or 64-bit environment.
19298 The 32-bit environment sets int, long and pointer to 32 bits.
19299 The 64-bit environment sets int to 32 bits and long and pointer
19300 to 64 bits.
19301
19302 @item -mcmodel=@var{which}
19303 @opindex mcmodel
19304 Set the code model to one of
19305
19306 @table @samp
19307 @item medlow
19308 The Medium/Low code model: 64-bit addresses, programs
19309 must be linked in the low 32 bits of memory.  Programs can be statically
19310 or dynamically linked.
19311
19312 @item medmid
19313 The Medium/Middle code model: 64-bit addresses, programs
19314 must be linked in the low 44 bits of memory, the text and data segments must
19315 be less than 2GB in size and the data segment must be located within 2GB of
19316 the text segment.
19317
19318 @item medany
19319 The Medium/Anywhere code model: 64-bit addresses, programs
19320 may be linked anywhere in memory, the text and data segments must be less
19321 than 2GB in size and the data segment must be located within 2GB of the
19322 text segment.
19323
19324 @item embmedany
19325 The Medium/Anywhere code model for embedded systems:
19326 64-bit addresses, the text and data segments must be less than 2GB in
19327 size, both starting anywhere in memory (determined at link time).  The
19328 global register %g4 points to the base of the data segment.  Programs
19329 are statically linked and PIC is not supported.
19330 @end table
19331
19332 @item -mmemory-model=@var{mem-model}
19333 @opindex mmemory-model
19334 Set the memory model in force on the processor to one of
19335
19336 @table @samp
19337 @item default
19338 The default memory model for the processor and operating system.
19339
19340 @item rmo
19341 Relaxed Memory Order
19342
19343 @item pso
19344 Partial Store Order
19345
19346 @item tso
19347 Total Store Order
19348
19349 @item sc
19350 Sequential Consistency
19351 @end table
19352
19353 These memory models are formally defined in Appendix D of the Sparc V9
19354 architecture manual, as set in the processor's @code{PSTATE.MM} field.
19355
19356 @item -mstack-bias
19357 @itemx -mno-stack-bias
19358 @opindex mstack-bias
19359 @opindex mno-stack-bias
19360 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
19361 frame pointer if present, are offset by @minus{}2047 which must be added back
19362 when making stack frame references.  This is the default in 64-bit mode.
19363 Otherwise, assume no such offset is present.
19364 @end table
19365
19366 @node SPU Options
19367 @subsection SPU Options
19368 @cindex SPU options
19369
19370 These @samp{-m} options are supported on the SPU:
19371
19372 @table @gcctabopt
19373 @item -mwarn-reloc
19374 @itemx -merror-reloc
19375 @opindex mwarn-reloc
19376 @opindex merror-reloc
19377
19378 The loader for SPU does not handle dynamic relocations.  By default, GCC
19379 gives an error when it generates code that requires a dynamic
19380 relocation.  @option{-mno-error-reloc} disables the error,
19381 @option{-mwarn-reloc} generates a warning instead.
19382
19383 @item -msafe-dma
19384 @itemx -munsafe-dma
19385 @opindex msafe-dma
19386 @opindex munsafe-dma
19387
19388 Instructions that initiate or test completion of DMA must not be
19389 reordered with respect to loads and stores of the memory that is being
19390 accessed.
19391 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
19392 memory accesses, but that can lead to inefficient code in places where the
19393 memory is known to not change.  Rather than mark the memory as volatile,
19394 you can use @option{-msafe-dma} to tell the compiler to treat
19395 the DMA instructions as potentially affecting all memory.  
19396
19397 @item -mbranch-hints
19398 @opindex mbranch-hints
19399
19400 By default, GCC generates a branch hint instruction to avoid
19401 pipeline stalls for always-taken or probably-taken branches.  A hint
19402 is not generated closer than 8 instructions away from its branch.
19403 There is little reason to disable them, except for debugging purposes,
19404 or to make an object a little bit smaller.
19405
19406 @item -msmall-mem
19407 @itemx -mlarge-mem
19408 @opindex msmall-mem
19409 @opindex mlarge-mem
19410
19411 By default, GCC generates code assuming that addresses are never larger
19412 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
19413 a full 32-bit address.
19414
19415 @item -mstdmain
19416 @opindex mstdmain
19417
19418 By default, GCC links against startup code that assumes the SPU-style
19419 main function interface (which has an unconventional parameter list).
19420 With @option{-mstdmain}, GCC links your program against startup
19421 code that assumes a C99-style interface to @code{main}, including a
19422 local copy of @code{argv} strings.
19423
19424 @item -mfixed-range=@var{register-range}
19425 @opindex mfixed-range
19426 Generate code treating the given register range as fixed registers.
19427 A fixed register is one that the register allocator cannot use.  This is
19428 useful when compiling kernel code.  A register range is specified as
19429 two registers separated by a dash.  Multiple register ranges can be
19430 specified separated by a comma.
19431
19432 @item -mea32
19433 @itemx -mea64
19434 @opindex mea32
19435 @opindex mea64
19436 Compile code assuming that pointers to the PPU address space accessed
19437 via the @code{__ea} named address space qualifier are either 32 or 64
19438 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
19439 all object code in an executable must be compiled with the same setting.
19440
19441 @item -maddress-space-conversion
19442 @itemx -mno-address-space-conversion
19443 @opindex maddress-space-conversion
19444 @opindex mno-address-space-conversion
19445 Allow/disallow treating the @code{__ea} address space as superset
19446 of the generic address space.  This enables explicit type casts
19447 between @code{__ea} and generic pointer as well as implicit
19448 conversions of generic pointers to @code{__ea} pointers.  The
19449 default is to allow address space pointer conversions.
19450
19451 @item -mcache-size=@var{cache-size}
19452 @opindex mcache-size
19453 This option controls the version of libgcc that the compiler links to an
19454 executable and selects a software-managed cache for accessing variables
19455 in the @code{__ea} address space with a particular cache size.  Possible
19456 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
19457 and @samp{128}.  The default cache size is 64KB.
19458
19459 @item -matomic-updates
19460 @itemx -mno-atomic-updates
19461 @opindex matomic-updates
19462 @opindex mno-atomic-updates
19463 This option controls the version of libgcc that the compiler links to an
19464 executable and selects whether atomic updates to the software-managed
19465 cache of PPU-side variables are used.  If you use atomic updates, changes
19466 to a PPU variable from SPU code using the @code{__ea} named address space
19467 qualifier do not interfere with changes to other PPU variables residing
19468 in the same cache line from PPU code.  If you do not use atomic updates,
19469 such interference may occur; however, writing back cache lines is
19470 more efficient.  The default behavior is to use atomic updates.
19471
19472 @item -mdual-nops
19473 @itemx -mdual-nops=@var{n}
19474 @opindex mdual-nops
19475 By default, GCC inserts nops to increase dual issue when it expects
19476 it to increase performance.  @var{n} can be a value from 0 to 10.  A
19477 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
19478 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
19479
19480 @item -mhint-max-nops=@var{n}
19481 @opindex mhint-max-nops
19482 Maximum number of nops to insert for a branch hint.  A branch hint must
19483 be at least 8 instructions away from the branch it is affecting.  GCC
19484 inserts up to @var{n} nops to enforce this, otherwise it does not
19485 generate the branch hint.
19486
19487 @item -mhint-max-distance=@var{n}
19488 @opindex mhint-max-distance
19489 The encoding of the branch hint instruction limits the hint to be within
19490 256 instructions of the branch it is affecting.  By default, GCC makes
19491 sure it is within 125.
19492
19493 @item -msafe-hints
19494 @opindex msafe-hints
19495 Work around a hardware bug that causes the SPU to stall indefinitely.
19496 By default, GCC inserts the @code{hbrp} instruction to make sure
19497 this stall won't happen.
19498
19499 @end table
19500
19501 @node System V Options
19502 @subsection Options for System V
19503
19504 These additional options are available on System V Release 4 for
19505 compatibility with other compilers on those systems:
19506
19507 @table @gcctabopt
19508 @item -G
19509 @opindex G
19510 Create a shared object.
19511 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
19512
19513 @item -Qy
19514 @opindex Qy
19515 Identify the versions of each tool used by the compiler, in a
19516 @code{.ident} assembler directive in the output.
19517
19518 @item -Qn
19519 @opindex Qn
19520 Refrain from adding @code{.ident} directives to the output file (this is
19521 the default).
19522
19523 @item -YP,@var{dirs}
19524 @opindex YP
19525 Search the directories @var{dirs}, and no others, for libraries
19526 specified with @option{-l}.
19527
19528 @item -Ym,@var{dir}
19529 @opindex Ym
19530 Look in the directory @var{dir} to find the M4 preprocessor.
19531 The assembler uses this option.
19532 @c This is supposed to go with a -Yd for predefined M4 macro files, but
19533 @c the generic assembler that comes with Solaris takes just -Ym.
19534 @end table
19535
19536 @node TILE-Gx Options
19537 @subsection TILE-Gx Options
19538 @cindex TILE-Gx options
19539
19540 These @samp{-m} options are supported on the TILE-Gx:
19541
19542 @table @gcctabopt
19543 @item -mcmodel=small
19544 @opindex mcmodel=small
19545 Generate code for the small model.  The distance for direct calls is
19546 limited to 500M in either direction.  PC-relative addresses are 32
19547 bits.  Absolute addresses support the full address range.
19548
19549 @item -mcmodel=large
19550 @opindex mcmodel=large
19551 Generate code for the large model.  There is no limitation on call
19552 distance, pc-relative addresses, or absolute addresses.
19553
19554 @item -mcpu=@var{name}
19555 @opindex mcpu
19556 Selects the type of CPU to be targeted.  Currently the only supported
19557 type is @samp{tilegx}.
19558
19559 @item -m32
19560 @itemx -m64
19561 @opindex m32
19562 @opindex m64
19563 Generate code for a 32-bit or 64-bit environment.  The 32-bit
19564 environment sets int, long, and pointer to 32 bits.  The 64-bit
19565 environment sets int to 32 bits and long and pointer to 64 bits.
19566 @end table
19567
19568 @node TILEPro Options
19569 @subsection TILEPro Options
19570 @cindex TILEPro options
19571
19572 These @samp{-m} options are supported on the TILEPro:
19573
19574 @table @gcctabopt
19575 @item -mcpu=@var{name}
19576 @opindex mcpu
19577 Selects the type of CPU to be targeted.  Currently the only supported
19578 type is @samp{tilepro}.
19579
19580 @item -m32
19581 @opindex m32
19582 Generate code for a 32-bit environment, which sets int, long, and
19583 pointer to 32 bits.  This is the only supported behavior so the flag
19584 is essentially ignored.
19585 @end table
19586
19587 @node V850 Options
19588 @subsection V850 Options
19589 @cindex V850 Options
19590
19591 These @samp{-m} options are defined for V850 implementations:
19592
19593 @table @gcctabopt
19594 @item -mlong-calls
19595 @itemx -mno-long-calls
19596 @opindex mlong-calls
19597 @opindex mno-long-calls
19598 Treat all calls as being far away (near).  If calls are assumed to be
19599 far away, the compiler always loads the function's address into a
19600 register, and calls indirect through the pointer.
19601
19602 @item -mno-ep
19603 @itemx -mep
19604 @opindex mno-ep
19605 @opindex mep
19606 Do not optimize (do optimize) basic blocks that use the same index
19607 pointer 4 or more times to copy pointer into the @code{ep} register, and
19608 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
19609 option is on by default if you optimize.
19610
19611 @item -mno-prolog-function
19612 @itemx -mprolog-function
19613 @opindex mno-prolog-function
19614 @opindex mprolog-function
19615 Do not use (do use) external functions to save and restore registers
19616 at the prologue and epilogue of a function.  The external functions
19617 are slower, but use less code space if more than one function saves
19618 the same number of registers.  The @option{-mprolog-function} option
19619 is on by default if you optimize.
19620
19621 @item -mspace
19622 @opindex mspace
19623 Try to make the code as small as possible.  At present, this just turns
19624 on the @option{-mep} and @option{-mprolog-function} options.
19625
19626 @item -mtda=@var{n}
19627 @opindex mtda
19628 Put static or global variables whose size is @var{n} bytes or less into
19629 the tiny data area that register @code{ep} points to.  The tiny data
19630 area can hold up to 256 bytes in total (128 bytes for byte references).
19631
19632 @item -msda=@var{n}
19633 @opindex msda
19634 Put static or global variables whose size is @var{n} bytes or less into
19635 the small data area that register @code{gp} points to.  The small data
19636 area can hold up to 64 kilobytes.
19637
19638 @item -mzda=@var{n}
19639 @opindex mzda
19640 Put static or global variables whose size is @var{n} bytes or less into
19641 the first 32 kilobytes of memory.
19642
19643 @item -mv850
19644 @opindex mv850
19645 Specify that the target processor is the V850.
19646
19647 @item -mv850e3v5
19648 @opindex mv850e3v5
19649 Specify that the target processor is the V850E3V5.  The preprocessor
19650 constant @samp{__v850e3v5__} is defined if this option is used.
19651
19652 @item -mv850e2v4
19653 @opindex mv850e2v4
19654 Specify that the target processor is the V850E3V5.  This is an alias for
19655 the @option{-mv850e3v5} option.
19656
19657 @item -mv850e2v3
19658 @opindex mv850e2v3
19659 Specify that the target processor is the V850E2V3.  The preprocessor
19660 constant @samp{__v850e2v3__} is defined if this option is used.
19661
19662 @item -mv850e2
19663 @opindex mv850e2
19664 Specify that the target processor is the V850E2.  The preprocessor
19665 constant @samp{__v850e2__} is defined if this option is used.
19666
19667 @item -mv850e1
19668 @opindex mv850e1
19669 Specify that the target processor is the V850E1.  The preprocessor
19670 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
19671 this option is used.
19672
19673 @item -mv850es
19674 @opindex mv850es
19675 Specify that the target processor is the V850ES.  This is an alias for
19676 the @option{-mv850e1} option.
19677
19678 @item -mv850e
19679 @opindex mv850e
19680 Specify that the target processor is the V850E@.  The preprocessor
19681 constant @samp{__v850e__} is defined if this option is used.
19682
19683 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
19684 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
19685 are defined then a default target processor is chosen and the
19686 relevant @samp{__v850*__} preprocessor constant is defined.
19687
19688 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
19689 defined, regardless of which processor variant is the target.
19690
19691 @item -mdisable-callt
19692 @itemx -mno-disable-callt
19693 @opindex mdisable-callt
19694 @opindex mno-disable-callt
19695 This option suppresses generation of the @code{CALLT} instruction for the
19696 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
19697 architecture.
19698
19699 This option is enabled by default when the RH850 ABI is
19700 in use (see @option{-mrh850-abi}), and disabled by default when the
19701 GCC ABI is in use.  If @code{CALLT} instructions are being generated
19702 then the C preprocessor symbol @code{__V850_CALLT__} will be defined.
19703
19704 @item -mrelax
19705 @itemx -mno-relax
19706 @opindex mrelax
19707 @opindex mno-relax
19708 Pass on (or do not pass on) the @option{-mrelax} command line option
19709 to the assembler.
19710
19711 @item -mlong-jumps
19712 @itemx -mno-long-jumps
19713 @opindex mlong-jumps
19714 @opindex mno-long-jumps
19715 Disable (or re-enable) the generation of PC-relative jump instructions.
19716
19717 @item -msoft-float
19718 @itemx -mhard-float
19719 @opindex msoft-float
19720 @opindex mhard-float
19721 Disable (or re-enable) the generation of hardware floating point
19722 instructions.  This option is only significant when the target
19723 architecture is @samp{V850E2V3} or higher.  If hardware floating point
19724 instructions are being generated then the C preprocessor symbol
19725 @code{__FPU_OK__} will be defined, otherwise the symbol
19726 @code{__NO_FPU__} will be defined.
19727
19728 @item -mloop
19729 @opindex mloop
19730 Enables the use of the e3v5 LOOP instruction.  The use of this
19731 instruction is not enabled by default when the e3v5 architecture is
19732 selected because its use is still experimental.
19733
19734 @item -mrh850-abi
19735 @itemx -mghs
19736 @opindex mrh850-abi
19737 @opindex mghs
19738 Enables support for the RH850 version of the V850 ABI.  This is the
19739 default.  With this version of the ABI the following rules apply:
19740
19741 @itemize
19742 @item
19743 Integer sized structures and unions are returned via a memory pointer
19744 rather than a register.
19745
19746 @item
19747 Large structures and unions (more than 8 bytes in size) are passed by
19748 value.
19749
19750 @item
19751 Functions are aligned to 16-bit boundaries.
19752
19753 @item
19754 The @option{-m8byte-align} command line option is supported.
19755
19756 @item
19757 The @option{-mdisable-callt} command line option is enabled by
19758 default.  The @option{-mno-disable-callt} command line option is not
19759 supported.
19760 @end itemize
19761
19762 When this version of the ABI is enabled the C preprocessor symbol
19763 @code{__V850_RH850_ABI__} is defined.
19764
19765 @item -mgcc-abi
19766 @opindex mgcc-abi
19767 Enables support for the old GCC version of the V850 ABI.  With this
19768 version of the ABI the following rules apply:
19769
19770 @itemize
19771 @item
19772 Integer sized structures and unions are returned in register @code{r10}.
19773
19774 @item
19775 Large structures and unions (more than 8 bytes in size) are passed by
19776 reference.
19777
19778 @item
19779 Functions are aligned to 32-bit boundaries, unless optimizing for
19780 size.
19781
19782 @item
19783 The @option{-m8byte-align} command line option is not supported.
19784
19785 @item
19786 The @option{-mdisable-callt} command line option is supported but not
19787 enabled by default.
19788 @end itemize
19789
19790 When this version of the ABI is enabled the C preprocessor symbol
19791 @code{__V850_GCC_ABI__} is defined.
19792
19793 @item -m8byte-align
19794 @itemx -mno-8byte-align
19795 @opindex m8byte-align
19796 @opindex mno-8byte-align
19797 Enables support for @code{doubles} and @code{long long} types to be
19798 aligned on 8-byte boundaries.  The default is to restrict the
19799 alignment of all objects to at most 4-bytes.  When
19800 @option{-m8byte-align} is in effect the C preprocessor symbol
19801 @code{__V850_8BYTE_ALIGN__} will be defined.
19802
19803 @item -mbig-switch
19804 @opindex mbig-switch
19805 Generate code suitable for big switch tables.  Use this option only if
19806 the assembler/linker complain about out of range branches within a switch
19807 table.
19808
19809 @item -mapp-regs
19810 @opindex mapp-regs
19811 This option causes r2 and r5 to be used in the code generated by
19812 the compiler.  This setting is the default.
19813
19814 @item -mno-app-regs
19815 @opindex mno-app-regs
19816 This option causes r2 and r5 to be treated as fixed registers.
19817
19818 @end table
19819
19820 @node VAX Options
19821 @subsection VAX Options
19822 @cindex VAX options
19823
19824 These @samp{-m} options are defined for the VAX:
19825
19826 @table @gcctabopt
19827 @item -munix
19828 @opindex munix
19829 Do not output certain jump instructions (@code{aobleq} and so on)
19830 that the Unix assembler for the VAX cannot handle across long
19831 ranges.
19832
19833 @item -mgnu
19834 @opindex mgnu
19835 Do output those jump instructions, on the assumption that the
19836 GNU assembler is being used.
19837
19838 @item -mg
19839 @opindex mg
19840 Output code for G-format floating-point numbers instead of D-format.
19841 @end table
19842
19843 @node VMS Options
19844 @subsection VMS Options
19845
19846 These @samp{-m} options are defined for the VMS implementations:
19847
19848 @table @gcctabopt
19849 @item -mvms-return-codes
19850 @opindex mvms-return-codes
19851 Return VMS condition codes from @code{main}. The default is to return POSIX-style
19852 condition (e.g.@ error) codes.
19853
19854 @item -mdebug-main=@var{prefix}
19855 @opindex mdebug-main=@var{prefix}
19856 Flag the first routine whose name starts with @var{prefix} as the main
19857 routine for the debugger.
19858
19859 @item -mmalloc64
19860 @opindex mmalloc64
19861 Default to 64-bit memory allocation routines.
19862
19863 @item -mpointer-size=@var{size}
19864 @opindex -mpointer-size=@var{size}
19865 Set the default size of pointers. Possible options for @var{size} are
19866 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
19867 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
19868 The later option disables @code{pragma pointer_size}.
19869 @end table
19870
19871 @node VxWorks Options
19872 @subsection VxWorks Options
19873 @cindex VxWorks Options
19874
19875 The options in this section are defined for all VxWorks targets.
19876 Options specific to the target hardware are listed with the other
19877 options for that target.
19878
19879 @table @gcctabopt
19880 @item -mrtp
19881 @opindex mrtp
19882 GCC can generate code for both VxWorks kernels and real time processes
19883 (RTPs).  This option switches from the former to the latter.  It also
19884 defines the preprocessor macro @code{__RTP__}.
19885
19886 @item -non-static
19887 @opindex non-static
19888 Link an RTP executable against shared libraries rather than static
19889 libraries.  The options @option{-static} and @option{-shared} can
19890 also be used for RTPs (@pxref{Link Options}); @option{-static}
19891 is the default.
19892
19893 @item -Bstatic
19894 @itemx -Bdynamic
19895 @opindex Bstatic
19896 @opindex Bdynamic
19897 These options are passed down to the linker.  They are defined for
19898 compatibility with Diab.
19899
19900 @item -Xbind-lazy
19901 @opindex Xbind-lazy
19902 Enable lazy binding of function calls.  This option is equivalent to
19903 @option{-Wl,-z,now} and is defined for compatibility with Diab.
19904
19905 @item -Xbind-now
19906 @opindex Xbind-now
19907 Disable lazy binding of function calls.  This option is the default and
19908 is defined for compatibility with Diab.
19909 @end table
19910
19911 @node x86-64 Options
19912 @subsection x86-64 Options
19913 @cindex x86-64 options
19914
19915 These are listed under @xref{i386 and x86-64 Options}.
19916
19917 @node Xstormy16 Options
19918 @subsection Xstormy16 Options
19919 @cindex Xstormy16 Options
19920
19921 These options are defined for Xstormy16:
19922
19923 @table @gcctabopt
19924 @item -msim
19925 @opindex msim
19926 Choose startup files and linker script suitable for the simulator.
19927 @end table
19928
19929 @node Xtensa Options
19930 @subsection Xtensa Options
19931 @cindex Xtensa Options
19932
19933 These options are supported for Xtensa targets:
19934
19935 @table @gcctabopt
19936 @item -mconst16
19937 @itemx -mno-const16
19938 @opindex mconst16
19939 @opindex mno-const16
19940 Enable or disable use of @code{CONST16} instructions for loading
19941 constant values.  The @code{CONST16} instruction is currently not a
19942 standard option from Tensilica.  When enabled, @code{CONST16}
19943 instructions are always used in place of the standard @code{L32R}
19944 instructions.  The use of @code{CONST16} is enabled by default only if
19945 the @code{L32R} instruction is not available.
19946
19947 @item -mfused-madd
19948 @itemx -mno-fused-madd
19949 @opindex mfused-madd
19950 @opindex mno-fused-madd
19951 Enable or disable use of fused multiply/add and multiply/subtract
19952 instructions in the floating-point option.  This has no effect if the
19953 floating-point option is not also enabled.  Disabling fused multiply/add
19954 and multiply/subtract instructions forces the compiler to use separate
19955 instructions for the multiply and add/subtract operations.  This may be
19956 desirable in some cases where strict IEEE 754-compliant results are
19957 required: the fused multiply add/subtract instructions do not round the
19958 intermediate result, thereby producing results with @emph{more} bits of
19959 precision than specified by the IEEE standard.  Disabling fused multiply
19960 add/subtract instructions also ensures that the program output is not
19961 sensitive to the compiler's ability to combine multiply and add/subtract
19962 operations.
19963
19964 @item -mserialize-volatile
19965 @itemx -mno-serialize-volatile
19966 @opindex mserialize-volatile
19967 @opindex mno-serialize-volatile
19968 When this option is enabled, GCC inserts @code{MEMW} instructions before
19969 @code{volatile} memory references to guarantee sequential consistency.
19970 The default is @option{-mserialize-volatile}.  Use
19971 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
19972
19973 @item -mforce-no-pic
19974 @opindex mforce-no-pic
19975 For targets, like GNU/Linux, where all user-mode Xtensa code must be
19976 position-independent code (PIC), this option disables PIC for compiling
19977 kernel code.
19978
19979 @item -mtext-section-literals
19980 @itemx -mno-text-section-literals
19981 @opindex mtext-section-literals
19982 @opindex mno-text-section-literals
19983 Control the treatment of literal pools.  The default is
19984 @option{-mno-text-section-literals}, which places literals in a separate
19985 section in the output file.  This allows the literal pool to be placed
19986 in a data RAM/ROM, and it also allows the linker to combine literal
19987 pools from separate object files to remove redundant literals and
19988 improve code size.  With @option{-mtext-section-literals}, the literals
19989 are interspersed in the text section in order to keep them as close as
19990 possible to their references.  This may be necessary for large assembly
19991 files.
19992
19993 @item -mtarget-align
19994 @itemx -mno-target-align
19995 @opindex mtarget-align
19996 @opindex mno-target-align
19997 When this option is enabled, GCC instructs the assembler to
19998 automatically align instructions to reduce branch penalties at the
19999 expense of some code density.  The assembler attempts to widen density
20000 instructions to align branch targets and the instructions following call
20001 instructions.  If there are not enough preceding safe density
20002 instructions to align a target, no widening is performed.  The
20003 default is @option{-mtarget-align}.  These options do not affect the
20004 treatment of auto-aligned instructions like @code{LOOP}, which the
20005 assembler always aligns, either by widening density instructions or
20006 by inserting NOP instructions.
20007
20008 @item -mlongcalls
20009 @itemx -mno-longcalls
20010 @opindex mlongcalls
20011 @opindex mno-longcalls
20012 When this option is enabled, GCC instructs the assembler to translate
20013 direct calls to indirect calls unless it can determine that the target
20014 of a direct call is in the range allowed by the call instruction.  This
20015 translation typically occurs for calls to functions in other source
20016 files.  Specifically, the assembler translates a direct @code{CALL}
20017 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
20018 The default is @option{-mno-longcalls}.  This option should be used in
20019 programs where the call target can potentially be out of range.  This
20020 option is implemented in the assembler, not the compiler, so the
20021 assembly code generated by GCC still shows direct call
20022 instructions---look at the disassembled object code to see the actual
20023 instructions.  Note that the assembler uses an indirect call for
20024 every cross-file call, not just those that really are out of range.
20025 @end table
20026
20027 @node zSeries Options
20028 @subsection zSeries Options
20029 @cindex zSeries options
20030
20031 These are listed under @xref{S/390 and zSeries Options}.
20032
20033 @node Code Gen Options
20034 @section Options for Code Generation Conventions
20035 @cindex code generation conventions
20036 @cindex options, code generation
20037 @cindex run-time options
20038
20039 These machine-independent options control the interface conventions
20040 used in code generation.
20041
20042 Most of them have both positive and negative forms; the negative form
20043 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
20044 one of the forms is listed---the one that is not the default.  You
20045 can figure out the other form by either removing @samp{no-} or adding
20046 it.
20047
20048 @table @gcctabopt
20049 @item -fbounds-check
20050 @opindex fbounds-check
20051 For front ends that support it, generate additional code to check that
20052 indices used to access arrays are within the declared range.  This is
20053 currently only supported by the Java and Fortran front ends, where
20054 this option defaults to true and false respectively.
20055
20056 @item -fstack-reuse=@var{reuse-level}
20057 @opindex fstack_reuse
20058 This option controls stack space reuse for user declared local/auto variables
20059 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
20060 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
20061 local variables and temporaries, @samp{named_vars} enables the reuse only for
20062 user defined local variables with names, and @samp{none} disables stack reuse
20063 completely. The default value is @samp{all}. The option is needed when the
20064 program extends the lifetime of a scoped local variable or a compiler generated
20065 temporary beyond the end point defined by the language.  When a lifetime of
20066 a variable ends, and if the variable lives in memory, the optimizing compiler
20067 has the freedom to reuse its stack space with other temporaries or scoped
20068 local variables whose live range does not overlap with it. Legacy code extending
20069 local lifetime will likely to break with the stack reuse optimization.
20070
20071 For example,
20072
20073 @smallexample
20074    int *p;
20075    @{
20076      int local1;
20077
20078      p = &local1;
20079      local1 = 10;
20080      ....
20081    @}
20082    @{
20083       int local2;
20084       local2 = 20;
20085       ...
20086    @}
20087
20088    if (*p == 10)  // out of scope use of local1
20089      @{
20090
20091      @}
20092 @end smallexample
20093
20094 Another example:
20095 @smallexample
20096
20097    struct A
20098    @{
20099        A(int k) : i(k), j(k) @{ @}
20100        int i;
20101        int j;
20102    @};
20103
20104    A *ap;
20105
20106    void foo(const A& ar)
20107    @{
20108       ap = &ar;
20109    @}
20110
20111    void bar()
20112    @{
20113       foo(A(10)); // temp object's lifetime ends when foo returns
20114
20115       @{
20116         A a(20);
20117         ....
20118       @}
20119       ap->i+= 10;  // ap references out of scope temp whose space
20120                    // is reused with a. What is the value of ap->i?
20121    @}
20122
20123 @end smallexample
20124
20125 The lifetime of a compiler generated temporary is well defined by the C++
20126 standard. When a lifetime of a temporary ends, and if the temporary lives
20127 in memory, the optimizing compiler has the freedom to reuse its stack
20128 space with other temporaries or scoped local variables whose live range
20129 does not overlap with it. However some of the legacy code relies on
20130 the behavior of older compilers in which temporaries' stack space is
20131 not reused, the aggressive stack reuse can lead to runtime errors. This
20132 option is used to control the temporary stack reuse optimization.
20133
20134 @item -ftrapv
20135 @opindex ftrapv
20136 This option generates traps for signed overflow on addition, subtraction,
20137 multiplication operations.
20138
20139 @item -fwrapv
20140 @opindex fwrapv
20141 This option instructs the compiler to assume that signed arithmetic
20142 overflow of addition, subtraction and multiplication wraps around
20143 using twos-complement representation.  This flag enables some optimizations
20144 and disables others.  This option is enabled by default for the Java
20145 front end, as required by the Java language specification.
20146
20147 @item -fexceptions
20148 @opindex fexceptions
20149 Enable exception handling.  Generates extra code needed to propagate
20150 exceptions.  For some targets, this implies GCC generates frame
20151 unwind information for all functions, which can produce significant data
20152 size overhead, although it does not affect execution.  If you do not
20153 specify this option, GCC enables it by default for languages like
20154 C++ that normally require exception handling, and disables it for
20155 languages like C that do not normally require it.  However, you may need
20156 to enable this option when compiling C code that needs to interoperate
20157 properly with exception handlers written in C++.  You may also wish to
20158 disable this option if you are compiling older C++ programs that don't
20159 use exception handling.
20160
20161 @item -fnon-call-exceptions
20162 @opindex fnon-call-exceptions
20163 Generate code that allows trapping instructions to throw exceptions.
20164 Note that this requires platform-specific runtime support that does
20165 not exist everywhere.  Moreover, it only allows @emph{trapping}
20166 instructions to throw exceptions, i.e.@: memory references or floating-point
20167 instructions.  It does not allow exceptions to be thrown from
20168 arbitrary signal handlers such as @code{SIGALRM}.
20169
20170 @item -fdelete-dead-exceptions
20171 @opindex fdelete-dead-exceptions
20172 Consider that instructions that may throw exceptions but don't otherwise
20173 contribute to the execution of the program can be optimized away.
20174 This option is enabled by default for the Ada front end, as permitted by
20175 the Ada language specification.
20176 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
20177
20178 @item -funwind-tables
20179 @opindex funwind-tables
20180 Similar to @option{-fexceptions}, except that it just generates any needed
20181 static data, but does not affect the generated code in any other way.
20182 You normally do not need to enable this option; instead, a language processor
20183 that needs this handling enables it on your behalf.
20184
20185 @item -fasynchronous-unwind-tables
20186 @opindex fasynchronous-unwind-tables
20187 Generate unwind table in DWARF 2 format, if supported by target machine.  The
20188 table is exact at each instruction boundary, so it can be used for stack
20189 unwinding from asynchronous events (such as debugger or garbage collector).
20190
20191 @item -fpcc-struct-return
20192 @opindex fpcc-struct-return
20193 Return ``short'' @code{struct} and @code{union} values in memory like
20194 longer ones, rather than in registers.  This convention is less
20195 efficient, but it has the advantage of allowing intercallability between
20196 GCC-compiled files and files compiled with other compilers, particularly
20197 the Portable C Compiler (pcc).
20198
20199 The precise convention for returning structures in memory depends
20200 on the target configuration macros.
20201
20202 Short structures and unions are those whose size and alignment match
20203 that of some integer type.
20204
20205 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
20206 switch is not binary compatible with code compiled with the
20207 @option{-freg-struct-return} switch.
20208 Use it to conform to a non-default application binary interface.
20209
20210 @item -freg-struct-return
20211 @opindex freg-struct-return
20212 Return @code{struct} and @code{union} values in registers when possible.
20213 This is more efficient for small structures than
20214 @option{-fpcc-struct-return}.
20215
20216 If you specify neither @option{-fpcc-struct-return} nor
20217 @option{-freg-struct-return}, GCC defaults to whichever convention is
20218 standard for the target.  If there is no standard convention, GCC
20219 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
20220 the principal compiler.  In those cases, we can choose the standard, and
20221 we chose the more efficient register return alternative.
20222
20223 @strong{Warning:} code compiled with the @option{-freg-struct-return}
20224 switch is not binary compatible with code compiled with the
20225 @option{-fpcc-struct-return} switch.
20226 Use it to conform to a non-default application binary interface.
20227
20228 @item -fshort-enums
20229 @opindex fshort-enums
20230 Allocate to an @code{enum} type only as many bytes as it needs for the
20231 declared range of possible values.  Specifically, the @code{enum} type
20232 is equivalent to the smallest integer type that has enough room.
20233
20234 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
20235 code that is not binary compatible with code generated without that switch.
20236 Use it to conform to a non-default application binary interface.
20237
20238 @item -fshort-double
20239 @opindex fshort-double
20240 Use the same size for @code{double} as for @code{float}.
20241
20242 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
20243 code that is not binary compatible with code generated without that switch.
20244 Use it to conform to a non-default application binary interface.
20245
20246 @item -fshort-wchar
20247 @opindex fshort-wchar
20248 Override the underlying type for @samp{wchar_t} to be @samp{short
20249 unsigned int} instead of the default for the target.  This option is
20250 useful for building programs to run under WINE@.
20251
20252 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
20253 code that is not binary compatible with code generated without that switch.
20254 Use it to conform to a non-default application binary interface.
20255
20256 @item -fno-common
20257 @opindex fno-common
20258 In C code, controls the placement of uninitialized global variables.
20259 Unix C compilers have traditionally permitted multiple definitions of
20260 such variables in different compilation units by placing the variables
20261 in a common block.
20262 This is the behavior specified by @option{-fcommon}, and is the default
20263 for GCC on most targets.
20264 On the other hand, this behavior is not required by ISO C, and on some
20265 targets may carry a speed or code size penalty on variable references.
20266 The @option{-fno-common} option specifies that the compiler should place
20267 uninitialized global variables in the data section of the object file,
20268 rather than generating them as common blocks.
20269 This has the effect that if the same variable is declared
20270 (without @code{extern}) in two different compilations,
20271 you get a multiple-definition error when you link them.
20272 In this case, you must compile with @option{-fcommon} instead.
20273 Compiling with @option{-fno-common} is useful on targets for which
20274 it provides better performance, or if you wish to verify that the
20275 program will work on other systems that always treat uninitialized
20276 variable declarations this way.
20277
20278 @item -fno-ident
20279 @opindex fno-ident
20280 Ignore the @samp{#ident} directive.
20281
20282 @item -finhibit-size-directive
20283 @opindex finhibit-size-directive
20284 Don't output a @code{.size} assembler directive, or anything else that
20285 would cause trouble if the function is split in the middle, and the
20286 two halves are placed at locations far apart in memory.  This option is
20287 used when compiling @file{crtstuff.c}; you should not need to use it
20288 for anything else.
20289
20290 @item -fverbose-asm
20291 @opindex fverbose-asm
20292 Put extra commentary information in the generated assembly code to
20293 make it more readable.  This option is generally only of use to those
20294 who actually need to read the generated assembly code (perhaps while
20295 debugging the compiler itself).
20296
20297 @option{-fno-verbose-asm}, the default, causes the
20298 extra information to be omitted and is useful when comparing two assembler
20299 files.
20300
20301 @item -frecord-gcc-switches
20302 @opindex frecord-gcc-switches
20303 This switch causes the command line used to invoke the
20304 compiler to be recorded into the object file that is being created.
20305 This switch is only implemented on some targets and the exact format
20306 of the recording is target and binary file format dependent, but it
20307 usually takes the form of a section containing ASCII text.  This
20308 switch is related to the @option{-fverbose-asm} switch, but that
20309 switch only records information in the assembler output file as
20310 comments, so it never reaches the object file.
20311 See also @option{-grecord-gcc-switches} for another
20312 way of storing compiler options into the object file.
20313
20314 @item -fpic
20315 @opindex fpic
20316 @cindex global offset table
20317 @cindex PIC
20318 Generate position-independent code (PIC) suitable for use in a shared
20319 library, if supported for the target machine.  Such code accesses all
20320 constant addresses through a global offset table (GOT)@.  The dynamic
20321 loader resolves the GOT entries when the program starts (the dynamic
20322 loader is not part of GCC; it is part of the operating system).  If
20323 the GOT size for the linked executable exceeds a machine-specific
20324 maximum size, you get an error message from the linker indicating that
20325 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
20326 instead.  (These maximums are 8k on the SPARC and 32k
20327 on the m68k and RS/6000.  The 386 has no such limit.)
20328
20329 Position-independent code requires special support, and therefore works
20330 only on certain machines.  For the 386, GCC supports PIC for System V
20331 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
20332 position-independent.
20333
20334 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20335 are defined to 1.
20336
20337 @item -fPIC
20338 @opindex fPIC
20339 If supported for the target machine, emit position-independent code,
20340 suitable for dynamic linking and avoiding any limit on the size of the
20341 global offset table.  This option makes a difference on the m68k,
20342 PowerPC and SPARC@.
20343
20344 Position-independent code requires special support, and therefore works
20345 only on certain machines.
20346
20347 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
20348 are defined to 2.
20349
20350 @item -fpie
20351 @itemx -fPIE
20352 @opindex fpie
20353 @opindex fPIE
20354 These options are similar to @option{-fpic} and @option{-fPIC}, but
20355 generated position independent code can be only linked into executables.
20356 Usually these options are used when @option{-pie} GCC option is
20357 used during linking.
20358
20359 @option{-fpie} and @option{-fPIE} both define the macros
20360 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
20361 for @option{-fpie} and 2 for @option{-fPIE}.
20362
20363 @item -fno-jump-tables
20364 @opindex fno-jump-tables
20365 Do not use jump tables for switch statements even where it would be
20366 more efficient than other code generation strategies.  This option is
20367 of use in conjunction with @option{-fpic} or @option{-fPIC} for
20368 building code that forms part of a dynamic linker and cannot
20369 reference the address of a jump table.  On some targets, jump tables
20370 do not require a GOT and this option is not needed.
20371
20372 @item -ffixed-@var{reg}
20373 @opindex ffixed
20374 Treat the register named @var{reg} as a fixed register; generated code
20375 should never refer to it (except perhaps as a stack pointer, frame
20376 pointer or in some other fixed role).
20377
20378 @var{reg} must be the name of a register.  The register names accepted
20379 are machine-specific and are defined in the @code{REGISTER_NAMES}
20380 macro in the machine description macro file.
20381
20382 This flag does not have a negative form, because it specifies a
20383 three-way choice.
20384
20385 @item -fcall-used-@var{reg}
20386 @opindex fcall-used
20387 Treat the register named @var{reg} as an allocable register that is
20388 clobbered by function calls.  It may be allocated for temporaries or
20389 variables that do not live across a call.  Functions compiled this way
20390 do not save and restore the register @var{reg}.
20391
20392 It is an error to use this flag with the frame pointer or stack pointer.
20393 Use of this flag for other registers that have fixed pervasive roles in
20394 the machine's execution model produces disastrous results.
20395
20396 This flag does not have a negative form, because it specifies a
20397 three-way choice.
20398
20399 @item -fcall-saved-@var{reg}
20400 @opindex fcall-saved
20401 Treat the register named @var{reg} as an allocable register saved by
20402 functions.  It may be allocated even for temporaries or variables that
20403 live across a call.  Functions compiled this way save and restore
20404 the register @var{reg} if they use it.
20405
20406 It is an error to use this flag with the frame pointer or stack pointer.
20407 Use of this flag for other registers that have fixed pervasive roles in
20408 the machine's execution model produces disastrous results.
20409
20410 A different sort of disaster results from the use of this flag for
20411 a register in which function values may be returned.
20412
20413 This flag does not have a negative form, because it specifies a
20414 three-way choice.
20415
20416 @item -fpack-struct[=@var{n}]
20417 @opindex fpack-struct
20418 Without a value specified, pack all structure members together without
20419 holes.  When a value is specified (which must be a small power of two), pack
20420 structure members according to this value, representing the maximum
20421 alignment (that is, objects with default alignment requirements larger than
20422 this are output potentially unaligned at the next fitting location.
20423
20424 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
20425 code that is not binary compatible with code generated without that switch.
20426 Additionally, it makes the code suboptimal.
20427 Use it to conform to a non-default application binary interface.
20428
20429 @item -finstrument-functions
20430 @opindex finstrument-functions
20431 Generate instrumentation calls for entry and exit to functions.  Just
20432 after function entry and just before function exit, the following
20433 profiling functions are called with the address of the current
20434 function and its call site.  (On some platforms,
20435 @code{__builtin_return_address} does not work beyond the current
20436 function, so the call site information may not be available to the
20437 profiling functions otherwise.)
20438
20439 @smallexample
20440 void __cyg_profile_func_enter (void *this_fn,
20441                                void *call_site);
20442 void __cyg_profile_func_exit  (void *this_fn,
20443                                void *call_site);
20444 @end smallexample
20445
20446 The first argument is the address of the start of the current function,
20447 which may be looked up exactly in the symbol table.
20448
20449 This instrumentation is also done for functions expanded inline in other
20450 functions.  The profiling calls indicate where, conceptually, the
20451 inline function is entered and exited.  This means that addressable
20452 versions of such functions must be available.  If all your uses of a
20453 function are expanded inline, this may mean an additional expansion of
20454 code size.  If you use @samp{extern inline} in your C code, an
20455 addressable version of such functions must be provided.  (This is
20456 normally the case anyway, but if you get lucky and the optimizer always
20457 expands the functions inline, you might have gotten away without
20458 providing static copies.)
20459
20460 A function may be given the attribute @code{no_instrument_function}, in
20461 which case this instrumentation is not done.  This can be used, for
20462 example, for the profiling functions listed above, high-priority
20463 interrupt routines, and any functions from which the profiling functions
20464 cannot safely be called (perhaps signal handlers, if the profiling
20465 routines generate output or allocate memory).
20466
20467 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
20468 @opindex finstrument-functions-exclude-file-list
20469
20470 Set the list of functions that are excluded from instrumentation (see
20471 the description of @code{-finstrument-functions}).  If the file that
20472 contains a function definition matches with one of @var{file}, then
20473 that function is not instrumented.  The match is done on substrings:
20474 if the @var{file} parameter is a substring of the file name, it is
20475 considered to be a match.
20476
20477 For example:
20478
20479 @smallexample
20480 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
20481 @end smallexample
20482
20483 @noindent
20484 excludes any inline function defined in files whose pathnames
20485 contain @code{/bits/stl} or @code{include/sys}.
20486
20487 If, for some reason, you want to include letter @code{','} in one of
20488 @var{sym}, write @code{'\,'}. For example,
20489 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
20490 (note the single quote surrounding the option).
20491
20492 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
20493 @opindex finstrument-functions-exclude-function-list
20494
20495 This is similar to @code{-finstrument-functions-exclude-file-list},
20496 but this option sets the list of function names to be excluded from
20497 instrumentation.  The function name to be matched is its user-visible
20498 name, such as @code{vector<int> blah(const vector<int> &)}, not the
20499 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
20500 match is done on substrings: if the @var{sym} parameter is a substring
20501 of the function name, it is considered to be a match.  For C99 and C++
20502 extended identifiers, the function name must be given in UTF-8, not
20503 using universal character names.
20504
20505 @item -fstack-check
20506 @opindex fstack-check
20507 Generate code to verify that you do not go beyond the boundary of the
20508 stack.  You should specify this flag if you are running in an
20509 environment with multiple threads, but you only rarely need to specify it in
20510 a single-threaded environment since stack overflow is automatically
20511 detected on nearly all systems if there is only one stack.
20512
20513 Note that this switch does not actually cause checking to be done; the
20514 operating system or the language runtime must do that.  The switch causes
20515 generation of code to ensure that they see the stack being extended.
20516
20517 You can additionally specify a string parameter: @code{no} means no
20518 checking, @code{generic} means force the use of old-style checking,
20519 @code{specific} means use the best checking method and is equivalent
20520 to bare @option{-fstack-check}.
20521
20522 Old-style checking is a generic mechanism that requires no specific
20523 target support in the compiler but comes with the following drawbacks:
20524
20525 @enumerate
20526 @item
20527 Modified allocation strategy for large objects: they are always
20528 allocated dynamically if their size exceeds a fixed threshold.
20529
20530 @item
20531 Fixed limit on the size of the static frame of functions: when it is
20532 topped by a particular function, stack checking is not reliable and
20533 a warning is issued by the compiler.
20534
20535 @item
20536 Inefficiency: because of both the modified allocation strategy and the
20537 generic implementation, code performance is hampered.
20538 @end enumerate
20539
20540 Note that old-style stack checking is also the fallback method for
20541 @code{specific} if no target support has been added in the compiler.
20542
20543 @item -fstack-limit-register=@var{reg}
20544 @itemx -fstack-limit-symbol=@var{sym}
20545 @itemx -fno-stack-limit
20546 @opindex fstack-limit-register
20547 @opindex fstack-limit-symbol
20548 @opindex fno-stack-limit
20549 Generate code to ensure that the stack does not grow beyond a certain value,
20550 either the value of a register or the address of a symbol.  If a larger
20551 stack is required, a signal is raised at run time.  For most targets,
20552 the signal is raised before the stack overruns the boundary, so
20553 it is possible to catch the signal without taking special precautions.
20554
20555 For instance, if the stack starts at absolute address @samp{0x80000000}
20556 and grows downwards, you can use the flags
20557 @option{-fstack-limit-symbol=__stack_limit} and
20558 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
20559 of 128KB@.  Note that this may only work with the GNU linker.
20560
20561 @item -fsplit-stack
20562 @opindex fsplit-stack
20563 Generate code to automatically split the stack before it overflows.
20564 The resulting program has a discontiguous stack which can only
20565 overflow if the program is unable to allocate any more memory.  This
20566 is most useful when running threaded programs, as it is no longer
20567 necessary to calculate a good stack size to use for each thread.  This
20568 is currently only implemented for the i386 and x86_64 back ends running
20569 GNU/Linux.
20570
20571 When code compiled with @option{-fsplit-stack} calls code compiled
20572 without @option{-fsplit-stack}, there may not be much stack space
20573 available for the latter code to run.  If compiling all code,
20574 including library code, with @option{-fsplit-stack} is not an option,
20575 then the linker can fix up these calls so that the code compiled
20576 without @option{-fsplit-stack} always has a large stack.  Support for
20577 this is implemented in the gold linker in GNU binutils release 2.21
20578 and later.
20579
20580 @item -fleading-underscore
20581 @opindex fleading-underscore
20582 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
20583 change the way C symbols are represented in the object file.  One use
20584 is to help link with legacy assembly code.
20585
20586 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
20587 generate code that is not binary compatible with code generated without that
20588 switch.  Use it to conform to a non-default application binary interface.
20589 Not all targets provide complete support for this switch.
20590
20591 @item -ftls-model=@var{model}
20592 @opindex ftls-model
20593 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
20594 The @var{model} argument should be one of @code{global-dynamic},
20595 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
20596
20597 The default without @option{-fpic} is @code{initial-exec}; with
20598 @option{-fpic} the default is @code{global-dynamic}.
20599
20600 @item -fvisibility=@var{default|internal|hidden|protected}
20601 @opindex fvisibility
20602 Set the default ELF image symbol visibility to the specified option---all
20603 symbols are marked with this unless overridden within the code.
20604 Using this feature can very substantially improve linking and
20605 load times of shared object libraries, produce more optimized
20606 code, provide near-perfect API export and prevent symbol clashes.
20607 It is @strong{strongly} recommended that you use this in any shared objects
20608 you distribute.
20609
20610 Despite the nomenclature, @code{default} always means public; i.e.,
20611 available to be linked against from outside the shared object.
20612 @code{protected} and @code{internal} are pretty useless in real-world
20613 usage so the only other commonly used option is @code{hidden}.
20614 The default if @option{-fvisibility} isn't specified is
20615 @code{default}, i.e., make every
20616 symbol public---this causes the same behavior as previous versions of
20617 GCC@.
20618
20619 A good explanation of the benefits offered by ensuring ELF
20620 symbols have the correct visibility is given by ``How To Write
20621 Shared Libraries'' by Ulrich Drepper (which can be found at
20622 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
20623 solution made possible by this option to marking things hidden when
20624 the default is public is to make the default hidden and mark things
20625 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
20626 and @code{__attribute__ ((visibility("default")))} instead of
20627 @code{__declspec(dllexport)} you get almost identical semantics with
20628 identical syntax.  This is a great boon to those working with
20629 cross-platform projects.
20630
20631 For those adding visibility support to existing code, you may find
20632 @samp{#pragma GCC visibility} of use.  This works by you enclosing
20633 the declarations you wish to set visibility for with (for example)
20634 @samp{#pragma GCC visibility push(hidden)} and
20635 @samp{#pragma GCC visibility pop}.
20636 Bear in mind that symbol visibility should be viewed @strong{as
20637 part of the API interface contract} and thus all new code should
20638 always specify visibility when it is not the default; i.e., declarations
20639 only for use within the local DSO should @strong{always} be marked explicitly
20640 as hidden as so to avoid PLT indirection overheads---making this
20641 abundantly clear also aids readability and self-documentation of the code.
20642 Note that due to ISO C++ specification requirements, @code{operator new} and
20643 @code{operator delete} must always be of default visibility.
20644
20645 Be aware that headers from outside your project, in particular system
20646 headers and headers from any other library you use, may not be
20647 expecting to be compiled with visibility other than the default.  You
20648 may need to explicitly say @samp{#pragma GCC visibility push(default)}
20649 before including any such headers.
20650
20651 @samp{extern} declarations are not affected by @option{-fvisibility}, so
20652 a lot of code can be recompiled with @option{-fvisibility=hidden} with
20653 no modifications.  However, this means that calls to @code{extern}
20654 functions with no explicit visibility use the PLT, so it is more
20655 effective to use @code{__attribute ((visibility))} and/or
20656 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
20657 declarations should be treated as hidden.
20658
20659 Note that @option{-fvisibility} does affect C++ vague linkage
20660 entities. This means that, for instance, an exception class that is
20661 be thrown between DSOs must be explicitly marked with default
20662 visibility so that the @samp{type_info} nodes are unified between
20663 the DSOs.
20664
20665 An overview of these techniques, their benefits and how to use them
20666 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
20667
20668 @item -fstrict-volatile-bitfields
20669 @opindex fstrict-volatile-bitfields
20670 This option should be used if accesses to volatile bit-fields (or other
20671 structure fields, although the compiler usually honors those types
20672 anyway) should use a single access of the width of the
20673 field's type, aligned to a natural alignment if possible.  For
20674 example, targets with memory-mapped peripheral registers might require
20675 all such accesses to be 16 bits wide; with this flag you can
20676 declare all peripheral bit-fields as @code{unsigned short} (assuming short
20677 is 16 bits on these targets) to force GCC to use 16-bit accesses
20678 instead of, perhaps, a more efficient 32-bit access.
20679
20680 If this option is disabled, the compiler uses the most efficient
20681 instruction.  In the previous example, that might be a 32-bit load
20682 instruction, even though that accesses bytes that do not contain
20683 any portion of the bit-field, or memory-mapped registers unrelated to
20684 the one being updated.
20685
20686 If the target requires strict alignment, and honoring the field
20687 type would require violating this alignment, a warning is issued.
20688 If the field has @code{packed} attribute, the access is done without
20689 honoring the field type.  If the field doesn't have @code{packed}
20690 attribute, the access is done honoring the field type.  In both cases,
20691 GCC assumes that the user knows something about the target hardware
20692 that it is unaware of.
20693
20694 The default value of this option is determined by the application binary
20695 interface for the target processor.
20696
20697 @item -fsync-libcalls
20698 @opindex fsync-libcalls
20699 This option controls whether any out-of-line instance of the @code{__sync}
20700 family of functions may be used to implement the C++11 @code{__atomic}
20701 family of functions.
20702
20703 The default value of this option is enabled, thus the only useful form
20704 of the option is @option{-fno-sync-libcalls}.  This option is used in
20705 the implementation of the @file{libatomic} runtime library.
20706
20707 @end table
20708
20709 @c man end
20710
20711 @node Environment Variables
20712 @section Environment Variables Affecting GCC
20713 @cindex environment variables
20714
20715 @c man begin ENVIRONMENT
20716 This section describes several environment variables that affect how GCC
20717 operates.  Some of them work by specifying directories or prefixes to use
20718 when searching for various kinds of files.  Some are used to specify other
20719 aspects of the compilation environment.
20720
20721 Note that you can also specify places to search using options such as
20722 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
20723 take precedence over places specified using environment variables, which
20724 in turn take precedence over those specified by the configuration of GCC@.
20725 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, @value{fngccint},
20726 GNU Compiler Collection (GCC) Internals}.
20727
20728 @table @env
20729 @item LANG
20730 @itemx LC_CTYPE
20731 @c @itemx LC_COLLATE
20732 @itemx LC_MESSAGES
20733 @c @itemx LC_MONETARY
20734 @c @itemx LC_NUMERIC
20735 @c @itemx LC_TIME
20736 @itemx LC_ALL
20737 @findex LANG
20738 @findex LC_CTYPE
20739 @c @findex LC_COLLATE
20740 @findex LC_MESSAGES
20741 @c @findex LC_MONETARY
20742 @c @findex LC_NUMERIC
20743 @c @findex LC_TIME
20744 @findex LC_ALL
20745 @cindex locale
20746 These environment variables control the way that GCC uses
20747 localization information which allows GCC to work with different
20748 national conventions.  GCC inspects the locale categories
20749 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
20750 so.  These locale categories can be set to any value supported by your
20751 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
20752 Kingdom encoded in UTF-8.
20753
20754 The @env{LC_CTYPE} environment variable specifies character
20755 classification.  GCC uses it to determine the character boundaries in
20756 a string; this is needed for some multibyte encodings that contain quote
20757 and escape characters that are otherwise interpreted as a string
20758 end or escape.
20759
20760 The @env{LC_MESSAGES} environment variable specifies the language to
20761 use in diagnostic messages.
20762
20763 If the @env{LC_ALL} environment variable is set, it overrides the value
20764 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
20765 and @env{LC_MESSAGES} default to the value of the @env{LANG}
20766 environment variable.  If none of these variables are set, GCC
20767 defaults to traditional C English behavior.
20768
20769 @item TMPDIR
20770 @findex TMPDIR
20771 If @env{TMPDIR} is set, it specifies the directory to use for temporary
20772 files.  GCC uses temporary files to hold the output of one stage of
20773 compilation which is to be used as input to the next stage: for example,
20774 the output of the preprocessor, which is the input to the compiler
20775 proper.
20776
20777 @item GCC_COMPARE_DEBUG
20778 @findex GCC_COMPARE_DEBUG
20779 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
20780 @option{-fcompare-debug} to the compiler driver.  See the documentation
20781 of this option for more details.
20782
20783 @item GCC_EXEC_PREFIX
20784 @findex GCC_EXEC_PREFIX
20785 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
20786 names of the subprograms executed by the compiler.  No slash is added
20787 when this prefix is combined with the name of a subprogram, but you can
20788 specify a prefix that ends with a slash if you wish.
20789
20790 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
20791 an appropriate prefix to use based on the pathname it is invoked with.
20792
20793 If GCC cannot find the subprogram using the specified prefix, it
20794 tries looking in the usual places for the subprogram.
20795
20796 The default value of @env{GCC_EXEC_PREFIX} is
20797 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
20798 the installed compiler. In many cases @var{prefix} is the value
20799 of @code{prefix} when you ran the @file{configure} script.
20800
20801 Other prefixes specified with @option{-B} take precedence over this prefix.
20802
20803 This prefix is also used for finding files such as @file{crt0.o} that are
20804 used for linking.
20805
20806 In addition, the prefix is used in an unusual way in finding the
20807 directories to search for header files.  For each of the standard
20808 directories whose name normally begins with @samp{/usr/local/lib/gcc}
20809 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
20810 replacing that beginning with the specified prefix to produce an
20811 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
20812 @file{foo/bar} just before it searches the standard directory 
20813 @file{/usr/local/lib/bar}.
20814 If a standard directory begins with the configured
20815 @var{prefix} then the value of @var{prefix} is replaced by
20816 @env{GCC_EXEC_PREFIX} when looking for header files.
20817
20818 @item COMPILER_PATH
20819 @findex COMPILER_PATH
20820 The value of @env{COMPILER_PATH} is a colon-separated list of
20821 directories, much like @env{PATH}.  GCC tries the directories thus
20822 specified when searching for subprograms, if it can't find the
20823 subprograms using @env{GCC_EXEC_PREFIX}.
20824
20825 @item LIBRARY_PATH
20826 @findex LIBRARY_PATH
20827 The value of @env{LIBRARY_PATH} is a colon-separated list of
20828 directories, much like @env{PATH}.  When configured as a native compiler,
20829 GCC tries the directories thus specified when searching for special
20830 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
20831 using GCC also uses these directories when searching for ordinary
20832 libraries for the @option{-l} option (but directories specified with
20833 @option{-L} come first).
20834
20835 @item LANG
20836 @findex LANG
20837 @cindex locale definition
20838 This variable is used to pass locale information to the compiler.  One way in
20839 which this information is used is to determine the character set to be used
20840 when character literals, string literals and comments are parsed in C and C++.
20841 When the compiler is configured to allow multibyte characters,
20842 the following values for @env{LANG} are recognized:
20843
20844 @table @samp
20845 @item C-JIS
20846 Recognize JIS characters.
20847 @item C-SJIS
20848 Recognize SJIS characters.
20849 @item C-EUCJP
20850 Recognize EUCJP characters.
20851 @end table
20852
20853 If @env{LANG} is not defined, or if it has some other value, then the
20854 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
20855 recognize and translate multibyte characters.
20856 @end table
20857
20858 @noindent
20859 Some additional environment variables affect the behavior of the
20860 preprocessor.
20861
20862 @include cppenv.texi
20863
20864 @c man end
20865
20866 @node Precompiled Headers
20867 @section Using Precompiled Headers
20868 @cindex precompiled headers
20869 @cindex speed of compilation
20870
20871 Often large projects have many header files that are included in every
20872 source file.  The time the compiler takes to process these header files
20873 over and over again can account for nearly all of the time required to
20874 build the project.  To make builds faster, GCC allows you to
20875 @dfn{precompile} a header file.
20876
20877 To create a precompiled header file, simply compile it as you would any
20878 other file, if necessary using the @option{-x} option to make the driver
20879 treat it as a C or C++ header file.  You may want to use a
20880 tool like @command{make} to keep the precompiled header up-to-date when
20881 the headers it contains change.
20882
20883 A precompiled header file is searched for when @code{#include} is
20884 seen in the compilation.  As it searches for the included file
20885 (@pxref{Search Path,,Search Path,@value{fncpp},The C Preprocessor}) the
20886 compiler looks for a precompiled header in each directory just before it
20887 looks for the include file in that directory.  The name searched for is
20888 the name specified in the @code{#include} with @samp{.gch} appended.  If
20889 the precompiled header file can't be used, it is ignored.
20890
20891 For instance, if you have @code{#include "all.h"}, and you have
20892 @file{all.h.gch} in the same directory as @file{all.h}, then the
20893 precompiled header file is used if possible, and the original
20894 header is used otherwise.
20895
20896 Alternatively, you might decide to put the precompiled header file in a
20897 directory and use @option{-I} to ensure that directory is searched
20898 before (or instead of) the directory containing the original header.
20899 Then, if you want to check that the precompiled header file is always
20900 used, you can put a file of the same name as the original header in this
20901 directory containing an @code{#error} command.
20902
20903 This also works with @option{-include}.  So yet another way to use
20904 precompiled headers, good for projects not designed with precompiled
20905 header files in mind, is to simply take most of the header files used by
20906 a project, include them from another header file, precompile that header
20907 file, and @option{-include} the precompiled header.  If the header files
20908 have guards against multiple inclusion, they are skipped because
20909 they've already been included (in the precompiled header).
20910
20911 If you need to precompile the same header file for different
20912 languages, targets, or compiler options, you can instead make a
20913 @emph{directory} named like @file{all.h.gch}, and put each precompiled
20914 header in the directory, perhaps using @option{-o}.  It doesn't matter
20915 what you call the files in the directory; every precompiled header in
20916 the directory is considered.  The first precompiled header
20917 encountered in the directory that is valid for this compilation is
20918 used; they're searched in no particular order.
20919
20920 There are many other possibilities, limited only by your imagination,
20921 good sense, and the constraints of your build system.
20922
20923 A precompiled header file can be used only when these conditions apply:
20924
20925 @itemize
20926 @item
20927 Only one precompiled header can be used in a particular compilation.
20928
20929 @item
20930 A precompiled header can't be used once the first C token is seen.  You
20931 can have preprocessor directives before a precompiled header; you cannot
20932 include a precompiled header from inside another header.
20933
20934 @item
20935 The precompiled header file must be produced for the same language as
20936 the current compilation.  You can't use a C precompiled header for a C++
20937 compilation.
20938
20939 @item
20940 The precompiled header file must have been produced by the same compiler
20941 binary as the current compilation is using.
20942
20943 @item
20944 Any macros defined before the precompiled header is included must
20945 either be defined in the same way as when the precompiled header was
20946 generated, or must not affect the precompiled header, which usually
20947 means that they don't appear in the precompiled header at all.
20948
20949 The @option{-D} option is one way to define a macro before a
20950 precompiled header is included; using a @code{#define} can also do it.
20951 There are also some options that define macros implicitly, like
20952 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
20953 defined this way.
20954
20955 @item If debugging information is output when using the precompiled
20956 header, using @option{-g} or similar, the same kind of debugging information
20957 must have been output when building the precompiled header.  However,
20958 a precompiled header built using @option{-g} can be used in a compilation
20959 when no debugging information is being output.
20960
20961 @item The same @option{-m} options must generally be used when building
20962 and using the precompiled header.  @xref{Submodel Options},
20963 for any cases where this rule is relaxed.
20964
20965 @item Each of the following options must be the same when building and using
20966 the precompiled header:
20967
20968 @gccoptlist{-fexceptions}
20969
20970 @item
20971 Some other command-line options starting with @option{-f},
20972 @option{-p}, or @option{-O} must be defined in the same way as when
20973 the precompiled header was generated.  At present, it's not clear
20974 which options are safe to change and which are not; the safest choice
20975 is to use exactly the same options when generating and using the
20976 precompiled header.  The following are known to be safe:
20977
20978 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
20979 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
20980 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
20981 -pedantic-errors}
20982
20983 @end itemize
20984
20985 For all of these except the last, the compiler automatically
20986 ignores the precompiled header if the conditions aren't met.  If you
20987 find an option combination that doesn't work and doesn't cause the
20988 precompiled header to be ignored, please consider filing a bug report,
20989 see @ref{Bugs}.
20990
20991 If you do use differing options when generating and using the
20992 precompiled header, the actual behavior is a mixture of the
20993 behavior for the options.  For instance, if you use @option{-g} to
20994 generate the precompiled header but not when using it, you may or may
20995 not get debugging information for routines in the precompiled header.