install.texi: Remove references to java/libjava.
[official-gcc.git] / gcc / doc / invoke.texi
blobdbb02bb7b2522beecca59fcf411dd4d519a145c2
1 @c Copyright (C) 1988-2016 Free Software Foundation, Inc.
2 @c This is part of the GCC manual.
3 @c For copying conditions, see the file gcc.texi.
5 @ignore
6 @c man begin INCLUDE
7 @include gcc-vers.texi
8 @c man end
10 @c man begin COPYRIGHT
11 Copyright @copyright{} 1988-2016 Free Software Foundation, Inc.
13 Permission is granted to copy, distribute and/or modify this document
14 under the terms of the GNU Free Documentation License, Version 1.3 or
15 any later version published by the Free Software Foundation; with the
16 Invariant Sections being ``GNU General Public License'' and ``Funding
17 Free Software'', the Front-Cover texts being (a) (see below), and with
18 the Back-Cover Texts being (b) (see below).  A copy of the license is
19 included in the gfdl(7) man page.
21 (a) The FSF's Front-Cover Text is:
23      A GNU Manual
25 (b) The FSF's Back-Cover Text is:
27      You have freedom to copy and modify this GNU Manual, like GNU
28      software.  Copies published by the Free Software Foundation raise
29      funds for GNU development.
30 @c man end
31 @c Set file name and title for the man page.
32 @setfilename gcc
33 @settitle GNU project C and C++ compiler
34 @c man begin SYNOPSIS
35 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
36     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
37     [@option{-W}@var{warn}@dots{}] [@option{-Wpedantic}]
38     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
39     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
40     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
41     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
43 Only the most useful options are listed here; see below for the
44 remainder.  @command{g++} accepts mostly the same options as @command{gcc}.
45 @c man end
46 @c man begin SEEALSO
47 gpl(7), gfdl(7), fsf-funding(7),
48 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
49 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
50 @file{ld}, @file{binutils} and @file{gdb}.
51 @c man end
52 @c man begin BUGS
53 For instructions on reporting bugs, see
54 @w{@value{BUGURL}}.
55 @c man end
56 @c man begin AUTHOR
57 See the Info entry for @command{gcc}, or
58 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
59 for contributors to GCC@.
60 @c man end
61 @end ignore
63 @node Invoking GCC
64 @chapter GCC Command Options
65 @cindex GCC command options
66 @cindex command options
67 @cindex options, GCC command
69 @c man begin DESCRIPTION
70 When you invoke GCC, it normally does preprocessing, compilation,
71 assembly and linking.  The ``overall options'' allow you to stop this
72 process at an intermediate stage.  For example, the @option{-c} option
73 says not to run the linker.  Then the output consists of object files
74 output by the assembler.
75 @xref{Overall Options,,Options Controlling the Kind of Output}.
77 Other options are passed on to one or more stages of processing.  Some options
78 control the preprocessor and others the compiler itself.  Yet other
79 options control the assembler and linker; most of these are not
80 documented here, since you rarely need to use any of them.
82 @cindex C compilation options
83 Most of the command-line options that you can use with GCC are useful
84 for C programs; when an option is only useful with another language
85 (usually C++), the explanation says so explicitly.  If the description
86 for a particular option does not mention a source language, you can use
87 that option with all supported languages.
89 @cindex cross compiling
90 @cindex specifying machine version
91 @cindex specifying compiler version and target machine
92 @cindex compiler version, specifying
93 @cindex target machine, specifying
94 The usual way to run GCC is to run the executable called @command{gcc}, or
95 @command{@var{machine}-gcc} when cross-compiling, or
96 @command{@var{machine}-gcc-@var{version}} to run a specific version of GCC.
97 When you compile C++ programs, you should invoke GCC as @command{g++} 
98 instead.  @xref{Invoking G++,,Compiling C++ Programs}, 
99 for information about the differences in behavior between @command{gcc} 
100 and @code{g++} when compiling C++ programs.
102 @cindex grouping options
103 @cindex options, grouping
104 The @command{gcc} program accepts options and file names as operands.  Many
105 options have multi-letter names; therefore multiple single-letter options
106 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
107 -v}}.
109 @cindex order of options
110 @cindex options, order
111 You can mix options and other arguments.  For the most part, the order
112 you use doesn't matter.  Order does matter when you use several
113 options of the same kind; for example, if you specify @option{-L} more
114 than once, the directories are searched in the order specified.  Also,
115 the placement of the @option{-l} option is significant.
117 Many options have long names starting with @samp{-f} or with
118 @samp{-W}---for example,
119 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
120 these have both positive and negative forms; the negative form of
121 @option{-ffoo} is @option{-fno-foo}.  This manual documents
122 only one of these two forms, whichever one is not the default.
124 @c man end
126 @xref{Option Index}, for an index to GCC's options.
128 @menu
129 * Option Summary::      Brief list of all options, without explanations.
130 * Overall Options::     Controlling the kind of output:
131                         an executable, object files, assembler files,
132                         or preprocessed source.
133 * Invoking G++::        Compiling C++ programs.
134 * C Dialect Options::   Controlling the variant of C language compiled.
135 * C++ Dialect Options:: Variations on C++.
136 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
137                         and Objective-C++.
138 * Diagnostic Message Formatting Options:: Controlling how diagnostics should
139                         be formatted.
140 * Warning Options::     How picky should the compiler be?
141 * Debugging Options::   Producing debuggable code.
142 * Optimize Options::    How much optimization?
143 * Instrumentation Options:: Enabling profiling and extra run-time error checking.
144 * Preprocessor Options:: Controlling header files and macro definitions.
145                          Also, getting dependency information for Make.
146 * Assembler Options::   Passing options to the assembler.
147 * Link Options::        Specifying libraries and so on.
148 * Directory Options::   Where to find header files and libraries.
149                         Where to find the compiler executable files.
150 * Code Gen Options::    Specifying conventions for function calls, data layout
151                         and register usage.
152 * Developer Options::   Printing GCC configuration info, statistics, and
153                         debugging dumps.
154 * Submodel Options::    Target-specific options, such as compiling for a
155                         specific processor variant.
156 * Spec Files::          How to pass switches to sub-processes.
157 * Environment Variables:: Env vars that affect GCC.
158 * Precompiled Headers:: Compiling a header once, and using it many times.
159 @end menu
161 @c man begin OPTIONS
163 @node Option Summary
164 @section Option Summary
166 Here is a summary of all the options, grouped by type.  Explanations are
167 in the following sections.
169 @table @emph
170 @item Overall Options
171 @xref{Overall Options,,Options Controlling the Kind of Output}.
172 @gccoptlist{-c  -S  -E  -o @var{file}  -x @var{language}  @gol
173 -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  --version @gol
174 -pass-exit-codes  -pipe  -specs=@var{file}  -wrapper  @gol
175 @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
176 -fdump-ada-spec@r{[}-slim@r{]} -fada-spec-parent=@var{unit} -fdump-go-spec=@var{file}}
178 @item C Language Options
179 @xref{C Dialect Options,,Options Controlling C Dialect}.
180 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
181 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
182 -fno-asm  -fno-builtin  -fno-builtin-@var{function} -fgimple@gol
183 -fhosted  -ffreestanding -fopenacc -fopenmp -fopenmp-simd @gol
184 -fms-extensions -fplan9-extensions -fsso-struct=@var{endianness}
185 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
186 -fsigned-bitfields  -fsigned-char @gol
187 -funsigned-bitfields  -funsigned-char @gol
188 -trigraphs -traditional -traditional-cpp}
190 @item C++ Language Options
191 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
192 @gccoptlist{-fabi-version=@var{n}  -fno-access-control @gol
193 -faligned-new=@var{n} -fargs-in-order=@var{n} -fcheck-new @gol
194 -fconstexpr-depth=@var{n} -fconstexpr-loop-limit=@var{n} @gol
195 -ffriend-injection @gol
196 -fno-elide-constructors @gol
197 -fno-enforce-eh-specs @gol
198 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
199 -fno-implicit-templates @gol
200 -fno-implicit-inline-templates @gol
201 -fno-implement-inlines  -fms-extensions @gol
202 -fnew-inheriting-ctors @gol
203 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
204 -fno-optional-diags  -fpermissive @gol
205 -fno-pretty-templates @gol
206 -frepo  -fno-rtti -fsized-deallocation @gol
207 -ftemplate-backtrace-limit=@var{n} @gol
208 -ftemplate-depth=@var{n} @gol
209 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
210 -fno-weak  -nostdinc++ @gol
211 -fvisibility-inlines-hidden @gol
212 -fvisibility-ms-compat @gol
213 -fext-numeric-literals @gol
214 -Wabi=@var{n}  -Wabi-tag  -Wconversion-null  -Wctor-dtor-privacy @gol
215 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wmultiple-inheritance @gol
216 -Wnamespaces -Wnarrowing @gol
217 -Wnoexcept -Wnon-virtual-dtor  -Wreorder -Wregister @gol
218 -Weffc++  -Wstrict-null-sentinel -Wtemplates @gol
219 -Wno-non-template-friend  -Wold-style-cast @gol
220 -Woverloaded-virtual  -Wno-pmf-conversions @gol
221 -Wsign-promo -Wvirtual-inheritance}
223 @item Objective-C and Objective-C++ Language Options
224 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
225 Objective-C and Objective-C++ Dialects}.
226 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
227 -fgnu-runtime  -fnext-runtime @gol
228 -fno-nil-receivers @gol
229 -fobjc-abi-version=@var{n} @gol
230 -fobjc-call-cxx-cdtors @gol
231 -fobjc-direct-dispatch @gol
232 -fobjc-exceptions @gol
233 -fobjc-gc @gol
234 -fobjc-nilcheck @gol
235 -fobjc-std=objc1 @gol
236 -fno-local-ivars @gol
237 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
238 -freplace-objc-classes @gol
239 -fzero-link @gol
240 -gen-decls @gol
241 -Wassign-intercept @gol
242 -Wno-protocol  -Wselector @gol
243 -Wstrict-selector-match @gol
244 -Wundeclared-selector}
246 @item Diagnostic Message Formatting Options
247 @xref{Diagnostic Message Formatting Options,,Options to Control Diagnostic Messages Formatting}.
248 @gccoptlist{-fmessage-length=@var{n}  @gol
249 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
250 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
251 -fno-diagnostics-show-option -fno-diagnostics-show-caret @gol
252 -fdiagnostics-parseable-fixits -fdiagnostics-generate-patch}
254 @item Warning Options
255 @xref{Warning Options,,Options to Request or Suppress Warnings}.
256 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
257 -pedantic-errors @gol
258 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
259 -Walloca -Walloca-larger-than=@var{n} @gol
260 -Wno-aggressive-loop-optimizations -Warray-bounds -Warray-bounds=@var{n} @gol
261 -Wno-attributes -Wbool-compare -Wbool-operation @gol
262 -Wno-builtin-macro-redefined -Wc90-c99-compat -Wc99-c11-compat @gol
263 -Wc++-compat -Wc++11-compat -Wc++14-compat -Wcast-align  -Wcast-qual  @gol
264 -Wchar-subscripts -Wclobbered  -Wcomment -Wconditionally-supported  @gol
265 -Wconversion -Wcoverage-mismatch -Wno-cpp -Wdangling-else -Wdate-time @gol
266 -Wdelete-incomplete @gol
267 -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init @gol
268 -Wdisabled-optimization @gol
269 -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol
270 -Wno-div-by-zero -Wdouble-promotion -Wduplicated-cond @gol
271 -Wempty-body  -Wenum-compare -Wno-endif-labels @gol
272 -Werror  -Werror=* -Wfatal-errors -Wfloat-equal  -Wformat  -Wformat=2 @gol
273 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-length=@var{n} @gol
274 -Wformat-nonliteral @gol
275 -Wformat-security  -Wformat-signedness  -Wformat-y2k -Wframe-address @gol
276 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
277 -Wignored-qualifiers  -Wignored-attributes  -Wincompatible-pointer-types @gol
278 -Wimplicit  -Wimplicit-fallthrough  -Wimplicit-fallthrough=@var{n} @gol
279 -Wimplicit-function-declaration  -Wimplicit-int @gol
280 -Winit-self  -Winline  -Wno-int-conversion  -Wint-in-bool-context @gol
281 -Wno-int-to-pointer-cast -Winvalid-memory-model -Wno-invalid-offsetof @gol
282 -Winvalid-pch -Wlarger-than=@var{len} @gol
283 -Wlogical-op -Wlogical-not-parentheses -Wlong-long @gol
284 -Wmain -Wmaybe-uninitialized -Wmemset-elt-size -Wmemset-transposed-args @gol
285 -Wmisleading-indentation -Wmissing-braces @gol
286 -Wmissing-field-initializers -Wmissing-include-dirs @gol
287 -Wno-multichar -Wnonnull -Wnonnull-compare @gol
288 -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
289 -Wnull-dereference -Wodr  -Wno-overflow  -Wopenmp-simd  @gol
290 -Woverride-init-side-effects -Woverlength-strings @gol
291 -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
292 -Wparentheses -Wno-pedantic-ms-format @gol
293 -Wplacement-new -Wplacement-new=@var{n} @gol
294 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
295 -Wno-pragmas -Wredundant-decls -Wrestrict  -Wno-return-local-addr @gol
296 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
297 -Wshadow=global, -Wshadow=local, -Wshadow=compatible-local @gol
298 -Wshift-overflow -Wshift-overflow=@var{n} @gol
299 -Wshift-count-negative -Wshift-count-overflow -Wshift-negative-value @gol
300 -Wsign-compare  -Wsign-conversion -Wfloat-conversion @gol
301 -Wno-scalar-storage-order @gol
302 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
303 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
304 -Wstrict-aliasing=n -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
305 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
306 -Wsuggest-final-types @gol -Wsuggest-final-methods -Wsuggest-override @gol
307 -Wmissing-format-attribute -Wsubobject-linkage @gol
308 -Wswitch  -Wswitch-bool  -Wswitch-default  -Wswitch-enum @gol
309 -Wswitch-unreachable  -Wsync-nand @gol
310 -Wsystem-headers  -Wtautological-compare  -Wtrampolines  -Wtrigraphs @gol
311 -Wtype-limits  -Wundef @gol
312 -Wuninitialized  -Wunknown-pragmas  -Wunsafe-loop-optimizations @gol
313 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
314 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
315 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
316 -Wunused-const-variable -Wunused-const-variable=@var{n} @gol
317 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
318 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
319 -Wvla -Wvla-larger-than=@var{n} -Wvolatile-register-var  -Wwrite-strings @gol
320 -Wzero-as-null-pointer-constant -Whsa}
322 @item C and Objective-C-only Warning Options
323 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
324 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
325 -Wold-style-declaration  -Wold-style-definition @gol
326 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
327 -Wdeclaration-after-statement -Wpointer-sign}
329 @item Debugging Options
330 @xref{Debugging Options,,Options for Debugging Your Program}.
331 @gccoptlist{-g  -g@var{level}  -gcoff  -gdwarf -gdwarf-@var{version} @gol
332 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
333 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
334 -gvms  -gxcoff  -gxcoff+ -gz@r{[}=@var{type}@r{]} @gol
335 -fdebug-prefix-map=@var{old}=@var{new} -fdebug-types-section @gol
336 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
337 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
338 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
339 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
340 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
341 -fvar-tracking -fvar-tracking-assignments}
343 @item Optimization Options
344 @xref{Optimize Options,,Options that Control Optimization}.
345 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
346 -falign-jumps[=@var{n}] @gol
347 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
348 -fassociative-math -fauto-profile -fauto-profile[=@var{path}] @gol
349 -fauto-inc-dec -fbranch-probabilities @gol
350 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
351 -fbtr-bb-exclusive -fcaller-saves @gol
352 -fcombine-stack-adjustments -fconserve-stack @gol
353 -fcompare-elim -fcprop-registers -fcrossjumping @gol
354 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
355 -fcx-limited-range @gol
356 -fdata-sections -fdce -fdelayed-branch @gol
357 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively @gol
358 -fdevirtualize-at-ltrans -fdse @gol
359 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
360 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
361 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
362 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
363 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
364 -fif-conversion2 -findirect-inlining @gol
365 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
366 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-cp-alignment -fipa-bit-cp @gol
367 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference -fipa-icf @gol
368 -fira-algorithm=@var{algorithm} @gol
369 -fira-region=@var{region} -fira-hoist-pressure @gol
370 -fira-loop-pressure -fno-ira-share-save-slots @gol
371 -fno-ira-share-spill-slots @gol
372 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute @gol
373 -fivopts -fkeep-inline-functions -fkeep-static-functions @gol
374 -fkeep-static-consts -flive-range-shrinkage @gol
375 -floop-block -floop-interchange -floop-strip-mine @gol
376 -floop-unroll-and-jam -floop-nest-optimize @gol
377 -floop-parallelize-all -flra-remat -flto -flto-compression-level @gol
378 -flto-partition=@var{alg} -fmerge-all-constants @gol
379 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
380 -fmove-loop-invariants -fno-branch-count-reg @gol
381 -fno-defer-pop -fno-fp-int-builtin-inexact -fno-function-cse @gol
382 -fno-guess-branch-probability -fno-inline -fno-math-errno -fno-peephole @gol
383 -fno-peephole2 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
384 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
385 -fomit-frame-pointer -foptimize-sibling-calls @gol
386 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
387 -fprefetch-loop-arrays -fprintf-return-value @gol
388 -fprofile-correction @gol
389 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
390 -fprofile-reorder-functions @gol
391 -freciprocal-math -free -frename-registers -freorder-blocks @gol
392 -freorder-blocks-algorithm=@var{algorithm} @gol
393 -freorder-blocks-and-partition -freorder-functions @gol
394 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
395 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
396 -fsched-spec-load -fsched-spec-load-dangerous @gol
397 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
398 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
399 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
400 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
401 -fschedule-fusion @gol
402 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
403 -fselective-scheduling -fselective-scheduling2 @gol
404 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
405 -fsemantic-interposition -fshrink-wrap -fshrink-wrap-separate @gol
406 -fsignaling-nans @gol
407 -fsingle-precision-constant -fsplit-ivs-in-unroller -fsplit-loops@gol
408 -fsplit-paths @gol
409 -fsplit-wide-types -fssa-backprop -fssa-phiopt @gol
410 -fstdarg-opt -fstore-merging -fstrict-aliasing @gol
411 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
412 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
413 -ftree-coalesce-vars -ftree-copy-prop -ftree-dce -ftree-dominator-opts @gol
414 -ftree-dse -ftree-forwprop -ftree-fre -fcode-hoisting -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-loop-vectorize @gol
419 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
420 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
421 -ftree-switch-conversion -ftree-tail-merge @gol
422 -ftree-ter -ftree-vectorize -ftree-vrp -funconstrained-commons @gol
423 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
424 -funsafe-math-optimizations -funswitch-loops @gol
425 -fipa-ra -fvariable-expansion-in-unroller -fvect-cost-model -fvpt @gol
426 -fweb -fwhole-program -fwpa -fuse-linker-plugin @gol
427 --param @var{name}=@var{value}
428 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
430 @item Program Instrumentation Options
431 @xref{Instrumentation Options,,Program Instrumentation Options}.
432 @gccoptlist{-p  -pg  -fprofile-arcs --coverage -ftest-coverage @gol
433 -fprofile-dir=@var{path} -fprofile-generate -fprofile-generate=@var{path} @gol
434 -fsanitize=@var{style} -fsanitize-recover -fsanitize-recover=@var{style} @gol
435 -fasan-shadow-offset=@var{number} -fsanitize-sections=@var{s1},@var{s2},... @gol
436 -fsanitize-undefined-trap-on-error -fbounds-check @gol
437 -fcheck-pointer-bounds -fchkp-check-incomplete-type @gol
438 -fchkp-first-field-has-own-bounds -fchkp-narrow-bounds @gol
439 -fchkp-narrow-to-innermost-array -fchkp-optimize @gol
440 -fchkp-use-fast-string-functions -fchkp-use-nochk-string-functions @gol
441 -fchkp-use-static-bounds -fchkp-use-static-const-bounds @gol
442 -fchkp-treat-zero-dynamic-size-as-infinite -fchkp-check-read @gol
443 -fchkp-check-read -fchkp-check-write -fchkp-store-bounds @gol
444 -fchkp-instrument-calls -fchkp-instrument-marked-only @gol
445 -fchkp-use-wrappers @gol
446 -fstack-protector -fstack-protector-all -fstack-protector-strong @gol
447 -fstack-protector-explicit -fstack-check @gol
448 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
449 -fno-stack-limit -fsplit-stack @gol
450 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
451 -fvtv-counts -fvtv-debug @gol
452 -finstrument-functions @gol
453 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
454 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}}
456 @item Preprocessor Options
457 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
458 @gccoptlist{-A@var{question}=@var{answer} @gol
459 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
460 -C  -dD  -dI  -dM  -dN @gol
461 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
462 -idirafter @var{dir} @gol
463 -include @var{file}  -imacros @var{file} @gol
464 -iprefix @var{file}  -iwithprefix @var{dir} @gol
465 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
466 -imultilib @var{dir} -isysroot @var{dir} @gol
467 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
468 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
469 -remap -trigraphs  -undef  -U@var{macro}  @gol
470 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
472 @item Assembler Option
473 @xref{Assembler Options,,Passing Options to the Assembler}.
474 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
476 @item Linker Options
477 @xref{Link Options,,Options for Linking}.
478 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker} -l@var{library} @gol
479 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
480 -s  -static -static-libgcc -static-libstdc++ @gol
481 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
482 -static-libmpx -static-libmpxwrappers @gol
483 -shared -shared-libgcc  -symbolic @gol
484 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
485 -u @var{symbol} -z @var{keyword}}
487 @item Directory Options
488 @xref{Directory Options,,Options for Directory Search}.
489 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
490 -iquote@var{dir} -L@var{dir} -no-canonical-prefixes -I- @gol
491 --sysroot=@var{dir} --no-sysroot-suffix}
493 @item Code Generation Options
494 @xref{Code Gen Options,,Options for Code Generation Conventions}.
495 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
496 -ffixed-@var{reg}  -fexceptions @gol
497 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
498 -fasynchronous-unwind-tables @gol
499 -fno-gnu-unique @gol
500 -finhibit-size-directive  -fno-common  -fno-ident @gol
501 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE -fno-plt @gol
502 -fno-jump-tables @gol
503 -frecord-gcc-switches @gol
504 -freg-struct-return  -fshort-enums  -fshort-wchar @gol
505 -fverbose-asm  -fpack-struct[=@var{n}]  @gol
506 -fleading-underscore  -ftls-model=@var{model} @gol
507 -fstack-reuse=@var{reuse_level} @gol
508 -ftrampolines  -ftrapv  -fwrapv @gol
509 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
510 -fstrict-volatile-bitfields -fsync-libcalls}
512 @item Developer Options
513 @xref{Developer Options,,GCC Developer Options}.
514 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
515 -fchecking -fchecking=@var{n} -fdbg-cnt-list @gol
516 -fdbg-cnt=@var{counter-value-list} @gol
517 -fdisable-ipa-@var{pass_name} @gol
518 -fdisable-rtl-@var{pass_name} @gol
519 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
520 -fdisable-tree-@var{pass_name} @gol
521 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
522 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
523 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
524 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
525 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
526 -fdump-passes @gol
527 -fdump-rtl-@var{pass} -fdump-rtl-@var{pass}=@var{filename} @gol
528 -fdump-statistics @gol
529 -fdump-tree-all @gol
530 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
531 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
532 -fdump-tree-cfg -fdump-tree-alias @gol
533 -fdump-tree-ch @gol
534 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
535 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
536 -fdump-tree-gimple@r{[}-raw@r{]} @gol
537 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
538 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
539 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
540 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
541 -fdump-tree-backprop@r{[}-@var{n}@r{]} @gol
542 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
543 -fdump-tree-nrv -fdump-tree-vect @gol
544 -fdump-tree-sink @gol
545 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
546 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
547 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
548 -fdump-tree-vtable-verify @gol
549 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
550 -fdump-tree-split-paths@r{[}-@var{n}@r{]} @gol
551 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
552 -fdump-final-insns=@var{file} @gol
553 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
554 -fenable-@var{kind}-@var{pass} @gol
555 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
556 -fira-verbose=@var{n} @gol
557 -flto-report -flto-report-wpa -fmem-report-wpa @gol
558 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report @gol
559 -fopt-info -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
560 -fprofile-report @gol
561 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
562 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
563 -fstats  -fstack-usage  -ftime-report -ftime-report-details @gol
564 -fvar-tracking-assignments-toggle -gtoggle @gol
565 -print-file-name=@var{library}  -print-libgcc-file-name @gol
566 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
567 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
568 -print-sysroot -print-sysroot-headers-suffix @gol
569 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
571 @item Machine-Dependent Options
572 @xref{Submodel Options,,Machine-Dependent Options}.
573 @c This list is ordered alphanumerically by subsection name.
574 @c Try and put the significant identifier (CPU or system) first,
575 @c so users have a clue at guessing where the ones they want will be.
577 @emph{AArch64 Options}
578 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
579 -mgeneral-regs-only @gol
580 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
581 -mstrict-align @gol
582 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
583 -mtls-dialect=desc  -mtls-dialect=traditional @gol
584 -mtls-size=@var{size} @gol
585 -mfix-cortex-a53-835769  -mno-fix-cortex-a53-835769 @gol
586 -mfix-cortex-a53-843419  -mno-fix-cortex-a53-843419 @gol
587 -mlow-precision-recip-sqrt -mno-low-precision-recip-sqrt@gol
588 -mlow-precision-sqrt -mno-low-precision-sqrt@gol
589 -mlow-precision-div -mno-low-precision-div @gol
590 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
592 @emph{Adapteva Epiphany Options}
593 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
594 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
595 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
596 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
597 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
598 -msplit-vecmove-early -m1reg-@var{reg}}
600 @emph{ARC Options}
601 @gccoptlist{-mbarrel-shifter @gol
602 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
603 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
604 -mea -mno-mpy -mmul32x16 -mmul64 -matomic @gol
605 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
606 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
607 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
608 -mlong-calls -mmedium-calls -msdata @gol
609 -mucb-mcount -mvolatile-cache -mtp-regno=@var{regno} @gol
610 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
611 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
612 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
613 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
614 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
615 -mtune=@var{cpu} -mmultcost=@var{num} @gol
616 -munalign-prob-threshold=@var{probability} -mmpy-option=@var{multo} @gol
617 -mdiv-rem -mcode-density -mll64 -mfpu=@var{fpu}}
619 @emph{ARM Options}
620 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
621 -mabi=@var{name} @gol
622 -mapcs-stack-check  -mno-apcs-stack-check @gol
623 -mapcs-float  -mno-apcs-float @gol
624 -mapcs-reentrant  -mno-apcs-reentrant @gol
625 -msched-prolog  -mno-sched-prolog @gol
626 -mlittle-endian  -mbig-endian @gol
627 -mfloat-abi=@var{name} @gol
628 -mfp16-format=@var{name}
629 -mthumb-interwork  -mno-thumb-interwork @gol
630 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
631 -mtune=@var{name} -mprint-tune-info @gol
632 -mstructure-size-boundary=@var{n} @gol
633 -mabort-on-noreturn @gol
634 -mlong-calls  -mno-long-calls @gol
635 -msingle-pic-base  -mno-single-pic-base @gol
636 -mpic-register=@var{reg} @gol
637 -mnop-fun-dllimport @gol
638 -mpoke-function-name @gol
639 -mthumb  -marm @gol
640 -mtpcs-frame  -mtpcs-leaf-frame @gol
641 -mcaller-super-interworking  -mcallee-super-interworking @gol
642 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
643 -mword-relocations @gol
644 -mfix-cortex-m3-ldrd @gol
645 -munaligned-access @gol
646 -mneon-for-64bits @gol
647 -mslow-flash-data @gol
648 -masm-syntax-unified @gol
649 -mrestrict-it @gol
650 -mpure-code}
652 @emph{AVR Options}
653 @gccoptlist{-mmcu=@var{mcu} -mabsdata -maccumulate-args @gol
654 -mbranch-cost=@var{cost} @gol
655 -mcall-prologues -mint8 -mn_flash=@var{size} -mno-interrupts @gol
656 -mrelax -mrmw -mstrict-X -mtiny-stack -mfract-convert-truncate -nodevicelib @gol
657 -Waddr-space-convert -Wmisspelled-isr}
659 @emph{Blackfin Options}
660 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
661 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
662 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
663 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
664 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
665 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
666 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
667 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
668 -micplb}
670 @emph{C6X Options}
671 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
672 -msim -msdata=@var{sdata-type}}
674 @emph{CRIS Options}
675 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
676 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
677 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
678 -mstack-align  -mdata-align  -mconst-align @gol
679 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
680 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
681 -mmul-bug-workaround  -mno-mul-bug-workaround}
683 @emph{CR16 Options}
684 @gccoptlist{-mmac @gol
685 -mcr16cplus -mcr16c @gol
686 -msim -mint32 -mbit-ops
687 -mdata-model=@var{model}}
689 @emph{Darwin Options}
690 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
691 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
692 -client_name  -compatibility_version  -current_version @gol
693 -dead_strip @gol
694 -dependency-file  -dylib_file  -dylinker_install_name @gol
695 -dynamic  -dynamiclib  -exported_symbols_list @gol
696 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
697 -force_flat_namespace  -headerpad_max_install_names @gol
698 -iframework @gol
699 -image_base  -init  -install_name  -keep_private_externs @gol
700 -multi_module  -multiply_defined  -multiply_defined_unused @gol
701 -noall_load   -no_dead_strip_inits_and_terms @gol
702 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
703 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
704 -private_bundle  -read_only_relocs  -sectalign @gol
705 -sectobjectsymbols  -whyload  -seg1addr @gol
706 -sectcreate  -sectobjectsymbols  -sectorder @gol
707 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
708 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
709 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
710 -single_module  -static  -sub_library  -sub_umbrella @gol
711 -twolevel_namespace  -umbrella  -undefined @gol
712 -unexported_symbols_list  -weak_reference_mismatches @gol
713 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
714 -mkernel -mone-byte-bool}
716 @emph{DEC Alpha Options}
717 @gccoptlist{-mno-fp-regs  -msoft-float @gol
718 -mieee  -mieee-with-inexact  -mieee-conformant @gol
719 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
720 -mtrap-precision=@var{mode}  -mbuild-constants @gol
721 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
722 -mbwx  -mmax  -mfix  -mcix @gol
723 -mfloat-vax  -mfloat-ieee @gol
724 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
725 -msmall-text  -mlarge-text @gol
726 -mmemory-latency=@var{time}}
728 @emph{FR30 Options}
729 @gccoptlist{-msmall-model -mno-lsim}
731 @emph{FT32 Options}
732 @gccoptlist{-msim -mlra -mnodiv}
734 @emph{FRV Options}
735 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
736 -mhard-float  -msoft-float @gol
737 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
738 -mdouble  -mno-double @gol
739 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
740 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
741 -mlinked-fp  -mlong-calls  -malign-labels @gol
742 -mlibrary-pic  -macc-4  -macc-8 @gol
743 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
744 -moptimize-membar -mno-optimize-membar @gol
745 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
746 -mvliw-branch  -mno-vliw-branch @gol
747 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
748 -mno-nested-cond-exec  -mtomcat-stats @gol
749 -mTLS -mtls @gol
750 -mcpu=@var{cpu}}
752 @emph{GNU/Linux Options}
753 @gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol
754 -tno-android-cc -tno-android-ld}
756 @emph{H8/300 Options}
757 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
759 @emph{HPPA Options}
760 @gccoptlist{-march=@var{architecture-type} @gol
761 -mdisable-fpregs  -mdisable-indexing @gol
762 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
763 -mfixed-range=@var{register-range} @gol
764 -mjump-in-delay -mlinker-opt -mlong-calls @gol
765 -mlong-load-store  -mno-disable-fpregs @gol
766 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
767 -mno-jump-in-delay  -mno-long-load-store @gol
768 -mno-portable-runtime  -mno-soft-float @gol
769 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
770 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
771 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
772 -munix=@var{unix-std}  -nolibdld  -static  -threads}
774 @emph{IA-64 Options}
775 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
776 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
777 -mconstant-gp  -mauto-pic  -mfused-madd @gol
778 -minline-float-divide-min-latency @gol
779 -minline-float-divide-max-throughput @gol
780 -mno-inline-float-divide @gol
781 -minline-int-divide-min-latency @gol
782 -minline-int-divide-max-throughput  @gol
783 -mno-inline-int-divide @gol
784 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
785 -mno-inline-sqrt @gol
786 -mdwarf2-asm -mearly-stop-bits @gol
787 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
788 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
789 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
790 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
791 -msched-spec-ldc -msched-spec-control-ldc @gol
792 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
793 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
794 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
795 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
797 @emph{LM32 Options}
798 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
799 -msign-extend-enabled -muser-enabled}
801 @emph{M32R/D Options}
802 @gccoptlist{-m32r2 -m32rx -m32r @gol
803 -mdebug @gol
804 -malign-loops -mno-align-loops @gol
805 -missue-rate=@var{number} @gol
806 -mbranch-cost=@var{number} @gol
807 -mmodel=@var{code-size-model-type} @gol
808 -msdata=@var{sdata-type} @gol
809 -mno-flush-func -mflush-func=@var{name} @gol
810 -mno-flush-trap -mflush-trap=@var{number} @gol
811 -G @var{num}}
813 @emph{M32C Options}
814 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
816 @emph{M680x0 Options}
817 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
818 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
819 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
820 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
821 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
822 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
823 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
824 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
825 -mxgot -mno-xgot}
827 @emph{MCore Options}
828 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
829 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
830 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
831 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
832 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
834 @emph{MeP Options}
835 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
836 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
837 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
838 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
839 -mtiny=@var{n}}
841 @emph{MicroBlaze Options}
842 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
843 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
844 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
845 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
846 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
848 @emph{MIPS Options}
849 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
850 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
851 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
852 -mips16  -mno-mips16  -mflip-mips16 @gol
853 -minterlink-compressed -mno-interlink-compressed @gol
854 -minterlink-mips16  -mno-interlink-mips16 @gol
855 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
856 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
857 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
858 -mno-float  -msingle-float  -mdouble-float @gol
859 -modd-spreg -mno-odd-spreg @gol
860 -mabs=@var{mode}  -mnan=@var{encoding} @gol
861 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
862 -mmcu -mmno-mcu @gol
863 -meva -mno-eva @gol
864 -mvirt -mno-virt @gol
865 -mxpa -mno-xpa @gol
866 -mmicromips -mno-micromips @gol
867 -mmsa -mno-msa @gol
868 -mfpu=@var{fpu-type} @gol
869 -msmartmips  -mno-smartmips @gol
870 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
871 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
872 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
873 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
874 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
875 -membedded-data  -mno-embedded-data @gol
876 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
877 -mcode-readable=@var{setting} @gol
878 -msplit-addresses  -mno-split-addresses @gol
879 -mexplicit-relocs  -mno-explicit-relocs @gol
880 -mcheck-zero-division  -mno-check-zero-division @gol
881 -mdivide-traps  -mdivide-breaks @gol
882 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
883 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
884 -mfix-24k -mno-fix-24k @gol
885 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
886 -mfix-r10000 -mno-fix-r10000  -mfix-rm7000 -mno-fix-rm7000 @gol
887 -mfix-vr4120  -mno-fix-vr4120 @gol
888 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
889 -mflush-func=@var{func}  -mno-flush-func @gol
890 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
891 -mcompact-branches=@var{policy} @gol
892 -mfp-exceptions -mno-fp-exceptions @gol
893 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
894 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address @gol
895 -mframe-header-opt -mno-frame-header-opt}
897 @emph{MMIX Options}
898 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
899 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
900 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
901 -mno-base-addresses  -msingle-exit  -mno-single-exit}
903 @emph{MN10300 Options}
904 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
905 -mno-am33 -mam33 -mam33-2 -mam34 @gol
906 -mtune=@var{cpu-type} @gol
907 -mreturn-pointer-on-d0 @gol
908 -mno-crt0  -mrelax -mliw -msetlb}
910 @emph{Moxie Options}
911 @gccoptlist{-meb -mel -mmul.x -mno-crt0}
913 @emph{MSP430 Options}
914 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
915 -mwarn-mcu @gol
916 -mcode-region= -mdata-region= @gol
917 -msilicon-errata= -msilicon-errata-warn= @gol
918 -mhwmult= -minrt}
920 @emph{NDS32 Options}
921 @gccoptlist{-mbig-endian -mlittle-endian @gol
922 -mreduced-regs -mfull-regs @gol
923 -mcmov -mno-cmov @gol
924 -mperf-ext -mno-perf-ext @gol
925 -mv3push -mno-v3push @gol
926 -m16bit -mno-16bit @gol
927 -misr-vector-size=@var{num} @gol
928 -mcache-block-size=@var{num} @gol
929 -march=@var{arch} @gol
930 -mcmodel=@var{code-model} @gol
931 -mctor-dtor -mrelax}
933 @emph{Nios II Options}
934 @gccoptlist{-G @var{num} -mgpopt=@var{option} -mgpopt -mno-gpopt @gol
935 -mel -meb @gol
936 -mno-bypass-cache -mbypass-cache @gol
937 -mno-cache-volatile -mcache-volatile @gol
938 -mno-fast-sw-div -mfast-sw-div @gol
939 -mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div @gol
940 -mcustom-@var{insn}=@var{N} -mno-custom-@var{insn} @gol
941 -mcustom-fpu-cfg=@var{name} @gol
942 -mhal -msmallc -msys-crt0=@var{name} -msys-lib=@var{name} @gol
943 -march=@var{arch} -mbmx -mno-bmx -mcdx -mno-cdx}
945 @emph{Nvidia PTX Options}
946 @gccoptlist{-m32 -m64 -mmainkernel -moptimize}
948 @emph{PDP-11 Options}
949 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
950 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
951 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
952 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
953 -mbranch-expensive  -mbranch-cheap @gol
954 -munix-asm  -mdec-asm}
956 @emph{picoChip Options}
957 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
958 -msymbol-as-address -mno-inefficient-warnings}
960 @emph{PowerPC Options}
961 See RS/6000 and PowerPC Options.
963 @emph{RL78 Options}
964 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=g14 -mallregs @gol
965 -mcpu=g10 -mcpu=g13 -mcpu=g14 -mg10 -mg13 -mg14 @gol
966 -m64bit-doubles -m32bit-doubles -msave-mduc-in-interrupts}
968 @emph{RS/6000 and PowerPC Options}
969 @gccoptlist{-mcpu=@var{cpu-type} @gol
970 -mtune=@var{cpu-type} @gol
971 -mcmodel=@var{code-model} @gol
972 -mpowerpc64 @gol
973 -maltivec  -mno-altivec @gol
974 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
975 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
976 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
977 -mfprnd  -mno-fprnd @gol
978 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
979 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
980 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
981 -malign-power  -malign-natural @gol
982 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
983 -msingle-float -mdouble-float -msimple-fpu @gol
984 -mstring  -mno-string  -mupdate  -mno-update @gol
985 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
986 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
987 -mstrict-align  -mno-strict-align  -mrelocatable @gol
988 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
989 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
990 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
991 -mprioritize-restricted-insns=@var{priority} @gol
992 -msched-costly-dep=@var{dependence_type} @gol
993 -minsert-sched-nops=@var{scheme} @gol
994 -mcall-sysv  -mcall-netbsd @gol
995 -maix-struct-return  -msvr4-struct-return @gol
996 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
997 -mblock-move-inline-limit=@var{num} @gol
998 -misel -mno-isel @gol
999 -misel=yes  -misel=no @gol
1000 -mspe -mno-spe @gol
1001 -mspe=yes  -mspe=no @gol
1002 -mpaired @gol
1003 -mgen-cell-microcode -mwarn-cell-microcode @gol
1004 -mvrsave -mno-vrsave @gol
1005 -mmulhw -mno-mulhw @gol
1006 -mdlmzb -mno-dlmzb @gol
1007 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
1008 -mprototype  -mno-prototype @gol
1009 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
1010 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
1011 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
1012 -mno-recip-precision @gol
1013 -mveclibabi=@var{type} -mfriz -mno-friz @gol
1014 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
1015 -msave-toc-indirect -mno-save-toc-indirect @gol
1016 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
1017 -mcrypto -mno-crypto -mhtm -mno-htm -mdirect-move -mno-direct-move @gol
1018 -mquad-memory -mno-quad-memory @gol
1019 -mquad-memory-atomic -mno-quad-memory-atomic @gol
1020 -mcompat-align-parm -mno-compat-align-parm @gol
1021 -mupper-regs-df -mno-upper-regs-df -mupper-regs-sf -mno-upper-regs-sf @gol
1022 -mupper-regs-di -mno-upper-regs-di @gol
1023 -mupper-regs -mno-upper-regs @gol
1024 -mfloat128 -mno-float128 -mfloat128-hardware -mno-float128-hardware @gol
1025 -mgnu-attribute -mno-gnu-attribute @gol
1026 -mlra -mno-lra}
1028 @emph{RX Options}
1029 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
1030 -mcpu=@gol
1031 -mbig-endian-data -mlittle-endian-data @gol
1032 -msmall-data @gol
1033 -msim  -mno-sim@gol
1034 -mas100-syntax -mno-as100-syntax@gol
1035 -mrelax@gol
1036 -mmax-constant-size=@gol
1037 -mint-register=@gol
1038 -mpid@gol
1039 -mallow-string-insns -mno-allow-string-insns@gol
1040 -mjsr@gol
1041 -mno-warn-multiple-fast-interrupts@gol
1042 -msave-acc-in-interrupts}
1044 @emph{S/390 and zSeries Options}
1045 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1046 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
1047 -mlong-double-64 -mlong-double-128 @gol
1048 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
1049 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
1050 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
1051 -mhtm -mvx -mzvector @gol
1052 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
1053 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard @gol
1054 -mhotpatch=@var{halfwords},@var{halfwords}}
1056 @emph{Score Options}
1057 @gccoptlist{-meb -mel @gol
1058 -mnhwloop @gol
1059 -muls @gol
1060 -mmac @gol
1061 -mscore5 -mscore5u -mscore7 -mscore7d}
1063 @emph{SH Options}
1064 @gccoptlist{-m1  -m2  -m2e @gol
1065 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
1066 -m3  -m3e @gol
1067 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
1068 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
1069 -mb  -ml  -mdalign  -mrelax @gol
1070 -mbigtable -mfmovd -mrenesas -mno-renesas -mnomacsave @gol
1071 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
1072 -mprefergot -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
1073 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
1074 -maccumulate-outgoing-args @gol
1075 -matomic-model=@var{atomic-model} @gol
1076 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch @gol
1077 -mcbranch-force-delay-slot @gol
1078 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
1079 -mpretend-cmove -mtas}
1081 @emph{Solaris 2 Options}
1082 @gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text  -mno-impure-text @gol
1083 -pthreads -pthread}
1085 @emph{SPARC Options}
1086 @gccoptlist{-mcpu=@var{cpu-type} @gol
1087 -mtune=@var{cpu-type} @gol
1088 -mcmodel=@var{code-model} @gol
1089 -mmemory-model=@var{mem-model} @gol
1090 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1091 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1092 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1093 -mhard-quad-float  -msoft-quad-float @gol
1094 -mstack-bias  -mno-stack-bias @gol
1095 -mstd-struct-return  -mno-std-struct-return @gol
1096 -munaligned-doubles  -mno-unaligned-doubles @gol
1097 -muser-mode  -mno-user-mode @gol
1098 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1099 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1100 -mcbcond -mno-cbcond  -mfmaf  -mno-fmaf  @gol
1101 -mpopc  -mno-popc  -msubxc  -mno-subxc@gol
1102 -mfix-at697f -mfix-ut699}
1104 @emph{SPU Options}
1105 @gccoptlist{-mwarn-reloc -merror-reloc @gol
1106 -msafe-dma -munsafe-dma @gol
1107 -mbranch-hints @gol
1108 -msmall-mem -mlarge-mem -mstdmain @gol
1109 -mfixed-range=@var{register-range} @gol
1110 -mea32 -mea64 @gol
1111 -maddress-space-conversion -mno-address-space-conversion @gol
1112 -mcache-size=@var{cache-size} @gol
1113 -matomic-updates -mno-atomic-updates}
1115 @emph{System V Options}
1116 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1118 @emph{TILE-Gx Options}
1119 @gccoptlist{-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian @gol
1120 -mcmodel=@var{code-model}}
1122 @emph{TILEPro Options}
1123 @gccoptlist{-mcpu=@var{cpu} -m32}
1125 @emph{V850 Options}
1126 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1127 -mprolog-function  -mno-prolog-function  -mspace @gol
1128 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1129 -mapp-regs  -mno-app-regs @gol
1130 -mdisable-callt  -mno-disable-callt @gol
1131 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
1132 -mv850e -mv850 -mv850e3v5 @gol
1133 -mloop @gol
1134 -mrelax @gol
1135 -mlong-jumps @gol
1136 -msoft-float @gol
1137 -mhard-float @gol
1138 -mgcc-abi @gol
1139 -mrh850-abi @gol
1140 -mbig-switch}
1142 @emph{VAX Options}
1143 @gccoptlist{-mg  -mgnu  -munix}
1145 @emph{Visium Options}
1146 @gccoptlist{-mdebug -msim -mfpu -mno-fpu -mhard-float -msoft-float @gol
1147 -mcpu=@var{cpu-type} -mtune=@var{cpu-type} -msv-mode -muser-mode}
1149 @emph{VMS Options}
1150 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1151 -mpointer-size=@var{size}}
1153 @emph{VxWorks Options}
1154 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1155 -Xbind-lazy  -Xbind-now}
1157 @emph{x86 Options}
1158 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1159 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
1160 -mfpmath=@var{unit} @gol
1161 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1162 -mno-fp-ret-in-387 -m80387 -mhard-float -msoft-float @gol
1163 -mno-wide-multiply  -mrtd  -malign-double @gol
1164 -mpreferred-stack-boundary=@var{num} @gol
1165 -mincoming-stack-boundary=@var{num} @gol
1166 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
1167 -mrecip -mrecip=@var{opt} @gol
1168 -mvzeroupper -mprefer-avx128 @gol
1169 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
1170 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -mavx512vl @gol
1171 -mavx512bw -mavx512dq -mavx512ifma -mavx512vbmi -msha -maes @gol
1172 -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
1173 -mprefetchwt1 -mclflushopt -mxsavec -mxsaves @gol
1174 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
1175 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mmpx -mmwaitx -mclzero
1176 -mpku -mthreads @gol
1177 -mms-bitfields -mno-align-stringops  -minline-all-stringops @gol
1178 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
1179 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy} @gol
1180 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1181 -m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128 @gol
1182 -mregparm=@var{num}  -msseregparm @gol
1183 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
1184 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
1185 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
1186 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
1187 -m32 -m64 -mx32 -m16 -miamcu -mlarge-data-threshold=@var{num} @gol
1188 -msse2avx -mfentry -mrecord-mcount -mnop-mcount -m8bit-idiv @gol
1189 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
1190 -malign-data=@var{type} -mstack-protector-guard=@var{guard} @gol
1191 -mmitigate-rop -mgeneral-regs-only}
1193 @emph{x86 Windows Options}
1194 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
1195 -mnop-fun-dllimport -mthread @gol
1196 -municode -mwin32 -mwindows -fno-set-stack-executable}
1198 @emph{Xstormy16 Options}
1199 @gccoptlist{-msim}
1201 @emph{Xtensa Options}
1202 @gccoptlist{-mconst16 -mno-const16 @gol
1203 -mfused-madd  -mno-fused-madd @gol
1204 -mforce-no-pic @gol
1205 -mserialize-volatile  -mno-serialize-volatile @gol
1206 -mtext-section-literals  -mno-text-section-literals @gol
1207 -mauto-litpools  -mno-auto-litpools @gol
1208 -mtarget-align  -mno-target-align @gol
1209 -mlongcalls  -mno-longcalls}
1211 @emph{zSeries Options}
1212 See S/390 and zSeries Options.
1213 @end table
1216 @node Overall Options
1217 @section Options Controlling the Kind of Output
1219 Compilation can involve up to four stages: preprocessing, compilation
1220 proper, assembly and linking, always in that order.  GCC is capable of
1221 preprocessing and compiling several files either into several
1222 assembler input files, or into one assembler input file; then each
1223 assembler input file produces an object file, and linking combines all
1224 the object files (those newly compiled, and those specified as input)
1225 into an executable file.
1227 @cindex file name suffix
1228 For any given input file, the file name suffix determines what kind of
1229 compilation is done:
1231 @table @gcctabopt
1232 @item @var{file}.c
1233 C source code that must be preprocessed.
1235 @item @var{file}.i
1236 C source code that should not be preprocessed.
1238 @item @var{file}.ii
1239 C++ source code that should not be preprocessed.
1241 @item @var{file}.m
1242 Objective-C source code.  Note that you must link with the @file{libobjc}
1243 library to make an Objective-C program work.
1245 @item @var{file}.mi
1246 Objective-C source code that should not be preprocessed.
1248 @item @var{file}.mm
1249 @itemx @var{file}.M
1250 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1251 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1252 to a literal capital M@.
1254 @item @var{file}.mii
1255 Objective-C++ source code that should not be preprocessed.
1257 @item @var{file}.h
1258 C, C++, Objective-C or Objective-C++ header file to be turned into a
1259 precompiled header (default), or C, C++ header file to be turned into an
1260 Ada spec (via the @option{-fdump-ada-spec} switch).
1262 @item @var{file}.cc
1263 @itemx @var{file}.cp
1264 @itemx @var{file}.cxx
1265 @itemx @var{file}.cpp
1266 @itemx @var{file}.CPP
1267 @itemx @var{file}.c++
1268 @itemx @var{file}.C
1269 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1270 the last two letters must both be literally @samp{x}.  Likewise,
1271 @samp{.C} refers to a literal capital C@.
1273 @item @var{file}.mm
1274 @itemx @var{file}.M
1275 Objective-C++ source code that must be preprocessed.
1277 @item @var{file}.mii
1278 Objective-C++ source code that should not be preprocessed.
1280 @item @var{file}.hh
1281 @itemx @var{file}.H
1282 @itemx @var{file}.hp
1283 @itemx @var{file}.hxx
1284 @itemx @var{file}.hpp
1285 @itemx @var{file}.HPP
1286 @itemx @var{file}.h++
1287 @itemx @var{file}.tcc
1288 C++ header file to be turned into a precompiled header or Ada spec.
1290 @item @var{file}.f
1291 @itemx @var{file}.for
1292 @itemx @var{file}.ftn
1293 Fixed form Fortran source code that should not be preprocessed.
1295 @item @var{file}.F
1296 @itemx @var{file}.FOR
1297 @itemx @var{file}.fpp
1298 @itemx @var{file}.FPP
1299 @itemx @var{file}.FTN
1300 Fixed form Fortran source code that must be preprocessed (with the traditional
1301 preprocessor).
1303 @item @var{file}.f90
1304 @itemx @var{file}.f95
1305 @itemx @var{file}.f03
1306 @itemx @var{file}.f08
1307 Free form Fortran source code that should not be preprocessed.
1309 @item @var{file}.F90
1310 @itemx @var{file}.F95
1311 @itemx @var{file}.F03
1312 @itemx @var{file}.F08
1313 Free form Fortran source code that must be preprocessed (with the
1314 traditional preprocessor).
1316 @item @var{file}.go
1317 Go source code.
1319 @item @var{file}.ads
1320 Ada source code file that contains a library unit declaration (a
1321 declaration of a package, subprogram, or generic, or a generic
1322 instantiation), or a library unit renaming declaration (a package,
1323 generic, or subprogram renaming declaration).  Such files are also
1324 called @dfn{specs}.
1326 @item @var{file}.adb
1327 Ada source code file containing a library unit body (a subprogram or
1328 package body).  Such files are also called @dfn{bodies}.
1330 @c GCC also knows about some suffixes for languages not yet included:
1331 @c Pascal:
1332 @c @var{file}.p
1333 @c @var{file}.pas
1334 @c Ratfor:
1335 @c @var{file}.r
1337 @item @var{file}.s
1338 Assembler code.
1340 @item @var{file}.S
1341 @itemx @var{file}.sx
1342 Assembler code that must be preprocessed.
1344 @item @var{other}
1345 An object file to be fed straight into linking.
1346 Any file name with no recognized suffix is treated this way.
1347 @end table
1349 @opindex x
1350 You can specify the input language explicitly with the @option{-x} option:
1352 @table @gcctabopt
1353 @item -x @var{language}
1354 Specify explicitly the @var{language} for the following input files
1355 (rather than letting the compiler choose a default based on the file
1356 name suffix).  This option applies to all following input files until
1357 the next @option{-x} option.  Possible values for @var{language} are:
1358 @smallexample
1359 c  c-header  cpp-output
1360 c++  c++-header  c++-cpp-output
1361 objective-c  objective-c-header  objective-c-cpp-output
1362 objective-c++ objective-c++-header objective-c++-cpp-output
1363 assembler  assembler-with-cpp
1365 f77  f77-cpp-input f95  f95-cpp-input
1367 @end smallexample
1369 @item -x none
1370 Turn off any specification of a language, so that subsequent files are
1371 handled according to their file name suffixes (as they are if @option{-x}
1372 has not been used at all).
1373 @end table
1375 If you only want some of the stages of compilation, you can use
1376 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1377 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1378 @command{gcc} is to stop.  Note that some combinations (for example,
1379 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1381 @table @gcctabopt
1382 @item -c
1383 @opindex c
1384 Compile or assemble the source files, but do not link.  The linking
1385 stage simply is not done.  The ultimate output is in the form of an
1386 object file for each source file.
1388 By default, the object file name for a source file is made by replacing
1389 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1391 Unrecognized input files, not requiring compilation or assembly, are
1392 ignored.
1394 @item -S
1395 @opindex S
1396 Stop after the stage of compilation proper; do not assemble.  The output
1397 is in the form of an assembler code file for each non-assembler input
1398 file specified.
1400 By default, the assembler file name for a source file is made by
1401 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1403 Input files that don't require compilation are ignored.
1405 @item -E
1406 @opindex E
1407 Stop after the preprocessing stage; do not run the compiler proper.  The
1408 output is in the form of preprocessed source code, which is sent to the
1409 standard output.
1411 Input files that don't require preprocessing are ignored.
1413 @cindex output file option
1414 @item -o @var{file}
1415 @opindex o
1416 Place output in file @var{file}.  This applies to whatever
1417 sort of output is being produced, whether it be an executable file,
1418 an object file, an assembler file or preprocessed C code.
1420 If @option{-o} is not specified, the default is to put an executable
1421 file in @file{a.out}, the object file for
1422 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1423 assembler file in @file{@var{source}.s}, a precompiled header file in
1424 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1425 standard output.
1427 @item -v
1428 @opindex v
1429 Print (on standard error output) the commands executed to run the stages
1430 of compilation.  Also print the version number of the compiler driver
1431 program and of the preprocessor and the compiler proper.
1433 @item -###
1434 @opindex ###
1435 Like @option{-v} except the commands are not executed and arguments
1436 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1437 This is useful for shell scripts to capture the driver-generated command lines.
1439 @item --help
1440 @opindex help
1441 Print (on the standard output) a description of the command-line options
1442 understood by @command{gcc}.  If the @option{-v} option is also specified
1443 then @option{--help} is also passed on to the various processes
1444 invoked by @command{gcc}, so that they can display the command-line options
1445 they accept.  If the @option{-Wextra} option has also been specified
1446 (prior to the @option{--help} option), then command-line options that
1447 have no documentation associated with them are also displayed.
1449 @item --target-help
1450 @opindex target-help
1451 Print (on the standard output) a description of target-specific command-line
1452 options for each tool.  For some targets extra target-specific
1453 information may also be printed.
1455 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1456 Print (on the standard output) a description of the command-line
1457 options understood by the compiler that fit into all specified classes
1458 and qualifiers.  These are the supported classes:
1460 @table @asis
1461 @item @samp{optimizers}
1462 Display all of the optimization options supported by the
1463 compiler.
1465 @item @samp{warnings}
1466 Display all of the options controlling warning messages
1467 produced by the compiler.
1469 @item @samp{target}
1470 Display target-specific options.  Unlike the
1471 @option{--target-help} option however, target-specific options of the
1472 linker and assembler are not displayed.  This is because those
1473 tools do not currently support the extended @option{--help=} syntax.
1475 @item @samp{params}
1476 Display the values recognized by the @option{--param}
1477 option.
1479 @item @var{language}
1480 Display the options supported for @var{language}, where
1481 @var{language} is the name of one of the languages supported in this
1482 version of GCC@.
1484 @item @samp{common}
1485 Display the options that are common to all languages.
1486 @end table
1488 These are the supported qualifiers:
1490 @table @asis
1491 @item @samp{undocumented}
1492 Display only those options that are undocumented.
1494 @item @samp{joined}
1495 Display options taking an argument that appears after an equal
1496 sign in the same continuous piece of text, such as:
1497 @samp{--help=target}.
1499 @item @samp{separate}
1500 Display options taking an argument that appears as a separate word
1501 following the original option, such as: @samp{-o output-file}.
1502 @end table
1504 Thus for example to display all the undocumented target-specific
1505 switches supported by the compiler, use:
1507 @smallexample
1508 --help=target,undocumented
1509 @end smallexample
1511 The sense of a qualifier can be inverted by prefixing it with the
1512 @samp{^} character, so for example to display all binary warning
1513 options (i.e., ones that are either on or off and that do not take an
1514 argument) that have a description, use:
1516 @smallexample
1517 --help=warnings,^joined,^undocumented
1518 @end smallexample
1520 The argument to @option{--help=} should not consist solely of inverted
1521 qualifiers.
1523 Combining several classes is possible, although this usually
1524 restricts the output so much that there is nothing to display.  One
1525 case where it does work, however, is when one of the classes is
1526 @var{target}.  For example, to display all the target-specific
1527 optimization options, use:
1529 @smallexample
1530 --help=target,optimizers
1531 @end smallexample
1533 The @option{--help=} option can be repeated on the command line.  Each
1534 successive use displays its requested class of options, skipping
1535 those that have already been displayed.
1537 If the @option{-Q} option appears on the command line before the
1538 @option{--help=} option, then the descriptive text displayed by
1539 @option{--help=} is changed.  Instead of describing the displayed
1540 options, an indication is given as to whether the option is enabled,
1541 disabled or set to a specific value (assuming that the compiler
1542 knows this at the point where the @option{--help=} option is used).
1544 Here is a truncated example from the ARM port of @command{gcc}:
1546 @smallexample
1547   % gcc -Q -mabi=2 --help=target -c
1548   The following options are target specific:
1549   -mabi=                                2
1550   -mabort-on-noreturn                   [disabled]
1551   -mapcs                                [disabled]
1552 @end smallexample
1554 The output is sensitive to the effects of previous command-line
1555 options, so for example it is possible to find out which optimizations
1556 are enabled at @option{-O2} by using:
1558 @smallexample
1559 -Q -O2 --help=optimizers
1560 @end smallexample
1562 Alternatively you can discover which binary optimizations are enabled
1563 by @option{-O3} by using:
1565 @smallexample
1566 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1567 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1568 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1569 @end smallexample
1571 @item --version
1572 @opindex version
1573 Display the version number and copyrights of the invoked GCC@.
1575 @item -pass-exit-codes
1576 @opindex pass-exit-codes
1577 Normally the @command{gcc} program exits with the code of 1 if any
1578 phase of the compiler returns a non-success return code.  If you specify
1579 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1580 the numerically highest error produced by any phase returning an error
1581 indication.  The C, C++, and Fortran front ends return 4 if an internal
1582 compiler error is encountered.
1584 @item -pipe
1585 @opindex pipe
1586 Use pipes rather than temporary files for communication between the
1587 various stages of compilation.  This fails to work on some systems where
1588 the assembler is unable to read from a pipe; but the GNU assembler has
1589 no trouble.
1591 @item -specs=@var{file}
1592 @opindex specs
1593 Process @var{file} after the compiler reads in the standard @file{specs}
1594 file, in order to override the defaults which the @command{gcc} driver
1595 program uses when determining what switches to pass to @command{cc1},
1596 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
1597 @option{-specs=@var{file}} can be specified on the command line, and they
1598 are processed in order, from left to right.  @xref{Spec Files}, for
1599 information about the format of the @var{file}.
1601 @item -wrapper
1602 @opindex wrapper
1603 Invoke all subcommands under a wrapper program.  The name of the
1604 wrapper program and its parameters are passed as a comma separated
1605 list.
1607 @smallexample
1608 gcc -c t.c -wrapper gdb,--args
1609 @end smallexample
1611 @noindent
1612 This invokes all subprograms of @command{gcc} under
1613 @samp{gdb --args}, thus the invocation of @command{cc1} is
1614 @samp{gdb --args cc1 @dots{}}.
1616 @item -fplugin=@var{name}.so
1617 @opindex fplugin
1618 Load the plugin code in file @var{name}.so, assumed to be a
1619 shared object to be dlopen'd by the compiler.  The base name of
1620 the shared object file is used to identify the plugin for the
1621 purposes of argument parsing (See
1622 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1623 Each plugin should define the callback functions specified in the
1624 Plugins API.
1626 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1627 @opindex fplugin-arg
1628 Define an argument called @var{key} with a value of @var{value}
1629 for the plugin called @var{name}.
1631 @item -fdump-ada-spec@r{[}-slim@r{]}
1632 @opindex fdump-ada-spec
1633 For C and C++ source and include files, generate corresponding Ada specs.
1634 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1635 GNAT User's Guide}, which provides detailed documentation on this feature.
1637 @item -fada-spec-parent=@var{unit}
1638 @opindex fada-spec-parent
1639 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1640 Ada specs as child units of parent @var{unit}.
1642 @item -fdump-go-spec=@var{file}
1643 @opindex fdump-go-spec
1644 For input files in any language, generate corresponding Go
1645 declarations in @var{file}.  This generates Go @code{const},
1646 @code{type}, @code{var}, and @code{func} declarations which may be a
1647 useful way to start writing a Go interface to code written in some
1648 other language.
1650 @include @value{srcdir}/../libiberty/at-file.texi
1651 @end table
1653 @node Invoking G++
1654 @section Compiling C++ Programs
1656 @cindex suffixes for C++ source
1657 @cindex C++ source file suffixes
1658 C++ source files conventionally use one of the suffixes @samp{.C},
1659 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1660 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1661 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1662 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1663 files with these names and compiles them as C++ programs even if you
1664 call the compiler the same way as for compiling C programs (usually
1665 with the name @command{gcc}).
1667 @findex g++
1668 @findex c++
1669 However, the use of @command{gcc} does not add the C++ library.
1670 @command{g++} is a program that calls GCC and automatically specifies linking
1671 against the C++ library.  It treats @samp{.c},
1672 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1673 files unless @option{-x} is used.  This program is also useful when
1674 precompiling a C header file with a @samp{.h} extension for use in C++
1675 compilations.  On many systems, @command{g++} is also installed with
1676 the name @command{c++}.
1678 @cindex invoking @command{g++}
1679 When you compile C++ programs, you may specify many of the same
1680 command-line options that you use for compiling programs in any
1681 language; or command-line options meaningful for C and related
1682 languages; or options that are meaningful only for C++ programs.
1683 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1684 explanations of options for languages related to C@.
1685 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1686 explanations of options that are meaningful only for C++ programs.
1688 @node C Dialect Options
1689 @section Options Controlling C Dialect
1690 @cindex dialect options
1691 @cindex language dialect options
1692 @cindex options, dialect
1694 The following options control the dialect of C (or languages derived
1695 from C, such as C++, Objective-C and Objective-C++) that the compiler
1696 accepts:
1698 @table @gcctabopt
1699 @cindex ANSI support
1700 @cindex ISO support
1701 @item -ansi
1702 @opindex ansi
1703 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1704 equivalent to @option{-std=c++98}.
1706 This turns off certain features of GCC that are incompatible with ISO
1707 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1708 such as the @code{asm} and @code{typeof} keywords, and
1709 predefined macros such as @code{unix} and @code{vax} that identify the
1710 type of system you are using.  It also enables the undesirable and
1711 rarely used ISO trigraph feature.  For the C compiler,
1712 it disables recognition of C++ style @samp{//} comments as well as
1713 the @code{inline} keyword.
1715 The alternate keywords @code{__asm__}, @code{__extension__},
1716 @code{__inline__} and @code{__typeof__} continue to work despite
1717 @option{-ansi}.  You would not want to use them in an ISO C program, of
1718 course, but it is useful to put them in header files that might be included
1719 in compilations done with @option{-ansi}.  Alternate predefined macros
1720 such as @code{__unix__} and @code{__vax__} are also available, with or
1721 without @option{-ansi}.
1723 The @option{-ansi} option does not cause non-ISO programs to be
1724 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1725 addition to @option{-ansi}.  @xref{Warning Options}.
1727 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1728 option is used.  Some header files may notice this macro and refrain
1729 from declaring certain functions or defining certain macros that the
1730 ISO standard doesn't call for; this is to avoid interfering with any
1731 programs that might use these names for other things.
1733 Functions that are normally built in but do not have semantics
1734 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1735 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1736 built-in functions provided by GCC}, for details of the functions
1737 affected.
1739 @item -std=
1740 @opindex std
1741 Determine the language standard. @xref{Standards,,Language Standards
1742 Supported by GCC}, for details of these standard versions.  This option
1743 is currently only supported when compiling C or C++.
1745 The compiler can accept several base standards, such as @samp{c90} or
1746 @samp{c++98}, and GNU dialects of those standards, such as
1747 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1748 compiler accepts all programs following that standard plus those
1749 using GNU extensions that do not contradict it.  For example,
1750 @option{-std=c90} turns off certain features of GCC that are
1751 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1752 keywords, but not other GNU extensions that do not have a meaning in
1753 ISO C90, such as omitting the middle term of a @code{?:}
1754 expression. On the other hand, when a GNU dialect of a standard is
1755 specified, all features supported by the compiler are enabled, even when
1756 those features change the meaning of the base standard.  As a result, some
1757 strict-conforming programs may be rejected.  The particular standard
1758 is used by @option{-Wpedantic} to identify which features are GNU
1759 extensions given that version of the standard. For example
1760 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1761 comments, while @option{-std=gnu99 -Wpedantic} does not.
1763 A value for this option must be provided; possible values are
1765 @table @samp
1766 @item c90
1767 @itemx c89
1768 @itemx iso9899:1990
1769 Support all ISO C90 programs (certain GNU extensions that conflict
1770 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1772 @item iso9899:199409
1773 ISO C90 as modified in amendment 1.
1775 @item c99
1776 @itemx c9x
1777 @itemx iso9899:1999
1778 @itemx iso9899:199x
1779 ISO C99.  This standard is substantially completely supported, modulo
1780 bugs and floating-point issues
1781 (mainly but not entirely relating to optional C99 features from
1782 Annexes F and G).  See
1783 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1784 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1786 @item c11
1787 @itemx c1x
1788 @itemx iso9899:2011
1789 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1790 substantially completely supported, modulo bugs, floating-point issues
1791 (mainly but not entirely relating to optional C11 features from
1792 Annexes F and G) and the optional Annexes K (Bounds-checking
1793 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1795 @item gnu90
1796 @itemx gnu89
1797 GNU dialect of ISO C90 (including some C99 features).
1799 @item gnu99
1800 @itemx gnu9x
1801 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1803 @item gnu11
1804 @itemx gnu1x
1805 GNU dialect of ISO C11.  This is the default for C code.
1806 The name @samp{gnu1x} is deprecated.
1808 @item c++98
1809 @itemx c++03
1810 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1811 additional defect reports. Same as @option{-ansi} for C++ code.
1813 @item gnu++98
1814 @itemx gnu++03
1815 GNU dialect of @option{-std=c++98}.
1817 @item c++11
1818 @itemx c++0x
1819 The 2011 ISO C++ standard plus amendments.
1820 The name @samp{c++0x} is deprecated.
1822 @item gnu++11
1823 @itemx gnu++0x
1824 GNU dialect of @option{-std=c++11}.
1825 The name @samp{gnu++0x} is deprecated.
1827 @item c++14
1828 @itemx c++1y
1829 The 2014 ISO C++ standard plus amendments.
1830 The name @samp{c++1y} is deprecated.
1832 @item gnu++14
1833 @itemx gnu++1y
1834 GNU dialect of @option{-std=c++14}.
1835 This is the default for C++ code.
1836 The name @samp{gnu++1y} is deprecated.
1838 @item c++1z
1839 The next revision of the ISO C++ standard, tentatively planned for
1840 2017.  Support is highly experimental, and will almost certainly
1841 change in incompatible ways in future releases.
1843 @item gnu++1z
1844 GNU dialect of @option{-std=c++1z}.  Support is highly experimental,
1845 and will almost certainly change in incompatible ways in future
1846 releases.
1847 @end table
1849 @item -fgnu89-inline
1850 @opindex fgnu89-inline
1851 The option @option{-fgnu89-inline} tells GCC to use the traditional
1852 GNU semantics for @code{inline} functions when in C99 mode.
1853 @xref{Inline,,An Inline Function is As Fast As a Macro}.
1854 Using this option is roughly equivalent to adding the
1855 @code{gnu_inline} function attribute to all inline functions
1856 (@pxref{Function Attributes}).
1858 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1859 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1860 specifies the default behavior).
1861 This option is not supported in @option{-std=c90} or
1862 @option{-std=gnu90} mode.
1864 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1865 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1866 in effect for @code{inline} functions.  @xref{Common Predefined
1867 Macros,,,cpp,The C Preprocessor}.
1869 @item -aux-info @var{filename}
1870 @opindex aux-info
1871 Output to the given filename prototyped declarations for all functions
1872 declared and/or defined in a translation unit, including those in header
1873 files.  This option is silently ignored in any language other than C@.
1875 Besides declarations, the file indicates, in comments, the origin of
1876 each declaration (source file and line), whether the declaration was
1877 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1878 @samp{O} for old, respectively, in the first character after the line
1879 number and the colon), and whether it came from a declaration or a
1880 definition (@samp{C} or @samp{F}, respectively, in the following
1881 character).  In the case of function definitions, a K&R-style list of
1882 arguments followed by their declarations is also provided, inside
1883 comments, after the declaration.
1885 @item -fallow-parameterless-variadic-functions
1886 @opindex fallow-parameterless-variadic-functions
1887 Accept variadic functions without named parameters.
1889 Although it is possible to define such a function, this is not very
1890 useful as it is not possible to read the arguments.  This is only
1891 supported for C as this construct is allowed by C++.
1893 @item -fno-asm
1894 @opindex fno-asm
1895 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1896 keyword, so that code can use these words as identifiers.  You can use
1897 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1898 instead.  @option{-ansi} implies @option{-fno-asm}.
1900 In C++, this switch only affects the @code{typeof} keyword, since
1901 @code{asm} and @code{inline} are standard keywords.  You may want to
1902 use the @option{-fno-gnu-keywords} flag instead, which has the same
1903 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1904 switch only affects the @code{asm} and @code{typeof} keywords, since
1905 @code{inline} is a standard keyword in ISO C99.
1907 @item -fno-builtin
1908 @itemx -fno-builtin-@var{function}
1909 @opindex fno-builtin
1910 @cindex built-in functions
1911 Don't recognize built-in functions that do not begin with
1912 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1913 functions provided by GCC}, for details of the functions affected,
1914 including those which are not built-in functions when @option{-ansi} or
1915 @option{-std} options for strict ISO C conformance are used because they
1916 do not have an ISO standard meaning.
1918 GCC normally generates special code to handle certain built-in functions
1919 more efficiently; for instance, calls to @code{alloca} may become single
1920 instructions which adjust the stack directly, and calls to @code{memcpy}
1921 may become inline copy loops.  The resulting code is often both smaller
1922 and faster, but since the function calls no longer appear as such, you
1923 cannot set a breakpoint on those calls, nor can you change the behavior
1924 of the functions by linking with a different library.  In addition,
1925 when a function is recognized as a built-in function, GCC may use
1926 information about that function to warn about problems with calls to
1927 that function, or to generate more efficient code, even if the
1928 resulting code still contains calls to that function.  For example,
1929 warnings are given with @option{-Wformat} for bad calls to
1930 @code{printf} when @code{printf} is built in and @code{strlen} is
1931 known not to modify global memory.
1933 With the @option{-fno-builtin-@var{function}} option
1934 only the built-in function @var{function} is
1935 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1936 function is named that is not built-in in this version of GCC, this
1937 option is ignored.  There is no corresponding
1938 @option{-fbuiltin-@var{function}} option; if you wish to enable
1939 built-in functions selectively when using @option{-fno-builtin} or
1940 @option{-ffreestanding}, you may define macros such as:
1942 @smallexample
1943 #define abs(n)          __builtin_abs ((n))
1944 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1945 @end smallexample
1947 @item -fgimple
1948 @opindex fgimple
1950 Enable parsing of function definitions marked with @code{__GIMPLE}.
1951 This is an experimental feature that allows unit testing of GIMPLE
1952 passes.
1954 @item -fhosted
1955 @opindex fhosted
1956 @cindex hosted environment
1958 Assert that compilation targets a hosted environment.  This implies
1959 @option{-fbuiltin}.  A hosted environment is one in which the
1960 entire standard library is available, and in which @code{main} has a return
1961 type of @code{int}.  Examples are nearly everything except a kernel.
1962 This is equivalent to @option{-fno-freestanding}.
1964 @item -ffreestanding
1965 @opindex ffreestanding
1966 @cindex hosted environment
1968 Assert that compilation targets a freestanding environment.  This
1969 implies @option{-fno-builtin}.  A freestanding environment
1970 is one in which the standard library may not exist, and program startup may
1971 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1972 This is equivalent to @option{-fno-hosted}.
1974 @xref{Standards,,Language Standards Supported by GCC}, for details of
1975 freestanding and hosted environments.
1977 @item -fopenacc
1978 @opindex fopenacc
1979 @cindex OpenACC accelerator programming
1980 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
1981 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
1982 compiler generates accelerated code according to the OpenACC Application
1983 Programming Interface v2.0 @w{@uref{http://www.openacc.org/}}.  This option
1984 implies @option{-pthread}, and thus is only supported on targets that
1985 have support for @option{-pthread}.
1987 @item -fopenacc-dim=@var{geom}
1988 @opindex fopenacc-dim
1989 @cindex OpenACC accelerator programming
1990 Specify default compute dimensions for parallel offload regions that do
1991 not explicitly specify.  The @var{geom} value is a triple of
1992 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'.  A size
1993 can be omitted, to use a target-specific default value.
1995 @item -fopenmp
1996 @opindex fopenmp
1997 @cindex OpenMP parallel
1998 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1999 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
2000 compiler generates parallel code according to the OpenMP Application
2001 Program Interface v4.0 @w{@uref{http://www.openmp.org/}}.  This option
2002 implies @option{-pthread}, and thus is only supported on targets that
2003 have support for @option{-pthread}. @option{-fopenmp} implies
2004 @option{-fopenmp-simd}.
2006 @item -fopenmp-simd
2007 @opindex fopenmp-simd
2008 @cindex OpenMP SIMD
2009 @cindex SIMD
2010 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
2011 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
2012 are ignored.
2014 @item -fcilkplus
2015 @opindex fcilkplus
2016 @cindex Enable Cilk Plus
2017 Enable the usage of Cilk Plus language extension features for C/C++.
2018 When the option @option{-fcilkplus} is specified, enable the usage of
2019 the Cilk Plus Language extension features for C/C++.  The present
2020 implementation follows ABI version 1.2.  This is an experimental
2021 feature that is only partially complete, and whose interface may
2022 change in future versions of GCC as the official specification
2023 changes.  Currently, all features but @code{_Cilk_for} have been
2024 implemented.
2026 @item -fgnu-tm
2027 @opindex fgnu-tm
2028 When the option @option{-fgnu-tm} is specified, the compiler
2029 generates code for the Linux variant of Intel's current Transactional
2030 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
2031 an experimental feature whose interface may change in future versions
2032 of GCC, as the official specification changes.  Please note that not
2033 all architectures are supported for this feature.
2035 For more information on GCC's support for transactional memory,
2036 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
2037 Transactional Memory Library}.
2039 Note that the transactional memory feature is not supported with
2040 non-call exceptions (@option{-fnon-call-exceptions}).
2042 @item -fms-extensions
2043 @opindex fms-extensions
2044 Accept some non-standard constructs used in Microsoft header files.
2046 In C++ code, this allows member names in structures to be similar
2047 to previous types declarations.
2049 @smallexample
2050 typedef int UOW;
2051 struct ABC @{
2052   UOW UOW;
2054 @end smallexample
2056 Some cases of unnamed fields in structures and unions are only
2057 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
2058 fields within structs/unions}, for details.
2060 Note that this option is off for all targets but x86 
2061 targets using ms-abi.
2063 @item -fplan9-extensions
2064 @opindex fplan9-extensions
2065 Accept some non-standard constructs used in Plan 9 code.
2067 This enables @option{-fms-extensions}, permits passing pointers to
2068 structures with anonymous fields to functions that expect pointers to
2069 elements of the type of the field, and permits referring to anonymous
2070 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
2071 struct/union fields within structs/unions}, for details.  This is only
2072 supported for C, not C++.
2074 @item -trigraphs
2075 @opindex trigraphs
2076 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
2077 options for strict ISO C conformance) implies @option{-trigraphs}.
2079 @cindex traditional C language
2080 @cindex C language, traditional
2081 @item -traditional
2082 @itemx -traditional-cpp
2083 @opindex traditional-cpp
2084 @opindex traditional
2085 Formerly, these options caused GCC to attempt to emulate a pre-standard
2086 C compiler.  They are now only supported with the @option{-E} switch.
2087 The preprocessor continues to support a pre-standard mode.  See the GNU
2088 CPP manual for details.
2090 @item -fcond-mismatch
2091 @opindex fcond-mismatch
2092 Allow conditional expressions with mismatched types in the second and
2093 third arguments.  The value of such an expression is void.  This option
2094 is not supported for C++.
2096 @item -flax-vector-conversions
2097 @opindex flax-vector-conversions
2098 Allow implicit conversions between vectors with differing numbers of
2099 elements and/or incompatible element types.  This option should not be
2100 used for new code.
2102 @item -funsigned-char
2103 @opindex funsigned-char
2104 Let the type @code{char} be unsigned, like @code{unsigned char}.
2106 Each kind of machine has a default for what @code{char} should
2107 be.  It is either like @code{unsigned char} by default or like
2108 @code{signed char} by default.
2110 Ideally, a portable program should always use @code{signed char} or
2111 @code{unsigned char} when it depends on the signedness of an object.
2112 But many programs have been written to use plain @code{char} and
2113 expect it to be signed, or expect it to be unsigned, depending on the
2114 machines they were written for.  This option, and its inverse, let you
2115 make such a program work with the opposite default.
2117 The type @code{char} is always a distinct type from each of
2118 @code{signed char} or @code{unsigned char}, even though its behavior
2119 is always just like one of those two.
2121 @item -fsigned-char
2122 @opindex fsigned-char
2123 Let the type @code{char} be signed, like @code{signed char}.
2125 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2126 the negative form of @option{-funsigned-char}.  Likewise, the option
2127 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2129 @item -fsigned-bitfields
2130 @itemx -funsigned-bitfields
2131 @itemx -fno-signed-bitfields
2132 @itemx -fno-unsigned-bitfields
2133 @opindex fsigned-bitfields
2134 @opindex funsigned-bitfields
2135 @opindex fno-signed-bitfields
2136 @opindex fno-unsigned-bitfields
2137 These options control whether a bit-field is signed or unsigned, when the
2138 declaration does not use either @code{signed} or @code{unsigned}.  By
2139 default, such a bit-field is signed, because this is consistent: the
2140 basic integer types such as @code{int} are signed types.
2142 @item -fsso-struct=@var{endianness}
2143 @opindex fsso-struct
2144 Set the default scalar storage order of structures and unions to the
2145 specified endianness.  The accepted values are @samp{big-endian} and
2146 @samp{little-endian}.  If the option is not passed, the compiler uses
2147 the native endianness of the target.  This option is not supported for C++.
2149 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
2150 code that is not binary compatible with code generated without it if the
2151 specified endianness is not the native endianness of the target.
2152 @end table
2154 @node C++ Dialect Options
2155 @section Options Controlling C++ Dialect
2157 @cindex compiler options, C++
2158 @cindex C++ options, command-line
2159 @cindex options, C++
2160 This section describes the command-line options that are only meaningful
2161 for C++ programs.  You can also use most of the GNU compiler options
2162 regardless of what language your program is in.  For example, you
2163 might compile a file @file{firstClass.C} like this:
2165 @smallexample
2166 g++ -g -fstrict-enums -O -c firstClass.C
2167 @end smallexample
2169 @noindent
2170 In this example, only @option{-fstrict-enums} is an option meant
2171 only for C++ programs; you can use the other options with any
2172 language supported by GCC@.
2174 Some options for compiling C programs, such as @option{-std}, are also
2175 relevant for C++ programs.
2176 @xref{C Dialect Options,,Options Controlling C Dialect}.
2178 Here is a list of options that are @emph{only} for compiling C++ programs:
2180 @table @gcctabopt
2182 @item -fabi-version=@var{n}
2183 @opindex fabi-version
2184 Use version @var{n} of the C++ ABI@.  The default is version 0.
2186 Version 0 refers to the version conforming most closely to
2187 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2188 will change in different versions of G++ as ABI bugs are fixed.
2190 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2192 Version 2 is the version of the C++ ABI that first appeared in G++
2193 3.4, and was the default through G++ 4.9.
2195 Version 3 corrects an error in mangling a constant address as a
2196 template argument.
2198 Version 4, which first appeared in G++ 4.5, implements a standard
2199 mangling for vector types.
2201 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2202 attribute const/volatile on function pointer types, decltype of a
2203 plain decl, and use of a function parameter in the declaration of
2204 another parameter.
2206 Version 6, which first appeared in G++ 4.7, corrects the promotion
2207 behavior of C++11 scoped enums and the mangling of template argument
2208 packs, const/static_cast, prefix ++ and --, and a class scope function
2209 used as a template argument.
2211 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2212 builtin type and corrects the mangling of lambdas in default argument
2213 scope.
2215 Version 8, which first appeared in G++ 4.9, corrects the substitution
2216 behavior of function types with function-cv-qualifiers.
2218 Version 9, which first appeared in G++ 5.2, corrects the alignment of
2219 @code{nullptr_t}.
2221 Version 10, which first appeared in G++ 6.1, adds mangling of
2222 attributes that affect type identity, such as ia32 calling convention
2223 attributes (e.g. @samp{stdcall}).
2225 Version 11, which first appeared in G++ 7, corrects the mangling of
2226 sizeof... expressions.  It also implies
2227 @option{-fnew-inheriting-ctors}.
2229 See also @option{-Wabi}.
2231 @item -fabi-compat-version=@var{n}
2232 @opindex fabi-compat-version
2233 On targets that support strong aliases, G++
2234 works around mangling changes by creating an alias with the correct
2235 mangled name when defining a symbol with an incorrect mangled name.
2236 This switch specifies which ABI version to use for the alias.
2238 With @option{-fabi-version=0} (the default), this defaults to 8 (GCC 5
2239 compatibility).  If another ABI version is explicitly selected, this
2240 defaults to 0.  For compatibility with GCC versions 3.2 through 4.9,
2241 use @option{-fabi-compat-version=2}.
2243 If this option is not provided but @option{-Wabi=@var{n}} is, that
2244 version is used for compatibility aliases.  If this option is provided
2245 along with @option{-Wabi} (without the version), the version from this
2246 option is used for the warning.
2248 @item -fno-access-control
2249 @opindex fno-access-control
2250 Turn off all access checking.  This switch is mainly useful for working
2251 around bugs in the access control code.
2253 @item -faligned-new
2254 @opindex faligned-new
2255 Enable support for C++17 @code{new} of types that require more
2256 alignment than @code{void* ::operator new(std::size_t)} provides.  A
2257 numeric argument such as @code{-faligned-new=32} can be used to
2258 specify how much alignment (in bytes) is provided by that function,
2259 but few users will need to override the default of
2260 @code{alignof(std::max_align_t)}.
2262 @item -fcheck-new
2263 @opindex fcheck-new
2264 Check that the pointer returned by @code{operator new} is non-null
2265 before attempting to modify the storage allocated.  This check is
2266 normally unnecessary because the C++ standard specifies that
2267 @code{operator new} only returns @code{0} if it is declared
2268 @code{throw()}, in which case the compiler always checks the
2269 return value even without this option.  In all other cases, when
2270 @code{operator new} has a non-empty exception specification, memory
2271 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2272 @samp{new (nothrow)}.
2274 @item -fconcepts
2275 @opindex fconcepts
2276 Enable support for the C++ Extensions for Concepts Technical
2277 Specification, ISO 19217 (2015), which allows code like
2279 @smallexample
2280 template <class T> concept bool Addable = requires (T t) @{ t + t; @};
2281 template <Addable T> T add (T a, T b) @{ return a + b; @}
2282 @end smallexample
2284 @item -fconstexpr-depth=@var{n}
2285 @opindex fconstexpr-depth
2286 Set the maximum nested evaluation depth for C++11 constexpr functions
2287 to @var{n}.  A limit is needed to detect endless recursion during
2288 constant expression evaluation.  The minimum specified by the standard
2289 is 512.
2291 @item -fconstexpr-loop-limit=@var{n}
2292 @opindex fconstexpr-loop-limit
2293 Set the maximum number of iterations for a loop in C++14 constexpr functions
2294 to @var{n}.  A limit is needed to detect infinite loops during
2295 constant expression evaluation.  The default is 262144 (1<<18).
2297 @item -fdeduce-init-list
2298 @opindex fdeduce-init-list
2299 Enable deduction of a template type parameter as
2300 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2302 @smallexample
2303 template <class T> auto forward(T t) -> decltype (realfn (t))
2305   return realfn (t);
2308 void f()
2310   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2312 @end smallexample
2314 This deduction was implemented as a possible extension to the
2315 originally proposed semantics for the C++11 standard, but was not part
2316 of the final standard, so it is disabled by default.  This option is
2317 deprecated, and may be removed in a future version of G++.
2319 @item -ffriend-injection
2320 @opindex ffriend-injection
2321 Inject friend functions into the enclosing namespace, so that they are
2322 visible outside the scope of the class in which they are declared.
2323 Friend functions were documented to work this way in the old Annotated
2324 C++ Reference Manual.  
2325 However, in ISO C++ a friend function that is not declared
2326 in an enclosing scope can only be found using argument dependent
2327 lookup.  GCC defaults to the standard behavior.
2329 This option is for compatibility, and may be removed in a future
2330 release of G++.
2332 @item -fno-elide-constructors
2333 @opindex fno-elide-constructors
2334 The C++ standard allows an implementation to omit creating a temporary
2335 that is only used to initialize another object of the same type.
2336 Specifying this option disables that optimization, and forces G++ to
2337 call the copy constructor in all cases.  This option also causes G++
2338 to call trivial member functions which otherwise would be expanded inline.
2340 In C++17, the compiler is required to omit these temporaries, but this
2341 option still affects trivial member functions.
2343 @item -fno-enforce-eh-specs
2344 @opindex fno-enforce-eh-specs
2345 Don't generate code to check for violation of exception specifications
2346 at run time.  This option violates the C++ standard, but may be useful
2347 for reducing code size in production builds, much like defining
2348 @code{NDEBUG}.  This does not give user code permission to throw
2349 exceptions in violation of the exception specifications; the compiler
2350 still optimizes based on the specifications, so throwing an
2351 unexpected exception results in undefined behavior at run time.
2353 @item -fextern-tls-init
2354 @itemx -fno-extern-tls-init
2355 @opindex fextern-tls-init
2356 @opindex fno-extern-tls-init
2357 The C++11 and OpenMP standards allow @code{thread_local} and
2358 @code{threadprivate} variables to have dynamic (runtime)
2359 initialization.  To support this, any use of such a variable goes
2360 through a wrapper function that performs any necessary initialization.
2361 When the use and definition of the variable are in the same
2362 translation unit, this overhead can be optimized away, but when the
2363 use is in a different translation unit there is significant overhead
2364 even if the variable doesn't actually need dynamic initialization.  If
2365 the programmer can be sure that no use of the variable in a
2366 non-defining TU needs to trigger dynamic initialization (either
2367 because the variable is statically initialized, or a use of the
2368 variable in the defining TU will be executed before any uses in
2369 another TU), they can avoid this overhead with the
2370 @option{-fno-extern-tls-init} option.
2372 On targets that support symbol aliases, the default is
2373 @option{-fextern-tls-init}.  On targets that do not support symbol
2374 aliases, the default is @option{-fno-extern-tls-init}.
2376 @item -ffor-scope
2377 @itemx -fno-for-scope
2378 @opindex ffor-scope
2379 @opindex fno-for-scope
2380 If @option{-ffor-scope} is specified, the scope of variables declared in
2381 a @i{for-init-statement} is limited to the @code{for} loop itself,
2382 as specified by the C++ standard.
2383 If @option{-fno-for-scope} is specified, the scope of variables declared in
2384 a @i{for-init-statement} extends to the end of the enclosing scope,
2385 as was the case in old versions of G++, and other (traditional)
2386 implementations of C++.
2388 If neither flag is given, the default is to follow the standard,
2389 but to allow and give a warning for old-style code that would
2390 otherwise be invalid, or have different behavior.
2392 @item -fno-gnu-keywords
2393 @opindex fno-gnu-keywords
2394 Do not recognize @code{typeof} as a keyword, so that code can use this
2395 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2396 This option is implied by the strict ISO C++ dialects: @option{-ansi},
2397 @option{-std=c++98}, @option{-std=c++11}, etc.
2399 @item -fno-implicit-templates
2400 @opindex fno-implicit-templates
2401 Never emit code for non-inline templates that are instantiated
2402 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2403 @xref{Template Instantiation}, for more information.
2405 @item -fno-implicit-inline-templates
2406 @opindex fno-implicit-inline-templates
2407 Don't emit code for implicit instantiations of inline templates, either.
2408 The default is to handle inlines differently so that compiles with and
2409 without optimization need the same set of explicit instantiations.
2411 @item -fno-implement-inlines
2412 @opindex fno-implement-inlines
2413 To save space, do not emit out-of-line copies of inline functions
2414 controlled by @code{#pragma implementation}.  This causes linker
2415 errors if these functions are not inlined everywhere they are called.
2417 @item -fms-extensions
2418 @opindex fms-extensions
2419 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2420 int and getting a pointer to member function via non-standard syntax.
2422 @item -fnew-inheriting-ctors
2423 @opindex fnew-inheriting-ctors
2424 Enable the P0136 adjustment to the semantics of C++11 constructor
2425 inheritance.  This is part of C++17 but also considered to be a Defect
2426 Report against C++11 and C++14.  This flag is enabled by default
2427 unless @option{-fabi-version=10} or lower is specified.
2429 @item -fno-nonansi-builtins
2430 @opindex fno-nonansi-builtins
2431 Disable built-in declarations of functions that are not mandated by
2432 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2433 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2435 @item -fnothrow-opt
2436 @opindex fnothrow-opt
2437 Treat a @code{throw()} exception specification as if it were a
2438 @code{noexcept} specification to reduce or eliminate the text size
2439 overhead relative to a function with no exception specification.  If
2440 the function has local variables of types with non-trivial
2441 destructors, the exception specification actually makes the
2442 function smaller because the EH cleanups for those variables can be
2443 optimized away.  The semantic effect is that an exception thrown out of
2444 a function with such an exception specification results in a call
2445 to @code{terminate} rather than @code{unexpected}.
2447 @item -fno-operator-names
2448 @opindex fno-operator-names
2449 Do not treat the operator name keywords @code{and}, @code{bitand},
2450 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2451 synonyms as keywords.
2453 @item -fno-optional-diags
2454 @opindex fno-optional-diags
2455 Disable diagnostics that the standard says a compiler does not need to
2456 issue.  Currently, the only such diagnostic issued by G++ is the one for
2457 a name having multiple meanings within a class.
2459 @item -fpermissive
2460 @opindex fpermissive
2461 Downgrade some diagnostics about nonconformant code from errors to
2462 warnings.  Thus, using @option{-fpermissive} allows some
2463 nonconforming code to compile.
2465 @item -fno-pretty-templates
2466 @opindex fno-pretty-templates
2467 When an error message refers to a specialization of a function
2468 template, the compiler normally prints the signature of the
2469 template followed by the template arguments and any typedefs or
2470 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2471 rather than @code{void f(int)}) so that it's clear which template is
2472 involved.  When an error message refers to a specialization of a class
2473 template, the compiler omits any template arguments that match
2474 the default template arguments for that template.  If either of these
2475 behaviors make it harder to understand the error message rather than
2476 easier, you can use @option{-fno-pretty-templates} to disable them.
2478 @item -frepo
2479 @opindex frepo
2480 Enable automatic template instantiation at link time.  This option also
2481 implies @option{-fno-implicit-templates}.  @xref{Template
2482 Instantiation}, for more information.
2484 @item -fno-rtti
2485 @opindex fno-rtti
2486 Disable generation of information about every class with virtual
2487 functions for use by the C++ run-time type identification features
2488 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2489 of the language, you can save some space by using this flag.  Note that
2490 exception handling uses the same information, but G++ generates it as
2491 needed. The @code{dynamic_cast} operator can still be used for casts that
2492 do not require run-time type information, i.e.@: casts to @code{void *} or to
2493 unambiguous base classes.
2495 @item -fsized-deallocation
2496 @opindex fsized-deallocation
2497 Enable the built-in global declarations
2498 @smallexample
2499 void operator delete (void *, std::size_t) noexcept;
2500 void operator delete[] (void *, std::size_t) noexcept;
2501 @end smallexample
2502 as introduced in C++14.  This is useful for user-defined replacement
2503 deallocation functions that, for example, use the size of the object
2504 to make deallocation faster.  Enabled by default under
2505 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2506 warns about places that might want to add a definition.
2508 @item -fstrict-enums
2509 @opindex fstrict-enums
2510 Allow the compiler to optimize using the assumption that a value of
2511 enumerated type can only be one of the values of the enumeration (as
2512 defined in the C++ standard; basically, a value that can be
2513 represented in the minimum number of bits needed to represent all the
2514 enumerators).  This assumption may not be valid if the program uses a
2515 cast to convert an arbitrary integer value to the enumerated type.
2517 @item -fstrong-eval-order
2518 @opindex fstrong-eval-order
2519 Evaluate member access, array subscripting, and shift expressions in
2520 left-to-right order, and evaluate assignment in right-to-left order,
2521 as adopted for C++17.  Enabled by default with @option{-std=c++1z}.
2522 @option{-fstrong-eval-order=some} enables just the ordering of member
2523 access and shift expressions, and is the default without
2524 @option{-std=c++1z}.
2526 @item -ftemplate-backtrace-limit=@var{n}
2527 @opindex ftemplate-backtrace-limit
2528 Set the maximum number of template instantiation notes for a single
2529 warning or error to @var{n}.  The default value is 10.
2531 @item -ftemplate-depth=@var{n}
2532 @opindex ftemplate-depth
2533 Set the maximum instantiation depth for template classes to @var{n}.
2534 A limit on the template instantiation depth is needed to detect
2535 endless recursions during template class instantiation.  ANSI/ISO C++
2536 conforming programs must not rely on a maximum depth greater than 17
2537 (changed to 1024 in C++11).  The default value is 900, as the compiler
2538 can run out of stack space before hitting 1024 in some situations.
2540 @item -fno-threadsafe-statics
2541 @opindex fno-threadsafe-statics
2542 Do not emit the extra code to use the routines specified in the C++
2543 ABI for thread-safe initialization of local statics.  You can use this
2544 option to reduce code size slightly in code that doesn't need to be
2545 thread-safe.
2547 @item -fuse-cxa-atexit
2548 @opindex fuse-cxa-atexit
2549 Register destructors for objects with static storage duration with the
2550 @code{__cxa_atexit} function rather than the @code{atexit} function.
2551 This option is required for fully standards-compliant handling of static
2552 destructors, but only works if your C library supports
2553 @code{__cxa_atexit}.
2555 @item -fno-use-cxa-get-exception-ptr
2556 @opindex fno-use-cxa-get-exception-ptr
2557 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2558 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2559 if the runtime routine is not available.
2561 @item -fvisibility-inlines-hidden
2562 @opindex fvisibility-inlines-hidden
2563 This switch declares that the user does not attempt to compare
2564 pointers to inline functions or methods where the addresses of the two functions
2565 are taken in different shared objects.
2567 The effect of this is that GCC may, effectively, mark inline methods with
2568 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2569 appear in the export table of a DSO and do not require a PLT indirection
2570 when used within the DSO@.  Enabling this option can have a dramatic effect
2571 on load and link times of a DSO as it massively reduces the size of the
2572 dynamic export table when the library makes heavy use of templates.
2574 The behavior of this switch is not quite the same as marking the
2575 methods as hidden directly, because it does not affect static variables
2576 local to the function or cause the compiler to deduce that
2577 the function is defined in only one shared object.
2579 You may mark a method as having a visibility explicitly to negate the
2580 effect of the switch for that method.  For example, if you do want to
2581 compare pointers to a particular inline method, you might mark it as
2582 having default visibility.  Marking the enclosing class with explicit
2583 visibility has no effect.
2585 Explicitly instantiated inline methods are unaffected by this option
2586 as their linkage might otherwise cross a shared library boundary.
2587 @xref{Template Instantiation}.
2589 @item -fvisibility-ms-compat
2590 @opindex fvisibility-ms-compat
2591 This flag attempts to use visibility settings to make GCC's C++
2592 linkage model compatible with that of Microsoft Visual Studio.
2594 The flag makes these changes to GCC's linkage model:
2596 @enumerate
2597 @item
2598 It sets the default visibility to @code{hidden}, like
2599 @option{-fvisibility=hidden}.
2601 @item
2602 Types, but not their members, are not hidden by default.
2604 @item
2605 The One Definition Rule is relaxed for types without explicit
2606 visibility specifications that are defined in more than one
2607 shared object: those declarations are permitted if they are
2608 permitted when this option is not used.
2609 @end enumerate
2611 In new code it is better to use @option{-fvisibility=hidden} and
2612 export those classes that are intended to be externally visible.
2613 Unfortunately it is possible for code to rely, perhaps accidentally,
2614 on the Visual Studio behavior.
2616 Among the consequences of these changes are that static data members
2617 of the same type with the same name but defined in different shared
2618 objects are different, so changing one does not change the other;
2619 and that pointers to function members defined in different shared
2620 objects may not compare equal.  When this flag is given, it is a
2621 violation of the ODR to define types with the same name differently.
2623 @item -fno-weak
2624 @opindex fno-weak
2625 Do not use weak symbol support, even if it is provided by the linker.
2626 By default, G++ uses weak symbols if they are available.  This
2627 option exists only for testing, and should not be used by end-users;
2628 it results in inferior code and has no benefits.  This option may
2629 be removed in a future release of G++.
2631 @item -nostdinc++
2632 @opindex nostdinc++
2633 Do not search for header files in the standard directories specific to
2634 C++, but do still search the other standard directories.  (This option
2635 is used when building the C++ library.)
2636 @end table
2638 In addition, these optimization, warning, and code generation options
2639 have meanings only for C++ programs:
2641 @table @gcctabopt
2642 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2643 @opindex Wabi
2644 @opindex Wno-abi
2645 Warn when G++ it generates code that is probably not compatible with
2646 the vendor-neutral C++ ABI@.  Since G++ now defaults to updating the
2647 ABI with each major release, normally @option{-Wabi} will warn only if
2648 there is a check added later in a release series for an ABI issue
2649 discovered since the initial release.  @option{-Wabi} will warn about
2650 more things if an older ABI version is selected (with
2651 @option{-fabi-version=@var{n}}).
2653 @option{-Wabi} can also be used with an explicit version number to
2654 warn about compatibility with a particular @option{-fabi-version}
2655 level, e.g. @option{-Wabi=2} to warn about changes relative to
2656 @option{-fabi-version=2}.
2658 If an explicit version number is provided and
2659 @option{-fabi-compat-version} is not specified, the version number
2660 from this option is used for compatibility aliases.  If no explicit
2661 version number is provided with this option, but
2662 @option{-fabi-compat-version} is specified, that version number is
2663 used for ABI warnings.
2665 Although an effort has been made to warn about
2666 all such cases, there are probably some cases that are not warned about,
2667 even though G++ is generating incompatible code.  There may also be
2668 cases where warnings are emitted even though the code that is generated
2669 is compatible.
2671 You should rewrite your code to avoid these warnings if you are
2672 concerned about the fact that code generated by G++ may not be binary
2673 compatible with code generated by other compilers.
2675 Known incompatibilities in @option{-fabi-version=2} (which was the
2676 default from GCC 3.4 to 4.9) include:
2678 @itemize @bullet
2680 @item
2681 A template with a non-type template parameter of reference type was
2682 mangled incorrectly:
2683 @smallexample
2684 extern int N;
2685 template <int &> struct S @{@};
2686 void n (S<N>) @{2@}
2687 @end smallexample
2689 This was fixed in @option{-fabi-version=3}.
2691 @item
2692 SIMD vector types declared using @code{__attribute ((vector_size))} were
2693 mangled in a non-standard way that does not allow for overloading of
2694 functions taking vectors of different sizes.
2696 The mangling was changed in @option{-fabi-version=4}.
2698 @item
2699 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2700 qualifiers, and @code{decltype} of a plain declaration was folded away.
2702 These mangling issues were fixed in @option{-fabi-version=5}.
2704 @item
2705 Scoped enumerators passed as arguments to a variadic function are
2706 promoted like unscoped enumerators, causing @code{va_arg} to complain.
2707 On most targets this does not actually affect the parameter passing
2708 ABI, as there is no way to pass an argument smaller than @code{int}.
2710 Also, the ABI changed the mangling of template argument packs,
2711 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2712 a class scope function used as a template argument.
2714 These issues were corrected in @option{-fabi-version=6}.
2716 @item
2717 Lambdas in default argument scope were mangled incorrectly, and the
2718 ABI changed the mangling of @code{nullptr_t}.
2720 These issues were corrected in @option{-fabi-version=7}.
2722 @item
2723 When mangling a function type with function-cv-qualifiers, the
2724 un-qualified function type was incorrectly treated as a substitution
2725 candidate.
2727 This was fixed in @option{-fabi-version=8}, the default for GCC 5.1.
2729 @item
2730 @code{decltype(nullptr)} incorrectly had an alignment of 1, leading to
2731 unaligned accesses.  Note that this did not affect the ABI of a
2732 function with a @code{nullptr_t} parameter, as parameters have a
2733 minimum alignment.
2735 This was fixed in @option{-fabi-version=9}, the default for GCC 5.2.
2737 @item
2738 Target-specific attributes that affect the identity of a type, such as
2739 ia32 calling conventions on a function type (stdcall, regparm, etc.),
2740 did not affect the mangled name, leading to name collisions when
2741 function pointers were used as template arguments.
2743 This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
2745 @end itemize
2747 It also warns about psABI-related changes.  The known psABI changes at this
2748 point include:
2750 @itemize @bullet
2752 @item
2753 For SysV/x86-64, unions with @code{long double} members are 
2754 passed in memory as specified in psABI.  For example:
2756 @smallexample
2757 union U @{
2758   long double ld;
2759   int i;
2761 @end smallexample
2763 @noindent
2764 @code{union U} is always passed in memory.
2766 @end itemize
2768 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
2769 @opindex Wabi-tag
2770 @opindex -Wabi-tag
2771 Warn when a type with an ABI tag is used in a context that does not
2772 have that ABI tag.  See @ref{C++ Attributes} for more information
2773 about ABI tags.
2775 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2776 @opindex Wctor-dtor-privacy
2777 @opindex Wno-ctor-dtor-privacy
2778 Warn when a class seems unusable because all the constructors or
2779 destructors in that class are private, and it has neither friends nor
2780 public static member functions.  Also warn if there are no non-private
2781 methods, and there's at least one private member function that isn't
2782 a constructor or destructor.
2784 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2785 @opindex Wdelete-non-virtual-dtor
2786 @opindex Wno-delete-non-virtual-dtor
2787 Warn when @code{delete} is used to destroy an instance of a class that
2788 has virtual functions and non-virtual destructor. It is unsafe to delete
2789 an instance of a derived class through a pointer to a base class if the
2790 base class does not have a virtual destructor.  This warning is enabled
2791 by @option{-Wall}.
2793 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2794 @opindex Wliteral-suffix
2795 @opindex Wno-literal-suffix
2796 Warn when a string or character literal is followed by a ud-suffix which does
2797 not begin with an underscore.  As a conforming extension, GCC treats such
2798 suffixes as separate preprocessing tokens in order to maintain backwards
2799 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2800 For example:
2802 @smallexample
2803 #define __STDC_FORMAT_MACROS
2804 #include <inttypes.h>
2805 #include <stdio.h>
2807 int main() @{
2808   int64_t i64 = 123;
2809   printf("My int64: %" PRId64"\n", i64);
2811 @end smallexample
2813 In this case, @code{PRId64} is treated as a separate preprocessing token.
2815 This warning is enabled by default.
2817 @item -Wlto-type-mismatch
2818 @opindex Wlto-type-mismatch
2819 @opindex Wno-lto-type-mismatch
2821 During the link-time optimization warn about type mismatches in
2822 global declarations from different compilation units.
2823 Requires @option{-flto} to be enabled.  Enabled by default.
2825 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2826 @opindex Wnarrowing
2827 @opindex Wno-narrowing
2828 With @option{-std=gnu++98} or @option{-std=c++98}, warn when a narrowing
2829 conversion prohibited by C++11 occurs within
2830 @samp{@{ @}}, e.g.
2832 @smallexample
2833 int i = @{ 2.2 @}; // error: narrowing from double to int
2834 @end smallexample
2836 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2838 When a later standard is in effect, e.g. when using @option{-std=c++11},
2839 narrowing conversions are diagnosed by default, as required by the standard.
2840 A narrowing conversion from a constant produces an error,
2841 and a narrowing conversion from a non-constant produces a warning,
2842 but @option{-Wno-narrowing} suppresses the diagnostic.
2843 Note that this does not affect the meaning of well-formed code;
2844 narrowing conversions are still considered ill-formed in SFINAE contexts.
2846 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2847 @opindex Wnoexcept
2848 @opindex Wno-noexcept
2849 Warn when a noexcept-expression evaluates to false because of a call
2850 to a function that does not have a non-throwing exception
2851 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
2852 the compiler to never throw an exception.
2854 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2855 @opindex Wnon-virtual-dtor
2856 @opindex Wno-non-virtual-dtor
2857 Warn when a class has virtual functions and an accessible non-virtual
2858 destructor itself or in an accessible polymorphic base class, in which
2859 case it is possible but unsafe to delete an instance of a derived
2860 class through a pointer to the class itself or base class.  This
2861 warning is automatically enabled if @option{-Weffc++} is specified.
2863 @item -Wregister @r{(C++ and Objective-C++ only)}
2864 @opindex Wregister
2865 @opindex Wno-register
2866 Warn on uses of the @code{register} storage class specifier, except
2867 when it is part of the GNU @ref{Explicit Register Variables} extension.
2868 The use of the @code{register} keyword as storage class specifier has
2869 been deprecated in C++11 and removed in C++17.
2870 Enabled by default with @option{-std=c++1z}.
2872 @item -Wreorder @r{(C++ and Objective-C++ only)}
2873 @opindex Wreorder
2874 @opindex Wno-reorder
2875 @cindex reordering, warning
2876 @cindex warning for reordering of member initializers
2877 Warn when the order of member initializers given in the code does not
2878 match the order in which they must be executed.  For instance:
2880 @smallexample
2881 struct A @{
2882   int i;
2883   int j;
2884   A(): j (0), i (1) @{ @}
2886 @end smallexample
2888 @noindent
2889 The compiler rearranges the member initializers for @code{i}
2890 and @code{j} to match the declaration order of the members, emitting
2891 a warning to that effect.  This warning is enabled by @option{-Wall}.
2893 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2894 @opindex fext-numeric-literals
2895 @opindex fno-ext-numeric-literals
2896 Accept imaginary, fixed-point, or machine-defined
2897 literal number suffixes as GNU extensions.
2898 When this option is turned off these suffixes are treated
2899 as C++11 user-defined literal numeric suffixes.
2900 This is on by default for all pre-C++11 dialects and all GNU dialects:
2901 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2902 @option{-std=gnu++14}.
2903 This option is off by default
2904 for ISO C++11 onwards (@option{-std=c++11}, ...).
2905 @end table
2907 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2909 @table @gcctabopt
2910 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2911 @opindex Weffc++
2912 @opindex Wno-effc++
2913 Warn about violations of the following style guidelines from Scott Meyers'
2914 @cite{Effective C++} series of books:
2916 @itemize @bullet
2917 @item
2918 Define a copy constructor and an assignment operator for classes
2919 with dynamically-allocated memory.
2921 @item
2922 Prefer initialization to assignment in constructors.
2924 @item
2925 Have @code{operator=} return a reference to @code{*this}.
2927 @item
2928 Don't try to return a reference when you must return an object.
2930 @item
2931 Distinguish between prefix and postfix forms of increment and
2932 decrement operators.
2934 @item
2935 Never overload @code{&&}, @code{||}, or @code{,}.
2937 @end itemize
2939 This option also enables @option{-Wnon-virtual-dtor}, which is also
2940 one of the effective C++ recommendations.  However, the check is
2941 extended to warn about the lack of virtual destructor in accessible
2942 non-polymorphic bases classes too.
2944 When selecting this option, be aware that the standard library
2945 headers do not obey all of these guidelines; use @samp{grep -v}
2946 to filter out those warnings.
2948 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2949 @opindex Wstrict-null-sentinel
2950 @opindex Wno-strict-null-sentinel
2951 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2952 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2953 to @code{__null}.  Although it is a null pointer constant rather than a
2954 null pointer, it is guaranteed to be of the same size as a pointer.
2955 But this use is not portable across different compilers.
2957 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2958 @opindex Wno-non-template-friend
2959 @opindex Wnon-template-friend
2960 Disable warnings when non-templatized friend functions are declared
2961 within a template.  Since the advent of explicit template specification
2962 support in G++, if the name of the friend is an unqualified-id (i.e.,
2963 @samp{friend foo(int)}), the C++ language specification demands that the
2964 friend declare or define an ordinary, nontemplate function.  (Section
2965 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2966 could be interpreted as a particular specialization of a templatized
2967 function.  Because this non-conforming behavior is no longer the default
2968 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2969 check existing code for potential trouble spots and is on by default.
2970 This new compiler behavior can be turned off with
2971 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2972 but disables the helpful warning.
2974 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2975 @opindex Wold-style-cast
2976 @opindex Wno-old-style-cast
2977 Warn if an old-style (C-style) cast to a non-void type is used within
2978 a C++ program.  The new-style casts (@code{dynamic_cast},
2979 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
2980 less vulnerable to unintended effects and much easier to search for.
2982 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2983 @opindex Woverloaded-virtual
2984 @opindex Wno-overloaded-virtual
2985 @cindex overloaded virtual function, warning
2986 @cindex warning for overloaded virtual function
2987 Warn when a function declaration hides virtual functions from a
2988 base class.  For example, in:
2990 @smallexample
2991 struct A @{
2992   virtual void f();
2995 struct B: public A @{
2996   void f(int);
2998 @end smallexample
3000 the @code{A} class version of @code{f} is hidden in @code{B}, and code
3001 like:
3003 @smallexample
3004 B* b;
3005 b->f();
3006 @end smallexample
3008 @noindent
3009 fails to compile.
3011 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
3012 @opindex Wno-pmf-conversions
3013 @opindex Wpmf-conversions
3014 Disable the diagnostic for converting a bound pointer to member function
3015 to a plain pointer.
3017 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
3018 @opindex Wsign-promo
3019 @opindex Wno-sign-promo
3020 Warn when overload resolution chooses a promotion from unsigned or
3021 enumerated type to a signed type, over a conversion to an unsigned type of
3022 the same size.  Previous versions of G++ tried to preserve
3023 unsignedness, but the standard mandates the current behavior.
3025 @item -Wtemplates @r{(C++ and Objective-C++ only)}
3026 @opindex Wtemplates
3027 Warn when a primary template declaration is encountered.  Some coding
3028 rules disallow templates, and this may be used to enforce that rule.
3029 The warning is inactive inside a system header file, such as the STL, so
3030 one can still use the STL.  One may also instantiate or specialize
3031 templates.
3033 @item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
3034 @opindex Wmultiple-inheritance
3035 Warn when a class is defined with multiple direct base classes.  Some
3036 coding rules disallow multiple inheritance, and this may be used to
3037 enforce that rule.  The warning is inactive inside a system header file,
3038 such as the STL, so one can still use the STL.  One may also define
3039 classes that indirectly use multiple inheritance.
3041 @item -Wvirtual-inheritance
3042 @opindex Wvirtual-inheritance
3043 Warn when a class is defined with a virtual direct base classe.  Some
3044 coding rules disallow multiple inheritance, and this may be used to
3045 enforce that rule.  The warning is inactive inside a system header file,
3046 such as the STL, so one can still use the STL.  One may also define
3047 classes that indirectly use virtual inheritance.
3049 @item -Wnamespaces
3050 @opindex Wnamespaces
3051 Warn when a namespace definition is opened.  Some coding rules disallow
3052 namespaces, and this may be used to enforce that rule.  The warning is
3053 inactive inside a system header file, such as the STL, so one can still
3054 use the STL.  One may also use using directives and qualified names.
3056 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
3057 @opindex Wterminate
3058 @opindex Wno-terminate
3059 Disable the warning about a throw-expression that will immediately
3060 result in a call to @code{terminate}.
3061 @end table
3063 @node Objective-C and Objective-C++ Dialect Options
3064 @section Options Controlling Objective-C and Objective-C++ Dialects
3066 @cindex compiler options, Objective-C and Objective-C++
3067 @cindex Objective-C and Objective-C++ options, command-line
3068 @cindex options, Objective-C and Objective-C++
3069 (NOTE: This manual does not describe the Objective-C and Objective-C++
3070 languages themselves.  @xref{Standards,,Language Standards
3071 Supported by GCC}, for references.)
3073 This section describes the command-line options that are only meaningful
3074 for Objective-C and Objective-C++ programs.  You can also use most of
3075 the language-independent GNU compiler options.
3076 For example, you might compile a file @file{some_class.m} like this:
3078 @smallexample
3079 gcc -g -fgnu-runtime -O -c some_class.m
3080 @end smallexample
3082 @noindent
3083 In this example, @option{-fgnu-runtime} is an option meant only for
3084 Objective-C and Objective-C++ programs; you can use the other options with
3085 any language supported by GCC@.
3087 Note that since Objective-C is an extension of the C language, Objective-C
3088 compilations may also use options specific to the C front-end (e.g.,
3089 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
3090 C++-specific options (e.g., @option{-Wabi}).
3092 Here is a list of options that are @emph{only} for compiling Objective-C
3093 and Objective-C++ programs:
3095 @table @gcctabopt
3096 @item -fconstant-string-class=@var{class-name}
3097 @opindex fconstant-string-class
3098 Use @var{class-name} as the name of the class to instantiate for each
3099 literal string specified with the syntax @code{@@"@dots{}"}.  The default
3100 class name is @code{NXConstantString} if the GNU runtime is being used, and
3101 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
3102 @option{-fconstant-cfstrings} option, if also present, overrides the
3103 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
3104 to be laid out as constant CoreFoundation strings.
3106 @item -fgnu-runtime
3107 @opindex fgnu-runtime
3108 Generate object code compatible with the standard GNU Objective-C
3109 runtime.  This is the default for most types of systems.
3111 @item -fnext-runtime
3112 @opindex fnext-runtime
3113 Generate output compatible with the NeXT runtime.  This is the default
3114 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
3115 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
3116 used.
3118 @item -fno-nil-receivers
3119 @opindex fno-nil-receivers
3120 Assume that all Objective-C message dispatches (@code{[receiver
3121 message:arg]}) in this translation unit ensure that the receiver is
3122 not @code{nil}.  This allows for more efficient entry points in the
3123 runtime to be used.  This option is only available in conjunction with
3124 the NeXT runtime and ABI version 0 or 1.
3126 @item -fobjc-abi-version=@var{n}
3127 @opindex fobjc-abi-version
3128 Use version @var{n} of the Objective-C ABI for the selected runtime.
3129 This option is currently supported only for the NeXT runtime.  In that
3130 case, Version 0 is the traditional (32-bit) ABI without support for
3131 properties and other Objective-C 2.0 additions.  Version 1 is the
3132 traditional (32-bit) ABI with support for properties and other
3133 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
3134 nothing is specified, the default is Version 0 on 32-bit target
3135 machines, and Version 2 on 64-bit target machines.
3137 @item -fobjc-call-cxx-cdtors
3138 @opindex fobjc-call-cxx-cdtors
3139 For each Objective-C class, check if any of its instance variables is a
3140 C++ object with a non-trivial default constructor.  If so, synthesize a
3141 special @code{- (id) .cxx_construct} instance method which runs
3142 non-trivial default constructors on any such instance variables, in order,
3143 and then return @code{self}.  Similarly, check if any instance variable
3144 is a C++ object with a non-trivial destructor, and if so, synthesize a
3145 special @code{- (void) .cxx_destruct} method which runs
3146 all such default destructors, in reverse order.
3148 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
3149 methods thusly generated only operate on instance variables
3150 declared in the current Objective-C class, and not those inherited
3151 from superclasses.  It is the responsibility of the Objective-C
3152 runtime to invoke all such methods in an object's inheritance
3153 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
3154 by the runtime immediately after a new object instance is allocated;
3155 the @code{- (void) .cxx_destruct} methods are invoked immediately
3156 before the runtime deallocates an object instance.
3158 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
3159 support for invoking the @code{- (id) .cxx_construct} and
3160 @code{- (void) .cxx_destruct} methods.
3162 @item -fobjc-direct-dispatch
3163 @opindex fobjc-direct-dispatch
3164 Allow fast jumps to the message dispatcher.  On Darwin this is
3165 accomplished via the comm page.
3167 @item -fobjc-exceptions
3168 @opindex fobjc-exceptions
3169 Enable syntactic support for structured exception handling in
3170 Objective-C, similar to what is offered by C++.  This option
3171 is required to use the Objective-C keywords @code{@@try},
3172 @code{@@throw}, @code{@@catch}, @code{@@finally} and
3173 @code{@@synchronized}.  This option is available with both the GNU
3174 runtime and the NeXT runtime (but not available in conjunction with
3175 the NeXT runtime on Mac OS X 10.2 and earlier).
3177 @item -fobjc-gc
3178 @opindex fobjc-gc
3179 Enable garbage collection (GC) in Objective-C and Objective-C++
3180 programs.  This option is only available with the NeXT runtime; the
3181 GNU runtime has a different garbage collection implementation that
3182 does not require special compiler flags.
3184 @item -fobjc-nilcheck
3185 @opindex fobjc-nilcheck
3186 For the NeXT runtime with version 2 of the ABI, check for a nil
3187 receiver in method invocations before doing the actual method call.
3188 This is the default and can be disabled using
3189 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3190 checked for nil in this way no matter what this flag is set to.
3191 Currently this flag does nothing when the GNU runtime, or an older
3192 version of the NeXT runtime ABI, is used.
3194 @item -fobjc-std=objc1
3195 @opindex fobjc-std
3196 Conform to the language syntax of Objective-C 1.0, the language
3197 recognized by GCC 4.0.  This only affects the Objective-C additions to
3198 the C/C++ language; it does not affect conformance to C/C++ standards,
3199 which is controlled by the separate C/C++ dialect option flags.  When
3200 this option is used with the Objective-C or Objective-C++ compiler,
3201 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3202 This is useful if you need to make sure that your Objective-C code can
3203 be compiled with older versions of GCC@.
3205 @item -freplace-objc-classes
3206 @opindex freplace-objc-classes
3207 Emit a special marker instructing @command{ld(1)} not to statically link in
3208 the resulting object file, and allow @command{dyld(1)} to load it in at
3209 run time instead.  This is used in conjunction with the Fix-and-Continue
3210 debugging mode, where the object file in question may be recompiled and
3211 dynamically reloaded in the course of program execution, without the need
3212 to restart the program itself.  Currently, Fix-and-Continue functionality
3213 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3214 and later.
3216 @item -fzero-link
3217 @opindex fzero-link
3218 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3219 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3220 compile time) with static class references that get initialized at load time,
3221 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3222 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3223 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3224 for individual class implementations to be modified during program execution.
3225 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3226 regardless of command-line options.
3228 @item -fno-local-ivars
3229 @opindex fno-local-ivars
3230 @opindex flocal-ivars
3231 By default instance variables in Objective-C can be accessed as if
3232 they were local variables from within the methods of the class they're
3233 declared in.  This can lead to shadowing between instance variables
3234 and other variables declared either locally inside a class method or
3235 globally with the same name.  Specifying the @option{-fno-local-ivars}
3236 flag disables this behavior thus avoiding variable shadowing issues.
3238 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3239 @opindex fivar-visibility
3240 Set the default instance variable visibility to the specified option
3241 so that instance variables declared outside the scope of any access
3242 modifier directives default to the specified visibility.
3244 @item -gen-decls
3245 @opindex gen-decls
3246 Dump interface declarations for all classes seen in the source file to a
3247 file named @file{@var{sourcename}.decl}.
3249 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3250 @opindex Wassign-intercept
3251 @opindex Wno-assign-intercept
3252 Warn whenever an Objective-C assignment is being intercepted by the
3253 garbage collector.
3255 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3256 @opindex Wno-protocol
3257 @opindex Wprotocol
3258 If a class is declared to implement a protocol, a warning is issued for
3259 every method in the protocol that is not implemented by the class.  The
3260 default behavior is to issue a warning for every method not explicitly
3261 implemented in the class, even if a method implementation is inherited
3262 from the superclass.  If you use the @option{-Wno-protocol} option, then
3263 methods inherited from the superclass are considered to be implemented,
3264 and no warning is issued for them.
3266 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3267 @opindex Wselector
3268 @opindex Wno-selector
3269 Warn if multiple methods of different types for the same selector are
3270 found during compilation.  The check is performed on the list of methods
3271 in the final stage of compilation.  Additionally, a check is performed
3272 for each selector appearing in a @code{@@selector(@dots{})}
3273 expression, and a corresponding method for that selector has been found
3274 during compilation.  Because these checks scan the method table only at
3275 the end of compilation, these warnings are not produced if the final
3276 stage of compilation is not reached, for example because an error is
3277 found during compilation, or because the @option{-fsyntax-only} option is
3278 being used.
3280 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3281 @opindex Wstrict-selector-match
3282 @opindex Wno-strict-selector-match
3283 Warn if multiple methods with differing argument and/or return types are
3284 found for a given selector when attempting to send a message using this
3285 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3286 is off (which is the default behavior), the compiler omits such warnings
3287 if any differences found are confined to types that share the same size
3288 and alignment.
3290 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3291 @opindex Wundeclared-selector
3292 @opindex Wno-undeclared-selector
3293 Warn if a @code{@@selector(@dots{})} expression referring to an
3294 undeclared selector is found.  A selector is considered undeclared if no
3295 method with that name has been declared before the
3296 @code{@@selector(@dots{})} expression, either explicitly in an
3297 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3298 an @code{@@implementation} section.  This option always performs its
3299 checks as soon as a @code{@@selector(@dots{})} expression is found,
3300 while @option{-Wselector} only performs its checks in the final stage of
3301 compilation.  This also enforces the coding style convention
3302 that methods and selectors must be declared before being used.
3304 @item -print-objc-runtime-info
3305 @opindex print-objc-runtime-info
3306 Generate C header describing the largest structure that is passed by
3307 value, if any.
3309 @end table
3311 @node Diagnostic Message Formatting Options
3312 @section Options to Control Diagnostic Messages Formatting
3313 @cindex options to control diagnostics formatting
3314 @cindex diagnostic messages
3315 @cindex message formatting
3317 Traditionally, diagnostic messages have been formatted irrespective of
3318 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3319 options described below
3320 to control the formatting algorithm for diagnostic messages, 
3321 e.g.@: how many characters per line, how often source location
3322 information should be reported.  Note that some language front ends may not
3323 honor these options.
3325 @table @gcctabopt
3326 @item -fmessage-length=@var{n}
3327 @opindex fmessage-length
3328 Try to format error messages so that they fit on lines of about
3329 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3330 done; each error message appears on a single line.  This is the
3331 default for all front ends.
3333 @item -fdiagnostics-show-location=once
3334 @opindex fdiagnostics-show-location
3335 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3336 reporter to emit source location information @emph{once}; that is, in
3337 case the message is too long to fit on a single physical line and has to
3338 be wrapped, the source location won't be emitted (as prefix) again,
3339 over and over, in subsequent continuation lines.  This is the default
3340 behavior.
3342 @item -fdiagnostics-show-location=every-line
3343 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3344 messages reporter to emit the same source location information (as
3345 prefix) for physical lines that result from the process of breaking
3346 a message which is too long to fit on a single line.
3348 @item -fdiagnostics-color[=@var{WHEN}]
3349 @itemx -fno-diagnostics-color
3350 @opindex fdiagnostics-color
3351 @cindex highlight, color
3352 @vindex GCC_COLORS @r{environment variable}
3353 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3354 or @samp{auto}.  The default depends on how the compiler has been configured,
3355 it can be any of the above @var{WHEN} options or also @samp{never}
3356 if @env{GCC_COLORS} environment variable isn't present in the environment,
3357 and @samp{auto} otherwise.
3358 @samp{auto} means to use color only when the standard error is a terminal.
3359 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3360 aliases for @option{-fdiagnostics-color=always} and
3361 @option{-fdiagnostics-color=never}, respectively.
3363 The colors are defined by the environment variable @env{GCC_COLORS}.
3364 Its value is a colon-separated list of capabilities and Select Graphic
3365 Rendition (SGR) substrings. SGR commands are interpreted by the
3366 terminal or terminal emulator.  (See the section in the documentation
3367 of your text terminal for permitted values and their meanings as
3368 character attributes.)  These substring values are integers in decimal
3369 representation and can be concatenated with semicolons.
3370 Common values to concatenate include
3371 @samp{1} for bold,
3372 @samp{4} for underline,
3373 @samp{5} for blink,
3374 @samp{7} for inverse,
3375 @samp{39} for default foreground color,
3376 @samp{30} to @samp{37} for foreground colors,
3377 @samp{90} to @samp{97} for 16-color mode foreground colors,
3378 @samp{38;5;0} to @samp{38;5;255}
3379 for 88-color and 256-color modes foreground colors,
3380 @samp{49} for default background color,
3381 @samp{40} to @samp{47} for background colors,
3382 @samp{100} to @samp{107} for 16-color mode background colors,
3383 and @samp{48;5;0} to @samp{48;5;255}
3384 for 88-color and 256-color modes background colors.
3386 The default @env{GCC_COLORS} is
3387 @smallexample
3388 error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:quote=01:\
3389 fixit-insert=32:fixit-delete=31:\
3390 diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32
3391 @end smallexample
3392 @noindent
3393 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3394 @samp{01;36} is bold cyan, @samp{32} is green, @samp{34} is blue,
3395 @samp{01} is bold, and @samp{31} is red.
3396 Setting @env{GCC_COLORS} to the empty string disables colors.
3397 Supported capabilities are as follows.
3399 @table @code
3400 @item error=
3401 @vindex error GCC_COLORS @r{capability}
3402 SGR substring for error: markers.
3404 @item warning=
3405 @vindex warning GCC_COLORS @r{capability}
3406 SGR substring for warning: markers.
3408 @item note=
3409 @vindex note GCC_COLORS @r{capability}
3410 SGR substring for note: markers.
3412 @item range1=
3413 @vindex range1 GCC_COLORS @r{capability}
3414 SGR substring for first additional range.
3416 @item range2=
3417 @vindex range2 GCC_COLORS @r{capability}
3418 SGR substring for second additional range.
3420 @item locus=
3421 @vindex locus GCC_COLORS @r{capability}
3422 SGR substring for location information, @samp{file:line} or
3423 @samp{file:line:column} etc.
3425 @item quote=
3426 @vindex quote GCC_COLORS @r{capability}
3427 SGR substring for information printed within quotes.
3429 @item fixit-insert=
3430 @vindex fixit-insert GCC_COLORS @r{capability}
3431 SGR substring for fix-it hints suggesting text to
3432 be inserted or replaced.
3434 @item fixit-delete=
3435 @vindex fixit-delete GCC_COLORS @r{capability}
3436 SGR substring for fix-it hints suggesting text to
3437 be deleted.
3439 @item diff-filename=
3440 @vindex diff-filename GCC_COLORS @r{capability}
3441 SGR substring for filename headers within generated patches.
3443 @item diff-hunk=
3444 @vindex diff-hunk GCC_COLORS @r{capability}
3445 SGR substring for the starts of hunks within generated patches.
3447 @item diff-delete=
3448 @vindex diff-delete GCC_COLORS @r{capability}
3449 SGR substring for deleted lines within generated patches.
3451 @item diff-insert=
3452 @vindex diff-insert GCC_COLORS @r{capability}
3453 SGR substring for inserted lines within generated patches.
3454 @end table
3456 @item -fno-diagnostics-show-option
3457 @opindex fno-diagnostics-show-option
3458 @opindex fdiagnostics-show-option
3459 By default, each diagnostic emitted includes text indicating the
3460 command-line option that directly controls the diagnostic (if such an
3461 option is known to the diagnostic machinery).  Specifying the
3462 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3464 @item -fno-diagnostics-show-caret
3465 @opindex fno-diagnostics-show-caret
3466 @opindex fdiagnostics-show-caret
3467 By default, each diagnostic emitted includes the original source line
3468 and a caret @samp{^} indicating the column.  This option suppresses this
3469 information.  The source line is truncated to @var{n} characters, if
3470 the @option{-fmessage-length=n} option is given.  When the output is done
3471 to the terminal, the width is limited to the width given by the
3472 @env{COLUMNS} environment variable or, if not set, to the terminal width.
3474 @item -fdiagnostics-parseable-fixits
3475 @opindex fdiagnostics-parseable-fixits
3476 Emit fix-it hints in a machine-parseable format, suitable for consumption
3477 by IDEs.  For each fix-it, a line will be printed after the relevant
3478 diagnostic, starting with the string ``fix-it:''.  For example:
3480 @smallexample
3481 fix-it:"test.c":@{45:3-45:21@}:"gtk_widget_show_all"
3482 @end smallexample
3484 The location is expressed as a half-open range, expressed as a count of
3485 bytes, starting at byte 1 for the initial column.  In the above example,
3486 bytes 3 through 20 of line 45 of ``test.c'' are to be replaced with the
3487 given string:
3489 @smallexample
3490 00000000011111111112222222222
3491 12345678901234567890123456789
3492   gtk_widget_showall (dlg);
3493   ^^^^^^^^^^^^^^^^^^
3494   gtk_widget_show_all
3495 @end smallexample
3497 The filename and replacement string escape backslash as ``\\", tab as ``\t'',
3498 newline as ``\n'', double quotes as ``\"'', non-printable characters as octal
3499 (e.g. vertical tab as ``\013'').
3501 An empty replacement string indicates that the given range is to be removed.
3502 An empty range (e.g. ``45:3-45:3'') indicates that the string is to
3503 be inserted at the given position.
3505 @item -fdiagnostics-generate-patch
3506 @opindex fdiagnostics-generate-patch
3507 Print fix-it hints to stderr in unified diff format, after any diagnostics
3508 are printed.  For example:
3510 @smallexample
3511 --- test.c
3512 +++ test.c
3513 @@ -42,5 +42,5 @@
3515  void show_cb(GtkDialog *dlg)
3516  @{
3517 -  gtk_widget_showall(dlg);
3518 +  gtk_widget_show_all(dlg);
3519  @}
3521 @end smallexample
3523 The diff may or may not be colorized, following the same rules
3524 as for diagnostics (see @option{-fdiagnostics-color}).
3526 @end table
3528 @node Warning Options
3529 @section Options to Request or Suppress Warnings
3530 @cindex options to control warnings
3531 @cindex warning messages
3532 @cindex messages, warning
3533 @cindex suppressing warnings
3535 Warnings are diagnostic messages that report constructions that
3536 are not inherently erroneous but that are risky or suggest there
3537 may have been an error.
3539 The following language-independent options do not enable specific
3540 warnings but control the kinds of diagnostics produced by GCC@.
3542 @table @gcctabopt
3543 @cindex syntax checking
3544 @item -fsyntax-only
3545 @opindex fsyntax-only
3546 Check the code for syntax errors, but don't do anything beyond that.
3548 @item -fmax-errors=@var{n}
3549 @opindex fmax-errors
3550 Limits the maximum number of error messages to @var{n}, at which point
3551 GCC bails out rather than attempting to continue processing the source
3552 code.  If @var{n} is 0 (the default), there is no limit on the number
3553 of error messages produced.  If @option{-Wfatal-errors} is also
3554 specified, then @option{-Wfatal-errors} takes precedence over this
3555 option.
3557 @item -w
3558 @opindex w
3559 Inhibit all warning messages.
3561 @item -Werror
3562 @opindex Werror
3563 @opindex Wno-error
3564 Make all warnings into errors.
3566 @item -Werror=
3567 @opindex Werror=
3568 @opindex Wno-error=
3569 Make the specified warning into an error.  The specifier for a warning
3570 is appended; for example @option{-Werror=switch} turns the warnings
3571 controlled by @option{-Wswitch} into errors.  This switch takes a
3572 negative form, to be used to negate @option{-Werror} for specific
3573 warnings; for example @option{-Wno-error=switch} makes
3574 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3575 is in effect.
3577 The warning message for each controllable warning includes the
3578 option that controls the warning.  That option can then be used with
3579 @option{-Werror=} and @option{-Wno-error=} as described above.
3580 (Printing of the option in the warning message can be disabled using the
3581 @option{-fno-diagnostics-show-option} flag.)
3583 Note that specifying @option{-Werror=}@var{foo} automatically implies
3584 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3585 imply anything.
3587 @item -Wfatal-errors
3588 @opindex Wfatal-errors
3589 @opindex Wno-fatal-errors
3590 This option causes the compiler to abort compilation on the first error
3591 occurred rather than trying to keep going and printing further error
3592 messages.
3594 @end table
3596 You can request many specific warnings with options beginning with
3597 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3598 implicit declarations.  Each of these specific warning options also
3599 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3600 example, @option{-Wno-implicit}.  This manual lists only one of the
3601 two forms, whichever is not the default.  For further
3602 language-specific options also refer to @ref{C++ Dialect Options} and
3603 @ref{Objective-C and Objective-C++ Dialect Options}.
3605 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
3606 options, such as @option{-Wunused}, which may turn on further options,
3607 such as @option{-Wunused-value}. The combined effect of positive and
3608 negative forms is that more specific options have priority over less
3609 specific ones, independently of their position in the command-line. For
3610 options of the same specificity, the last one takes effect. Options
3611 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
3612 as if they appeared at the end of the command-line.
3614 When an unrecognized warning option is requested (e.g.,
3615 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3616 that the option is not recognized.  However, if the @option{-Wno-} form
3617 is used, the behavior is slightly different: no diagnostic is
3618 produced for @option{-Wno-unknown-warning} unless other diagnostics
3619 are being produced.  This allows the use of new @option{-Wno-} options
3620 with old compilers, but if something goes wrong, the compiler
3621 warns that an unrecognized option is present.
3623 @table @gcctabopt
3624 @item -Wpedantic
3625 @itemx -pedantic
3626 @opindex pedantic
3627 @opindex Wpedantic
3628 Issue all the warnings demanded by strict ISO C and ISO C++;
3629 reject all programs that use forbidden extensions, and some other
3630 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3631 version of the ISO C standard specified by any @option{-std} option used.
3633 Valid ISO C and ISO C++ programs should compile properly with or without
3634 this option (though a rare few require @option{-ansi} or a
3635 @option{-std} option specifying the required version of ISO C)@.  However,
3636 without this option, certain GNU extensions and traditional C and C++
3637 features are supported as well.  With this option, they are rejected.
3639 @option{-Wpedantic} does not cause warning messages for use of the
3640 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3641 warnings are also disabled in the expression that follows
3642 @code{__extension__}.  However, only system header files should use
3643 these escape routes; application programs should avoid them.
3644 @xref{Alternate Keywords}.
3646 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3647 C conformance.  They soon find that it does not do quite what they want:
3648 it finds some non-ISO practices, but not all---only those for which
3649 ISO C @emph{requires} a diagnostic, and some others for which
3650 diagnostics have been added.
3652 A feature to report any failure to conform to ISO C might be useful in
3653 some instances, but would require considerable additional work and would
3654 be quite different from @option{-Wpedantic}.  We don't have plans to
3655 support such a feature in the near future.
3657 Where the standard specified with @option{-std} represents a GNU
3658 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3659 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3660 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3661 where they are required by the base standard.  (It does not make sense
3662 for such warnings to be given only for features not in the specified GNU
3663 C dialect, since by definition the GNU dialects of C include all
3664 features the compiler supports with the given option, and there would be
3665 nothing to warn about.)
3667 @item -pedantic-errors
3668 @opindex pedantic-errors
3669 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
3670 requires a diagnostic, in some cases where there is undefined behavior
3671 at compile-time and in some other cases that do not prevent compilation
3672 of programs that are valid according to the standard. This is not
3673 equivalent to @option{-Werror=pedantic}, since there are errors enabled
3674 by this option and not enabled by the latter and vice versa.
3676 @item -Wall
3677 @opindex Wall
3678 @opindex Wno-all
3679 This enables all the warnings about constructions that some users
3680 consider questionable, and that are easy to avoid (or modify to
3681 prevent the warning), even in conjunction with macros.  This also
3682 enables some language-specific warnings described in @ref{C++ Dialect
3683 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3685 @option{-Wall} turns on the following warning flags:
3687 @gccoptlist{-Waddress   @gol
3688 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
3689 -Wbool-compare  @gol
3690 -Wbool-operation  @gol
3691 -Wc++11-compat  -Wc++14-compat@gol
3692 -Wchar-subscripts  @gol
3693 -Wcomment  @gol
3694 -Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
3695 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3696 -Wformat   @gol
3697 -Wint-in-bool-context  @gol
3698 -Wimplicit @r{(C and Objective-C only)} @gol
3699 -Wimplicit-int @r{(C and Objective-C only)} @gol
3700 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3701 -Winit-self @r{(only for C++)} @gol
3702 -Wlogical-not-parentheses
3703 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3704 -Wmaybe-uninitialized @gol
3705 -Wmemset-elt-size @gol
3706 -Wmemset-transposed-args @gol
3707 -Wmisleading-indentation @r{(only for C/C++)} @gol
3708 -Wmissing-braces @r{(only for C/ObjC)} @gol
3709 -Wnarrowing @r{(only for C++)}  @gol
3710 -Wnonnull  @gol
3711 -Wnonnull-compare  @gol
3712 -Wopenmp-simd @gol
3713 -Wparentheses  @gol
3714 -Wpointer-sign  @gol
3715 -Wreorder   @gol
3716 -Wreturn-type  @gol
3717 -Wsequence-point  @gol
3718 -Wsign-compare @r{(only in C++)}  @gol
3719 -Wsizeof-pointer-memaccess @gol
3720 -Wstrict-aliasing  @gol
3721 -Wstrict-overflow=1  @gol
3722 -Wswitch  @gol
3723 -Wtautological-compare  @gol
3724 -Wtrigraphs  @gol
3725 -Wuninitialized  @gol
3726 -Wunknown-pragmas  @gol
3727 -Wunused-function  @gol
3728 -Wunused-label     @gol
3729 -Wunused-value     @gol
3730 -Wunused-variable  @gol
3731 -Wvolatile-register-var @gol
3734 Note that some warning flags are not implied by @option{-Wall}.  Some of
3735 them warn about constructions that users generally do not consider
3736 questionable, but which occasionally you might wish to check for;
3737 others warn about constructions that are necessary or hard to avoid in
3738 some cases, and there is no simple way to modify the code to suppress
3739 the warning. Some of them are enabled by @option{-Wextra} but many of
3740 them must be enabled individually.
3742 @item -Wextra
3743 @opindex W
3744 @opindex Wextra
3745 @opindex Wno-extra
3746 This enables some extra warning flags that are not enabled by
3747 @option{-Wall}. (This option used to be called @option{-W}.  The older
3748 name is still supported, but the newer name is more descriptive.)
3750 @gccoptlist{-Wclobbered  @gol
3751 -Wempty-body  @gol
3752 -Wignored-qualifiers @gol
3753 -Wimplicit-fallthrough=3 @gol
3754 -Wmissing-field-initializers  @gol
3755 -Wmissing-parameter-type @r{(C only)}  @gol
3756 -Wold-style-declaration @r{(C only)}  @gol
3757 -Woverride-init  @gol
3758 -Wsign-compare @r{(C only)} @gol
3759 -Wtype-limits  @gol
3760 -Wuninitialized  @gol
3761 -Wshift-negative-value @r{(in C++03 and in C99 and newer)}  @gol
3762 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3763 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3766 The option @option{-Wextra} also prints warning messages for the
3767 following cases:
3769 @itemize @bullet
3771 @item
3772 A pointer is compared against integer zero with @code{<}, @code{<=},
3773 @code{>}, or @code{>=}.
3775 @item
3776 (C++ only) An enumerator and a non-enumerator both appear in a
3777 conditional expression.
3779 @item
3780 (C++ only) Ambiguous virtual bases.
3782 @item
3783 (C++ only) Subscripting an array that has been declared @code{register}.
3785 @item
3786 (C++ only) Taking the address of a variable that has been declared
3787 @code{register}.
3789 @item
3790 (C++ only) A base class is not initialized in the copy constructor
3791 of a derived class.
3793 @end itemize
3795 @item -Wchar-subscripts
3796 @opindex Wchar-subscripts
3797 @opindex Wno-char-subscripts
3798 Warn if an array subscript has type @code{char}.  This is a common cause
3799 of error, as programmers often forget that this type is signed on some
3800 machines.
3801 This warning is enabled by @option{-Wall}.
3803 @item -Wcomment
3804 @opindex Wcomment
3805 @opindex Wno-comment
3806 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3807 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3808 This warning is enabled by @option{-Wall}.
3810 @item -Wno-coverage-mismatch
3811 @opindex Wno-coverage-mismatch
3812 Warn if feedback profiles do not match when using the
3813 @option{-fprofile-use} option.
3814 If a source file is changed between compiling with @option{-fprofile-gen} and
3815 with @option{-fprofile-use}, the files with the profile feedback can fail
3816 to match the source file and GCC cannot use the profile feedback
3817 information.  By default, this warning is enabled and is treated as an
3818 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3819 warning or @option{-Wno-error=coverage-mismatch} can be used to
3820 disable the error.  Disabling the error for this warning can result in
3821 poorly optimized code and is useful only in the
3822 case of very minor changes such as bug fixes to an existing code-base.
3823 Completely disabling the warning is not recommended.
3825 @item -Wno-cpp
3826 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3828 Suppress warning messages emitted by @code{#warning} directives.
3830 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3831 @opindex Wdouble-promotion
3832 @opindex Wno-double-promotion
3833 Give a warning when a value of type @code{float} is implicitly
3834 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3835 floating-point unit implement @code{float} in hardware, but emulate
3836 @code{double} in software.  On such a machine, doing computations
3837 using @code{double} values is much more expensive because of the
3838 overhead required for software emulation.
3840 It is easy to accidentally do computations with @code{double} because
3841 floating-point literals are implicitly of type @code{double}.  For
3842 example, in:
3843 @smallexample
3844 @group
3845 float area(float radius)
3847    return 3.14159 * radius * radius;
3849 @end group
3850 @end smallexample
3851 the compiler performs the entire computation with @code{double}
3852 because the floating-point literal is a @code{double}.
3854 @item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
3855 @opindex Wduplicate-decl-specifier
3856 @opindex Wno-duplicate-decl-specifier
3857 Warn if a declaration has duplicate @code{const}, @code{volatile},
3858 @code{restrict} or @code{_Atomic} specifier.  This warning is enabled by
3859 @option{-Wall}.
3861 @item -Wformat
3862 @itemx -Wformat=@var{n}
3863 @opindex Wformat
3864 @opindex Wno-format
3865 @opindex ffreestanding
3866 @opindex fno-builtin
3867 @opindex Wformat=
3868 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3869 the arguments supplied have types appropriate to the format string
3870 specified, and that the conversions specified in the format string make
3871 sense.  This includes standard functions, and others specified by format
3872 attributes (@pxref{Function Attributes}), in the @code{printf},
3873 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3874 not in the C standard) families (or other target-specific families).
3875 Which functions are checked without format attributes having been
3876 specified depends on the standard version selected, and such checks of
3877 functions without the attribute specified are disabled by
3878 @option{-ffreestanding} or @option{-fno-builtin}.
3880 The formats are checked against the format features supported by GNU
3881 libc version 2.2.  These include all ISO C90 and C99 features, as well
3882 as features from the Single Unix Specification and some BSD and GNU
3883 extensions.  Other library implementations may not support all these
3884 features; GCC does not support warning about features that go beyond a
3885 particular library's limitations.  However, if @option{-Wpedantic} is used
3886 with @option{-Wformat}, warnings are given about format features not
3887 in the selected standard version (but not for @code{strfmon} formats,
3888 since those are not in any version of the C standard).  @xref{C Dialect
3889 Options,,Options Controlling C Dialect}.
3891 @table @gcctabopt
3892 @item -Wformat=1
3893 @itemx -Wformat
3894 @opindex Wformat
3895 @opindex Wformat=1
3896 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3897 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3898 @option{-Wformat} also checks for null format arguments for several
3899 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3900 aspects of this level of format checking can be disabled by the
3901 options: @option{-Wno-format-contains-nul},
3902 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3903 @option{-Wformat} is enabled by @option{-Wall}.
3905 @item -Wno-format-contains-nul
3906 @opindex Wno-format-contains-nul
3907 @opindex Wformat-contains-nul
3908 If @option{-Wformat} is specified, do not warn about format strings that
3909 contain NUL bytes.
3911 @item -Wno-format-extra-args
3912 @opindex Wno-format-extra-args
3913 @opindex Wformat-extra-args
3914 If @option{-Wformat} is specified, do not warn about excess arguments to a
3915 @code{printf} or @code{scanf} format function.  The C standard specifies
3916 that such arguments are ignored.
3918 Where the unused arguments lie between used arguments that are
3919 specified with @samp{$} operand number specifications, normally
3920 warnings are still given, since the implementation could not know what
3921 type to pass to @code{va_arg} to skip the unused arguments.  However,
3922 in the case of @code{scanf} formats, this option suppresses the
3923 warning if the unused arguments are all pointers, since the Single
3924 Unix Specification says that such unused arguments are allowed.
3926 @item -Wformat-length
3927 @itemx -Wformat-length=@var{level}
3928 @opindex Wformat-length
3929 @opindex Wno-format-length
3930 Warn about calls to formatted input/output functions such as @code{sprintf}
3931 that might overflow the destination buffer, or about bounded functions such
3932 as @code{snprintf} that might result in output truncation.  When the exact
3933 number of bytes written by a format directive cannot be determined at
3934 compile-time it is estimated based on heuristics that depend on the
3935 @var{level} argument and on optimization.  While enabling optimization
3936 will in most cases improve the accuracy of the warning, it may also
3937 result in false positives.
3939 @table @gcctabopt
3940 @item -Wformat-length
3941 @item -Wformat-length=1
3942 @opindex Wformat-length
3943 @opindex Wno-format-length
3944 Level @var{1} of @option{-Wformat-length} enabled by @option{-Wformat}
3945 employs a conservative approach that warns only about calls that most
3946 likely overflow the buffer or result in output truncation.  At this
3947 level, numeric arguments to format directives with unknown values are
3948 assumed to have the value of one, and strings of unknown length to be
3949 empty.  Numeric arguments that are known to be bounded to a subrange
3950 of their type, or string arguments whose output is bounded either by
3951 their directive's precision or by a finite set of string literals, are
3952 assumed to take on the value within the range that results in the most
3953 bytes on output.  For example, the call to @code{sprintf} below is
3954 diagnosed because even with both @var{a} and @var{b} equal to zero,
3955 the terminating NUL character (@code{'\0'}) appended by the function
3956 to the destination buffer will be written past its end.  Increasing
3957 the size of the buffer by a single byte is sufficient to avoid the
3958 warning, though it may not be sufficient to avoid the overflow.
3960 @smallexample
3961 void f (int a, int b)
3963   char buf [12];
3964   sprintf (buf, "a = %i, b = %i\n", a, b);
3966 @end smallexample
3968 @item -Wformat-length=2
3969 Level @var{2} warns also about calls that might overflow the destination
3970 buffer or result in truncation given an argument of sufficient length
3971 or magnitude.  At level @var{2}, unknown numeric arguments are assumed
3972 to have the minimum representable value for signed types with a precision
3973 greater than 1, and the maximum representable value otherwise.  Unknown
3974 string arguments whose length cannot be assumed to be bounded either by
3975 the directive's precision, or by a finite set of string literals they
3976 may evaluate to, or the character array they may point to, are assumed
3977 to be 1 character long.
3979 At level @var{2}, the call in the example above is again diagnosed, but
3980 this time because with @var{a} equal to a 32-bit @code{INT_MIN} the first
3981 @code{%i} directive will write some of its digits beyond the end of
3982 the destination buffer.  To make the call safe regardless of the values
3983 of the two variables, the size of the destination buffer must be increased
3984 to at least 34 bytes.  GCC includes the minimum size of the buffer in
3985 an informational note following the warning.
3987 An alternative to increasing the size of the destination buffer is to
3988 constrain the range of formatted values.  The maximum length of string
3989 arguments can be bounded by specifying the precision in the format
3990 directive.  When numeric arguments of format directives can be assumed
3991 to be bounded by less than the precision of their type, choosing
3992 an appropriate length modifier to the format specifier will reduce
3993 the required buffer size.  For example, if @var{a} and @var{b} in the
3994 example above can be assumed to be within the precision of
3995 the @code{short int} type then using either the @code{%hi} format
3996 directive or casting the argument to @code{short} reduces the maximum
3997 required size of the buffer to 24 bytes.
3999 @smallexample
4000 void f (int a, int b)
4002   char buf [23];
4003   sprintf (buf, "a = %hi, b = %i\n", a, (short)b);
4005 @end smallexample
4006 @end table
4008 @item -Wno-format-zero-length
4009 @opindex Wno-format-zero-length
4010 @opindex Wformat-zero-length
4011 If @option{-Wformat} is specified, do not warn about zero-length formats.
4012 The C standard specifies that zero-length formats are allowed.
4015 @item -Wformat=2
4016 @opindex Wformat=2
4017 Enable @option{-Wformat} plus additional format checks.  Currently
4018 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
4019 -Wformat-y2k}.
4021 @item -Wformat-nonliteral
4022 @opindex Wformat-nonliteral
4023 @opindex Wno-format-nonliteral
4024 If @option{-Wformat} is specified, also warn if the format string is not a
4025 string literal and so cannot be checked, unless the format function
4026 takes its format arguments as a @code{va_list}.
4028 @item -Wformat-security
4029 @opindex Wformat-security
4030 @opindex Wno-format-security
4031 If @option{-Wformat} is specified, also warn about uses of format
4032 functions that represent possible security problems.  At present, this
4033 warns about calls to @code{printf} and @code{scanf} functions where the
4034 format string is not a string literal and there are no format arguments,
4035 as in @code{printf (foo);}.  This may be a security hole if the format
4036 string came from untrusted input and contains @samp{%n}.  (This is
4037 currently a subset of what @option{-Wformat-nonliteral} warns about, but
4038 in future warnings may be added to @option{-Wformat-security} that are not
4039 included in @option{-Wformat-nonliteral}.)
4041 @item -Wformat-signedness
4042 @opindex Wformat-signedness
4043 @opindex Wno-format-signedness
4044 If @option{-Wformat} is specified, also warn if the format string
4045 requires an unsigned argument and the argument is signed and vice versa.
4047 @item -Wformat-y2k
4048 @opindex Wformat-y2k
4049 @opindex Wno-format-y2k
4050 If @option{-Wformat} is specified, also warn about @code{strftime}
4051 formats that may yield only a two-digit year.
4052 @end table
4054 @item -Wnonnull
4055 @opindex Wnonnull
4056 @opindex Wno-nonnull
4057 Warn about passing a null pointer for arguments marked as
4058 requiring a non-null value by the @code{nonnull} function attribute.
4060 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
4061 can be disabled with the @option{-Wno-nonnull} option.
4063 @item -Wnonnull-compare
4064 @opindex Wnonnull-compare
4065 @opindex Wno-nonnull-compare
4066 Warn when comparing an argument marked with the @code{nonnull}
4067 function attribute against null inside the function.
4069 @option{-Wnonnull-compare} is included in @option{-Wall}.  It
4070 can be disabled with the @option{-Wno-nonnull-compare} option.
4072 @item -Wnull-dereference
4073 @opindex Wnull-dereference
4074 @opindex Wno-null-dereference
4075 Warn if the compiler detects paths that trigger erroneous or
4076 undefined behavior due to dereferencing a null pointer.  This option
4077 is only active when @option{-fdelete-null-pointer-checks} is active,
4078 which is enabled by optimizations in most targets.  The precision of
4079 the warnings depends on the optimization options used.
4081 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
4082 @opindex Winit-self
4083 @opindex Wno-init-self
4084 Warn about uninitialized variables that are initialized with themselves.
4085 Note this option can only be used with the @option{-Wuninitialized} option.
4087 For example, GCC warns about @code{i} being uninitialized in the
4088 following snippet only when @option{-Winit-self} has been specified:
4089 @smallexample
4090 @group
4091 int f()
4093   int i = i;
4094   return i;
4096 @end group
4097 @end smallexample
4099 This warning is enabled by @option{-Wall} in C++.
4101 @item -Wimplicit-int @r{(C and Objective-C only)}
4102 @opindex Wimplicit-int
4103 @opindex Wno-implicit-int
4104 Warn when a declaration does not specify a type.
4105 This warning is enabled by @option{-Wall}.
4107 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
4108 @opindex Wimplicit-function-declaration
4109 @opindex Wno-implicit-function-declaration
4110 Give a warning whenever a function is used before being declared. In
4111 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
4112 enabled by default and it is made into an error by
4113 @option{-pedantic-errors}. This warning is also enabled by
4114 @option{-Wall}.
4116 @item -Wimplicit @r{(C and Objective-C only)}
4117 @opindex Wimplicit
4118 @opindex Wno-implicit
4119 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
4120 This warning is enabled by @option{-Wall}.
4122 @item -Wimplicit-fallthrough
4123 @opindex Wimplicit-fallthrough
4124 @opindex Wno-implicit-fallthrough
4125 @option{-Wimplicit-fallthrough} is the same as @option{-Wimplicit-fallthrough=3}
4126 and @option{-Wno-implicit-fallthrough} is the same as
4127 @option{-Wimplicit-fallthrough=0}.
4129 @item -Wimplicit-fallthrough=@var{n}
4130 @opindex Wimplicit-fallthrough=
4131 Warn when a switch case falls through.  For example:
4133 @smallexample
4134 @group
4135 switch (cond)
4136   @{
4137   case 1:
4138     a = 1;
4139     break;
4140   case 2:
4141     a = 2;
4142   case 3:
4143     a = 3;
4144     break;
4145   @}
4146 @end group
4147 @end smallexample
4149 This warning does not warn when the last statement of a case cannot
4150 fall through, e.g. when there is a return statement or a call to function
4151 declared with the noreturn attribute.  @option{-Wimplicit-fallthrough=}
4152 also takes into account control flow statements, such as ifs, and only
4153 warns when appropriate.  E.g.@:
4155 @smallexample
4156 @group
4157 switch (cond)
4158   @{
4159   case 1:
4160     if (i > 3) @{
4161       bar (5);
4162       break;
4163     @} else if (i < 1) @{
4164       bar (0);
4165     @} else
4166       return;
4167   default:
4168     @dots{}
4169   @}
4170 @end group
4171 @end smallexample
4173 Since there are occasions where a switch case fall through is desirable,
4174 GCC provides an attribute, @code{__attribute__ ((fallthrough))}, that is
4175 to be used along with a null statement to suppress this warning that
4176 would normally occur:
4178 @smallexample
4179 @group
4180 switch (cond)
4181   @{
4182   case 1:
4183     bar (0);
4184     __attribute__ ((fallthrough));
4185   default:
4186     @dots{}
4187   @}
4188 @end group
4189 @end smallexample
4191 C++17 provides a standard way to suppress the @option{-Wimplicit-fallthrough}
4192 warning using @code{[[fallthrough]];} instead of the GNU attribute.  In C++11
4193 or C++14 users can use @code{[[gnu::fallthrough]];}, which is a GNU extension.
4194 Instead of the these attributes, it is also possible to add a fallthrough
4195 comment to silence the warning.  The whole body of the C or C++ style comment
4196 should match the given regular expressions listed below.  The option argument
4197 @var{n} specifies what kind of comments are accepted:
4199 @itemize @bullet
4201 @item @option{-Wimplicit-fallthrough=0} disables the warning altogether.
4203 @item @option{-Wimplicit-fallthrough=1} matches @code{.*} regular
4204 expression, any comment is used as fallthrough comment.
4206 @item @option{-Wimplicit-fallthrough=2} case insensitively matches
4207 @code{.*falls?[ \t-]*thr(ough|u).*} regular expression.
4209 @item @option{-Wimplicit-fallthrough=3} case sensitively matches one of the
4210 following regular expressions:
4212 @itemize @bullet
4214 @item @code{-fallthrough}
4216 @item @code{@@fallthrough@@}
4218 @item @code{lint -fallthrough[ \t]*}
4220 @item @code{[ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?@*FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?}
4222 @item @code{[ \t.!]*(Else,? |Intentional(ly)? )?@*Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?}
4224 @item @code{[ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?@*fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?}
4226 @end itemize
4228 @item @option{-Wimplicit-fallthrough=4} case sensitively matches one of the
4229 following regular expressions:
4231 @itemize @bullet
4233 @item @code{-fallthrough}
4235 @item @code{@@fallthrough@@}
4237 @item @code{lint -fallthrough[ \t]*}
4239 @item @code{[ \t]*FALLTHR(OUGH|U)[ \t]*}
4241 @end itemize
4243 @item @option{-Wimplicit-fallthrough=5} doesn't recognize any comments as
4244 fallthrough comments, only attributes disable the warning.
4246 @end itemize
4248 The comment needs to be followed after optional whitespace and other comments
4249 by @code{case} or @code{default} keywords or by a user label that preceeds some
4250 @code{case} or @code{default} label.
4252 @smallexample
4253 @group
4254 switch (cond)
4255   @{
4256   case 1:
4257     bar (0);
4258     /* FALLTHRU */
4259   default:
4260     @dots{}
4261   @}
4262 @end group
4263 @end smallexample
4265 The @option{-Wimplicit-fallthrough=3} warning is enabled by @option{-Wextra}.
4267 @item -Wignored-qualifiers @r{(C and C++ only)}
4268 @opindex Wignored-qualifiers
4269 @opindex Wno-ignored-qualifiers
4270 Warn if the return type of a function has a type qualifier
4271 such as @code{const}.  For ISO C such a type qualifier has no effect,
4272 since the value returned by a function is not an lvalue.
4273 For C++, the warning is only emitted for scalar types or @code{void}.
4274 ISO C prohibits qualified @code{void} return types on function
4275 definitions, so such return types always receive a warning
4276 even without this option.
4278 This warning is also enabled by @option{-Wextra}.
4280 @item -Wignored-attributes @r{(C and C++ only)}
4281 @opindex Wignored-attributes
4282 @opindex Wno-ignored-attributes
4283 Warn when an attribute is ignored.  This is different from the
4284 @option{-Wattributes} option in that it warns whenever the compiler decides
4285 to drop an attribute, not that the attribute is either unknown, used in a
4286 wrong place, etc.  This warning is enabled by default.
4288 @item -Wmain
4289 @opindex Wmain
4290 @opindex Wno-main
4291 Warn if the type of @code{main} is suspicious.  @code{main} should be
4292 a function with external linkage, returning int, taking either zero
4293 arguments, two, or three arguments of appropriate types.  This warning
4294 is enabled by default in C++ and is enabled by either @option{-Wall}
4295 or @option{-Wpedantic}.
4297 @item -Wmisleading-indentation @r{(C and C++ only)}
4298 @opindex Wmisleading-indentation
4299 @opindex Wno-misleading-indentation
4300 Warn when the indentation of the code does not reflect the block structure.
4301 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
4302 @code{for} clauses with a guarded statement that does not use braces,
4303 followed by an unguarded statement with the same indentation.
4305 In the following example, the call to ``bar'' is misleadingly indented as
4306 if it were guarded by the ``if'' conditional.
4308 @smallexample
4309   if (some_condition ())
4310     foo ();
4311     bar ();  /* Gotcha: this is not guarded by the "if".  */
4312 @end smallexample
4314 In the case of mixed tabs and spaces, the warning uses the
4315 @option{-ftabstop=} option to determine if the statements line up
4316 (defaulting to 8).
4318 The warning is not issued for code involving multiline preprocessor logic
4319 such as the following example.
4321 @smallexample
4322   if (flagA)
4323     foo (0);
4324 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
4325   if (flagB)
4326 #endif
4327     foo (1);
4328 @end smallexample
4330 The warning is not issued after a @code{#line} directive, since this
4331 typically indicates autogenerated code, and no assumptions can be made
4332 about the layout of the file that the directive references.
4334 This warning is enabled by @option{-Wall} in C and C++.
4336 @item -Wmissing-braces
4337 @opindex Wmissing-braces
4338 @opindex Wno-missing-braces
4339 Warn if an aggregate or union initializer is not fully bracketed.  In
4340 the following example, the initializer for @code{a} is not fully
4341 bracketed, but that for @code{b} is fully bracketed.  This warning is
4342 enabled by @option{-Wall} in C.
4344 @smallexample
4345 int a[2][2] = @{ 0, 1, 2, 3 @};
4346 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
4347 @end smallexample
4349 This warning is enabled by @option{-Wall}.
4351 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
4352 @opindex Wmissing-include-dirs
4353 @opindex Wno-missing-include-dirs
4354 Warn if a user-supplied include directory does not exist.
4356 @item -Wparentheses
4357 @opindex Wparentheses
4358 @opindex Wno-parentheses
4359 Warn if parentheses are omitted in certain contexts, such
4360 as when there is an assignment in a context where a truth value
4361 is expected, or when operators are nested whose precedence people
4362 often get confused about.
4364 Also warn if a comparison like @code{x<=y<=z} appears; this is
4365 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
4366 interpretation from that of ordinary mathematical notation.
4368 Also warn for dangerous uses of the GNU extension to
4369 @code{?:} with omitted middle operand. When the condition
4370 in the @code{?}: operator is a boolean expression, the omitted value is
4371 always 1.  Often programmers expect it to be a value computed
4372 inside the conditional expression instead.
4374 This warning is enabled by @option{-Wall}.
4376 @item -Wsequence-point
4377 @opindex Wsequence-point
4378 @opindex Wno-sequence-point
4379 Warn about code that may have undefined semantics because of violations
4380 of sequence point rules in the C and C++ standards.
4382 The C and C++ standards define the order in which expressions in a C/C++
4383 program are evaluated in terms of @dfn{sequence points}, which represent
4384 a partial ordering between the execution of parts of the program: those
4385 executed before the sequence point, and those executed after it.  These
4386 occur after the evaluation of a full expression (one which is not part
4387 of a larger expression), after the evaluation of the first operand of a
4388 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
4389 function is called (but after the evaluation of its arguments and the
4390 expression denoting the called function), and in certain other places.
4391 Other than as expressed by the sequence point rules, the order of
4392 evaluation of subexpressions of an expression is not specified.  All
4393 these rules describe only a partial order rather than a total order,
4394 since, for example, if two functions are called within one expression
4395 with no sequence point between them, the order in which the functions
4396 are called is not specified.  However, the standards committee have
4397 ruled that function calls do not overlap.
4399 It is not specified when between sequence points modifications to the
4400 values of objects take effect.  Programs whose behavior depends on this
4401 have undefined behavior; the C and C++ standards specify that ``Between
4402 the previous and next sequence point an object shall have its stored
4403 value modified at most once by the evaluation of an expression.
4404 Furthermore, the prior value shall be read only to determine the value
4405 to be stored.''.  If a program breaks these rules, the results on any
4406 particular implementation are entirely unpredictable.
4408 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
4409 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
4410 diagnosed by this option, and it may give an occasional false positive
4411 result, but in general it has been found fairly effective at detecting
4412 this sort of problem in programs.
4414 The C++17 standard will define the order of evaluation of operands in
4415 more cases: in particular it requires that the right-hand side of an
4416 assignment be evaluated before the left-hand side, so the above
4417 examples are no longer undefined.  But this warning will still warn
4418 about them, to help people avoid writing code that is undefined in C
4419 and earlier revisions of C++.
4421 The standard is worded confusingly, therefore there is some debate
4422 over the precise meaning of the sequence point rules in subtle cases.
4423 Links to discussions of the problem, including proposed formal
4424 definitions, may be found on the GCC readings page, at
4425 @uref{http://gcc.gnu.org/@/readings.html}.
4427 This warning is enabled by @option{-Wall} for C and C++.
4429 @item -Wno-return-local-addr
4430 @opindex Wno-return-local-addr
4431 @opindex Wreturn-local-addr
4432 Do not warn about returning a pointer (or in C++, a reference) to a
4433 variable that goes out of scope after the function returns.
4435 @item -Wreturn-type
4436 @opindex Wreturn-type
4437 @opindex Wno-return-type
4438 Warn whenever a function is defined with a return type that defaults
4439 to @code{int}.  Also warn about any @code{return} statement with no
4440 return value in a function whose return type is not @code{void}
4441 (falling off the end of the function body is considered returning
4442 without a value).
4444 For C only, warn about a @code{return} statement with an expression in a
4445 function whose return type is @code{void}, unless the expression type is
4446 also @code{void}.  As a GNU extension, the latter case is accepted
4447 without a warning unless @option{-Wpedantic} is used.
4449 For C++, a function without return type always produces a diagnostic
4450 message, even when @option{-Wno-return-type} is specified.  The only
4451 exceptions are @code{main} and functions defined in system headers.
4453 This warning is enabled by @option{-Wall}.
4455 @item -Wshift-count-negative
4456 @opindex Wshift-count-negative
4457 @opindex Wno-shift-count-negative
4458 Warn if shift count is negative. This warning is enabled by default.
4460 @item -Wshift-count-overflow
4461 @opindex Wshift-count-overflow
4462 @opindex Wno-shift-count-overflow
4463 Warn if shift count >= width of type. This warning is enabled by default.
4465 @item -Wshift-negative-value
4466 @opindex Wshift-negative-value
4467 @opindex Wno-shift-negative-value
4468 Warn if left shifting a negative value.  This warning is enabled by
4469 @option{-Wextra} in C99 and C++11 modes (and newer).
4471 @item -Wshift-overflow
4472 @itemx -Wshift-overflow=@var{n}
4473 @opindex Wshift-overflow
4474 @opindex Wno-shift-overflow
4475 Warn about left shift overflows.  This warning is enabled by
4476 default in C99 and C++11 modes (and newer).
4478 @table @gcctabopt
4479 @item -Wshift-overflow=1
4480 This is the warning level of @option{-Wshift-overflow} and is enabled
4481 by default in C99 and C++11 modes (and newer).  This warning level does
4482 not warn about left-shifting 1 into the sign bit.  (However, in C, such
4483 an overflow is still rejected in contexts where an integer constant expression
4484 is required.)
4486 @item -Wshift-overflow=2
4487 This warning level also warns about left-shifting 1 into the sign bit,
4488 unless C++14 mode is active.
4489 @end table
4491 @item -Wswitch
4492 @opindex Wswitch
4493 @opindex Wno-switch
4494 Warn whenever a @code{switch} statement has an index of enumerated type
4495 and lacks a @code{case} for one or more of the named codes of that
4496 enumeration.  (The presence of a @code{default} label prevents this
4497 warning.)  @code{case} labels outside the enumeration range also
4498 provoke warnings when this option is used (even if there is a
4499 @code{default} label).
4500 This warning is enabled by @option{-Wall}.
4502 @item -Wswitch-default
4503 @opindex Wswitch-default
4504 @opindex Wno-switch-default
4505 Warn whenever a @code{switch} statement does not have a @code{default}
4506 case.
4508 @item -Wswitch-enum
4509 @opindex Wswitch-enum
4510 @opindex Wno-switch-enum
4511 Warn whenever a @code{switch} statement has an index of enumerated type
4512 and lacks a @code{case} for one or more of the named codes of that
4513 enumeration.  @code{case} labels outside the enumeration range also
4514 provoke warnings when this option is used.  The only difference
4515 between @option{-Wswitch} and this option is that this option gives a
4516 warning about an omitted enumeration code even if there is a
4517 @code{default} label.
4519 @item -Wswitch-bool
4520 @opindex Wswitch-bool
4521 @opindex Wno-switch-bool
4522 Warn whenever a @code{switch} statement has an index of boolean type
4523 and the case values are outside the range of a boolean type.
4524 It is possible to suppress this warning by casting the controlling
4525 expression to a type other than @code{bool}.  For example:
4526 @smallexample
4527 @group
4528 switch ((int) (a == 4))
4529   @{
4530   @dots{}
4531   @}
4532 @end group
4533 @end smallexample
4534 This warning is enabled by default for C and C++ programs.
4536 @item -Wswitch-unreachable
4537 @opindex Wswitch-unreachable
4538 @opindex Wno-switch-unreachable
4539 Warn whenever a @code{switch} statement contains statements between the
4540 controlling expression and the first case label, which will never be
4541 executed.  For example:
4542 @smallexample
4543 @group
4544 switch (cond)
4545   @{
4546    i = 15;
4547   @dots{}
4548    case 5:
4549   @dots{}
4550   @}
4551 @end group
4552 @end smallexample
4553 @option{-Wswitch-unreachable} does not warn if the statement between the
4554 controlling expression and the first case label is just a declaration:
4555 @smallexample
4556 @group
4557 switch (cond)
4558   @{
4559    int i;
4560   @dots{}
4561    case 5:
4562    i = 5;
4563   @dots{}
4564   @}
4565 @end group
4566 @end smallexample
4567 This warning is enabled by default for C and C++ programs.
4569 @item -Wsync-nand @r{(C and C++ only)}
4570 @opindex Wsync-nand
4571 @opindex Wno-sync-nand
4572 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
4573 built-in functions are used.  These functions changed semantics in GCC 4.4.
4575 @item -Wtrigraphs
4576 @opindex Wtrigraphs
4577 @opindex Wno-trigraphs
4578 Warn if any trigraphs are encountered that might change the meaning of
4579 the program (trigraphs within comments are not warned about).
4580 This warning is enabled by @option{-Wall}.
4582 @item -Wunused-but-set-parameter
4583 @opindex Wunused-but-set-parameter
4584 @opindex Wno-unused-but-set-parameter
4585 Warn whenever a function parameter is assigned to, but otherwise unused
4586 (aside from its declaration).
4588 To suppress this warning use the @code{unused} attribute
4589 (@pxref{Variable Attributes}).
4591 This warning is also enabled by @option{-Wunused} together with
4592 @option{-Wextra}.
4594 @item -Wunused-but-set-variable
4595 @opindex Wunused-but-set-variable
4596 @opindex Wno-unused-but-set-variable
4597 Warn whenever a local variable is assigned to, but otherwise unused
4598 (aside from its declaration).
4599 This warning is enabled by @option{-Wall}.
4601 To suppress this warning use the @code{unused} attribute
4602 (@pxref{Variable Attributes}).
4604 This warning is also enabled by @option{-Wunused}, which is enabled
4605 by @option{-Wall}.
4607 @item -Wunused-function
4608 @opindex Wunused-function
4609 @opindex Wno-unused-function
4610 Warn whenever a static function is declared but not defined or a
4611 non-inline static function is unused.
4612 This warning is enabled by @option{-Wall}.
4614 @item -Wunused-label
4615 @opindex Wunused-label
4616 @opindex Wno-unused-label
4617 Warn whenever a label is declared but not used.
4618 This warning is enabled by @option{-Wall}.
4620 To suppress this warning use the @code{unused} attribute
4621 (@pxref{Variable Attributes}).
4623 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
4624 @opindex Wunused-local-typedefs
4625 Warn when a typedef locally defined in a function is not used.
4626 This warning is enabled by @option{-Wall}.
4628 @item -Wunused-parameter
4629 @opindex Wunused-parameter
4630 @opindex Wno-unused-parameter
4631 Warn whenever a function parameter is unused aside from its declaration.
4633 To suppress this warning use the @code{unused} attribute
4634 (@pxref{Variable Attributes}).
4636 @item -Wno-unused-result
4637 @opindex Wunused-result
4638 @opindex Wno-unused-result
4639 Do not warn if a caller of a function marked with attribute
4640 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
4641 its return value. The default is @option{-Wunused-result}.
4643 @item -Wunused-variable
4644 @opindex Wunused-variable
4645 @opindex Wno-unused-variable
4646 Warn whenever a local or static variable is unused aside from its
4647 declaration. This option implies @option{-Wunused-const-variable=1} for C,
4648 but not for C++. This warning is enabled by @option{-Wall}.
4650 To suppress this warning use the @code{unused} attribute
4651 (@pxref{Variable Attributes}).
4653 @item -Wunused-const-variable
4654 @itemx -Wunused-const-variable=@var{n}
4655 @opindex Wunused-const-variable
4656 @opindex Wno-unused-const-variable
4657 Warn whenever a constant static variable is unused aside from its declaration.
4658 @option{-Wunused-const-variable=1} is enabled by @option{-Wunused-variable}
4659 for C, but not for C++. In C this declares variable storage, but in C++ this
4660 is not an error since const variables take the place of @code{#define}s.
4662 To suppress this warning use the @code{unused} attribute
4663 (@pxref{Variable Attributes}).
4665 @table @gcctabopt
4666 @item -Wunused-const-variable=1
4667 This is the warning level that is enabled by @option{-Wunused-variable} for
4668 C.  It warns only about unused static const variables defined in the main
4669 compilation unit, but not about static const variables declared in any
4670 header included.
4672 @item -Wunused-const-variable=2
4673 This warning level also warns for unused constant static variables in
4674 headers (excluding system headers).  This is the warning level of
4675 @option{-Wunused-const-variable} and must be explicitly requested since
4676 in C++ this isn't an error and in C it might be harder to clean up all
4677 headers included.
4678 @end table
4680 @item -Wunused-value
4681 @opindex Wunused-value
4682 @opindex Wno-unused-value
4683 Warn whenever a statement computes a result that is explicitly not
4684 used. To suppress this warning cast the unused expression to
4685 @code{void}. This includes an expression-statement or the left-hand
4686 side of a comma expression that contains no side effects. For example,
4687 an expression such as @code{x[i,j]} causes a warning, while
4688 @code{x[(void)i,j]} does not.
4690 This warning is enabled by @option{-Wall}.
4692 @item -Wunused
4693 @opindex Wunused
4694 @opindex Wno-unused
4695 All the above @option{-Wunused} options combined.
4697 In order to get a warning about an unused function parameter, you must
4698 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
4699 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
4701 @item -Wuninitialized
4702 @opindex Wuninitialized
4703 @opindex Wno-uninitialized
4704 Warn if an automatic variable is used without first being initialized
4705 or if a variable may be clobbered by a @code{setjmp} call. In C++,
4706 warn if a non-static reference or non-static @code{const} member
4707 appears in a class without constructors.
4709 If you want to warn about code that uses the uninitialized value of the
4710 variable in its own initializer, use the @option{-Winit-self} option.
4712 These warnings occur for individual uninitialized or clobbered
4713 elements of structure, union or array variables as well as for
4714 variables that are uninitialized or clobbered as a whole.  They do
4715 not occur for variables or elements declared @code{volatile}.  Because
4716 these warnings depend on optimization, the exact variables or elements
4717 for which there are warnings depends on the precise optimization
4718 options and version of GCC used.
4720 Note that there may be no warning about a variable that is used only
4721 to compute a value that itself is never used, because such
4722 computations may be deleted by data flow analysis before the warnings
4723 are printed.
4725 @item -Winvalid-memory-model
4726 @opindex Winvalid-memory-model
4727 @opindex Wno-invalid-memory-model
4728 Warn for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
4729 and the C11 atomic generic functions with a memory consistency argument
4730 that is either invalid for the operation or outside the range of values
4731 of the @code{memory_order} enumeration.  For example, since the
4732 @code{__atomic_store} and @code{__atomic_store_n} built-ins are only
4733 defined for the relaxed, release, and sequentially consistent memory
4734 orders the following code is diagnosed:
4736 @smallexample
4737 void store (int *i)
4739   __atomic_store_n (i, 0, memory_order_consume);
4741 @end smallexample
4743 @option{-Winvalid-memory-model} is enabled by default.
4745 @item -Wmaybe-uninitialized
4746 @opindex Wmaybe-uninitialized
4747 @opindex Wno-maybe-uninitialized
4748 For an automatic variable, if there exists a path from the function
4749 entry to a use of the variable that is initialized, but there exist
4750 some other paths for which the variable is not initialized, the compiler
4751 emits a warning if it cannot prove the uninitialized paths are not
4752 executed at run time. These warnings are made optional because GCC is
4753 not smart enough to see all the reasons why the code might be correct
4754 in spite of appearing to have an error.  Here is one example of how
4755 this can happen:
4757 @smallexample
4758 @group
4760   int x;
4761   switch (y)
4762     @{
4763     case 1: x = 1;
4764       break;
4765     case 2: x = 4;
4766       break;
4767     case 3: x = 5;
4768     @}
4769   foo (x);
4771 @end group
4772 @end smallexample
4774 @noindent
4775 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4776 always initialized, but GCC doesn't know this. To suppress the
4777 warning, you need to provide a default case with assert(0) or
4778 similar code.
4780 @cindex @code{longjmp} warnings
4781 This option also warns when a non-volatile automatic variable might be
4782 changed by a call to @code{longjmp}.  These warnings as well are possible
4783 only in optimizing compilation.
4785 The compiler sees only the calls to @code{setjmp}.  It cannot know
4786 where @code{longjmp} will be called; in fact, a signal handler could
4787 call it at any point in the code.  As a result, you may get a warning
4788 even when there is in fact no problem because @code{longjmp} cannot
4789 in fact be called at the place that would cause a problem.
4791 Some spurious warnings can be avoided if you declare all the functions
4792 you use that never return as @code{noreturn}.  @xref{Function
4793 Attributes}.
4795 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4797 @item -Wunknown-pragmas
4798 @opindex Wunknown-pragmas
4799 @opindex Wno-unknown-pragmas
4800 @cindex warning for unknown pragmas
4801 @cindex unknown pragmas, warning
4802 @cindex pragmas, warning of unknown
4803 Warn when a @code{#pragma} directive is encountered that is not understood by 
4804 GCC@.  If this command-line option is used, warnings are even issued
4805 for unknown pragmas in system header files.  This is not the case if
4806 the warnings are only enabled by the @option{-Wall} command-line option.
4808 @item -Wno-pragmas
4809 @opindex Wno-pragmas
4810 @opindex Wpragmas
4811 Do not warn about misuses of pragmas, such as incorrect parameters,
4812 invalid syntax, or conflicts between pragmas.  See also
4813 @option{-Wunknown-pragmas}.
4815 @item -Wstrict-aliasing
4816 @opindex Wstrict-aliasing
4817 @opindex Wno-strict-aliasing
4818 This option is only active when @option{-fstrict-aliasing} is active.
4819 It warns about code that might break the strict aliasing rules that the
4820 compiler is using for optimization.  The warning does not catch all
4821 cases, but does attempt to catch the more common pitfalls.  It is
4822 included in @option{-Wall}.
4823 It is equivalent to @option{-Wstrict-aliasing=3}
4825 @item -Wstrict-aliasing=n
4826 @opindex Wstrict-aliasing=n
4827 This option is only active when @option{-fstrict-aliasing} is active.
4828 It warns about code that might break the strict aliasing rules that the
4829 compiler is using for optimization.
4830 Higher levels correspond to higher accuracy (fewer false positives).
4831 Higher levels also correspond to more effort, similar to the way @option{-O} 
4832 works.
4833 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4835 Level 1: Most aggressive, quick, least accurate.
4836 Possibly useful when higher levels
4837 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4838 false negatives.  However, it has many false positives.
4839 Warns for all pointer conversions between possibly incompatible types,
4840 even if never dereferenced.  Runs in the front end only.
4842 Level 2: Aggressive, quick, not too precise.
4843 May still have many false positives (not as many as level 1 though),
4844 and few false negatives (but possibly more than level 1).
4845 Unlike level 1, it only warns when an address is taken.  Warns about
4846 incomplete types.  Runs in the front end only.
4848 Level 3 (default for @option{-Wstrict-aliasing}):
4849 Should have very few false positives and few false
4850 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4851 Takes care of the common pun+dereference pattern in the front end:
4852 @code{*(int*)&some_float}.
4853 If optimization is enabled, it also runs in the back end, where it deals
4854 with multiple statement cases using flow-sensitive points-to information.
4855 Only warns when the converted pointer is dereferenced.
4856 Does not warn about incomplete types.
4858 @item -Wstrict-overflow
4859 @itemx -Wstrict-overflow=@var{n}
4860 @opindex Wstrict-overflow
4861 @opindex Wno-strict-overflow
4862 This option is only active when @option{-fstrict-overflow} is active.
4863 It warns about cases where the compiler optimizes based on the
4864 assumption that signed overflow does not occur.  Note that it does not
4865 warn about all cases where the code might overflow: it only warns
4866 about cases where the compiler implements some optimization.  Thus
4867 this warning depends on the optimization level.
4869 An optimization that assumes that signed overflow does not occur is
4870 perfectly safe if the values of the variables involved are such that
4871 overflow never does, in fact, occur.  Therefore this warning can
4872 easily give a false positive: a warning about code that is not
4873 actually a problem.  To help focus on important issues, several
4874 warning levels are defined.  No warnings are issued for the use of
4875 undefined signed overflow when estimating how many iterations a loop
4876 requires, in particular when determining whether a loop will be
4877 executed at all.
4879 @table @gcctabopt
4880 @item -Wstrict-overflow=1
4881 Warn about cases that are both questionable and easy to avoid.  For
4882 example,  with @option{-fstrict-overflow}, the compiler simplifies
4883 @code{x + 1 > x} to @code{1}.  This level of
4884 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4885 are not, and must be explicitly requested.
4887 @item -Wstrict-overflow=2
4888 Also warn about other cases where a comparison is simplified to a
4889 constant.  For example: @code{abs (x) >= 0}.  This can only be
4890 simplified when @option{-fstrict-overflow} is in effect, because
4891 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4892 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4893 @option{-Wstrict-overflow=2}.
4895 @item -Wstrict-overflow=3
4896 Also warn about other cases where a comparison is simplified.  For
4897 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4899 @item -Wstrict-overflow=4
4900 Also warn about other simplifications not covered by the above cases.
4901 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4903 @item -Wstrict-overflow=5
4904 Also warn about cases where the compiler reduces the magnitude of a
4905 constant involved in a comparison.  For example: @code{x + 2 > y} is
4906 simplified to @code{x + 1 >= y}.  This is reported only at the
4907 highest warning level because this simplification applies to many
4908 comparisons, so this warning level gives a very large number of
4909 false positives.
4910 @end table
4912 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4913 @opindex Wsuggest-attribute=
4914 @opindex Wno-suggest-attribute=
4915 Warn for cases where adding an attribute may be beneficial. The
4916 attributes currently supported are listed below.
4918 @table @gcctabopt
4919 @item -Wsuggest-attribute=pure
4920 @itemx -Wsuggest-attribute=const
4921 @itemx -Wsuggest-attribute=noreturn
4922 @opindex Wsuggest-attribute=pure
4923 @opindex Wno-suggest-attribute=pure
4924 @opindex Wsuggest-attribute=const
4925 @opindex Wno-suggest-attribute=const
4926 @opindex Wsuggest-attribute=noreturn
4927 @opindex Wno-suggest-attribute=noreturn
4929 Warn about functions that might be candidates for attributes
4930 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4931 functions visible in other compilation units or (in the case of @code{pure} and
4932 @code{const}) if it cannot prove that the function returns normally. A function
4933 returns normally if it doesn't contain an infinite loop or return abnormally
4934 by throwing, calling @code{abort} or trapping.  This analysis requires option
4935 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4936 higher.  Higher optimization levels improve the accuracy of the analysis.
4938 @item -Wsuggest-attribute=format
4939 @itemx -Wmissing-format-attribute
4940 @opindex Wsuggest-attribute=format
4941 @opindex Wmissing-format-attribute
4942 @opindex Wno-suggest-attribute=format
4943 @opindex Wno-missing-format-attribute
4944 @opindex Wformat
4945 @opindex Wno-format
4947 Warn about function pointers that might be candidates for @code{format}
4948 attributes.  Note these are only possible candidates, not absolute ones.
4949 GCC guesses that function pointers with @code{format} attributes that
4950 are used in assignment, initialization, parameter passing or return
4951 statements should have a corresponding @code{format} attribute in the
4952 resulting type.  I.e.@: the left-hand side of the assignment or
4953 initialization, the type of the parameter variable, or the return type
4954 of the containing function respectively should also have a @code{format}
4955 attribute to avoid the warning.
4957 GCC also warns about function definitions that might be
4958 candidates for @code{format} attributes.  Again, these are only
4959 possible candidates.  GCC guesses that @code{format} attributes
4960 might be appropriate for any function that calls a function like
4961 @code{vprintf} or @code{vscanf}, but this might not always be the
4962 case, and some functions for which @code{format} attributes are
4963 appropriate may not be detected.
4964 @end table
4966 @item -Wsuggest-final-types
4967 @opindex Wno-suggest-final-types
4968 @opindex Wsuggest-final-types
4969 Warn about types with virtual methods where code quality would be improved
4970 if the type were declared with the C++11 @code{final} specifier, 
4971 or, if possible,
4972 declared in an anonymous namespace. This allows GCC to more aggressively
4973 devirtualize the polymorphic calls. This warning is more effective with link
4974 time optimization, where the information about the class hierarchy graph is
4975 more complete.
4977 @item -Wsuggest-final-methods
4978 @opindex Wno-suggest-final-methods
4979 @opindex Wsuggest-final-methods
4980 Warn about virtual methods where code quality would be improved if the method
4981 were declared with the C++11 @code{final} specifier, 
4982 or, if possible, its type were
4983 declared in an anonymous namespace or with the @code{final} specifier.
4984 This warning is
4985 more effective with link time optimization, where the information about the
4986 class hierarchy graph is more complete. It is recommended to first consider
4987 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
4988 annotations.
4990 @item -Wsuggest-override
4991 Warn about overriding virtual functions that are not marked with the override
4992 keyword.
4994 @item -Walloca
4995 @opindex Wno-alloca
4996 @opindex Walloca
4997 This option warns on all uses of @code{alloca} in the source.
4999 @item -Walloca-larger-than=@var{n}
5000 This option warns on calls to @code{alloca} that are not bounded by a
5001 controlling predicate limiting its argument of integer type to at most
5002 @var{n} bytes, or calls to @code{alloca} where the bound is unknown.
5003 Arguments of non-integer types are considered unbounded even if they
5004 appear to be constrained to the expected range.
5006 For example, a bounded case of @code{alloca} could be:
5008 @smallexample
5009 void func (size_t n)
5011   void *p;
5012   if (n <= 1000)
5013     p = alloca (n);
5014   else
5015     p = malloc (n);
5016   f (p);
5018 @end smallexample
5020 In the above example, passing @code{-Walloca-larger-than=1000} would not
5021 issue a warning because the call to @code{alloca} is known to be at most
5022 1000 bytes.  However, if @code{-Walloca-larger-than=500} were passed,
5023 the compiler would emit a warning.
5025 Unbounded uses, on the other hand, are uses of @code{alloca} with no
5026 controlling predicate constraining its integer argument.  For example:
5028 @smallexample
5029 void func ()
5031   void *p = alloca (n);
5032   f (p);
5034 @end smallexample
5036 If @code{-Walloca-larger-than=500} were passed, the above would trigger
5037 a warning, but this time because of the lack of bounds checking.
5039 Note, that even seemingly correct code involving signed integers could
5040 cause a warning:
5042 @smallexample
5043 void func (signed int n)
5045   if (n < 500)
5046     @{
5047       p = alloca (n);
5048       f (p);
5049     @}
5051 @end smallexample
5053 In the above example, @var{n} could be negative, causing a larger than
5054 expected argument to be implicitly cast into the @code{alloca} call.
5056 This option also warns when @code{alloca} is used in a loop.
5058 This warning is not enabled by @option{-Wall}, and is only active when
5059 @option{-ftree-vrp} is active (default for @option{-O2} and above).
5061 See also @option{-Wvla-larger-than=@var{n}}.
5063 @item -Warray-bounds
5064 @itemx -Warray-bounds=@var{n}
5065 @opindex Wno-array-bounds
5066 @opindex Warray-bounds
5067 This option is only active when @option{-ftree-vrp} is active
5068 (default for @option{-O2} and above). It warns about subscripts to arrays
5069 that are always out of bounds. This warning is enabled by @option{-Wall}.
5071 @table @gcctabopt
5072 @item -Warray-bounds=1
5073 This is the warning level of @option{-Warray-bounds} and is enabled
5074 by @option{-Wall}; higher levels are not, and must be explicitly requested.
5076 @item -Warray-bounds=2
5077 This warning level also warns about out of bounds access for
5078 arrays at the end of a struct and for arrays accessed through
5079 pointers. This warning level may give a larger number of
5080 false positives and is deactivated by default.
5081 @end table
5083 @item -Wbool-compare
5084 @opindex Wno-bool-compare
5085 @opindex Wbool-compare
5086 Warn about boolean expression compared with an integer value different from
5087 @code{true}/@code{false}.  For instance, the following comparison is
5088 always false:
5089 @smallexample
5090 int n = 5;
5091 @dots{}
5092 if ((n > 1) == 2) @{ @dots{} @}
5093 @end smallexample
5094 This warning is enabled by @option{-Wall}.
5096 @item -Wbool-operation
5097 @opindex Wno-bool-operation
5098 @opindex Wbool-operation
5099 Warn about suspicious operations on expressions of a boolean type.  For
5100 instance, bitwise negation of a boolean is very likely a bug in the program.
5101 For C, this warning also warns about incrementing or decrementing a boolean,
5102 which rarely makes sense.  (In C++, decrementing a boolean is always invalid.
5103 Incrementing a boolean is invalid in C++1z, and deprecated otherwise.)
5105 This warning is enabled by @option{-Wall}.
5107 @item -Wduplicated-cond
5108 @opindex Wno-duplicated-cond
5109 @opindex Wduplicated-cond
5110 Warn about duplicated conditions in an if-else-if chain.  For instance,
5111 warn for the following code:
5112 @smallexample
5113 if (p->q != NULL) @{ @dots{} @}
5114 else if (p->q != NULL) @{ @dots{} @}
5115 @end smallexample
5117 @item -Wframe-address
5118 @opindex Wno-frame-address
5119 @opindex Wframe-address
5120 Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
5121 is called with an argument greater than 0.  Such calls may return indeterminate
5122 values or crash the program.  The warning is included in @option{-Wall}.
5124 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
5125 @opindex Wno-discarded-qualifiers
5126 @opindex Wdiscarded-qualifiers
5127 Do not warn if type qualifiers on pointers are being discarded.
5128 Typically, the compiler warns if a @code{const char *} variable is
5129 passed to a function that takes a @code{char *} parameter.  This option
5130 can be used to suppress such a warning.
5132 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
5133 @opindex Wno-discarded-array-qualifiers
5134 @opindex Wdiscarded-array-qualifiers
5135 Do not warn if type qualifiers on arrays which are pointer targets
5136 are being discarded. Typically, the compiler warns if a
5137 @code{const int (*)[]} variable is passed to a function that
5138 takes a @code{int (*)[]} parameter.  This option can be used to
5139 suppress such a warning.
5141 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
5142 @opindex Wno-incompatible-pointer-types
5143 @opindex Wincompatible-pointer-types
5144 Do not warn when there is a conversion between pointers that have incompatible
5145 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
5146 which warns for pointer argument passing or assignment with different
5147 signedness.
5149 @item -Wno-int-conversion @r{(C and Objective-C only)}
5150 @opindex Wno-int-conversion
5151 @opindex Wint-conversion
5152 Do not warn about incompatible integer to pointer and pointer to integer
5153 conversions.  This warning is about implicit conversions; for explicit
5154 conversions the warnings @option{-Wno-int-to-pointer-cast} and
5155 @option{-Wno-pointer-to-int-cast} may be used.
5157 @item -Wno-div-by-zero
5158 @opindex Wno-div-by-zero
5159 @opindex Wdiv-by-zero
5160 Do not warn about compile-time integer division by zero.  Floating-point
5161 division by zero is not warned about, as it can be a legitimate way of
5162 obtaining infinities and NaNs.
5164 @item -Wsystem-headers
5165 @opindex Wsystem-headers
5166 @opindex Wno-system-headers
5167 @cindex warnings from system headers
5168 @cindex system headers, warnings from
5169 Print warning messages for constructs found in system header files.
5170 Warnings from system headers are normally suppressed, on the assumption
5171 that they usually do not indicate real problems and would only make the
5172 compiler output harder to read.  Using this command-line option tells
5173 GCC to emit warnings from system headers as if they occurred in user
5174 code.  However, note that using @option{-Wall} in conjunction with this
5175 option does @emph{not} warn about unknown pragmas in system
5176 headers---for that, @option{-Wunknown-pragmas} must also be used.
5178 @item -Wtautological-compare
5179 @opindex Wtautological-compare
5180 @opindex Wno-tautological-compare
5181 Warn if a self-comparison always evaluates to true or false.  This
5182 warning detects various mistakes such as:
5183 @smallexample
5184 int i = 1;
5185 @dots{}
5186 if (i > i) @{ @dots{} @}
5187 @end smallexample
5188 This warning is enabled by @option{-Wall}.
5190 @item -Wtrampolines
5191 @opindex Wtrampolines
5192 @opindex Wno-trampolines
5193 Warn about trampolines generated for pointers to nested functions.
5194 A trampoline is a small piece of data or code that is created at run
5195 time on the stack when the address of a nested function is taken, and is
5196 used to call the nested function indirectly.  For some targets, it is
5197 made up of data only and thus requires no special treatment.  But, for
5198 most targets, it is made up of code and thus requires the stack to be
5199 made executable in order for the program to work properly.
5201 @item -Wfloat-equal
5202 @opindex Wfloat-equal
5203 @opindex Wno-float-equal
5204 Warn if floating-point values are used in equality comparisons.
5206 The idea behind this is that sometimes it is convenient (for the
5207 programmer) to consider floating-point values as approximations to
5208 infinitely precise real numbers.  If you are doing this, then you need
5209 to compute (by analyzing the code, or in some other way) the maximum or
5210 likely maximum error that the computation introduces, and allow for it
5211 when performing comparisons (and when producing output, but that's a
5212 different problem).  In particular, instead of testing for equality, you
5213 should check to see whether the two values have ranges that overlap; and
5214 this is done with the relational operators, so equality comparisons are
5215 probably mistaken.
5217 @item -Wtraditional @r{(C and Objective-C only)}
5218 @opindex Wtraditional
5219 @opindex Wno-traditional
5220 Warn about certain constructs that behave differently in traditional and
5221 ISO C@.  Also warn about ISO C constructs that have no traditional C
5222 equivalent, and/or problematic constructs that should be avoided.
5224 @itemize @bullet
5225 @item
5226 Macro parameters that appear within string literals in the macro body.
5227 In traditional C macro replacement takes place within string literals,
5228 but in ISO C it does not.
5230 @item
5231 In traditional C, some preprocessor directives did not exist.
5232 Traditional preprocessors only considered a line to be a directive
5233 if the @samp{#} appeared in column 1 on the line.  Therefore
5234 @option{-Wtraditional} warns about directives that traditional C
5235 understands but ignores because the @samp{#} does not appear as the
5236 first character on the line.  It also suggests you hide directives like
5237 @code{#pragma} not understood by traditional C by indenting them.  Some
5238 traditional implementations do not recognize @code{#elif}, so this option
5239 suggests avoiding it altogether.
5241 @item
5242 A function-like macro that appears without arguments.
5244 @item
5245 The unary plus operator.
5247 @item
5248 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
5249 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
5250 constants.)  Note, these suffixes appear in macros defined in the system
5251 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
5252 Use of these macros in user code might normally lead to spurious
5253 warnings, however GCC's integrated preprocessor has enough context to
5254 avoid warning in these cases.
5256 @item
5257 A function declared external in one block and then used after the end of
5258 the block.
5260 @item
5261 A @code{switch} statement has an operand of type @code{long}.
5263 @item
5264 A non-@code{static} function declaration follows a @code{static} one.
5265 This construct is not accepted by some traditional C compilers.
5267 @item
5268 The ISO type of an integer constant has a different width or
5269 signedness from its traditional type.  This warning is only issued if
5270 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
5271 typically represent bit patterns, are not warned about.
5273 @item
5274 Usage of ISO string concatenation is detected.
5276 @item
5277 Initialization of automatic aggregates.
5279 @item
5280 Identifier conflicts with labels.  Traditional C lacks a separate
5281 namespace for labels.
5283 @item
5284 Initialization of unions.  If the initializer is zero, the warning is
5285 omitted.  This is done under the assumption that the zero initializer in
5286 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
5287 initializer warnings and relies on default initialization to zero in the
5288 traditional C case.
5290 @item
5291 Conversions by prototypes between fixed/floating-point values and vice
5292 versa.  The absence of these prototypes when compiling with traditional
5293 C causes serious problems.  This is a subset of the possible
5294 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
5296 @item
5297 Use of ISO C style function definitions.  This warning intentionally is
5298 @emph{not} issued for prototype declarations or variadic functions
5299 because these ISO C features appear in your code when using
5300 libiberty's traditional C compatibility macros, @code{PARAMS} and
5301 @code{VPARAMS}.  This warning is also bypassed for nested functions
5302 because that feature is already a GCC extension and thus not relevant to
5303 traditional C compatibility.
5304 @end itemize
5306 @item -Wtraditional-conversion @r{(C and Objective-C only)}
5307 @opindex Wtraditional-conversion
5308 @opindex Wno-traditional-conversion
5309 Warn if a prototype causes a type conversion that is different from what
5310 would happen to the same argument in the absence of a prototype.  This
5311 includes conversions of fixed point to floating and vice versa, and
5312 conversions changing the width or signedness of a fixed-point argument
5313 except when the same as the default promotion.
5315 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
5316 @opindex Wdeclaration-after-statement
5317 @opindex Wno-declaration-after-statement
5318 Warn when a declaration is found after a statement in a block.  This
5319 construct, known from C++, was introduced with ISO C99 and is by default
5320 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
5322 @item -Wundef
5323 @opindex Wundef
5324 @opindex Wno-undef
5325 Warn if an undefined identifier is evaluated in an @code{#if} directive.
5327 @item -Wno-endif-labels
5328 @opindex Wno-endif-labels
5329 @opindex Wendif-labels
5330 Do not warn whenever an @code{#else} or an @code{#endif} are followed by text.
5332 @item -Wshadow
5333 @opindex Wshadow
5334 @opindex Wno-shadow
5335 Warn whenever a local variable or type declaration shadows another
5336 variable, parameter, type, class member (in C++), or instance variable
5337 (in Objective-C) or whenever a built-in function is shadowed. Note
5338 that in C++, the compiler warns if a local variable shadows an
5339 explicit typedef, but not if it shadows a struct/class/enum.
5340 Same as @option{-Wshadow=global}.
5342 @item -Wno-shadow-ivar @r{(Objective-C only)}
5343 @opindex Wno-shadow-ivar
5344 @opindex Wshadow-ivar
5345 Do not warn whenever a local variable shadows an instance variable in an
5346 Objective-C method.
5348 @item -Wshadow=global
5349 @opindex Wshadow=local
5350 The default for @option{-Wshadow}. Warns for any (global) shadowing.
5352 @item -Wshadow=local
5353 @opindex Wshadow=local
5354 Warn when a local variable shadows another local variable or parameter.
5355 This warning is enabled by @option{-Wshadow=global}.
5357 @item -Wshadow=compatible-local
5358 @opindex Wshadow=compatible-local
5359 Warn when a local variable shadows another local variable or parameter
5360 whose type is compatible with that of the shadowing variable. In C++,
5361 type compatibility here means the type of the shadowing variable can be
5362 converted to that of the shadowed variable. The creation of this flag
5363 (in addition to @option{-Wshadow=local}) is based on the idea that when
5364 a local variable shadows another one of incompatible type, it is most
5365 likely intentional, not a bug or typo, as shown in the following example:
5367 @smallexample
5368 @group
5369 for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
5371   for (int i = 0; i < N; ++i)
5372   @{
5373     ...
5374   @}
5375   ...
5377 @end group
5378 @end smallexample
5380 Since the two variable @code{i} in the example above have incompatible types,
5381 enabling only @option{-Wshadow=compatible-local} will not emit a warning.
5382 Because their types are incompatible, if a programmer accidentally uses one
5383 in place of the other, type checking will catch that and emit an error or
5384 warning. So not warning (about shadowing) in this case will not lead to
5385 undetected bugs. Use of this flag instead of @option{-Wshadow=local} can
5386 possibly reduce the number of warnings triggered by intentional shadowing.
5388 This warning is enabled by @option{-Wshadow=local}.
5390 @item -Wlarger-than=@var{len}
5391 @opindex Wlarger-than=@var{len}
5392 @opindex Wlarger-than-@var{len}
5393 Warn whenever an object of larger than @var{len} bytes is defined.
5395 @item -Wframe-larger-than=@var{len}
5396 @opindex Wframe-larger-than
5397 Warn if the size of a function frame is larger than @var{len} bytes.
5398 The computation done to determine the stack frame size is approximate
5399 and not conservative.
5400 The actual requirements may be somewhat greater than @var{len}
5401 even if you do not get a warning.  In addition, any space allocated
5402 via @code{alloca}, variable-length arrays, or related constructs
5403 is not included by the compiler when determining
5404 whether or not to issue a warning.
5406 @item -Wno-free-nonheap-object
5407 @opindex Wno-free-nonheap-object
5408 @opindex Wfree-nonheap-object
5409 Do not warn when attempting to free an object that was not allocated
5410 on the heap.
5412 @item -Wstack-usage=@var{len}
5413 @opindex Wstack-usage
5414 Warn if the stack usage of a function might be larger than @var{len} bytes.
5415 The computation done to determine the stack usage is conservative.
5416 Any space allocated via @code{alloca}, variable-length arrays, or related
5417 constructs is included by the compiler when determining whether or not to
5418 issue a warning.
5420 The message is in keeping with the output of @option{-fstack-usage}.
5422 @itemize
5423 @item
5424 If the stack usage is fully static but exceeds the specified amount, it's:
5426 @smallexample
5427   warning: stack usage is 1120 bytes
5428 @end smallexample
5429 @item
5430 If the stack usage is (partly) dynamic but bounded, it's:
5432 @smallexample
5433   warning: stack usage might be 1648 bytes
5434 @end smallexample
5435 @item
5436 If the stack usage is (partly) dynamic and not bounded, it's:
5438 @smallexample
5439   warning: stack usage might be unbounded
5440 @end smallexample
5441 @end itemize
5443 @item -Wunsafe-loop-optimizations
5444 @opindex Wunsafe-loop-optimizations
5445 @opindex Wno-unsafe-loop-optimizations
5446 Warn if the loop cannot be optimized because the compiler cannot
5447 assume anything on the bounds of the loop indices.  With
5448 @option{-funsafe-loop-optimizations} warn if the compiler makes
5449 such assumptions.
5451 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
5452 @opindex Wno-pedantic-ms-format
5453 @opindex Wpedantic-ms-format
5454 When used in combination with @option{-Wformat}
5455 and @option{-pedantic} without GNU extensions, this option
5456 disables the warnings about non-ISO @code{printf} / @code{scanf} format
5457 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
5458 which depend on the MS runtime.
5460 @item -Waligned-new
5461 @opindex Waligned-new
5462 @opindex Wno-aligned-new
5463 Warn about a new-expression of a type that requires greater alignment
5464 than the @code{alignof(std::max_align_t)} but uses an allocation
5465 function without an explicit alignment parameter. This option is
5466 enabled by @option{-Wall}.
5468 Normally this only warns about global allocation functions, but
5469 @option{-Waligned-new=all} also warns about class member allocation
5470 functions.
5472 @item -Wplacement-new
5473 @itemx -Wplacement-new=@var{n}
5474 @opindex Wplacement-new
5475 @opindex Wno-placement-new
5476 Warn about placement new expressions with undefined behavior, such as
5477 constructing an object in a buffer that is smaller than the type of
5478 the object.  For example, the placement new expression below is diagnosed
5479 because it attempts to construct an array of 64 integers in a buffer only
5480 64 bytes large.
5481 @smallexample
5482 char buf [64];
5483 new (buf) int[64];
5484 @end smallexample
5485 This warning is enabled by default.
5487 @table @gcctabopt
5488 @item -Wplacement-new=1
5489 This is the default warning level of @option{-Wplacement-new}.  At this
5490 level the warning is not issued for some strictly undefined constructs that
5491 GCC allows as extensions for compatibility with legacy code.  For example,
5492 the following @code{new} expression is not diagnosed at this level even
5493 though it has undefined behavior according to the C++ standard because
5494 it writes past the end of the one-element array.
5495 @smallexample
5496 struct S @{ int n, a[1]; @};
5497 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
5498 new (s->a)int [32]();
5499 @end smallexample
5501 @item -Wplacement-new=2
5502 At this level, in addition to diagnosing all the same constructs as at level
5503 1, a diagnostic is also issued for placement new expressions that construct
5504 an object in the last member of structure whose type is an array of a single
5505 element and whose size is less than the size of the object being constructed.
5506 While the previous example would be diagnosed, the following construct makes
5507 use of the flexible member array extension to avoid the warning at level 2.
5508 @smallexample
5509 struct S @{ int n, a[]; @};
5510 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
5511 new (s->a)int [32]();
5512 @end smallexample
5514 @end table
5516 @item -Wpointer-arith
5517 @opindex Wpointer-arith
5518 @opindex Wno-pointer-arith
5519 Warn about anything that depends on the ``size of'' a function type or
5520 of @code{void}.  GNU C assigns these types a size of 1, for
5521 convenience in calculations with @code{void *} pointers and pointers
5522 to functions.  In C++, warn also when an arithmetic operation involves
5523 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
5525 @item -Wtype-limits
5526 @opindex Wtype-limits
5527 @opindex Wno-type-limits
5528 Warn if a comparison is always true or always false due to the limited
5529 range of the data type, but do not warn for constant expressions.  For
5530 example, warn if an unsigned variable is compared against zero with
5531 @code{<} or @code{>=}.  This warning is also enabled by
5532 @option{-Wextra}.
5534 @item -Wbad-function-cast @r{(C and Objective-C only)}
5535 @opindex Wbad-function-cast
5536 @opindex Wno-bad-function-cast
5537 Warn when a function call is cast to a non-matching type.
5538 For example, warn if a call to a function returning an integer type 
5539 is cast to a pointer type.
5541 @item -Wc90-c99-compat @r{(C and Objective-C only)}
5542 @opindex Wc90-c99-compat
5543 @opindex Wno-c90-c99-compat
5544 Warn about features not present in ISO C90, but present in ISO C99.
5545 For instance, warn about use of variable length arrays, @code{long long}
5546 type, @code{bool} type, compound literals, designated initializers, and so
5547 on.  This option is independent of the standards mode.  Warnings are disabled
5548 in the expression that follows @code{__extension__}.
5550 @item -Wc99-c11-compat @r{(C and Objective-C only)}
5551 @opindex Wc99-c11-compat
5552 @opindex Wno-c99-c11-compat
5553 Warn about features not present in ISO C99, but present in ISO C11.
5554 For instance, warn about use of anonymous structures and unions,
5555 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
5556 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
5557 and so on.  This option is independent of the standards mode.  Warnings are
5558 disabled in the expression that follows @code{__extension__}.
5560 @item -Wc++-compat @r{(C and Objective-C only)}
5561 @opindex Wc++-compat
5562 Warn about ISO C constructs that are outside of the common subset of
5563 ISO C and ISO C++, e.g.@: request for implicit conversion from
5564 @code{void *} to a pointer to non-@code{void} type.
5566 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
5567 @opindex Wc++11-compat
5568 Warn about C++ constructs whose meaning differs between ISO C++ 1998
5569 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
5570 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
5571 enabled by @option{-Wall}.
5573 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
5574 @opindex Wc++14-compat
5575 Warn about C++ constructs whose meaning differs between ISO C++ 2011
5576 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
5578 @item -Wc++1z-compat @r{(C++ and Objective-C++ only)}
5579 @opindex Wc++1z-compat
5580 Warn about C++ constructs whose meaning differs between ISO C++ 2014
5581 and the forthoming ISO C++ 2017(?).  This warning is enabled by @option{-Wall}.
5583 @item -Wcast-qual
5584 @opindex Wcast-qual
5585 @opindex Wno-cast-qual
5586 Warn whenever a pointer is cast so as to remove a type qualifier from
5587 the target type.  For example, warn if a @code{const char *} is cast
5588 to an ordinary @code{char *}.
5590 Also warn when making a cast that introduces a type qualifier in an
5591 unsafe way.  For example, casting @code{char **} to @code{const char **}
5592 is unsafe, as in this example:
5594 @smallexample
5595   /* p is char ** value.  */
5596   const char **q = (const char **) p;
5597   /* Assignment of readonly string to const char * is OK.  */
5598   *q = "string";
5599   /* Now char** pointer points to read-only memory.  */
5600   **p = 'b';
5601 @end smallexample
5603 @item -Wcast-align
5604 @opindex Wcast-align
5605 @opindex Wno-cast-align
5606 Warn whenever a pointer is cast such that the required alignment of the
5607 target is increased.  For example, warn if a @code{char *} is cast to
5608 an @code{int *} on machines where integers can only be accessed at
5609 two- or four-byte boundaries.
5611 @item -Wwrite-strings
5612 @opindex Wwrite-strings
5613 @opindex Wno-write-strings
5614 When compiling C, give string constants the type @code{const
5615 char[@var{length}]} so that copying the address of one into a
5616 non-@code{const} @code{char *} pointer produces a warning.  These
5617 warnings help you find at compile time code that can try to write
5618 into a string constant, but only if you have been very careful about
5619 using @code{const} in declarations and prototypes.  Otherwise, it is
5620 just a nuisance. This is why we did not make @option{-Wall} request
5621 these warnings.
5623 When compiling C++, warn about the deprecated conversion from string
5624 literals to @code{char *}.  This warning is enabled by default for C++
5625 programs.
5627 @item -Wclobbered
5628 @opindex Wclobbered
5629 @opindex Wno-clobbered
5630 Warn for variables that might be changed by @code{longjmp} or
5631 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
5633 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
5634 @opindex Wconditionally-supported
5635 @opindex Wno-conditionally-supported
5636 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
5638 @item -Wconversion
5639 @opindex Wconversion
5640 @opindex Wno-conversion
5641 Warn for implicit conversions that may alter a value. This includes
5642 conversions between real and integer, like @code{abs (x)} when
5643 @code{x} is @code{double}; conversions between signed and unsigned,
5644 like @code{unsigned ui = -1}; and conversions to smaller types, like
5645 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
5646 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
5647 changed by the conversion like in @code{abs (2.0)}.  Warnings about
5648 conversions between signed and unsigned integers can be disabled by
5649 using @option{-Wno-sign-conversion}.
5651 For C++, also warn for confusing overload resolution for user-defined
5652 conversions; and conversions that never use a type conversion
5653 operator: conversions to @code{void}, the same type, a base class or a
5654 reference to them. Warnings about conversions between signed and
5655 unsigned integers are disabled by default in C++ unless
5656 @option{-Wsign-conversion} is explicitly enabled.
5658 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
5659 @opindex Wconversion-null
5660 @opindex Wno-conversion-null
5661 Do not warn for conversions between @code{NULL} and non-pointer
5662 types. @option{-Wconversion-null} is enabled by default.
5664 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
5665 @opindex Wzero-as-null-pointer-constant
5666 @opindex Wno-zero-as-null-pointer-constant
5667 Warn when a literal @samp{0} is used as null pointer constant.  This can
5668 be useful to facilitate the conversion to @code{nullptr} in C++11.
5670 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
5671 @opindex Wsubobject-linkage
5672 @opindex Wno-subobject-linkage
5673 Warn if a class type has a base or a field whose type uses the anonymous
5674 namespace or depends on a type with no linkage.  If a type A depends on
5675 a type B with no or internal linkage, defining it in multiple
5676 translation units would be an ODR violation because the meaning of B
5677 is different in each translation unit.  If A only appears in a single
5678 translation unit, the best way to silence the warning is to give it
5679 internal linkage by putting it in an anonymous namespace as well.  The
5680 compiler doesn't give this warning for types defined in the main .C
5681 file, as those are unlikely to have multiple definitions.
5682 @option{-Wsubobject-linkage} is enabled by default.
5684 @item -Wdangling-else
5685 @opindex Wdangling-else
5686 @opindex Wno-dangling-else
5687 Warn about constructions where there may be confusion to which
5688 @code{if} statement an @code{else} branch belongs.  Here is an example of
5689 such a case:
5691 @smallexample
5692 @group
5694   if (a)
5695     if (b)
5696       foo ();
5697   else
5698     bar ();
5700 @end group
5701 @end smallexample
5703 In C/C++, every @code{else} branch belongs to the innermost possible
5704 @code{if} statement, which in this example is @code{if (b)}.  This is
5705 often not what the programmer expected, as illustrated in the above
5706 example by indentation the programmer chose.  When there is the
5707 potential for this confusion, GCC issues a warning when this flag
5708 is specified.  To eliminate the warning, add explicit braces around
5709 the innermost @code{if} statement so there is no way the @code{else}
5710 can belong to the enclosing @code{if}.  The resulting code
5711 looks like this:
5713 @smallexample
5714 @group
5716   if (a)
5717     @{
5718       if (b)
5719         foo ();
5720       else
5721         bar ();
5722     @}
5724 @end group
5725 @end smallexample
5727 This warning is enabled by @option{-Wparentheses}.
5729 @item -Wdate-time
5730 @opindex Wdate-time
5731 @opindex Wno-date-time
5732 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
5733 are encountered as they might prevent bit-wise-identical reproducible
5734 compilations.
5736 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
5737 @opindex Wdelete-incomplete
5738 @opindex Wno-delete-incomplete
5739 Warn when deleting a pointer to incomplete type, which may cause
5740 undefined behavior at runtime.  This warning is enabled by default.
5742 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
5743 @opindex Wuseless-cast
5744 @opindex Wno-useless-cast
5745 Warn when an expression is casted to its own type.
5747 @item -Wempty-body
5748 @opindex Wempty-body
5749 @opindex Wno-empty-body
5750 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
5751 while} statement.  This warning is also enabled by @option{-Wextra}.
5753 @item -Wenum-compare
5754 @opindex Wenum-compare
5755 @opindex Wno-enum-compare
5756 Warn about a comparison between values of different enumerated types.
5757 In C++ enumeral mismatches in conditional expressions are also
5758 diagnosed and the warning is enabled by default.  In C this warning is 
5759 enabled by @option{-Wall}.
5761 @item -Wjump-misses-init @r{(C, Objective-C only)}
5762 @opindex Wjump-misses-init
5763 @opindex Wno-jump-misses-init
5764 Warn if a @code{goto} statement or a @code{switch} statement jumps
5765 forward across the initialization of a variable, or jumps backward to a
5766 label after the variable has been initialized.  This only warns about
5767 variables that are initialized when they are declared.  This warning is
5768 only supported for C and Objective-C; in C++ this sort of branch is an
5769 error in any case.
5771 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
5772 can be disabled with the @option{-Wno-jump-misses-init} option.
5774 @item -Wsign-compare
5775 @opindex Wsign-compare
5776 @opindex Wno-sign-compare
5777 @cindex warning for comparison of signed and unsigned values
5778 @cindex comparison of signed and unsigned values, warning
5779 @cindex signed and unsigned values, comparison warning
5780 Warn when a comparison between signed and unsigned values could produce
5781 an incorrect result when the signed value is converted to unsigned.
5782 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
5783 also enabled by @option{-Wextra}.
5785 @item -Wsign-conversion
5786 @opindex Wsign-conversion
5787 @opindex Wno-sign-conversion
5788 Warn for implicit conversions that may change the sign of an integer
5789 value, like assigning a signed integer expression to an unsigned
5790 integer variable. An explicit cast silences the warning. In C, this
5791 option is enabled also by @option{-Wconversion}.
5793 @item -Wfloat-conversion
5794 @opindex Wfloat-conversion
5795 @opindex Wno-float-conversion
5796 Warn for implicit conversions that reduce the precision of a real value.
5797 This includes conversions from real to integer, and from higher precision
5798 real to lower precision real values.  This option is also enabled by
5799 @option{-Wconversion}.
5801 @item -Wno-scalar-storage-order
5802 @opindex -Wno-scalar-storage-order
5803 @opindex -Wscalar-storage-order
5804 Do not warn on suspicious constructs involving reverse scalar storage order.
5806 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
5807 @opindex Wsized-deallocation
5808 @opindex Wno-sized-deallocation
5809 Warn about a definition of an unsized deallocation function
5810 @smallexample
5811 void operator delete (void *) noexcept;
5812 void operator delete[] (void *) noexcept;
5813 @end smallexample
5814 without a definition of the corresponding sized deallocation function
5815 @smallexample
5816 void operator delete (void *, std::size_t) noexcept;
5817 void operator delete[] (void *, std::size_t) noexcept;
5818 @end smallexample
5819 or vice versa.  Enabled by @option{-Wextra} along with
5820 @option{-fsized-deallocation}.
5822 @item -Wsizeof-pointer-memaccess
5823 @opindex Wsizeof-pointer-memaccess
5824 @opindex Wno-sizeof-pointer-memaccess
5825 Warn for suspicious length parameters to certain string and memory built-in
5826 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
5827 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
5828 but a pointer, and suggests a possible fix, or about
5829 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
5830 @option{-Wall}.
5832 @item -Wsizeof-array-argument
5833 @opindex Wsizeof-array-argument
5834 @opindex Wno-sizeof-array-argument
5835 Warn when the @code{sizeof} operator is applied to a parameter that is
5836 declared as an array in a function definition.  This warning is enabled by
5837 default for C and C++ programs.
5839 @item -Wmemset-elt-size
5840 @opindex Wmemset-elt-size
5841 @opindex Wno-memset-elt-size
5842 Warn for suspicious calls to the @code{memset} built-in function, if the
5843 first argument references an array, and the third argument is a number
5844 equal to the number of elements, but not equal to the size of the array
5845 in memory.  This indicates that the user has omitted a multiplication by
5846 the element size.  This warning is enabled by @option{-Wall}.
5848 @item -Wmemset-transposed-args
5849 @opindex Wmemset-transposed-args
5850 @opindex Wno-memset-transposed-args
5851 Warn for suspicious calls to the @code{memset} built-in function, if the
5852 second argument is not zero and the third argument is zero.  This warns e.g.@
5853 about @code{memset (buf, sizeof buf, 0)} where most probably
5854 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
5855 is only emitted if the third argument is literal zero.  If it is some
5856 expression that is folded to zero, a cast of zero to some type, etc., 
5857 it is far less likely that the user has mistakenly exchanged the arguments 
5858 and no warning is emitted.  This warning is enabled by @option{-Wall}.
5860 @item -Waddress
5861 @opindex Waddress
5862 @opindex Wno-address
5863 Warn about suspicious uses of memory addresses. These include using
5864 the address of a function in a conditional expression, such as
5865 @code{void func(void); if (func)}, and comparisons against the memory
5866 address of a string literal, such as @code{if (x == "abc")}.  Such
5867 uses typically indicate a programmer error: the address of a function
5868 always evaluates to true, so their use in a conditional usually
5869 indicate that the programmer forgot the parentheses in a function
5870 call; and comparisons against string literals result in unspecified
5871 behavior and are not portable in C, so they usually indicate that the
5872 programmer intended to use @code{strcmp}.  This warning is enabled by
5873 @option{-Wall}.
5875 @item -Wlogical-op
5876 @opindex Wlogical-op
5877 @opindex Wno-logical-op
5878 Warn about suspicious uses of logical operators in expressions.
5879 This includes using logical operators in contexts where a
5880 bit-wise operator is likely to be expected.  Also warns when
5881 the operands of a logical operator are the same:
5882 @smallexample
5883 extern int a;
5884 if (a < 0 && a < 0) @{ @dots{} @}
5885 @end smallexample
5887 @item -Wlogical-not-parentheses
5888 @opindex Wlogical-not-parentheses
5889 @opindex Wno-logical-not-parentheses
5890 Warn about logical not used on the left hand side operand of a comparison.
5891 This option does not warn if the right operand is considered to be a boolean
5892 expression.  Its purpose is to detect suspicious code like the following:
5893 @smallexample
5894 int a;
5895 @dots{}
5896 if (!a > 1) @{ @dots{} @}
5897 @end smallexample
5899 It is possible to suppress the warning by wrapping the LHS into
5900 parentheses:
5901 @smallexample
5902 if ((!a) > 1) @{ @dots{} @}
5903 @end smallexample
5905 This warning is enabled by @option{-Wall}.
5907 @item -Waggregate-return
5908 @opindex Waggregate-return
5909 @opindex Wno-aggregate-return
5910 Warn if any functions that return structures or unions are defined or
5911 called.  (In languages where you can return an array, this also elicits
5912 a warning.)
5914 @item -Wno-aggressive-loop-optimizations
5915 @opindex Wno-aggressive-loop-optimizations
5916 @opindex Waggressive-loop-optimizations
5917 Warn if in a loop with constant number of iterations the compiler detects
5918 undefined behavior in some statement during one or more of the iterations.
5920 @item -Wno-attributes
5921 @opindex Wno-attributes
5922 @opindex Wattributes
5923 Do not warn if an unexpected @code{__attribute__} is used, such as
5924 unrecognized attributes, function attributes applied to variables,
5925 etc.  This does not stop errors for incorrect use of supported
5926 attributes.
5928 @item -Wno-builtin-macro-redefined
5929 @opindex Wno-builtin-macro-redefined
5930 @opindex Wbuiltin-macro-redefined
5931 Do not warn if certain built-in macros are redefined.  This suppresses
5932 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
5933 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
5935 @item -Wstrict-prototypes @r{(C and Objective-C only)}
5936 @opindex Wstrict-prototypes
5937 @opindex Wno-strict-prototypes
5938 Warn if a function is declared or defined without specifying the
5939 argument types.  (An old-style function definition is permitted without
5940 a warning if preceded by a declaration that specifies the argument
5941 types.)
5943 @item -Wold-style-declaration @r{(C and Objective-C only)}
5944 @opindex Wold-style-declaration
5945 @opindex Wno-old-style-declaration
5946 Warn for obsolescent usages, according to the C Standard, in a
5947 declaration. For example, warn if storage-class specifiers like
5948 @code{static} are not the first things in a declaration.  This warning
5949 is also enabled by @option{-Wextra}.
5951 @item -Wold-style-definition @r{(C and Objective-C only)}
5952 @opindex Wold-style-definition
5953 @opindex Wno-old-style-definition
5954 Warn if an old-style function definition is used.  A warning is given
5955 even if there is a previous prototype.
5957 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
5958 @opindex Wmissing-parameter-type
5959 @opindex Wno-missing-parameter-type
5960 A function parameter is declared without a type specifier in K&R-style
5961 functions:
5963 @smallexample
5964 void foo(bar) @{ @}
5965 @end smallexample
5967 This warning is also enabled by @option{-Wextra}.
5969 @item -Wmissing-prototypes @r{(C and Objective-C only)}
5970 @opindex Wmissing-prototypes
5971 @opindex Wno-missing-prototypes
5972 Warn if a global function is defined without a previous prototype
5973 declaration.  This warning is issued even if the definition itself
5974 provides a prototype.  Use this option to detect global functions
5975 that do not have a matching prototype declaration in a header file.
5976 This option is not valid for C++ because all function declarations
5977 provide prototypes and a non-matching declaration declares an
5978 overload rather than conflict with an earlier declaration.
5979 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
5981 @item -Wmissing-declarations
5982 @opindex Wmissing-declarations
5983 @opindex Wno-missing-declarations
5984 Warn if a global function is defined without a previous declaration.
5985 Do so even if the definition itself provides a prototype.
5986 Use this option to detect global functions that are not declared in
5987 header files.  In C, no warnings are issued for functions with previous
5988 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
5989 missing prototypes.  In C++, no warnings are issued for function templates,
5990 or for inline functions, or for functions in anonymous namespaces.
5992 @item -Wmissing-field-initializers
5993 @opindex Wmissing-field-initializers
5994 @opindex Wno-missing-field-initializers
5995 @opindex W
5996 @opindex Wextra
5997 @opindex Wno-extra
5998 Warn if a structure's initializer has some fields missing.  For
5999 example, the following code causes such a warning, because
6000 @code{x.h} is implicitly zero:
6002 @smallexample
6003 struct s @{ int f, g, h; @};
6004 struct s x = @{ 3, 4 @};
6005 @end smallexample
6007 This option does not warn about designated initializers, so the following
6008 modification does not trigger a warning:
6010 @smallexample
6011 struct s @{ int f, g, h; @};
6012 struct s x = @{ .f = 3, .g = 4 @};
6013 @end smallexample
6015 In C++ this option does not warn either about the empty @{ @}
6016 initializer, for example:
6018 @smallexample
6019 struct s @{ int f, g, h; @};
6020 s x = @{ @};
6021 @end smallexample
6023 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
6024 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
6026 @item -Wno-multichar
6027 @opindex Wno-multichar
6028 @opindex Wmultichar
6029 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
6030 Usually they indicate a typo in the user's code, as they have
6031 implementation-defined values, and should not be used in portable code.
6033 @item -Wnormalized@r{[}=@r{<}none@r{|}id@r{|}nfc@r{|}nfkc@r{>]}
6034 @opindex Wnormalized=
6035 @opindex Wnormalized
6036 @opindex Wno-normalized
6037 @cindex NFC
6038 @cindex NFKC
6039 @cindex character set, input normalization
6040 In ISO C and ISO C++, two identifiers are different if they are
6041 different sequences of characters.  However, sometimes when characters
6042 outside the basic ASCII character set are used, you can have two
6043 different character sequences that look the same.  To avoid confusion,
6044 the ISO 10646 standard sets out some @dfn{normalization rules} which
6045 when applied ensure that two sequences that look the same are turned into
6046 the same sequence.  GCC can warn you if you are using identifiers that
6047 have not been normalized; this option controls that warning.
6049 There are four levels of warning supported by GCC@.  The default is
6050 @option{-Wnormalized=nfc}, which warns about any identifier that is
6051 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
6052 recommended form for most uses.  It is equivalent to
6053 @option{-Wnormalized}.
6055 Unfortunately, there are some characters allowed in identifiers by
6056 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
6057 identifiers.  That is, there's no way to use these symbols in portable
6058 ISO C or C++ and have all your identifiers in NFC@.
6059 @option{-Wnormalized=id} suppresses the warning for these characters.
6060 It is hoped that future versions of the standards involved will correct
6061 this, which is why this option is not the default.
6063 You can switch the warning off for all characters by writing
6064 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
6065 only do this if you are using some other normalization scheme (like
6066 ``D''), because otherwise you can easily create bugs that are
6067 literally impossible to see.
6069 Some characters in ISO 10646 have distinct meanings but look identical
6070 in some fonts or display methodologies, especially once formatting has
6071 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
6072 LETTER N'', displays just like a regular @code{n} that has been
6073 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
6074 normalization scheme to convert all these into a standard form as
6075 well, and GCC warns if your code is not in NFKC if you use
6076 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
6077 about every identifier that contains the letter O because it might be
6078 confused with the digit 0, and so is not the default, but may be
6079 useful as a local coding convention if the programming environment 
6080 cannot be fixed to display these characters distinctly.
6082 @item -Wno-deprecated
6083 @opindex Wno-deprecated
6084 @opindex Wdeprecated
6085 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
6087 @item -Wno-deprecated-declarations
6088 @opindex Wno-deprecated-declarations
6089 @opindex Wdeprecated-declarations
6090 Do not warn about uses of functions (@pxref{Function Attributes}),
6091 variables (@pxref{Variable Attributes}), and types (@pxref{Type
6092 Attributes}) marked as deprecated by using the @code{deprecated}
6093 attribute.
6095 @item -Wno-overflow
6096 @opindex Wno-overflow
6097 @opindex Woverflow
6098 Do not warn about compile-time overflow in constant expressions.
6100 @item -Wno-odr
6101 @opindex Wno-odr
6102 @opindex Wodr
6103 Warn about One Definition Rule violations during link-time optimization.
6104 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
6106 @item -Wopenmp-simd
6107 @opindex Wopenm-simd
6108 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
6109 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
6110 option can be used to relax the cost model.
6112 @item -Woverride-init @r{(C and Objective-C only)}
6113 @opindex Woverride-init
6114 @opindex Wno-override-init
6115 @opindex W
6116 @opindex Wextra
6117 @opindex Wno-extra
6118 Warn if an initialized field without side effects is overridden when
6119 using designated initializers (@pxref{Designated Inits, , Designated
6120 Initializers}).
6122 This warning is included in @option{-Wextra}.  To get other
6123 @option{-Wextra} warnings without this one, use @option{-Wextra
6124 -Wno-override-init}.
6126 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
6127 @opindex Woverride-init-side-effects
6128 @opindex Wno-override-init-side-effects
6129 Warn if an initialized field with side effects is overridden when
6130 using designated initializers (@pxref{Designated Inits, , Designated
6131 Initializers}).  This warning is enabled by default.
6133 @item -Wpacked
6134 @opindex Wpacked
6135 @opindex Wno-packed
6136 Warn if a structure is given the packed attribute, but the packed
6137 attribute has no effect on the layout or size of the structure.
6138 Such structures may be mis-aligned for little benefit.  For
6139 instance, in this code, the variable @code{f.x} in @code{struct bar}
6140 is misaligned even though @code{struct bar} does not itself
6141 have the packed attribute:
6143 @smallexample
6144 @group
6145 struct foo @{
6146   int x;
6147   char a, b, c, d;
6148 @} __attribute__((packed));
6149 struct bar @{
6150   char z;
6151   struct foo f;
6153 @end group
6154 @end smallexample
6156 @item -Wpacked-bitfield-compat
6157 @opindex Wpacked-bitfield-compat
6158 @opindex Wno-packed-bitfield-compat
6159 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
6160 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
6161 the change can lead to differences in the structure layout.  GCC
6162 informs you when the offset of such a field has changed in GCC 4.4.
6163 For example there is no longer a 4-bit padding between field @code{a}
6164 and @code{b} in this structure:
6166 @smallexample
6167 struct foo
6169   char a:4;
6170   char b:8;
6171 @} __attribute__ ((packed));
6172 @end smallexample
6174 This warning is enabled by default.  Use
6175 @option{-Wno-packed-bitfield-compat} to disable this warning.
6177 @item -Wpadded
6178 @opindex Wpadded
6179 @opindex Wno-padded
6180 Warn if padding is included in a structure, either to align an element
6181 of the structure or to align the whole structure.  Sometimes when this
6182 happens it is possible to rearrange the fields of the structure to
6183 reduce the padding and so make the structure smaller.
6185 @item -Wredundant-decls
6186 @opindex Wredundant-decls
6187 @opindex Wno-redundant-decls
6188 Warn if anything is declared more than once in the same scope, even in
6189 cases where multiple declaration is valid and changes nothing.
6191 @item -Wrestrict
6192 @opindex Wrestrict
6193 @opindex Wno-restrict
6194 Warn when an argument passed to a restrict-qualified parameter
6195 aliases with another argument.
6197 @item -Wnested-externs @r{(C and Objective-C only)}
6198 @opindex Wnested-externs
6199 @opindex Wno-nested-externs
6200 Warn if an @code{extern} declaration is encountered within a function.
6202 @item -Wno-inherited-variadic-ctor
6203 @opindex Winherited-variadic-ctor
6204 @opindex Wno-inherited-variadic-ctor
6205 Suppress warnings about use of C++11 inheriting constructors when the
6206 base class inherited from has a C variadic constructor; the warning is
6207 on by default because the ellipsis is not inherited.
6209 @item -Winline
6210 @opindex Winline
6211 @opindex Wno-inline
6212 Warn if a function that is declared as inline cannot be inlined.
6213 Even with this option, the compiler does not warn about failures to
6214 inline functions declared in system headers.
6216 The compiler uses a variety of heuristics to determine whether or not
6217 to inline a function.  For example, the compiler takes into account
6218 the size of the function being inlined and the amount of inlining
6219 that has already been done in the current function.  Therefore,
6220 seemingly insignificant changes in the source program can cause the
6221 warnings produced by @option{-Winline} to appear or disappear.
6223 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
6224 @opindex Wno-invalid-offsetof
6225 @opindex Winvalid-offsetof
6226 Suppress warnings from applying the @code{offsetof} macro to a non-POD
6227 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
6228 to a non-standard-layout type is undefined.  In existing C++ implementations,
6229 however, @code{offsetof} typically gives meaningful results.
6230 This flag is for users who are aware that they are
6231 writing nonportable code and who have deliberately chosen to ignore the
6232 warning about it.
6234 The restrictions on @code{offsetof} may be relaxed in a future version
6235 of the C++ standard.
6237 @item -Wint-in-bool-context
6238 @opindex Wint-in-bool-context
6239 @opindex Wno-int-in-bool-context
6240 Warn for suspicious use of integer values where boolean values are expected,
6241 such as conditional expressions (?:) using non-boolean integer constants in
6242 boolean context, like @code{if (a <= b ? 2 : 3)}.  Or left shifting of signed
6243 integers in boolean context, like @code{for (a = 0; 1 << a; a++);}.  Likewise
6244 for all kinds of multiplications regardless of the data type.
6245 This warning is enabled by @option{-Wall}.
6247 @item -Wno-int-to-pointer-cast
6248 @opindex Wno-int-to-pointer-cast
6249 @opindex Wint-to-pointer-cast
6250 Suppress warnings from casts to pointer type of an integer of a
6251 different size. In C++, casting to a pointer type of smaller size is
6252 an error. @option{Wint-to-pointer-cast} is enabled by default.
6255 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
6256 @opindex Wno-pointer-to-int-cast
6257 @opindex Wpointer-to-int-cast
6258 Suppress warnings from casts from a pointer to an integer type of a
6259 different size.
6261 @item -Winvalid-pch
6262 @opindex Winvalid-pch
6263 @opindex Wno-invalid-pch
6264 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
6265 the search path but can't be used.
6267 @item -Wlong-long
6268 @opindex Wlong-long
6269 @opindex Wno-long-long
6270 Warn if @code{long long} type is used.  This is enabled by either
6271 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
6272 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
6274 @item -Wvariadic-macros
6275 @opindex Wvariadic-macros
6276 @opindex Wno-variadic-macros
6277 Warn if variadic macros are used in ISO C90 mode, or if the GNU
6278 alternate syntax is used in ISO C99 mode.  This is enabled by either
6279 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
6280 messages, use @option{-Wno-variadic-macros}.
6282 @item -Wvarargs
6283 @opindex Wvarargs
6284 @opindex Wno-varargs
6285 Warn upon questionable usage of the macros used to handle variable
6286 arguments like @code{va_start}.  This is default.  To inhibit the
6287 warning messages, use @option{-Wno-varargs}.
6289 @item -Wvector-operation-performance
6290 @opindex Wvector-operation-performance
6291 @opindex Wno-vector-operation-performance
6292 Warn if vector operation is not implemented via SIMD capabilities of the
6293 architecture.  Mainly useful for the performance tuning.
6294 Vector operation can be implemented @code{piecewise}, which means that the
6295 scalar operation is performed on every vector element; 
6296 @code{in parallel}, which means that the vector operation is implemented
6297 using scalars of wider type, which normally is more performance efficient;
6298 and @code{as a single scalar}, which means that vector fits into a
6299 scalar type.
6301 @item -Wno-virtual-move-assign
6302 @opindex Wvirtual-move-assign
6303 @opindex Wno-virtual-move-assign
6304 Suppress warnings about inheriting from a virtual base with a
6305 non-trivial C++11 move assignment operator.  This is dangerous because
6306 if the virtual base is reachable along more than one path, it is
6307 moved multiple times, which can mean both objects end up in the
6308 moved-from state.  If the move assignment operator is written to avoid
6309 moving from a moved-from object, this warning can be disabled.
6311 @item -Wvla
6312 @opindex Wvla
6313 @opindex Wno-vla
6314 Warn if a variable-length array is used in the code.
6315 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
6316 the variable-length array.
6318 @item -Wvla-larger-than=@var{n}
6319 If this option is used, the compiler will warn on uses of
6320 variable-length arrays where the size is either unbounded, or bounded
6321 by an argument that can be larger than @var{n} bytes.  This is similar
6322 to how @option{-Walloca-larger-than=@var{n}} works, but with
6323 variable-length arrays.
6325 Note that GCC may optimize small variable-length arrays of a known
6326 value into plain arrays, so this warning may not get triggered for
6327 such arrays.
6329 This warning is not enabled by @option{-Wall}, and is only active when
6330 @option{-ftree-vrp} is active (default for @option{-O2} and above).
6332 See also @option{-Walloca-larger-than=@var{n}}.
6334 @item -Wvolatile-register-var
6335 @opindex Wvolatile-register-var
6336 @opindex Wno-volatile-register-var
6337 Warn if a register variable is declared volatile.  The volatile
6338 modifier does not inhibit all optimizations that may eliminate reads
6339 and/or writes to register variables.  This warning is enabled by
6340 @option{-Wall}.
6342 @item -Wdisabled-optimization
6343 @opindex Wdisabled-optimization
6344 @opindex Wno-disabled-optimization
6345 Warn if a requested optimization pass is disabled.  This warning does
6346 not generally indicate that there is anything wrong with your code; it
6347 merely indicates that GCC's optimizers are unable to handle the code
6348 effectively.  Often, the problem is that your code is too big or too
6349 complex; GCC refuses to optimize programs when the optimization
6350 itself is likely to take inordinate amounts of time.
6352 @item -Wpointer-sign @r{(C and Objective-C only)}
6353 @opindex Wpointer-sign
6354 @opindex Wno-pointer-sign
6355 Warn for pointer argument passing or assignment with different signedness.
6356 This option is only supported for C and Objective-C@.  It is implied by
6357 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
6358 @option{-Wno-pointer-sign}.
6360 @item -Wstack-protector
6361 @opindex Wstack-protector
6362 @opindex Wno-stack-protector
6363 This option is only active when @option{-fstack-protector} is active.  It
6364 warns about functions that are not protected against stack smashing.
6366 @item -Woverlength-strings
6367 @opindex Woverlength-strings
6368 @opindex Wno-overlength-strings
6369 Warn about string constants that are longer than the ``minimum
6370 maximum'' length specified in the C standard.  Modern compilers
6371 generally allow string constants that are much longer than the
6372 standard's minimum limit, but very portable programs should avoid
6373 using longer strings.
6375 The limit applies @emph{after} string constant concatenation, and does
6376 not count the trailing NUL@.  In C90, the limit was 509 characters; in
6377 C99, it was raised to 4095.  C++98 does not specify a normative
6378 minimum maximum, so we do not diagnose overlength strings in C++@.
6380 This option is implied by @option{-Wpedantic}, and can be disabled with
6381 @option{-Wno-overlength-strings}.
6383 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
6384 @opindex Wunsuffixed-float-constants
6386 Issue a warning for any floating constant that does not have
6387 a suffix.  When used together with @option{-Wsystem-headers} it
6388 warns about such constants in system header files.  This can be useful
6389 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
6390 from the decimal floating-point extension to C99.
6392 @item -Wno-designated-init @r{(C and Objective-C only)}
6393 Suppress warnings when a positional initializer is used to initialize
6394 a structure that has been marked with the @code{designated_init}
6395 attribute.
6397 @item -Whsa
6398 Issue a warning when HSAIL cannot be emitted for the compiled function or
6399 OpenMP construct.
6401 @end table
6403 @node Debugging Options
6404 @section Options for Debugging Your Program
6405 @cindex options, debugging
6406 @cindex debugging information options
6408 To tell GCC to emit extra information for use by a debugger, in almost 
6409 all cases you need only to add @option{-g} to your other options.
6411 GCC allows you to use @option{-g} with
6412 @option{-O}.  The shortcuts taken by optimized code may occasionally
6413 be surprising: some variables you declared may not exist
6414 at all; flow of control may briefly move where you did not expect it;
6415 some statements may not be executed because they compute constant
6416 results or their values are already at hand; some statements may
6417 execute in different places because they have been moved out of loops.
6418 Nevertheless it is possible to debug optimized output.  This makes
6419 it reasonable to use the optimizer for programs that might have bugs.
6421 If you are not using some other optimization option, consider
6422 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
6423 With no @option{-O} option at all, some compiler passes that collect
6424 information useful for debugging do not run at all, so that
6425 @option{-Og} may result in a better debugging experience.
6427 @table @gcctabopt
6428 @item -g
6429 @opindex g
6430 Produce debugging information in the operating system's native format
6431 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
6432 information.
6434 On most systems that use stabs format, @option{-g} enables use of extra
6435 debugging information that only GDB can use; this extra information
6436 makes debugging work better in GDB but probably makes other debuggers
6437 crash or
6438 refuse to read the program.  If you want to control for certain whether
6439 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
6440 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
6442 @item -ggdb
6443 @opindex ggdb
6444 Produce debugging information for use by GDB@.  This means to use the
6445 most expressive format available (DWARF, stabs, or the native format
6446 if neither of those are supported), including GDB extensions if at all
6447 possible.
6449 @item -gdwarf
6450 @itemx -gdwarf-@var{version}
6451 @opindex gdwarf
6452 Produce debugging information in DWARF format (if that is supported).
6453 The value of @var{version} may be either 2, 3, 4 or 5; the default version
6454 for most targets is 4.  DWARF Version 5 is only experimental.
6456 Note that with DWARF Version 2, some ports require and always
6457 use some non-conflicting DWARF 3 extensions in the unwind tables.
6459 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
6460 for maximum benefit.
6462 GCC no longer supports DWARF Version 1, which is substantially
6463 different than Version 2 and later.  For historical reasons, some
6464 other DWARF-related options (including @option{-feliminate-dwarf2-dups} 
6465 and @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
6466 in their names, but apply to all currently-supported versions of DWARF.
6468 @item -gstabs
6469 @opindex gstabs
6470 Produce debugging information in stabs format (if that is supported),
6471 without GDB extensions.  This is the format used by DBX on most BSD
6472 systems.  On MIPS, Alpha and System V Release 4 systems this option
6473 produces stabs debugging output that is not understood by DBX or SDB@.
6474 On System V Release 4 systems this option requires the GNU assembler.
6476 @item -gstabs+
6477 @opindex gstabs+
6478 Produce debugging information in stabs format (if that is supported),
6479 using GNU extensions understood only by the GNU debugger (GDB)@.  The
6480 use of these extensions is likely to make other debuggers crash or
6481 refuse to read the program.
6483 @item -gcoff
6484 @opindex gcoff
6485 Produce debugging information in COFF format (if that is supported).
6486 This is the format used by SDB on most System V systems prior to
6487 System V Release 4.
6489 @item -gxcoff
6490 @opindex gxcoff
6491 Produce debugging information in XCOFF format (if that is supported).
6492 This is the format used by the DBX debugger on IBM RS/6000 systems.
6494 @item -gxcoff+
6495 @opindex gxcoff+
6496 Produce debugging information in XCOFF format (if that is supported),
6497 using GNU extensions understood only by the GNU debugger (GDB)@.  The
6498 use of these extensions is likely to make other debuggers crash or
6499 refuse to read the program, and may cause assemblers other than the GNU
6500 assembler (GAS) to fail with an error.
6502 @item -gvms
6503 @opindex gvms
6504 Produce debugging information in Alpha/VMS debug format (if that is
6505 supported).  This is the format used by DEBUG on Alpha/VMS systems.
6507 @item -g@var{level}
6508 @itemx -ggdb@var{level}
6509 @itemx -gstabs@var{level}
6510 @itemx -gcoff@var{level}
6511 @itemx -gxcoff@var{level}
6512 @itemx -gvms@var{level}
6513 Request debugging information and also use @var{level} to specify how
6514 much information.  The default level is 2.
6516 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
6517 @option{-g}.
6519 Level 1 produces minimal information, enough for making backtraces in
6520 parts of the program that you don't plan to debug.  This includes
6521 descriptions of functions and external variables, and line number
6522 tables, but no information about local variables.
6524 Level 3 includes extra information, such as all the macro definitions
6525 present in the program.  Some debuggers support macro expansion when
6526 you use @option{-g3}.
6528 @option{-gdwarf} does not accept a concatenated debug level, to avoid
6529 confusion with @option{-gdwarf-@var{level}}.
6530 Instead use an additional @option{-g@var{level}} option to change the
6531 debug level for DWARF.
6533 @item -feliminate-unused-debug-symbols
6534 @opindex feliminate-unused-debug-symbols
6535 Produce debugging information in stabs format (if that is supported),
6536 for only symbols that are actually used.
6538 @item -femit-class-debug-always
6539 @opindex femit-class-debug-always
6540 Instead of emitting debugging information for a C++ class in only one
6541 object file, emit it in all object files using the class.  This option
6542 should be used only with debuggers that are unable to handle the way GCC
6543 normally emits debugging information for classes because using this
6544 option increases the size of debugging information by as much as a
6545 factor of two.
6547 @item -fno-merge-debug-strings
6548 @opindex fmerge-debug-strings
6549 @opindex fno-merge-debug-strings
6550 Direct the linker to not merge together strings in the debugging
6551 information that are identical in different object files.  Merging is
6552 not supported by all assemblers or linkers.  Merging decreases the size
6553 of the debug information in the output file at the cost of increasing
6554 link processing time.  Merging is enabled by default.
6556 @item -fdebug-prefix-map=@var{old}=@var{new}
6557 @opindex fdebug-prefix-map
6558 When compiling files in directory @file{@var{old}}, record debugging
6559 information describing them as in @file{@var{new}} instead.
6561 @item -fvar-tracking
6562 @opindex fvar-tracking
6563 Run variable tracking pass.  It computes where variables are stored at each
6564 position in code.  Better debugging information is then generated
6565 (if the debugging information format supports this information).
6567 It is enabled by default when compiling with optimization (@option{-Os},
6568 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6569 the debug info format supports it.
6571 @item -fvar-tracking-assignments
6572 @opindex fvar-tracking-assignments
6573 @opindex fno-var-tracking-assignments
6574 Annotate assignments to user variables early in the compilation and
6575 attempt to carry the annotations over throughout the compilation all the
6576 way to the end, in an attempt to improve debug information while
6577 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6579 It can be enabled even if var-tracking is disabled, in which case
6580 annotations are created and maintained, but discarded at the end.
6581 By default, this flag is enabled together with @option{-fvar-tracking},
6582 except when selective scheduling is enabled.
6584 @item -gsplit-dwarf
6585 @opindex gsplit-dwarf
6586 Separate as much DWARF debugging information as possible into a
6587 separate output file with the extension @file{.dwo}.  This option allows
6588 the build system to avoid linking files with debug information.  To
6589 be useful, this option requires a debugger capable of reading @file{.dwo}
6590 files.
6592 @item -gpubnames
6593 @opindex gpubnames
6594 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
6596 @item -ggnu-pubnames
6597 @opindex ggnu-pubnames
6598 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
6599 suitable for conversion into a GDB@ index.  This option is only useful
6600 with a linker that can produce GDB@ index version 7.
6602 @item -fdebug-types-section
6603 @opindex fdebug-types-section
6604 @opindex fno-debug-types-section
6605 When using DWARF Version 4 or higher, type DIEs can be put into
6606 their own @code{.debug_types} section instead of making them part of the
6607 @code{.debug_info} section.  It is more efficient to put them in a separate
6608 comdat sections since the linker can then remove duplicates.
6609 But not all DWARF consumers support @code{.debug_types} sections yet
6610 and on some objects @code{.debug_types} produces larger instead of smaller
6611 debugging information.
6613 @item -grecord-gcc-switches
6614 @item -gno-record-gcc-switches
6615 @opindex grecord-gcc-switches
6616 @opindex gno-record-gcc-switches
6617 This switch causes the command-line options used to invoke the
6618 compiler that may affect code generation to be appended to the
6619 DW_AT_producer attribute in DWARF debugging information.  The options
6620 are concatenated with spaces separating them from each other and from
6621 the compiler version.  
6622 It is enabled by default.
6623 See also @option{-frecord-gcc-switches} for another
6624 way of storing compiler options into the object file.  
6626 @item -gstrict-dwarf
6627 @opindex gstrict-dwarf
6628 Disallow using extensions of later DWARF standard version than selected
6629 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
6630 DWARF extensions from later standard versions is allowed.
6632 @item -gno-strict-dwarf
6633 @opindex gno-strict-dwarf
6634 Allow using extensions of later DWARF standard version than selected with
6635 @option{-gdwarf-@var{version}}.
6637 @item -gz@r{[}=@var{type}@r{]}
6638 @opindex gz
6639 Produce compressed debug sections in DWARF format, if that is supported.
6640 If @var{type} is not given, the default type depends on the capabilities
6641 of the assembler and linker used.  @var{type} may be one of
6642 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
6643 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
6644 compression in traditional GNU format).  If the linker doesn't support
6645 writing compressed debug sections, the option is rejected.  Otherwise,
6646 if the assembler does not support them, @option{-gz} is silently ignored
6647 when producing object files.
6649 @item -feliminate-dwarf2-dups
6650 @opindex feliminate-dwarf2-dups
6651 Compress DWARF debugging information by eliminating duplicated
6652 information about each symbol.  This option only makes sense when
6653 generating DWARF debugging information.
6655 @item -femit-struct-debug-baseonly
6656 @opindex femit-struct-debug-baseonly
6657 Emit debug information for struct-like types
6658 only when the base name of the compilation source file
6659 matches the base name of file in which the struct is defined.
6661 This option substantially reduces the size of debugging information,
6662 but at significant potential loss in type information to the debugger.
6663 See @option{-femit-struct-debug-reduced} for a less aggressive option.
6664 See @option{-femit-struct-debug-detailed} for more detailed control.
6666 This option works only with DWARF debug output.
6668 @item -femit-struct-debug-reduced
6669 @opindex femit-struct-debug-reduced
6670 Emit debug information for struct-like types
6671 only when the base name of the compilation source file
6672 matches the base name of file in which the type is defined,
6673 unless the struct is a template or defined in a system header.
6675 This option significantly reduces the size of debugging information,
6676 with some potential loss in type information to the debugger.
6677 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
6678 See @option{-femit-struct-debug-detailed} for more detailed control.
6680 This option works only with DWARF debug output.
6682 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
6683 @opindex femit-struct-debug-detailed
6684 Specify the struct-like types
6685 for which the compiler generates debug information.
6686 The intent is to reduce duplicate struct debug information
6687 between different object files within the same program.
6689 This option is a detailed version of
6690 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
6691 which serves for most needs.
6693 A specification has the syntax@*
6694 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
6696 The optional first word limits the specification to
6697 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
6698 A struct type is used directly when it is the type of a variable, member.
6699 Indirect uses arise through pointers to structs.
6700 That is, when use of an incomplete struct is valid, the use is indirect.
6701 An example is
6702 @samp{struct one direct; struct two * indirect;}.
6704 The optional second word limits the specification to
6705 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
6706 Generic structs are a bit complicated to explain.
6707 For C++, these are non-explicit specializations of template classes,
6708 or non-template classes within the above.
6709 Other programming languages have generics,
6710 but @option{-femit-struct-debug-detailed} does not yet implement them.
6712 The third word specifies the source files for those
6713 structs for which the compiler should emit debug information.
6714 The values @samp{none} and @samp{any} have the normal meaning.
6715 The value @samp{base} means that
6716 the base of name of the file in which the type declaration appears
6717 must match the base of the name of the main compilation file.
6718 In practice, this means that when compiling @file{foo.c}, debug information
6719 is generated for types declared in that file and @file{foo.h},
6720 but not other header files.
6721 The value @samp{sys} means those types satisfying @samp{base}
6722 or declared in system or compiler headers.
6724 You may need to experiment to determine the best settings for your application.
6726 The default is @option{-femit-struct-debug-detailed=all}.
6728 This option works only with DWARF debug output.
6730 @item -fno-dwarf2-cfi-asm
6731 @opindex fdwarf2-cfi-asm
6732 @opindex fno-dwarf2-cfi-asm
6733 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
6734 instead of using GAS @code{.cfi_*} directives.
6736 @item -fno-eliminate-unused-debug-types
6737 @opindex feliminate-unused-debug-types
6738 @opindex fno-eliminate-unused-debug-types
6739 Normally, when producing DWARF output, GCC avoids producing debug symbol 
6740 output for types that are nowhere used in the source file being compiled.
6741 Sometimes it is useful to have GCC emit debugging
6742 information for all types declared in a compilation
6743 unit, regardless of whether or not they are actually used
6744 in that compilation unit, for example 
6745 if, in the debugger, you want to cast a value to a type that is
6746 not actually used in your program (but is declared).  More often,
6747 however, this results in a significant amount of wasted space.
6748 @end table
6750 @node Optimize Options
6751 @section Options That Control Optimization
6752 @cindex optimize options
6753 @cindex options, optimization
6755 These options control various sorts of optimizations.
6757 Without any optimization option, the compiler's goal is to reduce the
6758 cost of compilation and to make debugging produce the expected
6759 results.  Statements are independent: if you stop the program with a
6760 breakpoint between statements, you can then assign a new value to any
6761 variable or change the program counter to any other statement in the
6762 function and get exactly the results you expect from the source
6763 code.
6765 Turning on optimization flags makes the compiler attempt to improve
6766 the performance and/or code size at the expense of compilation time
6767 and possibly the ability to debug the program.
6769 The compiler performs optimization based on the knowledge it has of the
6770 program.  Compiling multiple files at once to a single output file mode allows
6771 the compiler to use information gained from all of the files when compiling
6772 each of them.
6774 Not all optimizations are controlled directly by a flag.  Only
6775 optimizations that have a flag are listed in this section.
6777 Most optimizations are only enabled if an @option{-O} level is set on
6778 the command line.  Otherwise they are disabled, even if individual
6779 optimization flags are specified.
6781 Depending on the target and how GCC was configured, a slightly different
6782 set of optimizations may be enabled at each @option{-O} level than
6783 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6784 to find out the exact set of optimizations that are enabled at each level.
6785 @xref{Overall Options}, for examples.
6787 @table @gcctabopt
6788 @item -O
6789 @itemx -O1
6790 @opindex O
6791 @opindex O1
6792 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6793 more memory for a large function.
6795 With @option{-O}, the compiler tries to reduce code size and execution
6796 time, without performing any optimizations that take a great deal of
6797 compilation time.
6799 @option{-O} turns on the following optimization flags:
6800 @gccoptlist{
6801 -fauto-inc-dec @gol
6802 -fbranch-count-reg @gol
6803 -fcombine-stack-adjustments @gol
6804 -fcompare-elim @gol
6805 -fcprop-registers @gol
6806 -fdce @gol
6807 -fdefer-pop @gol
6808 -fdelayed-branch @gol
6809 -fdse @gol
6810 -fforward-propagate @gol
6811 -fguess-branch-probability @gol
6812 -fif-conversion2 @gol
6813 -fif-conversion @gol
6814 -finline-functions-called-once @gol
6815 -fipa-pure-const @gol
6816 -fipa-profile @gol
6817 -fipa-reference @gol
6818 -fmerge-constants @gol
6819 -fmove-loop-invariants @gol
6820 -freorder-blocks @gol
6821 -fshrink-wrap @gol
6822 -fshrink-wrap-separate @gol
6823 -fsplit-wide-types @gol
6824 -fssa-backprop @gol
6825 -fssa-phiopt @gol
6826 -fstore-merging @gol
6827 -ftree-bit-ccp @gol
6828 -ftree-ccp @gol
6829 -ftree-ch @gol
6830 -ftree-coalesce-vars @gol
6831 -ftree-copy-prop @gol
6832 -ftree-dce @gol
6833 -ftree-dominator-opts @gol
6834 -ftree-dse @gol
6835 -ftree-forwprop @gol
6836 -ftree-fre @gol
6837 -ftree-phiprop @gol
6838 -ftree-sink @gol
6839 -ftree-slsr @gol
6840 -ftree-sra @gol
6841 -ftree-pta @gol
6842 -ftree-ter @gol
6843 -funit-at-a-time}
6845 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6846 where doing so does not interfere with debugging.
6848 @item -O2
6849 @opindex O2
6850 Optimize even more.  GCC performs nearly all supported optimizations
6851 that do not involve a space-speed tradeoff.
6852 As compared to @option{-O}, this option increases both compilation time
6853 and the performance of the generated code.
6855 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6856 also turns on the following optimization flags:
6857 @gccoptlist{-fthread-jumps @gol
6858 -falign-functions  -falign-jumps @gol
6859 -falign-loops  -falign-labels @gol
6860 -fcaller-saves @gol
6861 -fcrossjumping @gol
6862 -fcse-follow-jumps  -fcse-skip-blocks @gol
6863 -fdelete-null-pointer-checks @gol
6864 -fdevirtualize -fdevirtualize-speculatively @gol
6865 -fexpensive-optimizations @gol
6866 -fgcse  -fgcse-lm  @gol
6867 -fhoist-adjacent-loads @gol
6868 -finline-small-functions @gol
6869 -findirect-inlining @gol
6870 -fipa-cp @gol
6871 -fipa-cp-alignment @gol
6872 -fipa-bit-cp @gol
6873 -fipa-sra @gol
6874 -fipa-icf @gol
6875 -fisolate-erroneous-paths-dereference @gol
6876 -flra-remat @gol
6877 -foptimize-sibling-calls @gol
6878 -foptimize-strlen @gol
6879 -fpartial-inlining @gol
6880 -fpeephole2 @gol
6881 -freorder-blocks-algorithm=stc @gol
6882 -freorder-blocks-and-partition -freorder-functions @gol
6883 -frerun-cse-after-loop  @gol
6884 -fsched-interblock  -fsched-spec @gol
6885 -fschedule-insns  -fschedule-insns2 @gol
6886 -fstrict-aliasing -fstrict-overflow @gol
6887 -ftree-builtin-call-dce @gol
6888 -ftree-switch-conversion -ftree-tail-merge @gol
6889 -fcode-hoisting @gol
6890 -ftree-pre @gol
6891 -ftree-vrp @gol
6892 -fipa-ra}
6894 Please note the warning under @option{-fgcse} about
6895 invoking @option{-O2} on programs that use computed gotos.
6897 @item -O3
6898 @opindex O3
6899 Optimize yet more.  @option{-O3} turns on all optimizations specified
6900 by @option{-O2} and also turns on the @option{-finline-functions},
6901 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6902 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
6903 @option{-ftree-loop-distribute-patterns}, @option{-fsplit-paths}
6904 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
6905 @option{-ftree-partial-pre}, @option{-fpeel-loops}
6906 and @option{-fipa-cp-clone} options.
6908 @item -O0
6909 @opindex O0
6910 Reduce compilation time and make debugging produce the expected
6911 results.  This is the default.
6913 @item -Os
6914 @opindex Os
6915 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6916 do not typically increase code size.  It also performs further
6917 optimizations designed to reduce code size.
6919 @option{-Os} disables the following optimization flags:
6920 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6921 -falign-labels  -freorder-blocks  -freorder-blocks-algorithm=stc @gol
6922 -freorder-blocks-and-partition  -fprefetch-loop-arrays}
6924 @item -Ofast
6925 @opindex Ofast
6926 Disregard strict standards compliance.  @option{-Ofast} enables all
6927 @option{-O3} optimizations.  It also enables optimizations that are not
6928 valid for all standard-compliant programs.
6929 It turns on @option{-ffast-math} and the Fortran-specific
6930 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6932 @item -Og
6933 @opindex Og
6934 Optimize debugging experience.  @option{-Og} enables optimizations
6935 that do not interfere with debugging. It should be the optimization
6936 level of choice for the standard edit-compile-debug cycle, offering
6937 a reasonable level of optimization while maintaining fast compilation
6938 and a good debugging experience.
6939 @end table
6941 If you use multiple @option{-O} options, with or without level numbers,
6942 the last such option is the one that is effective.
6944 Options of the form @option{-f@var{flag}} specify machine-independent
6945 flags.  Most flags have both positive and negative forms; the negative
6946 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6947 below, only one of the forms is listed---the one you typically 
6948 use.  You can figure out the other form by either removing @samp{no-}
6949 or adding it.
6951 The following options control specific optimizations.  They are either
6952 activated by @option{-O} options or are related to ones that are.  You
6953 can use the following flags in the rare cases when ``fine-tuning'' of
6954 optimizations to be performed is desired.
6956 @table @gcctabopt
6957 @item -fno-defer-pop
6958 @opindex fno-defer-pop
6959 Always pop the arguments to each function call as soon as that function
6960 returns.  For machines that must pop arguments after a function call,
6961 the compiler normally lets arguments accumulate on the stack for several
6962 function calls and pops them all at once.
6964 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6966 @item -fforward-propagate
6967 @opindex fforward-propagate
6968 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6969 instructions and checks if the result can be simplified.  If loop unrolling
6970 is active, two passes are performed and the second is scheduled after
6971 loop unrolling.
6973 This option is enabled by default at optimization levels @option{-O},
6974 @option{-O2}, @option{-O3}, @option{-Os}.
6976 @item -ffp-contract=@var{style}
6977 @opindex ffp-contract
6978 @option{-ffp-contract=off} disables floating-point expression contraction.
6979 @option{-ffp-contract=fast} enables floating-point expression contraction
6980 such as forming of fused multiply-add operations if the target has
6981 native support for them.
6982 @option{-ffp-contract=on} enables floating-point expression contraction
6983 if allowed by the language standard.  This is currently not implemented
6984 and treated equal to @option{-ffp-contract=off}.
6986 The default is @option{-ffp-contract=fast}.
6988 @item -fomit-frame-pointer
6989 @opindex fomit-frame-pointer
6990 Don't keep the frame pointer in a register for functions that
6991 don't need one.  This avoids the instructions to save, set up and
6992 restore frame pointers; it also makes an extra register available
6993 in many functions.  @strong{It also makes debugging impossible on
6994 some machines.}
6996 On some machines, such as the VAX, this flag has no effect, because
6997 the standard calling sequence automatically handles the frame pointer
6998 and nothing is saved by pretending it doesn't exist.  The
6999 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7000 whether a target machine supports this flag.  @xref{Registers,,Register
7001 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7003 The default setting (when not optimizing for
7004 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets is
7005 @option{-fomit-frame-pointer}.  You can configure GCC with the
7006 @option{--enable-frame-pointer} configure option to change the default.
7008 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7010 @item -foptimize-sibling-calls
7011 @opindex foptimize-sibling-calls
7012 Optimize sibling and tail recursive calls.
7014 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7016 @item -foptimize-strlen
7017 @opindex foptimize-strlen
7018 Optimize various standard C string functions (e.g. @code{strlen},
7019 @code{strchr} or @code{strcpy}) and
7020 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
7022 Enabled at levels @option{-O2}, @option{-O3}.
7024 @item -fno-inline
7025 @opindex fno-inline
7026 Do not expand any functions inline apart from those marked with
7027 the @code{always_inline} attribute.  This is the default when not
7028 optimizing.
7030 Single functions can be exempted from inlining by marking them
7031 with the @code{noinline} attribute.
7033 @item -finline-small-functions
7034 @opindex finline-small-functions
7035 Integrate functions into their callers when their body is smaller than expected
7036 function call code (so overall size of program gets smaller).  The compiler
7037 heuristically decides which functions are simple enough to be worth integrating
7038 in this way.  This inlining applies to all functions, even those not declared
7039 inline.
7041 Enabled at level @option{-O2}.
7043 @item -findirect-inlining
7044 @opindex findirect-inlining
7045 Inline also indirect calls that are discovered to be known at compile
7046 time thanks to previous inlining.  This option has any effect only
7047 when inlining itself is turned on by the @option{-finline-functions}
7048 or @option{-finline-small-functions} options.
7050 Enabled at level @option{-O2}.
7052 @item -finline-functions
7053 @opindex finline-functions
7054 Consider all functions for inlining, even if they are not declared inline.
7055 The compiler heuristically decides which functions are worth integrating
7056 in this way.
7058 If all calls to a given function are integrated, and the function is
7059 declared @code{static}, then the function is normally not output as
7060 assembler code in its own right.
7062 Enabled at level @option{-O3}.
7064 @item -finline-functions-called-once
7065 @opindex finline-functions-called-once
7066 Consider all @code{static} functions called once for inlining into their
7067 caller even if they are not marked @code{inline}.  If a call to a given
7068 function is integrated, then the function is not output as assembler code
7069 in its own right.
7071 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7073 @item -fearly-inlining
7074 @opindex fearly-inlining
7075 Inline functions marked by @code{always_inline} and functions whose body seems
7076 smaller than the function call overhead early before doing
7077 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
7078 makes profiling significantly cheaper and usually inlining faster on programs
7079 having large chains of nested wrapper functions.
7081 Enabled by default.
7083 @item -fipa-sra
7084 @opindex fipa-sra
7085 Perform interprocedural scalar replacement of aggregates, removal of
7086 unused parameters and replacement of parameters passed by reference
7087 by parameters passed by value.
7089 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
7091 @item -finline-limit=@var{n}
7092 @opindex finline-limit
7093 By default, GCC limits the size of functions that can be inlined.  This flag
7094 allows coarse control of this limit.  @var{n} is the size of functions that
7095 can be inlined in number of pseudo instructions.
7097 Inlining is actually controlled by a number of parameters, which may be
7098 specified individually by using @option{--param @var{name}=@var{value}}.
7099 The @option{-finline-limit=@var{n}} option sets some of these parameters
7100 as follows:
7102 @table @gcctabopt
7103 @item max-inline-insns-single
7104 is set to @var{n}/2.
7105 @item max-inline-insns-auto
7106 is set to @var{n}/2.
7107 @end table
7109 See below for a documentation of the individual
7110 parameters controlling inlining and for the defaults of these parameters.
7112 @emph{Note:} there may be no value to @option{-finline-limit} that results
7113 in default behavior.
7115 @emph{Note:} pseudo instruction represents, in this particular context, an
7116 abstract measurement of function's size.  In no way does it represent a count
7117 of assembly instructions and as such its exact meaning might change from one
7118 release to an another.
7120 @item -fno-keep-inline-dllexport
7121 @opindex fno-keep-inline-dllexport
7122 This is a more fine-grained version of @option{-fkeep-inline-functions},
7123 which applies only to functions that are declared using the @code{dllexport}
7124 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
7125 Functions}.)
7127 @item -fkeep-inline-functions
7128 @opindex fkeep-inline-functions
7129 In C, emit @code{static} functions that are declared @code{inline}
7130 into the object file, even if the function has been inlined into all
7131 of its callers.  This switch does not affect functions using the
7132 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7133 inline functions into the object file.
7135 @item -fkeep-static-functions
7136 @opindex fkeep-static-functions
7137 Emit @code{static} functions into the object file, even if the function
7138 is never used.
7140 @item -fkeep-static-consts
7141 @opindex fkeep-static-consts
7142 Emit variables declared @code{static const} when optimization isn't turned
7143 on, even if the variables aren't referenced.
7145 GCC enables this option by default.  If you want to force the compiler to
7146 check if a variable is referenced, regardless of whether or not
7147 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7149 @item -fmerge-constants
7150 @opindex fmerge-constants
7151 Attempt to merge identical constants (string constants and floating-point
7152 constants) across compilation units.
7154 This option is the default for optimized compilation if the assembler and
7155 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7156 behavior.
7158 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7160 @item -fmerge-all-constants
7161 @opindex fmerge-all-constants
7162 Attempt to merge identical constants and identical variables.
7164 This option implies @option{-fmerge-constants}.  In addition to
7165 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7166 arrays or initialized constant variables with integral or floating-point
7167 types.  Languages like C or C++ require each variable, including multiple
7168 instances of the same variable in recursive calls, to have distinct locations,
7169 so using this option results in non-conforming
7170 behavior.
7172 @item -fmodulo-sched
7173 @opindex fmodulo-sched
7174 Perform swing modulo scheduling immediately before the first scheduling
7175 pass.  This pass looks at innermost loops and reorders their
7176 instructions by overlapping different iterations.
7178 @item -fmodulo-sched-allow-regmoves
7179 @opindex fmodulo-sched-allow-regmoves
7180 Perform more aggressive SMS-based modulo scheduling with register moves
7181 allowed.  By setting this flag certain anti-dependences edges are
7182 deleted, which triggers the generation of reg-moves based on the
7183 life-range analysis.  This option is effective only with
7184 @option{-fmodulo-sched} enabled.
7186 @item -fno-branch-count-reg
7187 @opindex fno-branch-count-reg
7188 Avoid running a pass scanning for opportunities to use ``decrement and
7189 branch'' instructions on a count register instead of generating sequences
7190 of instructions that decrement a register, compare it against zero, and
7191 then branch based upon the result.  This option is only meaningful on
7192 architectures that support such instructions, which include x86, PowerPC,
7193 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
7194 doesn't remove the decrement and branch instructions from the generated
7195 instruction stream introduced by other optimization passes.
7197 Enabled by default at @option{-O1} and higher.
7199 The default is @option{-fbranch-count-reg}.
7201 @item -fno-function-cse
7202 @opindex fno-function-cse
7203 Do not put function addresses in registers; make each instruction that
7204 calls a constant function contain the function's address explicitly.
7206 This option results in less efficient code, but some strange hacks
7207 that alter the assembler output may be confused by the optimizations
7208 performed when this option is not used.
7210 The default is @option{-ffunction-cse}
7212 @item -fno-zero-initialized-in-bss
7213 @opindex fno-zero-initialized-in-bss
7214 If the target supports a BSS section, GCC by default puts variables that
7215 are initialized to zero into BSS@.  This can save space in the resulting
7216 code.
7218 This option turns off this behavior because some programs explicitly
7219 rely on variables going to the data section---e.g., so that the
7220 resulting executable can find the beginning of that section and/or make
7221 assumptions based on that.
7223 The default is @option{-fzero-initialized-in-bss}.
7225 @item -fthread-jumps
7226 @opindex fthread-jumps
7227 Perform optimizations that check to see if a jump branches to a
7228 location where another comparison subsumed by the first is found.  If
7229 so, the first branch is redirected to either the destination of the
7230 second branch or a point immediately following it, depending on whether
7231 the condition is known to be true or false.
7233 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7235 @item -fsplit-wide-types
7236 @opindex fsplit-wide-types
7237 When using a type that occupies multiple registers, such as @code{long
7238 long} on a 32-bit system, split the registers apart and allocate them
7239 independently.  This normally generates better code for those types,
7240 but may make debugging more difficult.
7242 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7243 @option{-Os}.
7245 @item -fcse-follow-jumps
7246 @opindex fcse-follow-jumps
7247 In common subexpression elimination (CSE), scan through jump instructions
7248 when the target of the jump is not reached by any other path.  For
7249 example, when CSE encounters an @code{if} statement with an
7250 @code{else} clause, CSE follows the jump when the condition
7251 tested is false.
7253 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7255 @item -fcse-skip-blocks
7256 @opindex fcse-skip-blocks
7257 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7258 follow jumps that conditionally skip over blocks.  When CSE
7259 encounters a simple @code{if} statement with no else clause,
7260 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7261 body of the @code{if}.
7263 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7265 @item -frerun-cse-after-loop
7266 @opindex frerun-cse-after-loop
7267 Re-run common subexpression elimination after loop optimizations are
7268 performed.
7270 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7272 @item -fgcse
7273 @opindex fgcse
7274 Perform a global common subexpression elimination pass.
7275 This pass also performs global constant and copy propagation.
7277 @emph{Note:} When compiling a program using computed gotos, a GCC
7278 extension, you may get better run-time performance if you disable
7279 the global common subexpression elimination pass by adding
7280 @option{-fno-gcse} to the command line.
7282 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7284 @item -fgcse-lm
7285 @opindex fgcse-lm
7286 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7287 attempts to move loads that are only killed by stores into themselves.  This
7288 allows a loop containing a load/store sequence to be changed to a load outside
7289 the loop, and a copy/store within the loop.
7291 Enabled by default when @option{-fgcse} is enabled.
7293 @item -fgcse-sm
7294 @opindex fgcse-sm
7295 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7296 global common subexpression elimination.  This pass attempts to move
7297 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7298 loops containing a load/store sequence can be changed to a load before
7299 the loop and a store after the loop.
7301 Not enabled at any optimization level.
7303 @item -fgcse-las
7304 @opindex fgcse-las
7305 When @option{-fgcse-las} is enabled, the global common subexpression
7306 elimination pass eliminates redundant loads that come after stores to the
7307 same memory location (both partial and full redundancies).
7309 Not enabled at any optimization level.
7311 @item -fgcse-after-reload
7312 @opindex fgcse-after-reload
7313 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7314 pass is performed after reload.  The purpose of this pass is to clean up
7315 redundant spilling.
7317 @item -faggressive-loop-optimizations
7318 @opindex faggressive-loop-optimizations
7319 This option tells the loop optimizer to use language constraints to
7320 derive bounds for the number of iterations of a loop.  This assumes that
7321 loop code does not invoke undefined behavior by for example causing signed
7322 integer overflows or out-of-bound array accesses.  The bounds for the
7323 number of iterations of a loop are used to guide loop unrolling and peeling
7324 and loop exit test optimizations.
7325 This option is enabled by default.
7327 @item -funconstrained-commons
7328 @opindex funconstrained-commons
7329 This option tells the compiler that variables declared in common blocks
7330 (e.g. Fortran) may later be overridden with longer trailing arrays. This
7331 prevents certain optimizations that depend on knowing the array bounds.
7333 @item -fcrossjumping
7334 @opindex fcrossjumping
7335 Perform cross-jumping transformation.
7336 This transformation unifies equivalent code and saves code size.  The
7337 resulting code may or may not perform better than without cross-jumping.
7339 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7341 @item -fauto-inc-dec
7342 @opindex fauto-inc-dec
7343 Combine increments or decrements of addresses with memory accesses.
7344 This pass is always skipped on architectures that do not have
7345 instructions to support this.  Enabled by default at @option{-O} and
7346 higher on architectures that support this.
7348 @item -fdce
7349 @opindex fdce
7350 Perform dead code elimination (DCE) on RTL@.
7351 Enabled by default at @option{-O} and higher.
7353 @item -fdse
7354 @opindex fdse
7355 Perform dead store elimination (DSE) on RTL@.
7356 Enabled by default at @option{-O} and higher.
7358 @item -fif-conversion
7359 @opindex fif-conversion
7360 Attempt to transform conditional jumps into branch-less equivalents.  This
7361 includes use of conditional moves, min, max, set flags and abs instructions, and
7362 some tricks doable by standard arithmetics.  The use of conditional execution
7363 on chips where it is available is controlled by @option{-fif-conversion2}.
7365 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7367 @item -fif-conversion2
7368 @opindex fif-conversion2
7369 Use conditional execution (where available) to transform conditional jumps into
7370 branch-less equivalents.
7372 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7374 @item -fdeclone-ctor-dtor
7375 @opindex fdeclone-ctor-dtor
7376 The C++ ABI requires multiple entry points for constructors and
7377 destructors: one for a base subobject, one for a complete object, and
7378 one for a virtual destructor that calls operator delete afterwards.
7379 For a hierarchy with virtual bases, the base and complete variants are
7380 clones, which means two copies of the function.  With this option, the
7381 base and complete variants are changed to be thunks that call a common
7382 implementation.
7384 Enabled by @option{-Os}.
7386 @item -fdelete-null-pointer-checks
7387 @opindex fdelete-null-pointer-checks
7388 Assume that programs cannot safely dereference null pointers, and that
7389 no code or data element resides at address zero.
7390 This option enables simple constant
7391 folding optimizations at all optimization levels.  In addition, other
7392 optimization passes in GCC use this flag to control global dataflow
7393 analyses that eliminate useless checks for null pointers; these assume
7394 that a memory access to address zero always results in a trap, so
7395 that if a pointer is checked after it has already been dereferenced,
7396 it cannot be null.
7398 Note however that in some environments this assumption is not true.
7399 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7400 for programs that depend on that behavior.
7402 This option is enabled by default on most targets.  On Nios II ELF, it
7403 defaults to off.  On AVR and CR16, this option is completely disabled.  
7405 Passes that use the dataflow information
7406 are enabled independently at different optimization levels.
7408 @item -fdevirtualize
7409 @opindex fdevirtualize
7410 Attempt to convert calls to virtual functions to direct calls.  This
7411 is done both within a procedure and interprocedurally as part of
7412 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
7413 propagation (@option{-fipa-cp}).
7414 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7416 @item -fdevirtualize-speculatively
7417 @opindex fdevirtualize-speculatively
7418 Attempt to convert calls to virtual functions to speculative direct calls.
7419 Based on the analysis of the type inheritance graph, determine for a given call
7420 the set of likely targets. If the set is small, preferably of size 1, change
7421 the call into a conditional deciding between direct and indirect calls.  The
7422 speculative calls enable more optimizations, such as inlining.  When they seem
7423 useless after further optimization, they are converted back into original form.
7425 @item -fdevirtualize-at-ltrans
7426 @opindex fdevirtualize-at-ltrans
7427 Stream extra information needed for aggressive devirtualization when running
7428 the link-time optimizer in local transformation mode.  
7429 This option enables more devirtualization but
7430 significantly increases the size of streamed data. For this reason it is
7431 disabled by default.
7433 @item -fexpensive-optimizations
7434 @opindex fexpensive-optimizations
7435 Perform a number of minor optimizations that are relatively expensive.
7437 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7439 @item -free
7440 @opindex free
7441 Attempt to remove redundant extension instructions.  This is especially
7442 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7443 registers after writing to their lower 32-bit half.
7445 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
7446 @option{-O3}, @option{-Os}.
7448 @item -fno-lifetime-dse
7449 @opindex fno-lifetime-dse
7450 In C++ the value of an object is only affected by changes within its
7451 lifetime: when the constructor begins, the object has an indeterminate
7452 value, and any changes during the lifetime of the object are dead when
7453 the object is destroyed.  Normally dead store elimination will take
7454 advantage of this; if your code relies on the value of the object
7455 storage persisting beyond the lifetime of the object, you can use this
7456 flag to disable this optimization.  To preserve stores before the
7457 constructor starts (e.g. because your operator new clears the object
7458 storage) but still treat the object as dead after the destructor you,
7459 can use @option{-flifetime-dse=1}.  The default behavior can be
7460 explicitly selected with @option{-flifetime-dse=2}.
7461 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
7463 @item -flive-range-shrinkage
7464 @opindex flive-range-shrinkage
7465 Attempt to decrease register pressure through register live range
7466 shrinkage.  This is helpful for fast processors with small or moderate
7467 size register sets.
7469 @item -fira-algorithm=@var{algorithm}
7470 @opindex fira-algorithm
7471 Use the specified coloring algorithm for the integrated register
7472 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7473 specifies Chow's priority coloring, or @samp{CB}, which specifies
7474 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7475 for all architectures, but for those targets that do support it, it is
7476 the default because it generates better code.
7478 @item -fira-region=@var{region}
7479 @opindex fira-region
7480 Use specified regions for the integrated register allocator.  The
7481 @var{region} argument should be one of the following:
7483 @table @samp
7485 @item all
7486 Use all loops as register allocation regions.
7487 This can give the best results for machines with a small and/or
7488 irregular register set.
7490 @item mixed
7491 Use all loops except for loops with small register pressure 
7492 as the regions.  This value usually gives
7493 the best results in most cases and for most architectures,
7494 and is enabled by default when compiling with optimization for speed
7495 (@option{-O}, @option{-O2}, @dots{}).
7497 @item one
7498 Use all functions as a single region.  
7499 This typically results in the smallest code size, and is enabled by default for
7500 @option{-Os} or @option{-O0}.
7502 @end table
7504 @item -fira-hoist-pressure
7505 @opindex fira-hoist-pressure
7506 Use IRA to evaluate register pressure in the code hoisting pass for
7507 decisions to hoist expressions.  This option usually results in smaller
7508 code, but it can slow the compiler down.
7510 This option is enabled at level @option{-Os} for all targets.
7512 @item -fira-loop-pressure
7513 @opindex fira-loop-pressure
7514 Use IRA to evaluate register pressure in loops for decisions to move
7515 loop invariants.  This option usually results in generation
7516 of faster and smaller code on machines with large register files (>= 32
7517 registers), but it can slow the compiler down.
7519 This option is enabled at level @option{-O3} for some targets.
7521 @item -fno-ira-share-save-slots
7522 @opindex fno-ira-share-save-slots
7523 Disable sharing of stack slots used for saving call-used hard
7524 registers living through a call.  Each hard register gets a
7525 separate stack slot, and as a result function stack frames are
7526 larger.
7528 @item -fno-ira-share-spill-slots
7529 @opindex fno-ira-share-spill-slots
7530 Disable sharing of stack slots allocated for pseudo-registers.  Each
7531 pseudo-register that does not get a hard register gets a separate
7532 stack slot, and as a result function stack frames are larger.
7534 @item -flra-remat
7535 @opindex flra-remat
7536 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
7537 values of spilled pseudos, LRA tries to rematerialize (recalculate)
7538 values if it is profitable.
7540 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7542 @item -fdelayed-branch
7543 @opindex fdelayed-branch
7544 If supported for the target machine, attempt to reorder instructions
7545 to exploit instruction slots available after delayed branch
7546 instructions.
7548 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7550 @item -fschedule-insns
7551 @opindex fschedule-insns
7552 If supported for the target machine, attempt to reorder instructions to
7553 eliminate execution stalls due to required data being unavailable.  This
7554 helps machines that have slow floating point or memory load instructions
7555 by allowing other instructions to be issued until the result of the load
7556 or floating-point instruction is required.
7558 Enabled at levels @option{-O2}, @option{-O3}.
7560 @item -fschedule-insns2
7561 @opindex fschedule-insns2
7562 Similar to @option{-fschedule-insns}, but requests an additional pass of
7563 instruction scheduling after register allocation has been done.  This is
7564 especially useful on machines with a relatively small number of
7565 registers and where memory load instructions take more than one cycle.
7567 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7569 @item -fno-sched-interblock
7570 @opindex fno-sched-interblock
7571 Don't schedule instructions across basic blocks.  This is normally
7572 enabled by default when scheduling before register allocation, i.e.@:
7573 with @option{-fschedule-insns} or at @option{-O2} or higher.
7575 @item -fno-sched-spec
7576 @opindex fno-sched-spec
7577 Don't allow speculative motion of non-load instructions.  This is normally
7578 enabled by default when scheduling before register allocation, i.e.@:
7579 with @option{-fschedule-insns} or at @option{-O2} or higher.
7581 @item -fsched-pressure
7582 @opindex fsched-pressure
7583 Enable register pressure sensitive insn scheduling before register
7584 allocation.  This only makes sense when scheduling before register
7585 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7586 @option{-O2} or higher.  Usage of this option can improve the
7587 generated code and decrease its size by preventing register pressure
7588 increase above the number of available hard registers and subsequent
7589 spills in register allocation.
7591 @item -fsched-spec-load
7592 @opindex fsched-spec-load
7593 Allow speculative motion of some load instructions.  This only makes
7594 sense when scheduling before register allocation, i.e.@: with
7595 @option{-fschedule-insns} or at @option{-O2} or higher.
7597 @item -fsched-spec-load-dangerous
7598 @opindex fsched-spec-load-dangerous
7599 Allow speculative motion of more load instructions.  This only makes
7600 sense when scheduling before register allocation, i.e.@: with
7601 @option{-fschedule-insns} or at @option{-O2} or higher.
7603 @item -fsched-stalled-insns
7604 @itemx -fsched-stalled-insns=@var{n}
7605 @opindex fsched-stalled-insns
7606 Define how many insns (if any) can be moved prematurely from the queue
7607 of stalled insns into the ready list during the second scheduling pass.
7608 @option{-fno-sched-stalled-insns} means that no insns are moved
7609 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7610 on how many queued insns can be moved prematurely.
7611 @option{-fsched-stalled-insns} without a value is equivalent to
7612 @option{-fsched-stalled-insns=1}.
7614 @item -fsched-stalled-insns-dep
7615 @itemx -fsched-stalled-insns-dep=@var{n}
7616 @opindex fsched-stalled-insns-dep
7617 Define how many insn groups (cycles) are examined for a dependency
7618 on a stalled insn that is a candidate for premature removal from the queue
7619 of stalled insns.  This has an effect only during the second scheduling pass,
7620 and only if @option{-fsched-stalled-insns} is used.
7621 @option{-fno-sched-stalled-insns-dep} is equivalent to
7622 @option{-fsched-stalled-insns-dep=0}.
7623 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7624 @option{-fsched-stalled-insns-dep=1}.
7626 @item -fsched2-use-superblocks
7627 @opindex fsched2-use-superblocks
7628 When scheduling after register allocation, use superblock scheduling.
7629 This allows motion across basic block boundaries,
7630 resulting in faster schedules.  This option is experimental, as not all machine
7631 descriptions used by GCC model the CPU closely enough to avoid unreliable
7632 results from the algorithm.
7634 This only makes sense when scheduling after register allocation, i.e.@: with
7635 @option{-fschedule-insns2} or at @option{-O2} or higher.
7637 @item -fsched-group-heuristic
7638 @opindex fsched-group-heuristic
7639 Enable the group heuristic in the scheduler.  This heuristic favors
7640 the instruction that belongs to a schedule group.  This is enabled
7641 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7642 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7644 @item -fsched-critical-path-heuristic
7645 @opindex fsched-critical-path-heuristic
7646 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7647 instructions on the critical path.  This is enabled by default when
7648 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7649 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7651 @item -fsched-spec-insn-heuristic
7652 @opindex fsched-spec-insn-heuristic
7653 Enable the speculative instruction heuristic in the scheduler.  This
7654 heuristic favors speculative instructions with greater dependency weakness.
7655 This is enabled by default when scheduling is enabled, i.e.@:
7656 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7657 or at @option{-O2} or higher.
7659 @item -fsched-rank-heuristic
7660 @opindex fsched-rank-heuristic
7661 Enable the rank heuristic in the scheduler.  This heuristic favors
7662 the instruction belonging to a basic block with greater size or frequency.
7663 This is enabled by default when scheduling is enabled, i.e.@:
7664 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7665 at @option{-O2} or higher.
7667 @item -fsched-last-insn-heuristic
7668 @opindex fsched-last-insn-heuristic
7669 Enable the last-instruction heuristic in the scheduler.  This heuristic
7670 favors the instruction that is less dependent on the last instruction
7671 scheduled.  This is enabled by default when scheduling is enabled,
7672 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7673 at @option{-O2} or higher.
7675 @item -fsched-dep-count-heuristic
7676 @opindex fsched-dep-count-heuristic
7677 Enable the dependent-count heuristic in the scheduler.  This heuristic
7678 favors the instruction that has more instructions depending on it.
7679 This is enabled by default when scheduling is enabled, i.e.@:
7680 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7681 at @option{-O2} or higher.
7683 @item -freschedule-modulo-scheduled-loops
7684 @opindex freschedule-modulo-scheduled-loops
7685 Modulo scheduling is performed before traditional scheduling.  If a loop
7686 is modulo scheduled, later scheduling passes may change its schedule.  
7687 Use this option to control that behavior.
7689 @item -fselective-scheduling
7690 @opindex fselective-scheduling
7691 Schedule instructions using selective scheduling algorithm.  Selective
7692 scheduling runs instead of the first scheduler pass.
7694 @item -fselective-scheduling2
7695 @opindex fselective-scheduling2
7696 Schedule instructions using selective scheduling algorithm.  Selective
7697 scheduling runs instead of the second scheduler pass.
7699 @item -fsel-sched-pipelining
7700 @opindex fsel-sched-pipelining
7701 Enable software pipelining of innermost loops during selective scheduling.
7702 This option has no effect unless one of @option{-fselective-scheduling} or
7703 @option{-fselective-scheduling2} is turned on.
7705 @item -fsel-sched-pipelining-outer-loops
7706 @opindex fsel-sched-pipelining-outer-loops
7707 When pipelining loops during selective scheduling, also pipeline outer loops.
7708 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7710 @item -fsemantic-interposition
7711 @opindex fsemantic-interposition
7712 Some object formats, like ELF, allow interposing of symbols by the 
7713 dynamic linker.
7714 This means that for symbols exported from the DSO, the compiler cannot perform
7715 interprocedural propagation, inlining and other optimizations in anticipation
7716 that the function or variable in question may change. While this feature is
7717 useful, for example, to rewrite memory allocation functions by a debugging
7718 implementation, it is expensive in the terms of code quality.
7719 With @option{-fno-semantic-interposition} the compiler assumes that 
7720 if interposition happens for functions the overwriting function will have 
7721 precisely the same semantics (and side effects). 
7722 Similarly if interposition happens
7723 for variables, the constructor of the variable will be the same. The flag
7724 has no effect for functions explicitly declared inline 
7725 (where it is never allowed for interposition to change semantics) 
7726 and for symbols explicitly declared weak.
7728 @item -fshrink-wrap
7729 @opindex fshrink-wrap
7730 Emit function prologues only before parts of the function that need it,
7731 rather than at the top of the function.  This flag is enabled by default at
7732 @option{-O} and higher.
7734 @item -fshrink-wrap-separate
7735 @opindex fshrink-wrap-separate
7736 Shrink-wrap separate parts of the prologue and epilogue separately, so that
7737 those parts are only executed when needed.
7738 This option is on by default, but has no effect unless @option{-fshrink-wrap}
7739 is also turned on and the target supports this.
7741 @item -fcaller-saves
7742 @opindex fcaller-saves
7743 Enable allocation of values to registers that are clobbered by
7744 function calls, by emitting extra instructions to save and restore the
7745 registers around such calls.  Such allocation is done only when it
7746 seems to result in better code.
7748 This option is always enabled by default on certain machines, usually
7749 those which have no call-preserved registers to use instead.
7751 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7753 @item -fcombine-stack-adjustments
7754 @opindex fcombine-stack-adjustments
7755 Tracks stack adjustments (pushes and pops) and stack memory references
7756 and then tries to find ways to combine them.
7758 Enabled by default at @option{-O1} and higher.
7760 @item -fipa-ra
7761 @opindex fipa-ra
7762 Use caller save registers for allocation if those registers are not used by
7763 any called function.  In that case it is not necessary to save and restore
7764 them around calls.  This is only possible if called functions are part of
7765 same compilation unit as current function and they are compiled before it.
7767 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}, however the option
7768 is disabled if generated code will be instrumented for profiling
7769 (@option{-p}, or @option{-pg}) or if callee's register usage cannot be known
7770 exactly (this happens on targets that do not expose prologues
7771 and epilogues in RTL).
7773 @item -fconserve-stack
7774 @opindex fconserve-stack
7775 Attempt to minimize stack usage.  The compiler attempts to use less
7776 stack space, even if that makes the program slower.  This option
7777 implies setting the @option{large-stack-frame} parameter to 100
7778 and the @option{large-stack-frame-growth} parameter to 400.
7780 @item -ftree-reassoc
7781 @opindex ftree-reassoc
7782 Perform reassociation on trees.  This flag is enabled by default
7783 at @option{-O} and higher.
7785 @item -fcode-hoisting
7786 @opindex fcode-hoisting
7787 Perform code hoisting.  Code hoisting tries to move the
7788 evaluation of expressions executed on all paths to the function exit
7789 as early as possible.  This is especially useful as a code size
7790 optimization, but it often helps for code speed as well.
7791 This flag is enabled by default at @option{-O2} and higher.
7793 @item -ftree-pre
7794 @opindex ftree-pre
7795 Perform partial redundancy elimination (PRE) on trees.  This flag is
7796 enabled by default at @option{-O2} and @option{-O3}.
7798 @item -ftree-partial-pre
7799 @opindex ftree-partial-pre
7800 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7801 enabled by default at @option{-O3}.
7803 @item -ftree-forwprop
7804 @opindex ftree-forwprop
7805 Perform forward propagation on trees.  This flag is enabled by default
7806 at @option{-O} and higher.
7808 @item -ftree-fre
7809 @opindex ftree-fre
7810 Perform full redundancy elimination (FRE) on trees.  The difference
7811 between FRE and PRE is that FRE only considers expressions
7812 that are computed on all paths leading to the redundant computation.
7813 This analysis is faster than PRE, though it exposes fewer redundancies.
7814 This flag is enabled by default at @option{-O} and higher.
7816 @item -ftree-phiprop
7817 @opindex ftree-phiprop
7818 Perform hoisting of loads from conditional pointers on trees.  This
7819 pass is enabled by default at @option{-O} and higher.
7821 @item -fhoist-adjacent-loads
7822 @opindex fhoist-adjacent-loads
7823 Speculatively hoist loads from both branches of an if-then-else if the
7824 loads are from adjacent locations in the same structure and the target
7825 architecture has a conditional move instruction.  This flag is enabled
7826 by default at @option{-O2} and higher.
7828 @item -ftree-copy-prop
7829 @opindex ftree-copy-prop
7830 Perform copy propagation on trees.  This pass eliminates unnecessary
7831 copy operations.  This flag is enabled by default at @option{-O} and
7832 higher.
7834 @item -fipa-pure-const
7835 @opindex fipa-pure-const
7836 Discover which functions are pure or constant.
7837 Enabled by default at @option{-O} and higher.
7839 @item -fipa-reference
7840 @opindex fipa-reference
7841 Discover which static variables do not escape the
7842 compilation unit.
7843 Enabled by default at @option{-O} and higher.
7845 @item -fipa-pta
7846 @opindex fipa-pta
7847 Perform interprocedural pointer analysis and interprocedural modification
7848 and reference analysis.  This option can cause excessive memory and
7849 compile-time usage on large compilation units.  It is not enabled by
7850 default at any optimization level.
7852 @item -fipa-profile
7853 @opindex fipa-profile
7854 Perform interprocedural profile propagation.  The functions called only from
7855 cold functions are marked as cold. Also functions executed once (such as
7856 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7857 functions and loop less parts of functions executed once are then optimized for
7858 size.
7859 Enabled by default at @option{-O} and higher.
7861 @item -fipa-cp
7862 @opindex fipa-cp
7863 Perform interprocedural constant propagation.
7864 This optimization analyzes the program to determine when values passed
7865 to functions are constants and then optimizes accordingly.
7866 This optimization can substantially increase performance
7867 if the application has constants passed to functions.
7868 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7870 @item -fipa-cp-clone
7871 @opindex fipa-cp-clone
7872 Perform function cloning to make interprocedural constant propagation stronger.
7873 When enabled, interprocedural constant propagation performs function cloning
7874 when externally visible function can be called with constant arguments.
7875 Because this optimization can create multiple copies of functions,
7876 it may significantly increase code size
7877 (see @option{--param ipcp-unit-growth=@var{value}}).
7878 This flag is enabled by default at @option{-O3}.
7880 @item -fipa-cp-alignment
7881 @opindex -fipa-cp-alignment
7882 When enabled, this optimization propagates alignment of function
7883 parameters to support better vectorization and string operations.
7885 This flag is enabled by default at @option{-O2} and @option{-Os}.  It
7886 requires that @option{-fipa-cp} is enabled.
7887 @option{-fipa-cp-alignment} is obsolete, use @option{-fipa-bit-cp} instead.
7889 @item -fipa-bit-cp
7890 @opindex -fipa-bit-cp
7891 When enabled, perform ipa bitwise constant propagation. This flag is
7892 enabled by default at @option{-O2}. It requires that @option{-fipa-cp}
7893 is enabled.
7895 @item -fipa-icf
7896 @opindex fipa-icf
7897 Perform Identical Code Folding for functions and read-only variables.
7898 The optimization reduces code size and may disturb unwind stacks by replacing
7899 a function by equivalent one with a different name. The optimization works
7900 more effectively with link time optimization enabled.
7902 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
7903 works on different levels and thus the optimizations are not same - there are
7904 equivalences that are found only by GCC and equivalences found only by Gold.
7906 This flag is enabled by default at @option{-O2} and @option{-Os}.
7908 @item -fisolate-erroneous-paths-dereference
7909 @opindex fisolate-erroneous-paths-dereference
7910 Detect paths that trigger erroneous or undefined behavior due to
7911 dereferencing a null pointer.  Isolate those paths from the main control
7912 flow and turn the statement with erroneous or undefined behavior into a trap.
7913 This flag is enabled by default at @option{-O2} and higher and depends on
7914 @option{-fdelete-null-pointer-checks} also being enabled.
7916 @item -fisolate-erroneous-paths-attribute
7917 @opindex fisolate-erroneous-paths-attribute
7918 Detect paths that trigger erroneous or undefined behavior due a null value
7919 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
7920 attribute.  Isolate those paths from the main control flow and turn the
7921 statement with erroneous or undefined behavior into a trap.  This is not
7922 currently enabled, but may be enabled by @option{-O2} in the future.
7924 @item -ftree-sink
7925 @opindex ftree-sink
7926 Perform forward store motion on trees.  This flag is
7927 enabled by default at @option{-O} and higher.
7929 @item -ftree-bit-ccp
7930 @opindex ftree-bit-ccp
7931 Perform sparse conditional bit constant propagation on trees and propagate
7932 pointer alignment information.
7933 This pass only operates on local scalar variables and is enabled by default
7934 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7936 @item -ftree-ccp
7937 @opindex ftree-ccp
7938 Perform sparse conditional constant propagation (CCP) on trees.  This
7939 pass only operates on local scalar variables and is enabled by default
7940 at @option{-O} and higher.
7942 @item -fssa-backprop
7943 @opindex fssa-backprop
7944 Propagate information about uses of a value up the definition chain
7945 in order to simplify the definitions.  For example, this pass strips
7946 sign operations if the sign of a value never matters.  The flag is
7947 enabled by default at @option{-O} and higher.
7949 @item -fssa-phiopt
7950 @opindex fssa-phiopt
7951 Perform pattern matching on SSA PHI nodes to optimize conditional
7952 code.  This pass is enabled by default at @option{-O} and higher.
7954 @item -ftree-switch-conversion
7955 @opindex ftree-switch-conversion
7956 Perform conversion of simple initializations in a switch to
7957 initializations from a scalar array.  This flag is enabled by default
7958 at @option{-O2} and higher.
7960 @item -ftree-tail-merge
7961 @opindex ftree-tail-merge
7962 Look for identical code sequences.  When found, replace one with a jump to the
7963 other.  This optimization is known as tail merging or cross jumping.  This flag
7964 is enabled by default at @option{-O2} and higher.  The compilation time
7965 in this pass can
7966 be limited using @option{max-tail-merge-comparisons} parameter and
7967 @option{max-tail-merge-iterations} parameter.
7969 @item -ftree-dce
7970 @opindex ftree-dce
7971 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7972 default at @option{-O} and higher.
7974 @item -ftree-builtin-call-dce
7975 @opindex ftree-builtin-call-dce
7976 Perform conditional dead code elimination (DCE) for calls to built-in functions
7977 that may set @code{errno} but are otherwise side-effect free.  This flag is
7978 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7979 specified.
7981 @item -ftree-dominator-opts
7982 @opindex ftree-dominator-opts
7983 Perform a variety of simple scalar cleanups (constant/copy
7984 propagation, redundancy elimination, range propagation and expression
7985 simplification) based on a dominator tree traversal.  This also
7986 performs jump threading (to reduce jumps to jumps). This flag is
7987 enabled by default at @option{-O} and higher.
7989 @item -ftree-dse
7990 @opindex ftree-dse
7991 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7992 a memory location that is later overwritten by another store without
7993 any intervening loads.  In this case the earlier store can be deleted.  This
7994 flag is enabled by default at @option{-O} and higher.
7996 @item -ftree-ch
7997 @opindex ftree-ch
7998 Perform loop header copying on trees.  This is beneficial since it increases
7999 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8000 is enabled by default at @option{-O} and higher.  It is not enabled
8001 for @option{-Os}, since it usually increases code size.
8003 @item -ftree-loop-optimize
8004 @opindex ftree-loop-optimize
8005 Perform loop optimizations on trees.  This flag is enabled by default
8006 at @option{-O} and higher.
8008 @item -ftree-loop-linear
8009 @itemx -floop-interchange
8010 @itemx -floop-strip-mine
8011 @itemx -floop-block
8012 @itemx -floop-unroll-and-jam
8013 @opindex ftree-loop-linear
8014 @opindex floop-interchange
8015 @opindex floop-strip-mine
8016 @opindex floop-block
8017 @opindex floop-unroll-and-jam
8018 Perform loop nest optimizations.  Same as
8019 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
8020 to be configured with @option{--with-isl} to enable the Graphite loop
8021 transformation infrastructure.
8023 @item -fgraphite-identity
8024 @opindex fgraphite-identity
8025 Enable the identity transformation for graphite.  For every SCoP we generate
8026 the polyhedral representation and transform it back to gimple.  Using
8027 @option{-fgraphite-identity} we can check the costs or benefits of the
8028 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8029 are also performed by the code generator isl, like index splitting and
8030 dead code elimination in loops.
8032 @item -floop-nest-optimize
8033 @opindex floop-nest-optimize
8034 Enable the isl based loop nest optimizer.  This is a generic loop nest
8035 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8036 structure optimized for data-locality and parallelism.  This option
8037 is experimental.
8039 @item -floop-parallelize-all
8040 @opindex floop-parallelize-all
8041 Use the Graphite data dependence analysis to identify loops that can
8042 be parallelized.  Parallelize all the loops that can be analyzed to
8043 not contain loop carried dependences without checking that it is
8044 profitable to parallelize the loops.
8046 @item -ftree-coalesce-vars
8047 @opindex ftree-coalesce-vars
8048 While transforming the program out of the SSA representation, attempt to
8049 reduce copying by coalescing versions of different user-defined
8050 variables, instead of just compiler temporaries.  This may severely
8051 limit the ability to debug an optimized program compiled with
8052 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
8053 prevents SSA coalescing of user variables.  This option is enabled by
8054 default if optimization is enabled, and it does very little otherwise.
8056 @item -ftree-loop-if-convert
8057 @opindex ftree-loop-if-convert
8058 Attempt to transform conditional jumps in the innermost loops to
8059 branch-less equivalents.  The intent is to remove control-flow from
8060 the innermost loops in order to improve the ability of the
8061 vectorization pass to handle these loops.  This is enabled by default
8062 if vectorization is enabled.
8064 @item -ftree-loop-if-convert-stores
8065 @opindex ftree-loop-if-convert-stores
8066 Attempt to also if-convert conditional jumps containing memory writes.
8067 This transformation can be unsafe for multi-threaded programs as it
8068 transforms conditional memory writes into unconditional memory writes.
8069 For example,
8070 @smallexample
8071 for (i = 0; i < N; i++)
8072   if (cond)
8073     A[i] = expr;
8074 @end smallexample
8075 is transformed to
8076 @smallexample
8077 for (i = 0; i < N; i++)
8078   A[i] = cond ? expr : A[i];
8079 @end smallexample
8080 potentially producing data races.
8082 @item -ftree-loop-distribution
8083 @opindex ftree-loop-distribution
8084 Perform loop distribution.  This flag can improve cache performance on
8085 big loop bodies and allow further loop optimizations, like
8086 parallelization or vectorization, to take place.  For example, the loop
8087 @smallexample
8088 DO I = 1, N
8089   A(I) = B(I) + C
8090   D(I) = E(I) * F
8091 ENDDO
8092 @end smallexample
8093 is transformed to
8094 @smallexample
8095 DO I = 1, N
8096    A(I) = B(I) + C
8097 ENDDO
8098 DO I = 1, N
8099    D(I) = E(I) * F
8100 ENDDO
8101 @end smallexample
8103 @item -ftree-loop-distribute-patterns
8104 @opindex ftree-loop-distribute-patterns
8105 Perform loop distribution of patterns that can be code generated with
8106 calls to a library.  This flag is enabled by default at @option{-O3}.
8108 This pass distributes the initialization loops and generates a call to
8109 memset zero.  For example, the loop
8110 @smallexample
8111 DO I = 1, N
8112   A(I) = 0
8113   B(I) = A(I) + I
8114 ENDDO
8115 @end smallexample
8116 is transformed to
8117 @smallexample
8118 DO I = 1, N
8119    A(I) = 0
8120 ENDDO
8121 DO I = 1, N
8122    B(I) = A(I) + I
8123 ENDDO
8124 @end smallexample
8125 and the initialization loop is transformed into a call to memset zero.
8127 @item -ftree-loop-im
8128 @opindex ftree-loop-im
8129 Perform loop invariant motion on trees.  This pass moves only invariants that
8130 are hard to handle at RTL level (function calls, operations that expand to
8131 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
8132 operands of conditions that are invariant out of the loop, so that we can use
8133 just trivial invariantness analysis in loop unswitching.  The pass also includes
8134 store motion.
8136 @item -ftree-loop-ivcanon
8137 @opindex ftree-loop-ivcanon
8138 Create a canonical counter for number of iterations in loops for which
8139 determining number of iterations requires complicated analysis.  Later
8140 optimizations then may determine the number easily.  Useful especially
8141 in connection with unrolling.
8143 @item -fivopts
8144 @opindex fivopts
8145 Perform induction variable optimizations (strength reduction, induction
8146 variable merging and induction variable elimination) on trees.
8148 @item -ftree-parallelize-loops=n
8149 @opindex ftree-parallelize-loops
8150 Parallelize loops, i.e., split their iteration space to run in n threads.
8151 This is only possible for loops whose iterations are independent
8152 and can be arbitrarily reordered.  The optimization is only
8153 profitable on multiprocessor machines, for loops that are CPU-intensive,
8154 rather than constrained e.g.@: by memory bandwidth.  This option
8155 implies @option{-pthread}, and thus is only supported on targets
8156 that have support for @option{-pthread}.
8158 @item -ftree-pta
8159 @opindex ftree-pta
8160 Perform function-local points-to analysis on trees.  This flag is
8161 enabled by default at @option{-O} and higher.
8163 @item -ftree-sra
8164 @opindex ftree-sra
8165 Perform scalar replacement of aggregates.  This pass replaces structure
8166 references with scalars to prevent committing structures to memory too
8167 early.  This flag is enabled by default at @option{-O} and higher.
8169 @item -fstore-merging
8170 @opindex fstore-merging
8171 Perform merging of narrow stores to consecutive memory addresses.  This pass
8172 merges contiguous stores of immediate values narrower than a word into fewer
8173 wider stores to reduce the number of instructions.  This is enabled by default
8174 at @option{-O} and higher.
8176 @item -ftree-ter
8177 @opindex ftree-ter
8178 Perform temporary expression replacement during the SSA->normal phase.  Single
8179 use/single def temporaries are replaced at their use location with their
8180 defining expression.  This results in non-GIMPLE code, but gives the expanders
8181 much more complex trees to work on resulting in better RTL generation.  This is
8182 enabled by default at @option{-O} and higher.
8184 @item -ftree-slsr
8185 @opindex ftree-slsr
8186 Perform straight-line strength reduction on trees.  This recognizes related
8187 expressions involving multiplications and replaces them by less expensive
8188 calculations when possible.  This is enabled by default at @option{-O} and
8189 higher.
8191 @item -ftree-vectorize
8192 @opindex ftree-vectorize
8193 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8194 and @option{-ftree-slp-vectorize} if not explicitly specified.
8196 @item -ftree-loop-vectorize
8197 @opindex ftree-loop-vectorize
8198 Perform loop vectorization on trees. This flag is enabled by default at
8199 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8201 @item -ftree-slp-vectorize
8202 @opindex ftree-slp-vectorize
8203 Perform basic block vectorization on trees. This flag is enabled by default at
8204 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8206 @item -fvect-cost-model=@var{model}
8207 @opindex fvect-cost-model
8208 Alter the cost model used for vectorization.  The @var{model} argument
8209 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
8210 With the @samp{unlimited} model the vectorized code-path is assumed
8211 to be profitable while with the @samp{dynamic} model a runtime check
8212 guards the vectorized code-path to enable it only for iteration
8213 counts that will likely execute faster than when executing the original
8214 scalar loop.  The @samp{cheap} model disables vectorization of
8215 loops where doing so would be cost prohibitive for example due to
8216 required runtime checks for data dependence or alignment but otherwise
8217 is equal to the @samp{dynamic} model.
8218 The default cost model depends on other optimization flags and is
8219 either @samp{dynamic} or @samp{cheap}.
8221 @item -fsimd-cost-model=@var{model}
8222 @opindex fsimd-cost-model
8223 Alter the cost model used for vectorization of loops marked with the OpenMP
8224 or Cilk Plus simd directive.  The @var{model} argument should be one of
8225 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
8226 have the same meaning as described in @option{-fvect-cost-model} and by
8227 default a cost model defined with @option{-fvect-cost-model} is used.
8229 @item -ftree-vrp
8230 @opindex ftree-vrp
8231 Perform Value Range Propagation on trees.  This is similar to the
8232 constant propagation pass, but instead of values, ranges of values are
8233 propagated.  This allows the optimizers to remove unnecessary range
8234 checks like array bound checks and null pointer checks.  This is
8235 enabled by default at @option{-O2} and higher.  Null pointer check
8236 elimination is only done if @option{-fdelete-null-pointer-checks} is
8237 enabled.
8239 @item -fsplit-paths
8240 @opindex fsplit-paths
8241 Split paths leading to loop backedges.  This can improve dead code
8242 elimination and common subexpression elimination.  This is enabled by
8243 default at @option{-O2} and above.
8245 @item -fsplit-ivs-in-unroller
8246 @opindex fsplit-ivs-in-unroller
8247 Enables expression of values of induction variables in later iterations
8248 of the unrolled loop using the value in the first iteration.  This breaks
8249 long dependency chains, thus improving efficiency of the scheduling passes.
8251 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8252 same effect.  However, that is not reliable in cases where the loop body
8253 is more complicated than a single basic block.  It also does not work at all
8254 on some architectures due to restrictions in the CSE pass.
8256 This optimization is enabled by default.
8258 @item -fvariable-expansion-in-unroller
8259 @opindex fvariable-expansion-in-unroller
8260 With this option, the compiler creates multiple copies of some
8261 local variables when unrolling a loop, which can result in superior code.
8263 @item -fpartial-inlining
8264 @opindex fpartial-inlining
8265 Inline parts of functions.  This option has any effect only
8266 when inlining itself is turned on by the @option{-finline-functions}
8267 or @option{-finline-small-functions} options.
8269 Enabled at level @option{-O2}.
8271 @item -fpredictive-commoning
8272 @opindex fpredictive-commoning
8273 Perform predictive commoning optimization, i.e., reusing computations
8274 (especially memory loads and stores) performed in previous
8275 iterations of loops.
8277 This option is enabled at level @option{-O3}.
8279 @item -fprefetch-loop-arrays
8280 @opindex fprefetch-loop-arrays
8281 If supported by the target machine, generate instructions to prefetch
8282 memory to improve the performance of loops that access large arrays.
8284 This option may generate better or worse code; results are highly
8285 dependent on the structure of loops within the source code.
8287 Disabled at level @option{-Os}.
8289 @item -fprintf-return-value
8290 @opindex fprintf-return-value
8291 Substitute constants for known return value of formatted output functions
8292 such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and @code{vsnprintf}
8293 (but not @code{printf} of @code{fprintf}).  This transformation allows GCC
8294 to optimize or even eliminate branches based on the known return value of
8295 these functions called with arguments that are either constant, or whose
8296 values are known to be in a range that makes determining the exact return
8297 value possible.  For example, both the branch and the body of the @code{if}
8298 statement (but not the call to @code{snprint}) can be optimized away when
8299 @code{i} is a 32-bit or smaller integer because the return value is guaranteed
8300 to be at most 8.
8302 @smallexample
8303 char buf[9];
8304 if (snprintf (buf, "%08x", i) >= sizeof buf)
8305   @dots{}
8306 @end smallexample
8308 The @option{-fprintf-return-value} option relies on other optimizations
8309 and yields best results with @option{-O2}.  It works in tandem with the
8310 @option{-Wformat-length} option.  The @option{-fprintf-return-value}
8311 option is disabled by default.
8313 @item -fno-peephole
8314 @itemx -fno-peephole2
8315 @opindex fno-peephole
8316 @opindex fno-peephole2
8317 Disable any machine-specific peephole optimizations.  The difference
8318 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8319 are implemented in the compiler; some targets use one, some use the
8320 other, a few use both.
8322 @option{-fpeephole} is enabled by default.
8323 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8325 @item -fno-guess-branch-probability
8326 @opindex fno-guess-branch-probability
8327 Do not guess branch probabilities using heuristics.
8329 GCC uses heuristics to guess branch probabilities if they are
8330 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8331 heuristics are based on the control flow graph.  If some branch probabilities
8332 are specified by @code{__builtin_expect}, then the heuristics are
8333 used to guess branch probabilities for the rest of the control flow graph,
8334 taking the @code{__builtin_expect} info into account.  The interactions
8335 between the heuristics and @code{__builtin_expect} can be complex, and in
8336 some cases, it may be useful to disable the heuristics so that the effects
8337 of @code{__builtin_expect} are easier to understand.
8339 The default is @option{-fguess-branch-probability} at levels
8340 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8342 @item -freorder-blocks
8343 @opindex freorder-blocks
8344 Reorder basic blocks in the compiled function in order to reduce number of
8345 taken branches and improve code locality.
8347 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8349 @item -freorder-blocks-algorithm=@var{algorithm}
8350 @opindex freorder-blocks-algorithm
8351 Use the specified algorithm for basic block reordering.  The
8352 @var{algorithm} argument can be @samp{simple}, which does not increase
8353 code size (except sometimes due to secondary effects like alignment),
8354 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
8355 put all often executed code together, minimizing the number of branches
8356 executed by making extra copies of code.
8358 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
8359 @samp{stc} at levels @option{-O2}, @option{-O3}.
8361 @item -freorder-blocks-and-partition
8362 @opindex freorder-blocks-and-partition
8363 In addition to reordering basic blocks in the compiled function, in order
8364 to reduce number of taken branches, partitions hot and cold basic blocks
8365 into separate sections of the assembly and @file{.o} files, to improve
8366 paging and cache locality performance.
8368 This optimization is automatically turned off in the presence of
8369 exception handling, for linkonce sections, for functions with a user-defined
8370 section attribute and on any architecture that does not support named
8371 sections.
8373 Enabled for x86 at levels @option{-O2}, @option{-O3}.
8375 @item -freorder-functions
8376 @opindex freorder-functions
8377 Reorder functions in the object file in order to
8378 improve code locality.  This is implemented by using special
8379 subsections @code{.text.hot} for most frequently executed functions and
8380 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8381 the linker so object file format must support named sections and linker must
8382 place them in a reasonable way.
8384 Also profile feedback must be available to make this option effective.  See
8385 @option{-fprofile-arcs} for details.
8387 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8389 @item -fstrict-aliasing
8390 @opindex fstrict-aliasing
8391 Allow the compiler to assume the strictest aliasing rules applicable to
8392 the language being compiled.  For C (and C++), this activates
8393 optimizations based on the type of expressions.  In particular, an
8394 object of one type is assumed never to reside at the same address as an
8395 object of a different type, unless the types are almost the same.  For
8396 example, an @code{unsigned int} can alias an @code{int}, but not a
8397 @code{void*} or a @code{double}.  A character type may alias any other
8398 type.
8400 @anchor{Type-punning}Pay special attention to code like this:
8401 @smallexample
8402 union a_union @{
8403   int i;
8404   double d;
8407 int f() @{
8408   union a_union t;
8409   t.d = 3.0;
8410   return t.i;
8412 @end smallexample
8413 The practice of reading from a different union member than the one most
8414 recently written to (called ``type-punning'') is common.  Even with
8415 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8416 is accessed through the union type.  So, the code above works as
8417 expected.  @xref{Structures unions enumerations and bit-fields
8418 implementation}.  However, this code might not:
8419 @smallexample
8420 int f() @{
8421   union a_union t;
8422   int* ip;
8423   t.d = 3.0;
8424   ip = &t.i;
8425   return *ip;
8427 @end smallexample
8429 Similarly, access by taking the address, casting the resulting pointer
8430 and dereferencing the result has undefined behavior, even if the cast
8431 uses a union type, e.g.:
8432 @smallexample
8433 int f() @{
8434   double d = 3.0;
8435   return ((union a_union *) &d)->i;
8437 @end smallexample
8439 The @option{-fstrict-aliasing} option is enabled at levels
8440 @option{-O2}, @option{-O3}, @option{-Os}.
8442 @item -fstrict-overflow
8443 @opindex fstrict-overflow
8444 Allow the compiler to assume strict signed overflow rules, depending
8445 on the language being compiled.  For C (and C++) this means that
8446 overflow when doing arithmetic with signed numbers is undefined, which
8447 means that the compiler may assume that it does not happen.  This
8448 permits various optimizations.  For example, the compiler assumes
8449 that an expression like @code{i + 10 > i} is always true for
8450 signed @code{i}.  This assumption is only valid if signed overflow is
8451 undefined, as the expression is false if @code{i + 10} overflows when
8452 using twos complement arithmetic.  When this option is in effect any
8453 attempt to determine whether an operation on signed numbers 
8454 overflows must be written carefully to not actually involve overflow.
8456 This option also allows the compiler to assume strict pointer
8457 semantics: given a pointer to an object, if adding an offset to that
8458 pointer does not produce a pointer to the same object, the addition is
8459 undefined.  This permits the compiler to conclude that @code{p + u >
8460 p} is always true for a pointer @code{p} and unsigned integer
8461 @code{u}.  This assumption is only valid because pointer wraparound is
8462 undefined, as the expression is false if @code{p + u} overflows using
8463 twos complement arithmetic.
8465 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8466 that integer signed overflow is fully defined: it wraps.  When
8467 @option{-fwrapv} is used, there is no difference between
8468 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8469 integers.  With @option{-fwrapv} certain types of overflow are
8470 permitted.  For example, if the compiler gets an overflow when doing
8471 arithmetic on constants, the overflowed value can still be used with
8472 @option{-fwrapv}, but not otherwise.
8474 The @option{-fstrict-overflow} option is enabled at levels
8475 @option{-O2}, @option{-O3}, @option{-Os}.
8477 @item -falign-functions
8478 @itemx -falign-functions=@var{n}
8479 @opindex falign-functions
8480 Align the start of functions to the next power-of-two greater than
8481 @var{n}, skipping up to @var{n} bytes.  For instance,
8482 @option{-falign-functions=32} aligns functions to the next 32-byte
8483 boundary, but @option{-falign-functions=24} aligns to the next
8484 32-byte boundary only if this can be done by skipping 23 bytes or less.
8486 @option{-fno-align-functions} and @option{-falign-functions=1} are
8487 equivalent and mean that functions are not aligned.
8489 Some assemblers only support this flag when @var{n} is a power of two;
8490 in that case, it is rounded up.
8492 If @var{n} is not specified or is zero, use a machine-dependent default.
8494 Enabled at levels @option{-O2}, @option{-O3}.
8496 @item -falign-labels
8497 @itemx -falign-labels=@var{n}
8498 @opindex falign-labels
8499 Align all branch targets to a power-of-two boundary, skipping up to
8500 @var{n} bytes like @option{-falign-functions}.  This option can easily
8501 make code slower, because it must insert dummy operations for when the
8502 branch target is reached in the usual flow of the code.
8504 @option{-fno-align-labels} and @option{-falign-labels=1} are
8505 equivalent and mean that labels are not aligned.
8507 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8508 are greater than this value, then their values are used instead.
8510 If @var{n} is not specified or is zero, use a machine-dependent default
8511 which is very likely to be @samp{1}, meaning no alignment.
8513 Enabled at levels @option{-O2}, @option{-O3}.
8515 @item -falign-loops
8516 @itemx -falign-loops=@var{n}
8517 @opindex falign-loops
8518 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8519 like @option{-falign-functions}.  If the loops are
8520 executed many times, this makes up for any execution of the dummy
8521 operations.
8523 @option{-fno-align-loops} and @option{-falign-loops=1} are
8524 equivalent and mean that loops are not aligned.
8526 If @var{n} is not specified or is zero, use a machine-dependent default.
8528 Enabled at levels @option{-O2}, @option{-O3}.
8530 @item -falign-jumps
8531 @itemx -falign-jumps=@var{n}
8532 @opindex falign-jumps
8533 Align branch targets to a power-of-two boundary, for branch targets
8534 where the targets can only be reached by jumping, skipping up to @var{n}
8535 bytes like @option{-falign-functions}.  In this case, no dummy operations
8536 need be executed.
8538 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8539 equivalent and mean that loops are not aligned.
8541 If @var{n} is not specified or is zero, use a machine-dependent default.
8543 Enabled at levels @option{-O2}, @option{-O3}.
8545 @item -funit-at-a-time
8546 @opindex funit-at-a-time
8547 This option is left for compatibility reasons. @option{-funit-at-a-time}
8548 has no effect, while @option{-fno-unit-at-a-time} implies
8549 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8551 Enabled by default.
8553 @item -fno-toplevel-reorder
8554 @opindex fno-toplevel-reorder
8555 Do not reorder top-level functions, variables, and @code{asm}
8556 statements.  Output them in the same order that they appear in the
8557 input file.  When this option is used, unreferenced static variables
8558 are not removed.  This option is intended to support existing code
8559 that relies on a particular ordering.  For new code, it is better to
8560 use attributes when possible.
8562 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8563 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8564 targets.
8566 @item -fweb
8567 @opindex fweb
8568 Constructs webs as commonly used for register allocation purposes and assign
8569 each web individual pseudo register.  This allows the register allocation pass
8570 to operate on pseudos directly, but also strengthens several other optimization
8571 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8572 however, make debugging impossible, since variables no longer stay in a
8573 ``home register''.
8575 Enabled by default with @option{-funroll-loops}.
8577 @item -fwhole-program
8578 @opindex fwhole-program
8579 Assume that the current compilation unit represents the whole program being
8580 compiled.  All public functions and variables with the exception of @code{main}
8581 and those merged by attribute @code{externally_visible} become static functions
8582 and in effect are optimized more aggressively by interprocedural optimizers.
8584 This option should not be used in combination with @option{-flto}.
8585 Instead relying on a linker plugin should provide safer and more precise
8586 information.
8588 @item -flto[=@var{n}]
8589 @opindex flto
8590 This option runs the standard link-time optimizer.  When invoked
8591 with source code, it generates GIMPLE (one of GCC's internal
8592 representations) and writes it to special ELF sections in the object
8593 file.  When the object files are linked together, all the function
8594 bodies are read from these ELF sections and instantiated as if they
8595 had been part of the same translation unit.
8597 To use the link-time optimizer, @option{-flto} and optimization
8598 options should be specified at compile time and during the final link.
8599 It is recommended that you compile all the files participating in the
8600 same link with the same options and also specify those options at
8601 link time.  
8602 For example:
8604 @smallexample
8605 gcc -c -O2 -flto foo.c
8606 gcc -c -O2 -flto bar.c
8607 gcc -o myprog -flto -O2 foo.o bar.o
8608 @end smallexample
8610 The first two invocations to GCC save a bytecode representation
8611 of GIMPLE into special ELF sections inside @file{foo.o} and
8612 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8613 @file{foo.o} and @file{bar.o}, merges the two files into a single
8614 internal image, and compiles the result as usual.  Since both
8615 @file{foo.o} and @file{bar.o} are merged into a single image, this
8616 causes all the interprocedural analyses and optimizations in GCC to
8617 work across the two files as if they were a single one.  This means,
8618 for example, that the inliner is able to inline functions in
8619 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8621 Another (simpler) way to enable link-time optimization is:
8623 @smallexample
8624 gcc -o myprog -flto -O2 foo.c bar.c
8625 @end smallexample
8627 The above generates bytecode for @file{foo.c} and @file{bar.c},
8628 merges them together into a single GIMPLE representation and optimizes
8629 them as usual to produce @file{myprog}.
8631 The only important thing to keep in mind is that to enable link-time
8632 optimizations you need to use the GCC driver to perform the link step.
8633 GCC then automatically performs link-time optimization if any of the
8634 objects involved were compiled with the @option{-flto} command-line option.  
8635 You generally
8636 should specify the optimization options to be used for link-time
8637 optimization though GCC tries to be clever at guessing an
8638 optimization level to use from the options used at compile time
8639 if you fail to specify one at link time.  You can always override
8640 the automatic decision to do link-time optimization at link time
8641 by passing @option{-fno-lto} to the link command.
8643 To make whole program optimization effective, it is necessary to make
8644 certain whole program assumptions.  The compiler needs to know
8645 what functions and variables can be accessed by libraries and runtime
8646 outside of the link-time optimized unit.  When supported by the linker,
8647 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8648 to the compiler about used and externally visible symbols.  When
8649 the linker plugin is not available, @option{-fwhole-program} should be
8650 used to allow the compiler to make these assumptions, which leads
8651 to more aggressive optimization decisions.
8653 When @option{-fuse-linker-plugin} is not enabled, when a file is
8654 compiled with @option{-flto}, the generated object file is larger than
8655 a regular object file because it contains GIMPLE bytecodes and the usual
8656 final code (see @option{-ffat-lto-objects}.  This means that
8657 object files with LTO information can be linked as normal object
8658 files; if @option{-fno-lto} is passed to the linker, no
8659 interprocedural optimizations are applied.  Note that when
8660 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
8661 but you cannot perform a regular, non-LTO link on them.
8663 Additionally, the optimization flags used to compile individual files
8664 are not necessarily related to those used at link time.  For instance,
8666 @smallexample
8667 gcc -c -O0 -ffat-lto-objects -flto foo.c
8668 gcc -c -O0 -ffat-lto-objects -flto bar.c
8669 gcc -o myprog -O3 foo.o bar.o
8670 @end smallexample
8672 This produces individual object files with unoptimized assembler
8673 code, but the resulting binary @file{myprog} is optimized at
8674 @option{-O3}.  If, instead, the final binary is generated with
8675 @option{-fno-lto}, then @file{myprog} is not optimized.
8677 When producing the final binary, GCC only
8678 applies link-time optimizations to those files that contain bytecode.
8679 Therefore, you can mix and match object files and libraries with
8680 GIMPLE bytecodes and final object code.  GCC automatically selects
8681 which files to optimize in LTO mode and which files to link without
8682 further processing.
8684 There are some code generation flags preserved by GCC when
8685 generating bytecodes, as they need to be used during the final link
8686 stage.  Generally options specified at link time override those
8687 specified at compile time.
8689 If you do not specify an optimization level option @option{-O} at
8690 link time, then GCC uses the highest optimization level 
8691 used when compiling the object files.
8693 Currently, the following options and their settings are taken from
8694 the first object file that explicitly specifies them: 
8695 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
8696 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
8697 and all the @option{-m} target flags.
8699 Certain ABI-changing flags are required to match in all compilation units,
8700 and trying to override this at link time with a conflicting value
8701 is ignored.  This includes options such as @option{-freg-struct-return}
8702 and @option{-fpcc-struct-return}. 
8704 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
8705 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
8706 are passed through to the link stage and merged conservatively for
8707 conflicting translation units.  Specifically
8708 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
8709 precedence; and for example @option{-ffp-contract=off} takes precedence
8710 over @option{-ffp-contract=fast}.  You can override them at link time.
8712 If LTO encounters objects with C linkage declared with incompatible
8713 types in separate translation units to be linked together (undefined
8714 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8715 issued.  The behavior is still undefined at run time.  Similar
8716 diagnostics may be raised for other languages.
8718 Another feature of LTO is that it is possible to apply interprocedural
8719 optimizations on files written in different languages:
8721 @smallexample
8722 gcc -c -flto foo.c
8723 g++ -c -flto bar.cc
8724 gfortran -c -flto baz.f90
8725 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8726 @end smallexample
8728 Notice that the final link is done with @command{g++} to get the C++
8729 runtime libraries and @option{-lgfortran} is added to get the Fortran
8730 runtime libraries.  In general, when mixing languages in LTO mode, you
8731 should use the same link command options as when mixing languages in a
8732 regular (non-LTO) compilation.
8734 If object files containing GIMPLE bytecode are stored in a library archive, say
8735 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8736 are using a linker with plugin support.  To create static libraries suitable
8737 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
8738 and @command{ranlib}; 
8739 to show the symbols of object files with GIMPLE bytecode, use
8740 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
8741 and @command{nm} have been compiled with plugin support.  At link time, use the the
8742 flag @option{-fuse-linker-plugin} to ensure that the library participates in
8743 the LTO optimization process:
8745 @smallexample
8746 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8747 @end smallexample
8749 With the linker plugin enabled, the linker extracts the needed
8750 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8751 to make them part of the aggregated GIMPLE image to be optimized.
8753 If you are not using a linker with plugin support and/or do not
8754 enable the linker plugin, then the objects inside @file{libfoo.a}
8755 are extracted and linked as usual, but they do not participate
8756 in the LTO optimization process.  In order to make a static library suitable
8757 for both LTO optimization and usual linkage, compile its object files with
8758 @option{-flto} @option{-ffat-lto-objects}.
8760 Link-time optimizations do not require the presence of the whole program to
8761 operate.  If the program does not require any symbols to be exported, it is
8762 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8763 the interprocedural optimizers to use more aggressive assumptions which may
8764 lead to improved optimization opportunities.
8765 Use of @option{-fwhole-program} is not needed when linker plugin is
8766 active (see @option{-fuse-linker-plugin}).
8768 The current implementation of LTO makes no
8769 attempt to generate bytecode that is portable between different
8770 types of hosts.  The bytecode files are versioned and there is a
8771 strict version check, so bytecode files generated in one version of
8772 GCC do not work with an older or newer version of GCC.
8774 Link-time optimization does not work well with generation of debugging
8775 information.  Combining @option{-flto} with
8776 @option{-g} is currently experimental and expected to produce unexpected
8777 results.
8779 If you specify the optional @var{n}, the optimization and code
8780 generation done at link time is executed in parallel using @var{n}
8781 parallel jobs by utilizing an installed @command{make} program.  The
8782 environment variable @env{MAKE} may be used to override the program
8783 used.  The default value for @var{n} is 1.
8785 You can also specify @option{-flto=jobserver} to use GNU make's
8786 job server mode to determine the number of parallel jobs. This
8787 is useful when the Makefile calling GCC is already executing in parallel.
8788 You must prepend a @samp{+} to the command recipe in the parent Makefile
8789 for this to work.  This option likely only works if @env{MAKE} is
8790 GNU make.
8792 @item -flto-partition=@var{alg}
8793 @opindex flto-partition
8794 Specify the partitioning algorithm used by the link-time optimizer.
8795 The value is either @samp{1to1} to specify a partitioning mirroring
8796 the original source files or @samp{balanced} to specify partitioning
8797 into equally sized chunks (whenever possible) or @samp{max} to create
8798 new partition for every symbol where possible.  Specifying @samp{none}
8799 as an algorithm disables partitioning and streaming completely. 
8800 The default value is @samp{balanced}. While @samp{1to1} can be used
8801 as an workaround for various code ordering issues, the @samp{max}
8802 partitioning is intended for internal testing only.
8803 The value @samp{one} specifies that exactly one partition should be
8804 used while the value @samp{none} bypasses partitioning and executes
8805 the link-time optimization step directly from the WPA phase.
8807 @item -flto-odr-type-merging
8808 @opindex flto-odr-type-merging
8809 Enable streaming of mangled types names of C++ types and their unification
8810 at link time.  This increases size of LTO object files, but enables
8811 diagnostics about One Definition Rule violations.
8813 @item -flto-compression-level=@var{n}
8814 @opindex flto-compression-level
8815 This option specifies the level of compression used for intermediate
8816 language written to LTO object files, and is only meaningful in
8817 conjunction with LTO mode (@option{-flto}).  Valid
8818 values are 0 (no compression) to 9 (maximum compression).  Values
8819 outside this range are clamped to either 0 or 9.  If the option is not
8820 given, a default balanced compression setting is used.
8822 @item -fuse-linker-plugin
8823 @opindex fuse-linker-plugin
8824 Enables the use of a linker plugin during link-time optimization.  This
8825 option relies on plugin support in the linker, which is available in gold
8826 or in GNU ld 2.21 or newer.
8828 This option enables the extraction of object files with GIMPLE bytecode out
8829 of library archives. This improves the quality of optimization by exposing
8830 more code to the link-time optimizer.  This information specifies what
8831 symbols can be accessed externally (by non-LTO object or during dynamic
8832 linking).  Resulting code quality improvements on binaries (and shared
8833 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
8834 See @option{-flto} for a description of the effect of this flag and how to
8835 use it.
8837 This option is enabled by default when LTO support in GCC is enabled
8838 and GCC was configured for use with
8839 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8841 @item -ffat-lto-objects
8842 @opindex ffat-lto-objects
8843 Fat LTO objects are object files that contain both the intermediate language
8844 and the object code. This makes them usable for both LTO linking and normal
8845 linking. This option is effective only when compiling with @option{-flto}
8846 and is ignored at link time.
8848 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8849 requires the complete toolchain to be aware of LTO. It requires a linker with
8850 linker plugin support for basic functionality.  Additionally,
8851 @command{nm}, @command{ar} and @command{ranlib}
8852 need to support linker plugins to allow a full-featured build environment
8853 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8854 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8855 to these tools. With non fat LTO makefiles need to be modified to use them.
8857 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
8858 support.
8860 @item -fcompare-elim
8861 @opindex fcompare-elim
8862 After register allocation and post-register allocation instruction splitting,
8863 identify arithmetic instructions that compute processor flags similar to a
8864 comparison operation based on that arithmetic.  If possible, eliminate the
8865 explicit comparison operation.
8867 This pass only applies to certain targets that cannot explicitly represent
8868 the comparison operation before register allocation is complete.
8870 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8872 @item -fcprop-registers
8873 @opindex fcprop-registers
8874 After register allocation and post-register allocation instruction splitting,
8875 perform a copy-propagation pass to try to reduce scheduling dependencies
8876 and occasionally eliminate the copy.
8878 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8880 @item -fprofile-correction
8881 @opindex fprofile-correction
8882 Profiles collected using an instrumented binary for multi-threaded programs may
8883 be inconsistent due to missed counter updates. When this option is specified,
8884 GCC uses heuristics to correct or smooth out such inconsistencies. By
8885 default, GCC emits an error message when an inconsistent profile is detected.
8887 @item -fprofile-use
8888 @itemx -fprofile-use=@var{path}
8889 @opindex fprofile-use
8890 Enable profile feedback-directed optimizations, 
8891 and the following optimizations
8892 which are generally profitable only with profile feedback available:
8893 @option{-fbranch-probabilities}, @option{-fvpt},
8894 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
8895 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
8897 Before you can use this option, you must first generate profiling information.
8898 @xref{Optimize Options}, for information about the @option{-fprofile-generate}
8899 option.
8901 By default, GCC emits an error message if the feedback profiles do not
8902 match the source code.  This error can be turned into a warning by using
8903 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8904 code.
8906 If @var{path} is specified, GCC looks at the @var{path} to find
8907 the profile feedback data files. See @option{-fprofile-dir}.
8909 @item -fauto-profile
8910 @itemx -fauto-profile=@var{path}
8911 @opindex fauto-profile
8912 Enable sampling-based feedback-directed optimizations, 
8913 and the following optimizations
8914 which are generally profitable only with profile feedback available:
8915 @option{-fbranch-probabilities}, @option{-fvpt},
8916 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
8917 @option{-ftree-vectorize},
8918 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
8919 @option{-fpredictive-commoning}, @option{-funswitch-loops},
8920 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
8922 @var{path} is the name of a file containing AutoFDO profile information.
8923 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
8925 Producing an AutoFDO profile data file requires running your program
8926 with the @command{perf} utility on a supported GNU/Linux target system.
8927 For more information, see @uref{https://perf.wiki.kernel.org/}.
8929 E.g.
8930 @smallexample
8931 perf record -e br_inst_retired:near_taken -b -o perf.data \
8932     -- your_program
8933 @end smallexample
8935 Then use the @command{create_gcov} tool to convert the raw profile data
8936 to a format that can be used by GCC.@  You must also supply the 
8937 unstripped binary for your program to this tool.  
8938 See @uref{https://github.com/google/autofdo}.
8940 E.g.
8941 @smallexample
8942 create_gcov --binary=your_program.unstripped --profile=perf.data \
8943     --gcov=profile.afdo
8944 @end smallexample
8945 @end table
8947 The following options control compiler behavior regarding floating-point 
8948 arithmetic.  These options trade off between speed and
8949 correctness.  All must be specifically enabled.
8951 @table @gcctabopt
8952 @item -ffloat-store
8953 @opindex ffloat-store
8954 Do not store floating-point variables in registers, and inhibit other
8955 options that might change whether a floating-point value is taken from a
8956 register or memory.
8958 @cindex floating-point precision
8959 This option prevents undesirable excess precision on machines such as
8960 the 68000 where the floating registers (of the 68881) keep more
8961 precision than a @code{double} is supposed to have.  Similarly for the
8962 x86 architecture.  For most programs, the excess precision does only
8963 good, but a few programs rely on the precise definition of IEEE floating
8964 point.  Use @option{-ffloat-store} for such programs, after modifying
8965 them to store all pertinent intermediate computations into variables.
8967 @item -fexcess-precision=@var{style}
8968 @opindex fexcess-precision
8969 This option allows further control over excess precision on machines
8970 where floating-point registers have more precision than the IEEE
8971 @code{float} and @code{double} types and the processor does not
8972 support operations rounding to those types.  By default,
8973 @option{-fexcess-precision=fast} is in effect; this means that
8974 operations are carried out in the precision of the registers and that
8975 it is unpredictable when rounding to the types specified in the source
8976 code takes place.  When compiling C, if
8977 @option{-fexcess-precision=standard} is specified then excess
8978 precision follows the rules specified in ISO C99; in particular,
8979 both casts and assignments cause values to be rounded to their
8980 semantic types (whereas @option{-ffloat-store} only affects
8981 assignments).  This option is enabled by default for C if a strict
8982 conformance option such as @option{-std=c99} is used.
8984 @opindex mfpmath
8985 @option{-fexcess-precision=standard} is not implemented for languages
8986 other than C, and has no effect if
8987 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8988 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8989 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8990 semantics apply without excess precision, and in the latter, rounding
8991 is unpredictable.
8993 @item -ffast-math
8994 @opindex ffast-math
8995 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8996 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8997 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8999 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
9001 This option is not turned on by any @option{-O} option besides
9002 @option{-Ofast} since it can result in incorrect output for programs
9003 that depend on an exact implementation of IEEE or ISO rules/specifications
9004 for math functions. It may, however, yield faster code for programs
9005 that do not require the guarantees of these specifications.
9007 @item -fno-math-errno
9008 @opindex fno-math-errno
9009 Do not set @code{errno} after calling math functions that are executed
9010 with a single instruction, e.g., @code{sqrt}.  A program that relies on
9011 IEEE exceptions for math error handling may want to use this flag
9012 for speed while maintaining IEEE arithmetic compatibility.
9014 This option is not turned on by any @option{-O} option since
9015 it can result in incorrect output for programs that depend on
9016 an exact implementation of IEEE or ISO rules/specifications for
9017 math functions. It may, however, yield faster code for programs
9018 that do not require the guarantees of these specifications.
9020 The default is @option{-fmath-errno}.
9022 On Darwin systems, the math library never sets @code{errno}.  There is
9023 therefore no reason for the compiler to consider the possibility that
9024 it might, and @option{-fno-math-errno} is the default.
9026 @item -funsafe-math-optimizations
9027 @opindex funsafe-math-optimizations
9029 Allow optimizations for floating-point arithmetic that (a) assume
9030 that arguments and results are valid and (b) may violate IEEE or
9031 ANSI standards.  When used at link time, it may include libraries
9032 or startup files that change the default FPU control word or other
9033 similar optimizations.
9035 This option is not turned on by any @option{-O} option since
9036 it can result in incorrect output for programs that depend on
9037 an exact implementation of IEEE or ISO rules/specifications for
9038 math functions. It may, however, yield faster code for programs
9039 that do not require the guarantees of these specifications.
9040 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9041 @option{-fassociative-math} and @option{-freciprocal-math}.
9043 The default is @option{-fno-unsafe-math-optimizations}.
9045 @item -fassociative-math
9046 @opindex fassociative-math
9048 Allow re-association of operands in series of floating-point operations.
9049 This violates the ISO C and C++ language standard by possibly changing
9050 computation result.  NOTE: re-ordering may change the sign of zero as
9051 well as ignore NaNs and inhibit or create underflow or overflow (and
9052 thus cannot be used on code that relies on rounding behavior like
9053 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9054 and thus may not be used when ordered comparisons are required.
9055 This option requires that both @option{-fno-signed-zeros} and
9056 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9057 much sense with @option{-frounding-math}. For Fortran the option
9058 is automatically enabled when both @option{-fno-signed-zeros} and
9059 @option{-fno-trapping-math} are in effect.
9061 The default is @option{-fno-associative-math}.
9063 @item -freciprocal-math
9064 @opindex freciprocal-math
9066 Allow the reciprocal of a value to be used instead of dividing by
9067 the value if this enables optimizations.  For example @code{x / y}
9068 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9069 is subject to common subexpression elimination.  Note that this loses
9070 precision and increases the number of flops operating on the value.
9072 The default is @option{-fno-reciprocal-math}.
9074 @item -ffinite-math-only
9075 @opindex ffinite-math-only
9076 Allow optimizations for floating-point arithmetic that assume
9077 that arguments and results are not NaNs or +-Infs.
9079 This option is not turned on by any @option{-O} option since
9080 it can result in incorrect output for programs that depend on
9081 an exact implementation of IEEE or ISO rules/specifications for
9082 math functions. It may, however, yield faster code for programs
9083 that do not require the guarantees of these specifications.
9085 The default is @option{-fno-finite-math-only}.
9087 @item -fno-signed-zeros
9088 @opindex fno-signed-zeros
9089 Allow optimizations for floating-point arithmetic that ignore the
9090 signedness of zero.  IEEE arithmetic specifies the behavior of
9091 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9092 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9093 This option implies that the sign of a zero result isn't significant.
9095 The default is @option{-fsigned-zeros}.
9097 @item -fno-trapping-math
9098 @opindex fno-trapping-math
9099 Compile code assuming that floating-point operations cannot generate
9100 user-visible traps.  These traps include division by zero, overflow,
9101 underflow, inexact result and invalid operation.  This option requires
9102 that @option{-fno-signaling-nans} be in effect.  Setting this option may
9103 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
9105 This option should never be turned on by any @option{-O} option since
9106 it can result in incorrect output for programs that depend on
9107 an exact implementation of IEEE or ISO rules/specifications for
9108 math functions.
9110 The default is @option{-ftrapping-math}.
9112 @item -frounding-math
9113 @opindex frounding-math
9114 Disable transformations and optimizations that assume default floating-point
9115 rounding behavior.  This is round-to-zero for all floating point
9116 to integer conversions, and round-to-nearest for all other arithmetic
9117 truncations.  This option should be specified for programs that change
9118 the FP rounding mode dynamically, or that may be executed with a
9119 non-default rounding mode.  This option disables constant folding of
9120 floating-point expressions at compile time (which may be affected by
9121 rounding mode) and arithmetic transformations that are unsafe in the
9122 presence of sign-dependent rounding modes.
9124 The default is @option{-fno-rounding-math}.
9126 This option is experimental and does not currently guarantee to
9127 disable all GCC optimizations that are affected by rounding mode.
9128 Future versions of GCC may provide finer control of this setting
9129 using C99's @code{FENV_ACCESS} pragma.  This command-line option
9130 will be used to specify the default state for @code{FENV_ACCESS}.
9132 @item -fsignaling-nans
9133 @opindex fsignaling-nans
9134 Compile code assuming that IEEE signaling NaNs may generate user-visible
9135 traps during floating-point operations.  Setting this option disables
9136 optimizations that may change the number of exceptions visible with
9137 signaling NaNs.  This option implies @option{-ftrapping-math}.
9139 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
9140 be defined.
9142 The default is @option{-fno-signaling-nans}.
9144 This option is experimental and does not currently guarantee to
9145 disable all GCC optimizations that affect signaling NaN behavior.
9147 @item -fno-fp-int-builtin-inexact
9148 @opindex fno-fp-int-builtin-inexact
9149 Do not allow the built-in functions @code{ceil}, @code{floor},
9150 @code{round} and @code{trunc}, and their @code{float} and @code{long
9151 double} variants, to generate code that raises the ``inexact''
9152 floating-point exception for noninteger arguments.  ISO C99 and C11
9153 allow these functions to raise the ``inexact'' exception, but ISO/IEC
9154 TS 18661-1:2014, the C bindings to IEEE 754-2008, does not allow these
9155 functions to do so.
9157 The default is @option{-ffp-int-builtin-inexact}, allowing the
9158 exception to be raised.  This option does nothing unless
9159 @option{-ftrapping-math} is in effect.
9161 Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions
9162 generate a call to a library function then the ``inexact'' exception
9163 may be raised if the library implementation does not follow TS 18661.
9165 @item -fsingle-precision-constant
9166 @opindex fsingle-precision-constant
9167 Treat floating-point constants as single precision instead of
9168 implicitly converting them to double-precision constants.
9170 @item -fcx-limited-range
9171 @opindex fcx-limited-range
9172 When enabled, this option states that a range reduction step is not
9173 needed when performing complex division.  Also, there is no checking
9174 whether the result of a complex multiplication or division is @code{NaN
9175 + I*NaN}, with an attempt to rescue the situation in that case.  The
9176 default is @option{-fno-cx-limited-range}, but is enabled by
9177 @option{-ffast-math}.
9179 This option controls the default setting of the ISO C99
9180 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
9181 all languages.
9183 @item -fcx-fortran-rules
9184 @opindex fcx-fortran-rules
9185 Complex multiplication and division follow Fortran rules.  Range
9186 reduction is done as part of complex division, but there is no checking
9187 whether the result of a complex multiplication or division is @code{NaN
9188 + I*NaN}, with an attempt to rescue the situation in that case.
9190 The default is @option{-fno-cx-fortran-rules}.
9192 @end table
9194 The following options control optimizations that may improve
9195 performance, but are not enabled by any @option{-O} options.  This
9196 section includes experimental options that may produce broken code.
9198 @table @gcctabopt
9199 @item -fbranch-probabilities
9200 @opindex fbranch-probabilities
9201 After running a program compiled with @option{-fprofile-arcs}
9202 (@pxref{Instrumentation Options}),
9203 you can compile it a second time using
9204 @option{-fbranch-probabilities}, to improve optimizations based on
9205 the number of times each branch was taken.  When a program
9206 compiled with @option{-fprofile-arcs} exits, it saves arc execution
9207 counts to a file called @file{@var{sourcename}.gcda} for each source
9208 file.  The information in this data file is very dependent on the
9209 structure of the generated code, so you must use the same source code
9210 and the same optimization options for both compilations.
9212 With @option{-fbranch-probabilities}, GCC puts a
9213 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
9214 These can be used to improve optimization.  Currently, they are only
9215 used in one place: in @file{reorg.c}, instead of guessing which path a
9216 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
9217 exactly determine which path is taken more often.
9219 @item -fprofile-values
9220 @opindex fprofile-values
9221 If combined with @option{-fprofile-arcs}, it adds code so that some
9222 data about values of expressions in the program is gathered.
9224 With @option{-fbranch-probabilities}, it reads back the data gathered
9225 from profiling values of expressions for usage in optimizations.
9227 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
9229 @item -fprofile-reorder-functions
9230 @opindex fprofile-reorder-functions
9231 Function reordering based on profile instrumentation collects
9232 first time of execution of a function and orders these functions
9233 in ascending order.
9235 Enabled with @option{-fprofile-use}.
9237 @item -fvpt
9238 @opindex fvpt
9239 If combined with @option{-fprofile-arcs}, this option instructs the compiler
9240 to add code to gather information about values of expressions.
9242 With @option{-fbranch-probabilities}, it reads back the data gathered
9243 and actually performs the optimizations based on them.
9244 Currently the optimizations include specialization of division operations
9245 using the knowledge about the value of the denominator.
9247 @item -frename-registers
9248 @opindex frename-registers
9249 Attempt to avoid false dependencies in scheduled code by making use
9250 of registers left over after register allocation.  This optimization
9251 most benefits processors with lots of registers.  Depending on the
9252 debug information format adopted by the target, however, it can
9253 make debugging impossible, since variables no longer stay in
9254 a ``home register''.
9256 Enabled by default with @option{-funroll-loops}.
9258 @item -fschedule-fusion
9259 @opindex fschedule-fusion
9260 Performs a target dependent pass over the instruction stream to schedule
9261 instructions of same type together because target machine can execute them
9262 more efficiently if they are adjacent to each other in the instruction flow.
9264 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9266 @item -ftracer
9267 @opindex ftracer
9268 Perform tail duplication to enlarge superblock size.  This transformation
9269 simplifies the control flow of the function allowing other optimizations to do
9270 a better job.
9272 Enabled with @option{-fprofile-use}.
9274 @item -funroll-loops
9275 @opindex funroll-loops
9276 Unroll loops whose number of iterations can be determined at compile time or
9277 upon entry to the loop.  @option{-funroll-loops} implies
9278 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
9279 It also turns on complete loop peeling (i.e.@: complete removal of loops with
9280 a small constant number of iterations).  This option makes code larger, and may
9281 or may not make it run faster.
9283 Enabled with @option{-fprofile-use}.
9285 @item -funroll-all-loops
9286 @opindex funroll-all-loops
9287 Unroll all loops, even if their number of iterations is uncertain when
9288 the loop is entered.  This usually makes programs run more slowly.
9289 @option{-funroll-all-loops} implies the same options as
9290 @option{-funroll-loops}.
9292 @item -fpeel-loops
9293 @opindex fpeel-loops
9294 Peels loops for which there is enough information that they do not
9295 roll much (from profile feedback or static analysis).  It also turns on
9296 complete loop peeling (i.e.@: complete removal of loops with small constant
9297 number of iterations).
9299 Enabled with @option{-O3} and/or @option{-fprofile-use}.
9301 @item -fmove-loop-invariants
9302 @opindex fmove-loop-invariants
9303 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9304 at level @option{-O1}
9306 @item -fsplit-loops
9307 @opindex fsplit-loops
9308 Split a loop into two if it contains a condition that's always true
9309 for one side of the iteration space and false for the other.
9311 @item -funswitch-loops
9312 @opindex funswitch-loops
9313 Move branches with loop invariant conditions out of the loop, with duplicates
9314 of the loop on both branches (modified according to result of the condition).
9316 @item -ffunction-sections
9317 @itemx -fdata-sections
9318 @opindex ffunction-sections
9319 @opindex fdata-sections
9320 Place each function or data item into its own section in the output
9321 file if the target supports arbitrary sections.  The name of the
9322 function or the name of the data item determines the section's name
9323 in the output file.
9325 Use these options on systems where the linker can perform optimizations
9326 to improve locality of reference in the instruction space.  Most systems
9327 using the ELF object format and SPARC processors running Solaris 2 have
9328 linkers with such optimizations.  AIX may have these optimizations in
9329 the future.
9331 Only use these options when there are significant benefits from doing
9332 so.  When you specify these options, the assembler and linker
9333 create larger object and executable files and are also slower.
9334 You cannot use @command{gprof} on all systems if you
9335 specify this option, and you may have problems with debugging if
9336 you specify both this option and @option{-g}.
9338 @item -fbranch-target-load-optimize
9339 @opindex fbranch-target-load-optimize
9340 Perform branch target register load optimization before prologue / epilogue
9341 threading.
9342 The use of target registers can typically be exposed only during reload,
9343 thus hoisting loads out of loops and doing inter-block scheduling needs
9344 a separate optimization pass.
9346 @item -fbranch-target-load-optimize2
9347 @opindex fbranch-target-load-optimize2
9348 Perform branch target register load optimization after prologue / epilogue
9349 threading.
9351 @item -fbtr-bb-exclusive
9352 @opindex fbtr-bb-exclusive
9353 When performing branch target register load optimization, don't reuse
9354 branch target registers within any basic block.
9356 @item -fstdarg-opt
9357 @opindex fstdarg-opt
9358 Optimize the prologue of variadic argument functions with respect to usage of
9359 those arguments.
9361 @item -fsection-anchors
9362 @opindex fsection-anchors
9363 Try to reduce the number of symbolic address calculations by using
9364 shared ``anchor'' symbols to address nearby objects.  This transformation
9365 can help to reduce the number of GOT entries and GOT accesses on some
9366 targets.
9368 For example, the implementation of the following function @code{foo}:
9370 @smallexample
9371 static int a, b, c;
9372 int foo (void) @{ return a + b + c; @}
9373 @end smallexample
9375 @noindent
9376 usually calculates the addresses of all three variables, but if you
9377 compile it with @option{-fsection-anchors}, it accesses the variables
9378 from a common anchor point instead.  The effect is similar to the
9379 following pseudocode (which isn't valid C):
9381 @smallexample
9382 int foo (void)
9384   register int *xr = &x;
9385   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9387 @end smallexample
9389 Not all targets support this option.
9391 @item --param @var{name}=@var{value}
9392 @opindex param
9393 In some places, GCC uses various constants to control the amount of
9394 optimization that is done.  For example, GCC does not inline functions
9395 that contain more than a certain number of instructions.  You can
9396 control some of these constants on the command line using the
9397 @option{--param} option.
9399 The names of specific parameters, and the meaning of the values, are
9400 tied to the internals of the compiler, and are subject to change
9401 without notice in future releases.
9403 In each case, the @var{value} is an integer.  The allowable choices for
9404 @var{name} are:
9406 @table @gcctabopt
9407 @item predictable-branch-outcome
9408 When branch is predicted to be taken with probability lower than this threshold
9409 (in percent), then it is considered well predictable. The default is 10.
9411 @item max-rtl-if-conversion-insns
9412 RTL if-conversion tries to remove conditional branches around a block and
9413 replace them with conditionally executed instructions.  This parameter
9414 gives the maximum number of instructions in a block which should be
9415 considered for if-conversion.  The default is 10, though the compiler will
9416 also use other heuristics to decide whether if-conversion is likely to be
9417 profitable.
9419 @item max-rtl-if-conversion-predictable-cost
9420 @item max-rtl-if-conversion-unpredictable-cost
9421 RTL if-conversion will try to remove conditional branches around a block
9422 and replace them with conditionally executed instructions.  These parameters
9423 give the maximum permissible cost for the sequence that would be generated
9424 by if-conversion depending on whether the branch is statically determined
9425 to be predictable or not.  The units for this parameter are the same as
9426 those for the GCC internal seq_cost metric.  The compiler will try to
9427 provide a reasonable default for this parameter using the BRANCH_COST
9428 target macro.
9430 @item max-crossjump-edges
9431 The maximum number of incoming edges to consider for cross-jumping.
9432 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9433 the number of edges incoming to each block.  Increasing values mean
9434 more aggressive optimization, making the compilation time increase with
9435 probably small improvement in executable size.
9437 @item min-crossjump-insns
9438 The minimum number of instructions that must be matched at the end
9439 of two blocks before cross-jumping is performed on them.  This
9440 value is ignored in the case where all instructions in the block being
9441 cross-jumped from are matched.  The default value is 5.
9443 @item max-grow-copy-bb-insns
9444 The maximum code size expansion factor when copying basic blocks
9445 instead of jumping.  The expansion is relative to a jump instruction.
9446 The default value is 8.
9448 @item max-goto-duplication-insns
9449 The maximum number of instructions to duplicate to a block that jumps
9450 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9451 passes, GCC factors computed gotos early in the compilation process,
9452 and unfactors them as late as possible.  Only computed jumps at the
9453 end of a basic blocks with no more than max-goto-duplication-insns are
9454 unfactored.  The default value is 8.
9456 @item max-delay-slot-insn-search
9457 The maximum number of instructions to consider when looking for an
9458 instruction to fill a delay slot.  If more than this arbitrary number of
9459 instructions are searched, the time savings from filling the delay slot
9460 are minimal, so stop searching.  Increasing values mean more
9461 aggressive optimization, making the compilation time increase with probably
9462 small improvement in execution time.
9464 @item max-delay-slot-live-search
9465 When trying to fill delay slots, the maximum number of instructions to
9466 consider when searching for a block with valid live register
9467 information.  Increasing this arbitrarily chosen value means more
9468 aggressive optimization, increasing the compilation time.  This parameter
9469 should be removed when the delay slot code is rewritten to maintain the
9470 control-flow graph.
9472 @item max-gcse-memory
9473 The approximate maximum amount of memory that can be allocated in
9474 order to perform the global common subexpression elimination
9475 optimization.  If more memory than specified is required, the
9476 optimization is not done.
9478 @item max-gcse-insertion-ratio
9479 If the ratio of expression insertions to deletions is larger than this value
9480 for any expression, then RTL PRE inserts or removes the expression and thus
9481 leaves partially redundant computations in the instruction stream.  The default value is 20.
9483 @item max-pending-list-length
9484 The maximum number of pending dependencies scheduling allows
9485 before flushing the current state and starting over.  Large functions
9486 with few branches or calls can create excessively large lists which
9487 needlessly consume memory and resources.
9489 @item max-modulo-backtrack-attempts
9490 The maximum number of backtrack attempts the scheduler should make
9491 when modulo scheduling a loop.  Larger values can exponentially increase
9492 compilation time.
9494 @item max-inline-insns-single
9495 Several parameters control the tree inliner used in GCC@.
9496 This number sets the maximum number of instructions (counted in GCC's
9497 internal representation) in a single function that the tree inliner
9498 considers for inlining.  This only affects functions declared
9499 inline and methods implemented in a class declaration (C++).
9500 The default value is 400.
9502 @item max-inline-insns-auto
9503 When you use @option{-finline-functions} (included in @option{-O3}),
9504 a lot of functions that would otherwise not be considered for inlining
9505 by the compiler are investigated.  To those functions, a different
9506 (more restrictive) limit compared to functions declared inline can
9507 be applied.
9508 The default value is 40.
9510 @item inline-min-speedup
9511 When estimated performance improvement of caller + callee runtime exceeds this
9512 threshold (in precent), the function can be inlined regardless the limit on
9513 @option{--param max-inline-insns-single} and @option{--param
9514 max-inline-insns-auto}.
9516 @item large-function-insns
9517 The limit specifying really large functions.  For functions larger than this
9518 limit after inlining, inlining is constrained by
9519 @option{--param large-function-growth}.  This parameter is useful primarily
9520 to avoid extreme compilation time caused by non-linear algorithms used by the
9521 back end.
9522 The default value is 2700.
9524 @item large-function-growth
9525 Specifies maximal growth of large function caused by inlining in percents.
9526 The default value is 100 which limits large function growth to 2.0 times
9527 the original size.
9529 @item large-unit-insns
9530 The limit specifying large translation unit.  Growth caused by inlining of
9531 units larger than this limit is limited by @option{--param inline-unit-growth}.
9532 For small units this might be too tight.
9533 For example, consider a unit consisting of function A
9534 that is inline and B that just calls A three times.  If B is small relative to
9535 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9536 large units consisting of small inlineable functions, however, the overall unit
9537 growth limit is needed to avoid exponential explosion of code size.  Thus for
9538 smaller units, the size is increased to @option{--param large-unit-insns}
9539 before applying @option{--param inline-unit-growth}.  The default is 10000.
9541 @item inline-unit-growth
9542 Specifies maximal overall growth of the compilation unit caused by inlining.
9543 The default value is 20 which limits unit growth to 1.2 times the original
9544 size. Cold functions (either marked cold via an attribute or by profile
9545 feedback) are not accounted into the unit size.
9547 @item ipcp-unit-growth
9548 Specifies maximal overall growth of the compilation unit caused by
9549 interprocedural constant propagation.  The default value is 10 which limits
9550 unit growth to 1.1 times the original size.
9552 @item large-stack-frame
9553 The limit specifying large stack frames.  While inlining the algorithm is trying
9554 to not grow past this limit too much.  The default value is 256 bytes.
9556 @item large-stack-frame-growth
9557 Specifies maximal growth of large stack frames caused by inlining in percents.
9558 The default value is 1000 which limits large stack frame growth to 11 times
9559 the original size.
9561 @item max-inline-insns-recursive
9562 @itemx max-inline-insns-recursive-auto
9563 Specifies the maximum number of instructions an out-of-line copy of a
9564 self-recursive inline
9565 function can grow into by performing recursive inlining.
9567 @option{--param max-inline-insns-recursive} applies to functions
9568 declared inline.
9569 For functions not declared inline, recursive inlining
9570 happens only when @option{-finline-functions} (included in @option{-O3}) is
9571 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
9572 default value is 450.
9574 @item max-inline-recursive-depth
9575 @itemx max-inline-recursive-depth-auto
9576 Specifies the maximum recursion depth used for recursive inlining.
9578 @option{--param max-inline-recursive-depth} applies to functions
9579 declared inline.  For functions not declared inline, recursive inlining
9580 happens only when @option{-finline-functions} (included in @option{-O3}) is
9581 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
9582 default value is 8.
9584 @item min-inline-recursive-probability
9585 Recursive inlining is profitable only for function having deep recursion
9586 in average and can hurt for function having little recursion depth by
9587 increasing the prologue size or complexity of function body to other
9588 optimizers.
9590 When profile feedback is available (see @option{-fprofile-generate}) the actual
9591 recursion depth can be guessed from the probability that function recurses
9592 via a given call expression.  This parameter limits inlining only to call
9593 expressions whose probability exceeds the given threshold (in percents).
9594 The default value is 10.
9596 @item early-inlining-insns
9597 Specify growth that the early inliner can make.  In effect it increases
9598 the amount of inlining for code having a large abstraction penalty.
9599 The default value is 14.
9601 @item max-early-inliner-iterations
9602 Limit of iterations of the early inliner.  This basically bounds
9603 the number of nested indirect calls the early inliner can resolve.
9604 Deeper chains are still handled by late inlining.
9606 @item comdat-sharing-probability
9607 Probability (in percent) that C++ inline function with comdat visibility
9608 are shared across multiple compilation units.  The default value is 20.
9610 @item profile-func-internal-id
9611 A parameter to control whether to use function internal id in profile
9612 database lookup. If the value is 0, the compiler uses an id that
9613 is based on function assembler name and filename, which makes old profile
9614 data more tolerant to source changes such as function reordering etc.
9615 The default value is 0.
9617 @item min-vect-loop-bound
9618 The minimum number of iterations under which loops are not vectorized
9619 when @option{-ftree-vectorize} is used.  The number of iterations after
9620 vectorization needs to be greater than the value specified by this option
9621 to allow vectorization.  The default value is 0.
9623 @item gcse-cost-distance-ratio
9624 Scaling factor in calculation of maximum distance an expression
9625 can be moved by GCSE optimizations.  This is currently supported only in the
9626 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9627 is with simple expressions, i.e., the expressions that have cost
9628 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9629 hoisting of simple expressions.  The default value is 10.
9631 @item gcse-unrestricted-cost
9632 Cost, roughly measured as the cost of a single typical machine
9633 instruction, at which GCSE optimizations do not constrain
9634 the distance an expression can travel.  This is currently
9635 supported only in the code hoisting pass.  The lesser the cost,
9636 the more aggressive code hoisting is.  Specifying 0 
9637 allows all expressions to travel unrestricted distances.
9638 The default value is 3.
9640 @item max-hoist-depth
9641 The depth of search in the dominator tree for expressions to hoist.
9642 This is used to avoid quadratic behavior in hoisting algorithm.
9643 The value of 0 does not limit on the search, but may slow down compilation
9644 of huge functions.  The default value is 30.
9646 @item max-tail-merge-comparisons
9647 The maximum amount of similar bbs to compare a bb with.  This is used to
9648 avoid quadratic behavior in tree tail merging.  The default value is 10.
9650 @item max-tail-merge-iterations
9651 The maximum amount of iterations of the pass over the function.  This is used to
9652 limit compilation time in tree tail merging.  The default value is 2.
9654 @item store-merging-allow-unaligned
9655 Allow the store merging pass to introduce unaligned stores if it is legal to
9656 do so.  The default value is 1.
9658 @item max-stores-to-merge
9659 The maximum number of stores to attempt to merge into wider stores in the store
9660 merging pass.  The minimum value is 2 and the default is 64.
9662 @item max-unrolled-insns
9663 The maximum number of instructions that a loop may have to be unrolled.
9664 If a loop is unrolled, this parameter also determines how many times
9665 the loop code is unrolled.
9667 @item max-average-unrolled-insns
9668 The maximum number of instructions biased by probabilities of their execution
9669 that a loop may have to be unrolled.  If a loop is unrolled,
9670 this parameter also determines how many times the loop code is unrolled.
9672 @item max-unroll-times
9673 The maximum number of unrollings of a single loop.
9675 @item max-peeled-insns
9676 The maximum number of instructions that a loop may have to be peeled.
9677 If a loop is peeled, this parameter also determines how many times
9678 the loop code is peeled.
9680 @item max-peel-times
9681 The maximum number of peelings of a single loop.
9683 @item max-peel-branches
9684 The maximum number of branches on the hot path through the peeled sequence.
9686 @item max-completely-peeled-insns
9687 The maximum number of insns of a completely peeled loop.
9689 @item max-completely-peel-times
9690 The maximum number of iterations of a loop to be suitable for complete peeling.
9692 @item max-completely-peel-loop-nest-depth
9693 The maximum depth of a loop nest suitable for complete peeling.
9695 @item max-unswitch-insns
9696 The maximum number of insns of an unswitched loop.
9698 @item max-unswitch-level
9699 The maximum number of branches unswitched in a single loop.
9701 @item max-loop-headers-insns
9702 The maximum number of insns in loop header duplicated by he copy loop headers
9703 pass.
9705 @item lim-expensive
9706 The minimum cost of an expensive expression in the loop invariant motion.
9708 @item iv-consider-all-candidates-bound
9709 Bound on number of candidates for induction variables, below which
9710 all candidates are considered for each use in induction variable
9711 optimizations.  If there are more candidates than this,
9712 only the most relevant ones are considered to avoid quadratic time complexity.
9714 @item iv-max-considered-uses
9715 The induction variable optimizations give up on loops that contain more
9716 induction variable uses.
9718 @item iv-always-prune-cand-set-bound
9719 If the number of candidates in the set is smaller than this value,
9720 always try to remove unnecessary ivs from the set
9721 when adding a new one.
9723 @item avg-loop-niter
9724 Average number of iterations of a loop.
9726 @item scev-max-expr-size
9727 Bound on size of expressions used in the scalar evolutions analyzer.
9728 Large expressions slow the analyzer.
9730 @item scev-max-expr-complexity
9731 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9732 Complex expressions slow the analyzer.
9734 @item max-tree-if-conversion-phi-args
9735 Maximum number of arguments in a PHI supported by TREE if conversion
9736 unless the loop is marked with simd pragma.
9738 @item vect-max-version-for-alignment-checks
9739 The maximum number of run-time checks that can be performed when
9740 doing loop versioning for alignment in the vectorizer.
9742 @item vect-max-version-for-alias-checks
9743 The maximum number of run-time checks that can be performed when
9744 doing loop versioning for alias in the vectorizer.
9746 @item vect-max-peeling-for-alignment
9747 The maximum number of loop peels to enhance access alignment
9748 for vectorizer. Value -1 means no limit.
9750 @item max-iterations-to-track
9751 The maximum number of iterations of a loop the brute-force algorithm
9752 for analysis of the number of iterations of the loop tries to evaluate.
9754 @item hot-bb-count-ws-permille
9755 A basic block profile count is considered hot if it contributes to 
9756 the given permillage (i.e. 0...1000) of the entire profiled execution.
9758 @item hot-bb-frequency-fraction
9759 Select fraction of the entry block frequency of executions of basic block in
9760 function given basic block needs to have to be considered hot.
9762 @item max-predicted-iterations
9763 The maximum number of loop iterations we predict statically.  This is useful
9764 in cases where a function contains a single loop with known bound and
9765 another loop with unknown bound.
9766 The known number of iterations is predicted correctly, while
9767 the unknown number of iterations average to roughly 10.  This means that the
9768 loop without bounds appears artificially cold relative to the other one.
9770 @item builtin-expect-probability
9771 Control the probability of the expression having the specified value. This
9772 parameter takes a percentage (i.e. 0 ... 100) as input.
9773 The default probability of 90 is obtained empirically.
9775 @item align-threshold
9777 Select fraction of the maximal frequency of executions of a basic block in
9778 a function to align the basic block.
9780 @item align-loop-iterations
9782 A loop expected to iterate at least the selected number of iterations is
9783 aligned.
9785 @item tracer-dynamic-coverage
9786 @itemx tracer-dynamic-coverage-feedback
9788 This value is used to limit superblock formation once the given percentage of
9789 executed instructions is covered.  This limits unnecessary code size
9790 expansion.
9792 The @option{tracer-dynamic-coverage-feedback} parameter
9793 is used only when profile
9794 feedback is available.  The real profiles (as opposed to statically estimated
9795 ones) are much less balanced allowing the threshold to be larger value.
9797 @item tracer-max-code-growth
9798 Stop tail duplication once code growth has reached given percentage.  This is
9799 a rather artificial limit, as most of the duplicates are eliminated later in
9800 cross jumping, so it may be set to much higher values than is the desired code
9801 growth.
9803 @item tracer-min-branch-ratio
9805 Stop reverse growth when the reverse probability of best edge is less than this
9806 threshold (in percent).
9808 @item tracer-min-branch-probability
9809 @itemx tracer-min-branch-probability-feedback
9811 Stop forward growth if the best edge has probability lower than this
9812 threshold.
9814 Similarly to @option{tracer-dynamic-coverage} two parameters are
9815 provided.  @option{tracer-min-branch-probability-feedback} is used for
9816 compilation with profile feedback and @option{tracer-min-branch-probability}
9817 compilation without.  The value for compilation with profile feedback
9818 needs to be more conservative (higher) in order to make tracer
9819 effective.
9821 @item max-cse-path-length
9823 The maximum number of basic blocks on path that CSE considers.
9824 The default is 10.
9826 @item max-cse-insns
9827 The maximum number of instructions CSE processes before flushing.
9828 The default is 1000.
9830 @item ggc-min-expand
9832 GCC uses a garbage collector to manage its own memory allocation.  This
9833 parameter specifies the minimum percentage by which the garbage
9834 collector's heap should be allowed to expand between collections.
9835 Tuning this may improve compilation speed; it has no effect on code
9836 generation.
9838 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9839 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9840 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9841 GCC is not able to calculate RAM on a particular platform, the lower
9842 bound of 30% is used.  Setting this parameter and
9843 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9844 every opportunity.  This is extremely slow, but can be useful for
9845 debugging.
9847 @item ggc-min-heapsize
9849 Minimum size of the garbage collector's heap before it begins bothering
9850 to collect garbage.  The first collection occurs after the heap expands
9851 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9852 tuning this may improve compilation speed, and has no effect on code
9853 generation.
9855 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9856 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9857 with a lower bound of 4096 (four megabytes) and an upper bound of
9858 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9859 particular platform, the lower bound is used.  Setting this parameter
9860 very large effectively disables garbage collection.  Setting this
9861 parameter and @option{ggc-min-expand} to zero causes a full collection
9862 to occur at every opportunity.
9864 @item max-reload-search-insns
9865 The maximum number of instruction reload should look backward for equivalent
9866 register.  Increasing values mean more aggressive optimization, making the
9867 compilation time increase with probably slightly better performance.
9868 The default value is 100.
9870 @item max-cselib-memory-locations
9871 The maximum number of memory locations cselib should take into account.
9872 Increasing values mean more aggressive optimization, making the compilation time
9873 increase with probably slightly better performance.  The default value is 500.
9875 @item max-sched-ready-insns
9876 The maximum number of instructions ready to be issued the scheduler should
9877 consider at any given time during the first scheduling pass.  Increasing
9878 values mean more thorough searches, making the compilation time increase
9879 with probably little benefit.  The default value is 100.
9881 @item max-sched-region-blocks
9882 The maximum number of blocks in a region to be considered for
9883 interblock scheduling.  The default value is 10.
9885 @item max-pipeline-region-blocks
9886 The maximum number of blocks in a region to be considered for
9887 pipelining in the selective scheduler.  The default value is 15.
9889 @item max-sched-region-insns
9890 The maximum number of insns in a region to be considered for
9891 interblock scheduling.  The default value is 100.
9893 @item max-pipeline-region-insns
9894 The maximum number of insns in a region to be considered for
9895 pipelining in the selective scheduler.  The default value is 200.
9897 @item min-spec-prob
9898 The minimum probability (in percents) of reaching a source block
9899 for interblock speculative scheduling.  The default value is 40.
9901 @item max-sched-extend-regions-iters
9902 The maximum number of iterations through CFG to extend regions.
9903 A value of 0 (the default) disables region extensions.
9905 @item max-sched-insn-conflict-delay
9906 The maximum conflict delay for an insn to be considered for speculative motion.
9907 The default value is 3.
9909 @item sched-spec-prob-cutoff
9910 The minimal probability of speculation success (in percents), so that
9911 speculative insns are scheduled.
9912 The default value is 40.
9914 @item sched-state-edge-prob-cutoff
9915 The minimum probability an edge must have for the scheduler to save its
9916 state across it.
9917 The default value is 10.
9919 @item sched-mem-true-dep-cost
9920 Minimal distance (in CPU cycles) between store and load targeting same
9921 memory locations.  The default value is 1.
9923 @item selsched-max-lookahead
9924 The maximum size of the lookahead window of selective scheduling.  It is a
9925 depth of search for available instructions.
9926 The default value is 50.
9928 @item selsched-max-sched-times
9929 The maximum number of times that an instruction is scheduled during
9930 selective scheduling.  This is the limit on the number of iterations
9931 through which the instruction may be pipelined.  The default value is 2.
9933 @item selsched-insns-to-rename
9934 The maximum number of best instructions in the ready list that are considered
9935 for renaming in the selective scheduler.  The default value is 2.
9937 @item sms-min-sc
9938 The minimum value of stage count that swing modulo scheduler
9939 generates.  The default value is 2.
9941 @item max-last-value-rtl
9942 The maximum size measured as number of RTLs that can be recorded in an expression
9943 in combiner for a pseudo register as last known value of that register.  The default
9944 is 10000.
9946 @item max-combine-insns
9947 The maximum number of instructions the RTL combiner tries to combine.
9948 The default value is 2 at @option{-Og} and 4 otherwise.
9950 @item integer-share-limit
9951 Small integer constants can use a shared data structure, reducing the
9952 compiler's memory usage and increasing its speed.  This sets the maximum
9953 value of a shared integer constant.  The default value is 256.
9955 @item ssp-buffer-size
9956 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9957 protection when @option{-fstack-protection} is used.
9959 @item min-size-for-stack-sharing
9960 The minimum size of variables taking part in stack slot sharing when not
9961 optimizing. The default value is 32.
9963 @item max-jump-thread-duplication-stmts
9964 Maximum number of statements allowed in a block that needs to be
9965 duplicated when threading jumps.
9967 @item max-fields-for-field-sensitive
9968 Maximum number of fields in a structure treated in
9969 a field sensitive manner during pointer analysis.  The default is zero
9970 for @option{-O0} and @option{-O1},
9971 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9973 @item prefetch-latency
9974 Estimate on average number of instructions that are executed before
9975 prefetch finishes.  The distance prefetched ahead is proportional
9976 to this constant.  Increasing this number may also lead to less
9977 streams being prefetched (see @option{simultaneous-prefetches}).
9979 @item simultaneous-prefetches
9980 Maximum number of prefetches that can run at the same time.
9982 @item l1-cache-line-size
9983 The size of cache line in L1 cache, in bytes.
9985 @item l1-cache-size
9986 The size of L1 cache, in kilobytes.
9988 @item l2-cache-size
9989 The size of L2 cache, in kilobytes.
9991 @item min-insn-to-prefetch-ratio
9992 The minimum ratio between the number of instructions and the
9993 number of prefetches to enable prefetching in a loop.
9995 @item prefetch-min-insn-to-mem-ratio
9996 The minimum ratio between the number of instructions and the
9997 number of memory references to enable prefetching in a loop.
9999 @item use-canonical-types
10000 Whether the compiler should use the ``canonical'' type system.  By
10001 default, this should always be 1, which uses a more efficient internal
10002 mechanism for comparing types in C++ and Objective-C++.  However, if
10003 bugs in the canonical type system are causing compilation failures,
10004 set this value to 0 to disable canonical types.
10006 @item switch-conversion-max-branch-ratio
10007 Switch initialization conversion refuses to create arrays that are
10008 bigger than @option{switch-conversion-max-branch-ratio} times the number of
10009 branches in the switch.
10011 @item max-partial-antic-length
10012 Maximum length of the partial antic set computed during the tree
10013 partial redundancy elimination optimization (@option{-ftree-pre}) when
10014 optimizing at @option{-O3} and above.  For some sorts of source code
10015 the enhanced partial redundancy elimination optimization can run away,
10016 consuming all of the memory available on the host machine.  This
10017 parameter sets a limit on the length of the sets that are computed,
10018 which prevents the runaway behavior.  Setting a value of 0 for
10019 this parameter allows an unlimited set length.
10021 @item sccvn-max-scc-size
10022 Maximum size of a strongly connected component (SCC) during SCCVN
10023 processing.  If this limit is hit, SCCVN processing for the whole
10024 function is not done and optimizations depending on it are
10025 disabled.  The default maximum SCC size is 10000.
10027 @item sccvn-max-alias-queries-per-access
10028 Maximum number of alias-oracle queries we perform when looking for
10029 redundancies for loads and stores.  If this limit is hit the search
10030 is aborted and the load or store is not considered redundant.  The
10031 number of queries is algorithmically limited to the number of
10032 stores on all paths from the load to the function entry.
10033 The default maximum number of queries is 1000.
10035 @item ira-max-loops-num
10036 IRA uses regional register allocation by default.  If a function
10037 contains more loops than the number given by this parameter, only at most
10038 the given number of the most frequently-executed loops form regions
10039 for regional register allocation.  The default value of the
10040 parameter is 100.
10042 @item ira-max-conflict-table-size 
10043 Although IRA uses a sophisticated algorithm to compress the conflict
10044 table, the table can still require excessive amounts of memory for
10045 huge functions.  If the conflict table for a function could be more
10046 than the size in MB given by this parameter, the register allocator
10047 instead uses a faster, simpler, and lower-quality
10048 algorithm that does not require building a pseudo-register conflict table.  
10049 The default value of the parameter is 2000.
10051 @item ira-loop-reserved-regs
10052 IRA can be used to evaluate more accurate register pressure in loops
10053 for decisions to move loop invariants (see @option{-O3}).  The number
10054 of available registers reserved for some other purposes is given
10055 by this parameter.  The default value of the parameter is 2, which is
10056 the minimal number of registers needed by typical instructions.
10057 This value is the best found from numerous experiments.
10059 @item lra-inheritance-ebb-probability-cutoff
10060 LRA tries to reuse values reloaded in registers in subsequent insns.
10061 This optimization is called inheritance.  EBB is used as a region to
10062 do this optimization.  The parameter defines a minimal fall-through
10063 edge probability in percentage used to add BB to inheritance EBB in
10064 LRA.  The default value of the parameter is 40.  The value was chosen
10065 from numerous runs of SPEC2000 on x86-64.
10067 @item loop-invariant-max-bbs-in-loop
10068 Loop invariant motion can be very expensive, both in compilation time and
10069 in amount of needed compile-time memory, with very large loops.  Loops
10070 with more basic blocks than this parameter won't have loop invariant
10071 motion optimization performed on them.  The default value of the
10072 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10074 @item loop-max-datarefs-for-datadeps
10075 Building data dependencies is expensive for very large loops.  This
10076 parameter limits the number of data references in loops that are
10077 considered for data dependence analysis.  These large loops are no
10078 handled by the optimizations using loop data dependencies.
10079 The default value is 1000.
10081 @item max-vartrack-size
10082 Sets a maximum number of hash table slots to use during variable
10083 tracking dataflow analysis of any function.  If this limit is exceeded
10084 with variable tracking at assignments enabled, analysis for that
10085 function is retried without it, after removing all debug insns from
10086 the function.  If the limit is exceeded even without debug insns, var
10087 tracking analysis is completely disabled for the function.  Setting
10088 the parameter to zero makes it unlimited.
10090 @item max-vartrack-expr-depth
10091 Sets a maximum number of recursion levels when attempting to map
10092 variable names or debug temporaries to value expressions.  This trades
10093 compilation time for more complete debug information.  If this is set too
10094 low, value expressions that are available and could be represented in
10095 debug information may end up not being used; setting this higher may
10096 enable the compiler to find more complex debug expressions, but compile
10097 time and memory use may grow.  The default is 12.
10099 @item min-nondebug-insn-uid
10100 Use uids starting at this parameter for nondebug insns.  The range below
10101 the parameter is reserved exclusively for debug insns created by
10102 @option{-fvar-tracking-assignments}, but debug insns may get
10103 (non-overlapping) uids above it if the reserved range is exhausted.
10105 @item ipa-sra-ptr-growth-factor
10106 IPA-SRA replaces a pointer to an aggregate with one or more new
10107 parameters only when their cumulative size is less or equal to
10108 @option{ipa-sra-ptr-growth-factor} times the size of the original
10109 pointer parameter.
10111 @item sra-max-scalarization-size-Ospeed
10112 @item sra-max-scalarization-size-Osize
10113 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
10114 replace scalar parts of aggregates with uses of independent scalar
10115 variables.  These parameters control the maximum size, in storage units,
10116 of aggregate which is considered for replacement when compiling for
10117 speed
10118 (@option{sra-max-scalarization-size-Ospeed}) or size
10119 (@option{sra-max-scalarization-size-Osize}) respectively.
10121 @item tm-max-aggregate-size
10122 When making copies of thread-local variables in a transaction, this
10123 parameter specifies the size in bytes after which variables are
10124 saved with the logging functions as opposed to save/restore code
10125 sequence pairs.  This option only applies when using
10126 @option{-fgnu-tm}.
10128 @item graphite-max-nb-scop-params
10129 To avoid exponential effects in the Graphite loop transforms, the
10130 number of parameters in a Static Control Part (SCoP) is bounded.  The
10131 default value is 10 parameters.  A variable whose value is unknown at
10132 compilation time and defined outside a SCoP is a parameter of the SCoP.
10134 @item graphite-max-bbs-per-function
10135 To avoid exponential effects in the detection of SCoPs, the size of
10136 the functions analyzed by Graphite is bounded.  The default value is
10137 100 basic blocks.
10139 @item loop-block-tile-size
10140 Loop blocking or strip mining transforms, enabled with
10141 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
10142 loop in the loop nest by a given number of iterations.  The strip
10143 length can be changed using the @option{loop-block-tile-size}
10144 parameter.  The default value is 51 iterations.
10146 @item loop-unroll-jam-size
10147 Specify the unroll factor for the @option{-floop-unroll-and-jam} option.  The 
10148 default value is 4.
10150 @item loop-unroll-jam-depth
10151 Specify the dimension to be unrolled (counting from the most inner loop)
10152 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
10154 @item ipa-cp-value-list-size
10155 IPA-CP attempts to track all possible values and types passed to a function's
10156 parameter in order to propagate them and perform devirtualization.
10157 @option{ipa-cp-value-list-size} is the maximum number of values and types it
10158 stores per one formal parameter of a function.
10160 @item ipa-cp-eval-threshold
10161 IPA-CP calculates its own score of cloning profitability heuristics
10162 and performs those cloning opportunities with scores that exceed
10163 @option{ipa-cp-eval-threshold}.
10165 @item ipa-cp-recursion-penalty
10166 Percentage penalty the recursive functions will receive when they
10167 are evaluated for cloning.
10169 @item ipa-cp-single-call-penalty
10170 Percentage penalty functions containg a single call to another
10171 function will receive when they are evaluated for cloning.
10174 @item ipa-max-agg-items
10175 IPA-CP is also capable to propagate a number of scalar values passed
10176 in an aggregate. @option{ipa-max-agg-items} controls the maximum
10177 number of such values per one parameter.
10179 @item ipa-cp-loop-hint-bonus
10180 When IPA-CP determines that a cloning candidate would make the number
10181 of iterations of a loop known, it adds a bonus of
10182 @option{ipa-cp-loop-hint-bonus} to the profitability score of
10183 the candidate.
10185 @item ipa-cp-array-index-hint-bonus
10186 When IPA-CP determines that a cloning candidate would make the index of
10187 an array access known, it adds a bonus of
10188 @option{ipa-cp-array-index-hint-bonus} to the profitability
10189 score of the candidate.
10191 @item ipa-max-aa-steps
10192 During its analysis of function bodies, IPA-CP employs alias analysis
10193 in order to track values pointed to by function parameters.  In order
10194 not spend too much time analyzing huge functions, it gives up and
10195 consider all memory clobbered after examining
10196 @option{ipa-max-aa-steps} statements modifying memory.
10198 @item lto-partitions
10199 Specify desired number of partitions produced during WHOPR compilation.
10200 The number of partitions should exceed the number of CPUs used for compilation.
10201 The default value is 32.
10203 @item lto-min-partition
10204 Size of minimal partition for WHOPR (in estimated instructions).
10205 This prevents expenses of splitting very small programs into too many
10206 partitions.
10208 @item lto-max-partition
10209 Size of max partition for WHOPR (in estimated instructions).
10210 to provide an upper bound for individual size of partition.
10211 Meant to be used only with balanced partitioning.
10213 @item cxx-max-namespaces-for-diagnostic-help
10214 The maximum number of namespaces to consult for suggestions when C++
10215 name lookup fails for an identifier.  The default is 1000.
10217 @item sink-frequency-threshold
10218 The maximum relative execution frequency (in percents) of the target block
10219 relative to a statement's original block to allow statement sinking of a
10220 statement.  Larger numbers result in more aggressive statement sinking.
10221 The default value is 75.  A small positive adjustment is applied for
10222 statements with memory operands as those are even more profitable so sink.
10224 @item max-stores-to-sink
10225 The maximum number of conditional store pairs that can be sunk.  Set to 0
10226 if either vectorization (@option{-ftree-vectorize}) or if-conversion
10227 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
10229 @item allow-store-data-races
10230 Allow optimizers to introduce new data races on stores.
10231 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10232 at optimization level @option{-Ofast}.
10234 @item case-values-threshold
10235 The smallest number of different values for which it is best to use a
10236 jump-table instead of a tree of conditional branches.  If the value is
10237 0, use the default for the machine.  The default is 0.
10239 @item tree-reassoc-width
10240 Set the maximum number of instructions executed in parallel in
10241 reassociated tree. This parameter overrides target dependent
10242 heuristics used by default if has non zero value.
10244 @item sched-pressure-algorithm
10245 Choose between the two available implementations of
10246 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
10247 and is the more likely to prevent instructions from being reordered.
10248 Algorithm 2 was designed to be a compromise between the relatively
10249 conservative approach taken by algorithm 1 and the rather aggressive
10250 approach taken by the default scheduler.  It relies more heavily on
10251 having a regular register file and accurate register pressure classes.
10252 See @file{haifa-sched.c} in the GCC sources for more details.
10254 The default choice depends on the target.
10256 @item max-slsr-cand-scan
10257 Set the maximum number of existing candidates that are considered when
10258 seeking a basis for a new straight-line strength reduction candidate.
10260 @item asan-globals
10261 Enable buffer overflow detection for global objects.  This kind
10262 of protection is enabled by default if you are using
10263 @option{-fsanitize=address} option.
10264 To disable global objects protection use @option{--param asan-globals=0}.
10266 @item asan-stack
10267 Enable buffer overflow detection for stack objects.  This kind of
10268 protection is enabled by default when using @option{-fsanitize=address}.
10269 To disable stack protection use @option{--param asan-stack=0} option.
10271 @item asan-instrument-reads
10272 Enable buffer overflow detection for memory reads.  This kind of
10273 protection is enabled by default when using @option{-fsanitize=address}.
10274 To disable memory reads protection use
10275 @option{--param asan-instrument-reads=0}.
10277 @item asan-instrument-writes
10278 Enable buffer overflow detection for memory writes.  This kind of
10279 protection is enabled by default when using @option{-fsanitize=address}.
10280 To disable memory writes protection use
10281 @option{--param asan-instrument-writes=0} option.
10283 @item asan-memintrin
10284 Enable detection for built-in functions.  This kind of protection
10285 is enabled by default when using @option{-fsanitize=address}.
10286 To disable built-in functions protection use
10287 @option{--param asan-memintrin=0}.
10289 @item asan-use-after-return
10290 Enable detection of use-after-return.  This kind of protection
10291 is enabled by default when using @option{-fsanitize=address} option.
10292 To disable use-after-return detection use 
10293 @option{--param asan-use-after-return=0}.
10295 Note: The check is disabled by default at runtime.  To enable the check,
10296 you should set environment variable @env{ASAN_OPTIONS} to
10297 @code{detect_stack_use_after_return=1}.
10299 @item asan-instrumentation-with-call-threshold
10300 If number of memory accesses in function being instrumented
10301 is greater or equal to this number, use callbacks instead of inline checks.
10302 E.g. to disable inline code use
10303 @option{--param asan-instrumentation-with-call-threshold=0}.
10305 @item use-after-scope-direct-emission-threshold
10306 If size of a local variables in bytes is smaller of equal to this number,
10307 direct instruction emission is utilized to poison and unpoison local variables.
10309 @item chkp-max-ctor-size
10310 Static constructors generated by Pointer Bounds Checker may become very
10311 large and significantly increase compile time at optimization level
10312 @option{-O1} and higher.  This parameter is a maximum nubmer of statements
10313 in a single generated constructor.  Default value is 5000.
10315 @item max-fsm-thread-path-insns
10316 Maximum number of instructions to copy when duplicating blocks on a
10317 finite state automaton jump thread path.  The default is 100.
10319 @item max-fsm-thread-length
10320 Maximum number of basic blocks on a finite state automaton jump thread
10321 path.  The default is 10.
10323 @item max-fsm-thread-paths
10324 Maximum number of new jump thread paths to create for a finite state
10325 automaton.  The default is 50.
10327 @item parloops-chunk-size
10328 Chunk size of omp schedule for loops parallelized by parloops.  The default
10329 is 0.
10331 @item parloops-schedule
10332 Schedule type of omp schedule for loops parallelized by parloops (static,
10333 dynamic, guided, auto, runtime).  The default is static.
10335 @item max-ssa-name-query-depth
10336 Maximum depth of recursion when querying properties of SSA names in things
10337 like fold routines.  One level of recursion corresponds to following a
10338 use-def chain.
10340 @item hsa-gen-debug-stores
10341 Enable emission of special debug stores within HSA kernels which are
10342 then read and reported by libgomp plugin.  Generation of these stores
10343 is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
10344 enable it.
10346 @item max-speculative-devirt-maydefs
10347 The maximum number of may-defs we analyze when looking for a must-def
10348 specifying the dynamic type of an object that invokes a virtual call
10349 we may be able to devirtualize speculatively.
10351 @item max-vrp-switch-assertions
10352 The maximum number of assertions to add along the default edge of a switch
10353 statement during VRP.  The default is 10.
10354 @end table
10355 @end table
10357 @node Instrumentation Options
10358 @section Program Instrumentation Options
10359 @cindex instrumentation options
10360 @cindex program instrumentation options
10361 @cindex run-time error checking options
10362 @cindex profiling options
10363 @cindex options, program instrumentation
10364 @cindex options, run-time error checking
10365 @cindex options, profiling
10367 GCC supports a number of command-line options that control adding
10368 run-time instrumentation to the code it normally generates.  
10369 For example, one purpose of instrumentation is collect profiling
10370 statistics for use in finding program hot spots, code coverage
10371 analysis, or profile-guided optimizations.
10372 Another class of program instrumentation is adding run-time checking 
10373 to detect programming errors like invalid pointer
10374 dereferences or out-of-bounds array accesses, as well as deliberately
10375 hostile attacks such as stack smashing or C++ vtable hijacking.
10376 There is also a general hook which can be used to implement other
10377 forms of tracing or function-level instrumentation for debug or
10378 program analysis purposes.
10380 @table @gcctabopt
10381 @cindex @command{prof}
10382 @item -p
10383 @opindex p
10384 Generate extra code to write profile information suitable for the
10385 analysis program @command{prof}.  You must use this option when compiling
10386 the source files you want data about, and you must also use it when
10387 linking.
10389 @cindex @command{gprof}
10390 @item -pg
10391 @opindex pg
10392 Generate extra code to write profile information suitable for the
10393 analysis program @command{gprof}.  You must use this option when compiling
10394 the source files you want data about, and you must also use it when
10395 linking.
10397 @item -fprofile-arcs
10398 @opindex fprofile-arcs
10399 Add code so that program flow @dfn{arcs} are instrumented.  During
10400 execution the program records how many times each branch and call is
10401 executed and how many times it is taken or returns.  When the compiled
10402 program exits it saves this data to a file called
10403 @file{@var{auxname}.gcda} for each source file.  The data may be used for
10404 profile-directed optimizations (@option{-fbranch-probabilities}), or for
10405 test coverage analysis (@option{-ftest-coverage}).  Each object file's
10406 @var{auxname} is generated from the name of the output file, if
10407 explicitly specified and it is not the final executable, otherwise it is
10408 the basename of the source file.  In both cases any suffix is removed
10409 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
10410 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
10411 @xref{Cross-profiling}.
10413 @cindex @command{gcov}
10414 @item --coverage
10415 @opindex coverage
10417 This option is used to compile and link code instrumented for coverage
10418 analysis.  The option is a synonym for @option{-fprofile-arcs}
10419 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
10420 linking).  See the documentation for those options for more details.
10422 @itemize
10424 @item
10425 Compile the source files with @option{-fprofile-arcs} plus optimization
10426 and code generation options.  For test coverage analysis, use the
10427 additional @option{-ftest-coverage} option.  You do not need to profile
10428 every source file in a program.
10430 @item
10431 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
10432 (the latter implies the former).
10434 @item
10435 Run the program on a representative workload to generate the arc profile
10436 information.  This may be repeated any number of times.  You can run
10437 concurrent instances of your program, and provided that the file system
10438 supports locking, the data files will be correctly updated.  Also
10439 @code{fork} calls are detected and correctly handled (double counting
10440 will not happen).
10442 @item
10443 For profile-directed optimizations, compile the source files again with
10444 the same optimization and code generation options plus
10445 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
10446 Control Optimization}).
10448 @item
10449 For test coverage analysis, use @command{gcov} to produce human readable
10450 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
10451 @command{gcov} documentation for further information.
10453 @end itemize
10455 With @option{-fprofile-arcs}, for each function of your program GCC
10456 creates a program flow graph, then finds a spanning tree for the graph.
10457 Only arcs that are not on the spanning tree have to be instrumented: the
10458 compiler adds code to count the number of times that these arcs are
10459 executed.  When an arc is the only exit or only entrance to a block, the
10460 instrumentation code can be added to the block; otherwise, a new basic
10461 block must be created to hold the instrumentation code.
10463 @need 2000
10464 @item -ftest-coverage
10465 @opindex ftest-coverage
10466 Produce a notes file that the @command{gcov} code-coverage utility
10467 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
10468 show program coverage.  Each source file's note file is called
10469 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
10470 above for a description of @var{auxname} and instructions on how to
10471 generate test coverage data.  Coverage data matches the source files
10472 more closely if you do not optimize.
10474 @item -fprofile-dir=@var{path}
10475 @opindex fprofile-dir
10477 Set the directory to search for the profile data files in to @var{path}.
10478 This option affects only the profile data generated by
10479 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
10480 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
10481 and its related options.  Both absolute and relative paths can be used.
10482 By default, GCC uses the current directory as @var{path}, thus the
10483 profile data file appears in the same directory as the object file.
10485 @item -fprofile-generate
10486 @itemx -fprofile-generate=@var{path}
10487 @opindex fprofile-generate
10489 Enable options usually used for instrumenting application to produce
10490 profile useful for later recompilation with profile feedback based
10491 optimization.  You must use @option{-fprofile-generate} both when
10492 compiling and when linking your program.
10494 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
10496 If @var{path} is specified, GCC looks at the @var{path} to find
10497 the profile feedback data files. See @option{-fprofile-dir}.
10499 To optimize the program based on the collected profile information, use
10500 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
10502 @item -fprofile-update=@var{method}
10503 @opindex fprofile-update
10505 Alter the update method for an application instrumented for profile
10506 feedback based optimization.  The @var{method} argument should be one of
10507 @samp{single}, @samp{atomic} or @samp{prefer-atomic}.
10508 The first one is useful for single-threaded applications,
10509 while the second one prevents profile corruption by emitting thread-safe code.
10511 @strong{Warning:} When an application does not properly join all threads
10512 (or creates an detached thread), a profile file can be still corrupted.
10514 Using @samp{prefer-atomic} would be transformed either to @samp{atomic},
10515 when supported by a target, or to @samp{single} otherwise.  The GCC driver
10516 automatically selects @samp{prefer-atomic} when @option{-pthread}
10517 is present in the command line.
10519 @item -fsanitize=address
10520 @opindex fsanitize=address
10521 Enable AddressSanitizer, a fast memory error detector.
10522 Memory access instructions are instrumented to detect
10523 out-of-bounds and use-after-free bugs.
10524 The option enables @option{-fsanitize-address-use-after-scope}.
10525 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
10526 more details.  The run-time behavior can be influenced using the
10527 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
10528 the available options are shown at startup of the instrumented program.  See
10529 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
10530 for a list of supported options.
10531 The option can't be combined with @option{-fsanitize=thread}.
10533 @item -fsanitize=kernel-address
10534 @opindex fsanitize=kernel-address
10535 Enable AddressSanitizer for Linux kernel.
10536 The option enables @option{-fsanitize-address-use-after-scope}.
10537 See @uref{https://github.com/google/kasan/wiki} for more details.
10539 @item -fsanitize=thread
10540 @opindex fsanitize=thread
10541 Enable ThreadSanitizer, a fast data race detector.
10542 Memory access instructions are instrumented to detect
10543 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
10544 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
10545 environment variable; see
10546 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
10547 supported options.
10548 The option can't be combined with @option{-fsanitize=address}
10549 and/or @option{-fsanitize=leak}.
10551 @item -fsanitize=leak
10552 @opindex fsanitize=leak
10553 Enable LeakSanitizer, a memory leak detector.
10554 This option only matters for linking of executables and
10555 the executable is linked against a library that overrides @code{malloc}
10556 and other allocator functions.  See
10557 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
10558 details.  The run-time behavior can be influenced using the
10559 @env{LSAN_OPTIONS} environment variable.
10560 The option can't be combined with @option{-fsanitize=thread}.
10562 @item -fsanitize=undefined
10563 @opindex fsanitize=undefined
10564 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
10565 Various computations are instrumented to detect undefined behavior
10566 at runtime.  Current suboptions are:
10568 @table @gcctabopt
10570 @item -fsanitize=shift
10571 @opindex fsanitize=shift
10572 This option enables checking that the result of a shift operation is
10573 not undefined.  Note that what exactly is considered undefined differs
10574 slightly between C and C++, as well as between ISO C90 and C99, etc.
10575 This option has two suboptions, @option{-fsanitize=shift-base} and
10576 @option{-fsanitize=shift-exponent}.
10578 @item -fsanitize=shift-exponent
10579 @opindex fsanitize=shift-exponent
10580 This option enables checking that the second argument of a shift operation
10581 is not negative and is smaller than the precision of the promoted first
10582 argument.
10584 @item -fsanitize=shift-base
10585 @opindex fsanitize=shift-base
10586 If the second argument of a shift operation is within range, check that the
10587 result of a shift operation is not undefined.  Note that what exactly is
10588 considered undefined differs slightly between C and C++, as well as between
10589 ISO C90 and C99, etc.
10591 @item -fsanitize=integer-divide-by-zero
10592 @opindex fsanitize=integer-divide-by-zero
10593 Detect integer division by zero as well as @code{INT_MIN / -1} division.
10595 @item -fsanitize=unreachable
10596 @opindex fsanitize=unreachable
10597 With this option, the compiler turns the @code{__builtin_unreachable}
10598 call into a diagnostics message call instead.  When reaching the
10599 @code{__builtin_unreachable} call, the behavior is undefined.
10601 @item -fsanitize=vla-bound
10602 @opindex fsanitize=vla-bound
10603 This option instructs the compiler to check that the size of a variable
10604 length array is positive.
10606 @item -fsanitize=null
10607 @opindex fsanitize=null
10608 This option enables pointer checking.  Particularly, the application
10609 built with this option turned on will issue an error message when it
10610 tries to dereference a NULL pointer, or if a reference (possibly an
10611 rvalue reference) is bound to a NULL pointer, or if a method is invoked
10612 on an object pointed by a NULL pointer.
10614 @item -fsanitize=return
10615 @opindex fsanitize=return
10616 This option enables return statement checking.  Programs
10617 built with this option turned on will issue an error message
10618 when the end of a non-void function is reached without actually
10619 returning a value.  This option works in C++ only.
10621 @item -fsanitize=signed-integer-overflow
10622 @opindex fsanitize=signed-integer-overflow
10623 This option enables signed integer overflow checking.  We check that
10624 the result of @code{+}, @code{*}, and both unary and binary @code{-}
10625 does not overflow in the signed arithmetics.  Note, integer promotion
10626 rules must be taken into account.  That is, the following is not an
10627 overflow:
10628 @smallexample
10629 signed char a = SCHAR_MAX;
10630 a++;
10631 @end smallexample
10633 @item -fsanitize=bounds
10634 @opindex fsanitize=bounds
10635 This option enables instrumentation of array bounds.  Various out of bounds
10636 accesses are detected.  Flexible array members, flexible array member-like
10637 arrays, and initializers of variables with static storage are not instrumented.
10639 @item -fsanitize=bounds-strict
10640 @opindex fsanitize=bounds-strict
10641 This option enables strict instrumentation of array bounds.  Most out of bounds
10642 accesses are detected, including flexible array members and flexible array
10643 member-like arrays.  Initializers of variables with static storage are not
10644 instrumented.
10646 @item -fsanitize=alignment
10647 @opindex fsanitize=alignment
10649 This option enables checking of alignment of pointers when they are
10650 dereferenced, or when a reference is bound to insufficiently aligned target,
10651 or when a method or constructor is invoked on insufficiently aligned object.
10653 @item -fsanitize=object-size
10654 @opindex fsanitize=object-size
10655 This option enables instrumentation of memory references using the
10656 @code{__builtin_object_size} function.  Various out of bounds pointer
10657 accesses are detected.
10659 @item -fsanitize=float-divide-by-zero
10660 @opindex fsanitize=float-divide-by-zero
10661 Detect floating-point division by zero.  Unlike other similar options,
10662 @option{-fsanitize=float-divide-by-zero} is not enabled by
10663 @option{-fsanitize=undefined}, since floating-point division by zero can
10664 be a legitimate way of obtaining infinities and NaNs.
10666 @item -fsanitize=float-cast-overflow
10667 @opindex fsanitize=float-cast-overflow
10668 This option enables floating-point type to integer conversion checking.
10669 We check that the result of the conversion does not overflow.
10670 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
10671 not enabled by @option{-fsanitize=undefined}.
10672 This option does not work well with @code{FE_INVALID} exceptions enabled.
10674 @item -fsanitize=nonnull-attribute
10675 @opindex fsanitize=nonnull-attribute
10677 This option enables instrumentation of calls, checking whether null values
10678 are not passed to arguments marked as requiring a non-null value by the
10679 @code{nonnull} function attribute.
10681 @item -fsanitize=returns-nonnull-attribute
10682 @opindex fsanitize=returns-nonnull-attribute
10684 This option enables instrumentation of return statements in functions
10685 marked with @code{returns_nonnull} function attribute, to detect returning
10686 of null values from such functions.
10688 @item -fsanitize=bool
10689 @opindex fsanitize=bool
10691 This option enables instrumentation of loads from bool.  If a value other
10692 than 0/1 is loaded, a run-time error is issued.
10694 @item -fsanitize=enum
10695 @opindex fsanitize=enum
10697 This option enables instrumentation of loads from an enum type.  If
10698 a value outside the range of values for the enum type is loaded,
10699 a run-time error is issued.
10701 @item -fsanitize=vptr
10702 @opindex fsanitize=vptr
10704 This option enables instrumentation of C++ member function calls, member
10705 accesses and some conversions between pointers to base and derived classes,
10706 to verify the referenced object has the correct dynamic type.
10708 @end table
10710 While @option{-ftrapv} causes traps for signed overflows to be emitted,
10711 @option{-fsanitize=undefined} gives a diagnostic message.
10712 This currently works only for the C family of languages.
10714 @item -fno-sanitize=all
10715 @opindex fno-sanitize=all
10717 This option disables all previously enabled sanitizers.
10718 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
10719 together.
10721 @item -fasan-shadow-offset=@var{number}
10722 @opindex fasan-shadow-offset
10723 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
10724 It is useful for experimenting with different shadow memory layouts in
10725 Kernel AddressSanitizer.
10727 @item -fsanitize-sections=@var{s1},@var{s2},...
10728 @opindex fsanitize-sections
10729 Sanitize global variables in selected user-defined sections.  @var{si} may
10730 contain wildcards.
10732 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
10733 @opindex fsanitize-recover
10734 @opindex fno-sanitize-recover
10735 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
10736 mentioned in comma-separated list of @var{opts}.  Enabling this option
10737 for a sanitizer component causes it to attempt to continue
10738 running the program as if no error happened.  This means multiple
10739 runtime errors can be reported in a single program run, and the exit
10740 code of the program may indicate success even when errors
10741 have been reported.  The @option{-fno-sanitize-recover=} option
10742 can be used to alter
10743 this behavior: only the first detected error is reported
10744 and program then exits with a non-zero exit code.
10746 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
10747 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
10748 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
10749 @option{-fsanitize=bounds-strict},
10750 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
10751 For these sanitizers error recovery is turned on by default,
10752 except @option{-fsanitize=address}, for which this feature is experimental.
10753 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
10754 accepted, the former enables recovery for all sanitizers that support it,
10755 the latter disables recovery for all sanitizers that support it.
10757 Even if a recovery mode is turned on the compiler side, it needs to be also
10758 enabled on the runtime library side, otherwise the failures are still fatal.
10759 The runtime library defaults to @code{halt_on_error=0} for
10760 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
10761 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
10762 setting the @code{halt_on_error} flag in the corresponding environment variable.
10764 Syntax without explicit @var{opts} parameter is deprecated.  It is equivalent to
10765 @smallexample
10766 -fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
10767 @end smallexample
10768 @noindent
10769 Similarly @option{-fno-sanitize-recover} is equivalent to
10770 @smallexample
10771 -fno-sanitize-recover=undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
10772 @end smallexample
10774 @item -fsanitize-address-use-after-scope
10775 @opindex fsanitize-address-use-after-scope
10776 Enable sanitization of local variables to detect use-after-scope bugs.
10777 The option sets @option{-fstack-reuse} to @samp{none}.
10779 @item -fsanitize-undefined-trap-on-error
10780 @opindex fsanitize-undefined-trap-on-error
10781 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
10782 report undefined behavior using @code{__builtin_trap} rather than
10783 a @code{libubsan} library routine.  The advantage of this is that the
10784 @code{libubsan} library is not needed and is not linked in, so this
10785 is usable even in freestanding environments.
10787 @item -fsanitize-coverage=trace-pc
10788 @opindex fsanitize-coverage=trace-pc
10789 Enable coverage-guided fuzzing code instrumentation.
10790 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
10792 @item -fbounds-check
10793 @opindex fbounds-check
10794 For front ends that support it, generate additional code to check that
10795 indices used to access arrays are within the declared range.  This is
10796 currently only supported by the Fortran front end, where
10797 this option defaults to true and false respectively.
10799 @item -fcheck-pointer-bounds
10800 @opindex fcheck-pointer-bounds
10801 @opindex fno-check-pointer-bounds
10802 @cindex Pointer Bounds Checker options
10803 Enable Pointer Bounds Checker instrumentation.  Each memory reference
10804 is instrumented with checks of the pointer used for memory access against
10805 bounds associated with that pointer.  
10807 Currently there
10808 is only an implementation for Intel MPX available, thus x86 GNU/Linux target
10809 and @option{-mmpx} are required to enable this feature.  
10810 MPX-based instrumentation requires
10811 a runtime library to enable MPX in hardware and handle bounds
10812 violation signals.  By default when @option{-fcheck-pointer-bounds}
10813 and @option{-mmpx} options are used to link a program, the GCC driver
10814 links against the @file{libmpx} and @file{libmpxwrappers} libraries.
10815 Bounds checking on calls to dynamic libraries requires a linker
10816 with @option{-z bndplt} support; if GCC was configured with a linker
10817 without support for this option (including the Gold linker and older
10818 versions of ld), a warning is given if you link with @option{-mmpx}
10819 without also specifying @option{-static}, since the overall effectiveness
10820 of the bounds checking protection is reduced.
10821 See also @option{-static-libmpxwrappers}.
10823 MPX-based instrumentation
10824 may be used for debugging and also may be included in production code
10825 to increase program security.  Depending on usage, you may
10826 have different requirements for the runtime library.  The current version
10827 of the MPX runtime library is more oriented for use as a debugging
10828 tool.  MPX runtime library usage implies @option{-lpthread}.  See
10829 also @option{-static-libmpx}.  The runtime library  behavior can be
10830 influenced using various @env{CHKP_RT_*} environment variables.  See
10831 @uref{https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler}
10832 for more details.
10834 Generated instrumentation may be controlled by various
10835 @option{-fchkp-*} options and by the @code{bnd_variable_size}
10836 structure field attribute (@pxref{Type Attributes}) and
10837 @code{bnd_legacy}, and @code{bnd_instrument} function attributes
10838 (@pxref{Function Attributes}).  GCC also provides a number of built-in
10839 functions for controlling the Pointer Bounds Checker.  @xref{Pointer
10840 Bounds Checker builtins}, for more information.
10842 @item -fchkp-check-incomplete-type
10843 @opindex fchkp-check-incomplete-type
10844 @opindex fno-chkp-check-incomplete-type
10845 Generate pointer bounds checks for variables with incomplete type.
10846 Enabled by default.
10848 @item -fchkp-narrow-bounds
10849 @opindex fchkp-narrow-bounds
10850 @opindex fno-chkp-narrow-bounds
10851 Controls bounds used by Pointer Bounds Checker for pointers to object
10852 fields.  If narrowing is enabled then field bounds are used.  Otherwise
10853 object bounds are used.  See also @option{-fchkp-narrow-to-innermost-array}
10854 and @option{-fchkp-first-field-has-own-bounds}.  Enabled by default.
10856 @item -fchkp-first-field-has-own-bounds
10857 @opindex fchkp-first-field-has-own-bounds
10858 @opindex fno-chkp-first-field-has-own-bounds
10859 Forces Pointer Bounds Checker to use narrowed bounds for the address of the
10860 first field in the structure.  By default a pointer to the first field has
10861 the same bounds as a pointer to the whole structure.
10863 @item -fchkp-narrow-to-innermost-array
10864 @opindex fchkp-narrow-to-innermost-array
10865 @opindex fno-chkp-narrow-to-innermost-array
10866 Forces Pointer Bounds Checker to use bounds of the innermost arrays in
10867 case of nested static array access.  By default this option is disabled and
10868 bounds of the outermost array are used.
10870 @item -fchkp-optimize
10871 @opindex fchkp-optimize
10872 @opindex fno-chkp-optimize
10873 Enables Pointer Bounds Checker optimizations.  Enabled by default at
10874 optimization levels @option{-O}, @option{-O2}, @option{-O3}.
10876 @item -fchkp-use-fast-string-functions
10877 @opindex fchkp-use-fast-string-functions
10878 @opindex fno-chkp-use-fast-string-functions
10879 Enables use of @code{*_nobnd} versions of string functions (not copying bounds)
10880 by Pointer Bounds Checker.  Disabled by default.
10882 @item -fchkp-use-nochk-string-functions
10883 @opindex fchkp-use-nochk-string-functions
10884 @opindex fno-chkp-use-nochk-string-functions
10885 Enables use of @code{*_nochk} versions of string functions (not checking bounds)
10886 by Pointer Bounds Checker.  Disabled by default.
10888 @item -fchkp-use-static-bounds
10889 @opindex fchkp-use-static-bounds
10890 @opindex fno-chkp-use-static-bounds
10891 Allow Pointer Bounds Checker to generate static bounds holding
10892 bounds of static variables.  Enabled by default.
10894 @item -fchkp-use-static-const-bounds
10895 @opindex fchkp-use-static-const-bounds
10896 @opindex fno-chkp-use-static-const-bounds
10897 Use statically-initialized bounds for constant bounds instead of
10898 generating them each time they are required.  By default enabled when
10899 @option{-fchkp-use-static-bounds} is enabled.
10901 @item -fchkp-treat-zero-dynamic-size-as-infinite
10902 @opindex fchkp-treat-zero-dynamic-size-as-infinite
10903 @opindex fno-chkp-treat-zero-dynamic-size-as-infinite
10904 With this option, objects with incomplete type whose
10905 dynamically-obtained size is zero are treated as having infinite size
10906 instead by Pointer Bounds
10907 Checker.  This option may be helpful if a program is linked with a library
10908 missing size information for some symbols.  Disabled by default.
10910 @item -fchkp-check-read
10911 @opindex fchkp-check-read
10912 @opindex fno-chkp-check-read
10913 Instructs Pointer Bounds Checker to generate checks for all read
10914 accesses to memory.  Enabled by default.
10916 @item -fchkp-check-write
10917 @opindex fchkp-check-write
10918 @opindex fno-chkp-check-write
10919 Instructs Pointer Bounds Checker to generate checks for all write
10920 accesses to memory.  Enabled by default.
10922 @item -fchkp-store-bounds
10923 @opindex fchkp-store-bounds
10924 @opindex fno-chkp-store-bounds
10925 Instructs Pointer Bounds Checker to generate bounds stores for
10926 pointer writes.  Enabled by default.
10928 @item -fchkp-instrument-calls
10929 @opindex fchkp-instrument-calls
10930 @opindex fno-chkp-instrument-calls
10931 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
10932 Enabled by default.
10934 @item -fchkp-instrument-marked-only
10935 @opindex fchkp-instrument-marked-only
10936 @opindex fno-chkp-instrument-marked-only
10937 Instructs Pointer Bounds Checker to instrument only functions
10938 marked with the @code{bnd_instrument} attribute
10939 (@pxref{Function Attributes}).  Disabled by default.
10941 @item -fchkp-use-wrappers
10942 @opindex fchkp-use-wrappers
10943 @opindex fno-chkp-use-wrappers
10944 Allows Pointer Bounds Checker to replace calls to built-in functions
10945 with calls to wrapper functions.  When @option{-fchkp-use-wrappers}
10946 is used to link a program, the GCC driver automatically links
10947 against @file{libmpxwrappers}.  See also @option{-static-libmpxwrappers}.
10948 Enabled by default.
10950 @item -fstack-protector
10951 @opindex fstack-protector
10952 Emit extra code to check for buffer overflows, such as stack smashing
10953 attacks.  This is done by adding a guard variable to functions with
10954 vulnerable objects.  This includes functions that call @code{alloca}, and
10955 functions with buffers larger than 8 bytes.  The guards are initialized
10956 when a function is entered and then checked when the function exits.
10957 If a guard check fails, an error message is printed and the program exits.
10959 @item -fstack-protector-all
10960 @opindex fstack-protector-all
10961 Like @option{-fstack-protector} except that all functions are protected.
10963 @item -fstack-protector-strong
10964 @opindex fstack-protector-strong
10965 Like @option{-fstack-protector} but includes additional functions to
10966 be protected --- those that have local array definitions, or have
10967 references to local frame addresses.
10969 @item -fstack-protector-explicit
10970 @opindex fstack-protector-explicit
10971 Like @option{-fstack-protector} but only protects those functions which
10972 have the @code{stack_protect} attribute.
10974 @item -fstack-check
10975 @opindex fstack-check
10976 Generate code to verify that you do not go beyond the boundary of the
10977 stack.  You should specify this flag if you are running in an
10978 environment with multiple threads, but you only rarely need to specify it in
10979 a single-threaded environment since stack overflow is automatically
10980 detected on nearly all systems if there is only one stack.
10982 Note that this switch does not actually cause checking to be done; the
10983 operating system or the language runtime must do that.  The switch causes
10984 generation of code to ensure that they see the stack being extended.
10986 You can additionally specify a string parameter: @samp{no} means no
10987 checking, @samp{generic} means force the use of old-style checking,
10988 @samp{specific} means use the best checking method and is equivalent
10989 to bare @option{-fstack-check}.
10991 Old-style checking is a generic mechanism that requires no specific
10992 target support in the compiler but comes with the following drawbacks:
10994 @enumerate
10995 @item
10996 Modified allocation strategy for large objects: they are always
10997 allocated dynamically if their size exceeds a fixed threshold.
10999 @item
11000 Fixed limit on the size of the static frame of functions: when it is
11001 topped by a particular function, stack checking is not reliable and
11002 a warning is issued by the compiler.
11004 @item
11005 Inefficiency: because of both the modified allocation strategy and the
11006 generic implementation, code performance is hampered.
11007 @end enumerate
11009 Note that old-style stack checking is also the fallback method for
11010 @samp{specific} if no target support has been added in the compiler.
11012 @item -fstack-limit-register=@var{reg}
11013 @itemx -fstack-limit-symbol=@var{sym}
11014 @itemx -fno-stack-limit
11015 @opindex fstack-limit-register
11016 @opindex fstack-limit-symbol
11017 @opindex fno-stack-limit
11018 Generate code to ensure that the stack does not grow beyond a certain value,
11019 either the value of a register or the address of a symbol.  If a larger
11020 stack is required, a signal is raised at run time.  For most targets,
11021 the signal is raised before the stack overruns the boundary, so
11022 it is possible to catch the signal without taking special precautions.
11024 For instance, if the stack starts at absolute address @samp{0x80000000}
11025 and grows downwards, you can use the flags
11026 @option{-fstack-limit-symbol=__stack_limit} and
11027 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
11028 of 128KB@.  Note that this may only work with the GNU linker.
11030 You can locally override stack limit checking by using the
11031 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
11033 @item -fsplit-stack
11034 @opindex fsplit-stack
11035 Generate code to automatically split the stack before it overflows.
11036 The resulting program has a discontiguous stack which can only
11037 overflow if the program is unable to allocate any more memory.  This
11038 is most useful when running threaded programs, as it is no longer
11039 necessary to calculate a good stack size to use for each thread.  This
11040 is currently only implemented for the x86 targets running
11041 GNU/Linux.
11043 When code compiled with @option{-fsplit-stack} calls code compiled
11044 without @option{-fsplit-stack}, there may not be much stack space
11045 available for the latter code to run.  If compiling all code,
11046 including library code, with @option{-fsplit-stack} is not an option,
11047 then the linker can fix up these calls so that the code compiled
11048 without @option{-fsplit-stack} always has a large stack.  Support for
11049 this is implemented in the gold linker in GNU binutils release 2.21
11050 and later.
11052 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
11053 @opindex fvtable-verify
11054 This option is only available when compiling C++ code.
11055 It turns on (or off, if using @option{-fvtable-verify=none}) the security
11056 feature that verifies at run time, for every virtual call, that
11057 the vtable pointer through which the call is made is valid for the type of
11058 the object, and has not been corrupted or overwritten.  If an invalid vtable
11059 pointer is detected at run time, an error is reported and execution of the
11060 program is immediately halted.
11062 This option causes run-time data structures to be built at program startup,
11063 which are used for verifying the vtable pointers.  
11064 The options @samp{std} and @samp{preinit}
11065 control the timing of when these data structures are built.  In both cases the
11066 data structures are built before execution reaches @code{main}.  Using
11067 @option{-fvtable-verify=std} causes the data structures to be built after
11068 shared libraries have been loaded and initialized.
11069 @option{-fvtable-verify=preinit} causes them to be built before shared
11070 libraries have been loaded and initialized.
11072 If this option appears multiple times in the command line with different
11073 values specified, @samp{none} takes highest priority over both @samp{std} and
11074 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
11076 @item -fvtv-debug
11077 @opindex fvtv-debug
11078 When used in conjunction with @option{-fvtable-verify=std} or 
11079 @option{-fvtable-verify=preinit}, causes debug versions of the 
11080 runtime functions for the vtable verification feature to be called.  
11081 This flag also causes the compiler to log information about which 
11082 vtable pointers it finds for each class.
11083 This information is written to a file named @file{vtv_set_ptr_data.log} 
11084 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
11085 if that is defined or the current working directory otherwise.
11087 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
11088 file, be sure to delete any existing one.
11090 @item -fvtv-counts
11091 @opindex fvtv-counts
11092 This is a debugging flag.  When used in conjunction with
11093 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
11094 causes the compiler to keep track of the total number of virtual calls
11095 it encounters and the number of verifications it inserts.  It also
11096 counts the number of calls to certain run-time library functions
11097 that it inserts and logs this information for each compilation unit.
11098 The compiler writes this information to a file named
11099 @file{vtv_count_data.log} in the directory named by the environment
11100 variable @env{VTV_LOGS_DIR} if that is defined or the current working
11101 directory otherwise.  It also counts the size of the vtable pointer sets
11102 for each class, and writes this information to @file{vtv_class_set_sizes.log}
11103 in the same directory.
11105 Note:  This feature @emph{appends} data to the log files.  To get fresh log
11106 files, be sure to delete any existing ones.
11108 @item -finstrument-functions
11109 @opindex finstrument-functions
11110 Generate instrumentation calls for entry and exit to functions.  Just
11111 after function entry and just before function exit, the following
11112 profiling functions are called with the address of the current
11113 function and its call site.  (On some platforms,
11114 @code{__builtin_return_address} does not work beyond the current
11115 function, so the call site information may not be available to the
11116 profiling functions otherwise.)
11118 @smallexample
11119 void __cyg_profile_func_enter (void *this_fn,
11120                                void *call_site);
11121 void __cyg_profile_func_exit  (void *this_fn,
11122                                void *call_site);
11123 @end smallexample
11125 The first argument is the address of the start of the current function,
11126 which may be looked up exactly in the symbol table.
11128 This instrumentation is also done for functions expanded inline in other
11129 functions.  The profiling calls indicate where, conceptually, the
11130 inline function is entered and exited.  This means that addressable
11131 versions of such functions must be available.  If all your uses of a
11132 function are expanded inline, this may mean an additional expansion of
11133 code size.  If you use @code{extern inline} in your C code, an
11134 addressable version of such functions must be provided.  (This is
11135 normally the case anyway, but if you get lucky and the optimizer always
11136 expands the functions inline, you might have gotten away without
11137 providing static copies.)
11139 A function may be given the attribute @code{no_instrument_function}, in
11140 which case this instrumentation is not done.  This can be used, for
11141 example, for the profiling functions listed above, high-priority
11142 interrupt routines, and any functions from which the profiling functions
11143 cannot safely be called (perhaps signal handlers, if the profiling
11144 routines generate output or allocate memory).
11146 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
11147 @opindex finstrument-functions-exclude-file-list
11149 Set the list of functions that are excluded from instrumentation (see
11150 the description of @option{-finstrument-functions}).  If the file that
11151 contains a function definition matches with one of @var{file}, then
11152 that function is not instrumented.  The match is done on substrings:
11153 if the @var{file} parameter is a substring of the file name, it is
11154 considered to be a match.
11156 For example:
11158 @smallexample
11159 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
11160 @end smallexample
11162 @noindent
11163 excludes any inline function defined in files whose pathnames
11164 contain @file{/bits/stl} or @file{include/sys}.
11166 If, for some reason, you want to include letter @samp{,} in one of
11167 @var{sym}, write @samp{\,}. For example,
11168 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
11169 (note the single quote surrounding the option).
11171 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
11172 @opindex finstrument-functions-exclude-function-list
11174 This is similar to @option{-finstrument-functions-exclude-file-list},
11175 but this option sets the list of function names to be excluded from
11176 instrumentation.  The function name to be matched is its user-visible
11177 name, such as @code{vector<int> blah(const vector<int> &)}, not the
11178 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
11179 match is done on substrings: if the @var{sym} parameter is a substring
11180 of the function name, it is considered to be a match.  For C99 and C++
11181 extended identifiers, the function name must be given in UTF-8, not
11182 using universal character names.
11184 @end table
11187 @node Preprocessor Options
11188 @section Options Controlling the Preprocessor
11189 @cindex preprocessor options
11190 @cindex options, preprocessor
11192 These options control the C preprocessor, which is run on each C source
11193 file before actual compilation.
11195 If you use the @option{-E} option, nothing is done except preprocessing.
11196 Some of these options make sense only together with @option{-E} because
11197 they cause the preprocessor output to be unsuitable for actual
11198 compilation.
11200 @table @gcctabopt
11201 @item -Wp,@var{option}
11202 @opindex Wp
11203 You can use @option{-Wp,@var{option}} to bypass the compiler driver
11204 and pass @var{option} directly through to the preprocessor.  If
11205 @var{option} contains commas, it is split into multiple options at the
11206 commas.  However, many options are modified, translated or interpreted
11207 by the compiler driver before being passed to the preprocessor, and
11208 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
11209 interface is undocumented and subject to change, so whenever possible
11210 you should avoid using @option{-Wp} and let the driver handle the
11211 options instead.
11213 @item -Xpreprocessor @var{option}
11214 @opindex Xpreprocessor
11215 Pass @var{option} as an option to the preprocessor.  You can use this to
11216 supply system-specific preprocessor options that GCC does not 
11217 recognize.
11219 If you want to pass an option that takes an argument, you must use
11220 @option{-Xpreprocessor} twice, once for the option and once for the argument.
11222 @item -no-integrated-cpp
11223 @opindex no-integrated-cpp
11224 Perform preprocessing as a separate pass before compilation.
11225 By default, GCC performs preprocessing as an integrated part of
11226 input tokenization and parsing.
11227 If this option is provided, the appropriate language front end
11228 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
11229 and Objective-C, respectively) is instead invoked twice,
11230 once for preprocessing only and once for actual compilation
11231 of the preprocessed input.
11232 This option may be useful in conjunction with the @option{-B} or
11233 @option{-wrapper} options to specify an alternate preprocessor or
11234 perform additional processing of the program source between
11235 normal preprocessing and compilation.
11236 @end table
11238 @include cppopts.texi
11240 @node Assembler Options
11241 @section Passing Options to the Assembler
11243 @c prevent bad page break with this line
11244 You can pass options to the assembler.
11246 @table @gcctabopt
11247 @item -Wa,@var{option}
11248 @opindex Wa
11249 Pass @var{option} as an option to the assembler.  If @var{option}
11250 contains commas, it is split into multiple options at the commas.
11252 @item -Xassembler @var{option}
11253 @opindex Xassembler
11254 Pass @var{option} as an option to the assembler.  You can use this to
11255 supply system-specific assembler options that GCC does not
11256 recognize.
11258 If you want to pass an option that takes an argument, you must use
11259 @option{-Xassembler} twice, once for the option and once for the argument.
11261 @end table
11263 @node Link Options
11264 @section Options for Linking
11265 @cindex link options
11266 @cindex options, linking
11268 These options come into play when the compiler links object files into
11269 an executable output file.  They are meaningless if the compiler is
11270 not doing a link step.
11272 @table @gcctabopt
11273 @cindex file names
11274 @item @var{object-file-name}
11275 A file name that does not end in a special recognized suffix is
11276 considered to name an object file or library.  (Object files are
11277 distinguished from libraries by the linker according to the file
11278 contents.)  If linking is done, these object files are used as input
11279 to the linker.
11281 @item -c
11282 @itemx -S
11283 @itemx -E
11284 @opindex c
11285 @opindex S
11286 @opindex E
11287 If any of these options is used, then the linker is not run, and
11288 object file names should not be used as arguments.  @xref{Overall
11289 Options}.
11291 @item -fuse-ld=bfd
11292 @opindex fuse-ld=bfd
11293 Use the @command{bfd} linker instead of the default linker.
11295 @item -fuse-ld=gold
11296 @opindex fuse-ld=gold
11297 Use the @command{gold} linker instead of the default linker.
11299 @cindex Libraries
11300 @item -l@var{library}
11301 @itemx -l @var{library}
11302 @opindex l
11303 Search the library named @var{library} when linking.  (The second
11304 alternative with the library as a separate argument is only for
11305 POSIX compliance and is not recommended.)
11307 It makes a difference where in the command you write this option; the
11308 linker searches and processes libraries and object files in the order they
11309 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
11310 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
11311 to functions in @samp{z}, those functions may not be loaded.
11313 The linker searches a standard list of directories for the library,
11314 which is actually a file named @file{lib@var{library}.a}.  The linker
11315 then uses this file as if it had been specified precisely by name.
11317 The directories searched include several standard system directories
11318 plus any that you specify with @option{-L}.
11320 Normally the files found this way are library files---archive files
11321 whose members are object files.  The linker handles an archive file by
11322 scanning through it for members which define symbols that have so far
11323 been referenced but not defined.  But if the file that is found is an
11324 ordinary object file, it is linked in the usual fashion.  The only
11325 difference between using an @option{-l} option and specifying a file name
11326 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
11327 and searches several directories.
11329 @item -lobjc
11330 @opindex lobjc
11331 You need this special case of the @option{-l} option in order to
11332 link an Objective-C or Objective-C++ program.
11334 @item -nostartfiles
11335 @opindex nostartfiles
11336 Do not use the standard system startup files when linking.
11337 The standard system libraries are used normally, unless @option{-nostdlib}
11338 or @option{-nodefaultlibs} is used.
11340 @item -nodefaultlibs
11341 @opindex nodefaultlibs
11342 Do not use the standard system libraries when linking.
11343 Only the libraries you specify are passed to the linker, and options
11344 specifying linkage of the system libraries, such as @option{-static-libgcc}
11345 or @option{-shared-libgcc}, are ignored.  
11346 The standard startup files are used normally, unless @option{-nostartfiles}
11347 is used.  
11349 The compiler may generate calls to @code{memcmp},
11350 @code{memset}, @code{memcpy} and @code{memmove}.
11351 These entries are usually resolved by entries in
11352 libc.  These entry points should be supplied through some other
11353 mechanism when this option is specified.
11355 @item -nostdlib
11356 @opindex nostdlib
11357 Do not use the standard system startup files or libraries when linking.
11358 No startup files and only the libraries you specify are passed to
11359 the linker, and options specifying linkage of the system libraries, such as
11360 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
11362 The compiler may generate calls to @code{memcmp}, @code{memset},
11363 @code{memcpy} and @code{memmove}.
11364 These entries are usually resolved by entries in
11365 libc.  These entry points should be supplied through some other
11366 mechanism when this option is specified.
11368 @cindex @option{-lgcc}, use with @option{-nostdlib}
11369 @cindex @option{-nostdlib} and unresolved references
11370 @cindex unresolved references and @option{-nostdlib}
11371 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
11372 @cindex @option{-nodefaultlibs} and unresolved references
11373 @cindex unresolved references and @option{-nodefaultlibs}
11374 One of the standard libraries bypassed by @option{-nostdlib} and
11375 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
11376 which GCC uses to overcome shortcomings of particular machines, or special
11377 needs for some languages.
11378 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
11379 Collection (GCC) Internals},
11380 for more discussion of @file{libgcc.a}.)
11381 In most cases, you need @file{libgcc.a} even when you want to avoid
11382 other standard libraries.  In other words, when you specify @option{-nostdlib}
11383 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
11384 This ensures that you have no unresolved references to internal GCC
11385 library subroutines.
11386 (An example of such an internal subroutine is @code{__main}, used to ensure C++
11387 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
11388 GNU Compiler Collection (GCC) Internals}.)
11390 @item -pie
11391 @opindex pie
11392 Produce a position independent executable on targets that support it.
11393 For predictable results, you must also specify the same set of options
11394 used for compilation (@option{-fpie}, @option{-fPIE},
11395 or model suboptions) when you specify this linker option.
11397 @item -no-pie
11398 @opindex no-pie
11399 Don't produce a position independent executable.
11401 @item -rdynamic
11402 @opindex rdynamic
11403 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
11404 that support it. This instructs the linker to add all symbols, not
11405 only used ones, to the dynamic symbol table. This option is needed
11406 for some uses of @code{dlopen} or to allow obtaining backtraces
11407 from within a program.
11409 @item -s
11410 @opindex s
11411 Remove all symbol table and relocation information from the executable.
11413 @item -static
11414 @opindex static
11415 On systems that support dynamic linking, this prevents linking with the shared
11416 libraries.  On other systems, this option has no effect.
11418 @item -shared
11419 @opindex shared
11420 Produce a shared object which can then be linked with other objects to
11421 form an executable.  Not all systems support this option.  For predictable
11422 results, you must also specify the same set of options used for compilation
11423 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
11424 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
11425 needs to build supplementary stub code for constructors to work.  On
11426 multi-libbed systems, @samp{gcc -shared} must select the correct support
11427 libraries to link against.  Failing to supply the correct flags may lead
11428 to subtle defects.  Supplying them in cases where they are not necessary
11429 is innocuous.}
11431 @item -shared-libgcc
11432 @itemx -static-libgcc
11433 @opindex shared-libgcc
11434 @opindex static-libgcc
11435 On systems that provide @file{libgcc} as a shared library, these options
11436 force the use of either the shared or static version, respectively.
11437 If no shared version of @file{libgcc} was built when the compiler was
11438 configured, these options have no effect.
11440 There are several situations in which an application should use the
11441 shared @file{libgcc} instead of the static version.  The most common
11442 of these is when the application wishes to throw and catch exceptions
11443 across different shared libraries.  In that case, each of the libraries
11444 as well as the application itself should use the shared @file{libgcc}.
11446 Therefore, the G++ and driver automatically adds @option{-shared-libgcc}
11447  whenever you build a shared library or a main executable, because C++
11448  programs typically use exceptions, so this is the right thing to do.
11450 If, instead, you use the GCC driver to create shared libraries, you may
11451 find that they are not always linked with the shared @file{libgcc}.
11452 If GCC finds, at its configuration time, that you have a non-GNU linker
11453 or a GNU linker that does not support option @option{--eh-frame-hdr},
11454 it links the shared version of @file{libgcc} into shared libraries
11455 by default.  Otherwise, it takes advantage of the linker and optimizes
11456 away the linking with the shared version of @file{libgcc}, linking with
11457 the static version of libgcc by default.  This allows exceptions to
11458 propagate through such shared libraries, without incurring relocation
11459 costs at library load time.
11461 However, if a library or main executable is supposed to throw or catch
11462 exceptions, you must link it using the G++ driver, as appropriate
11463 for the languages used in the program, or using the option
11464 @option{-shared-libgcc}, such that it is linked with the shared
11465 @file{libgcc}.
11467 @item -static-libasan
11468 @opindex static-libasan
11469 When the @option{-fsanitize=address} option is used to link a program,
11470 the GCC driver automatically links against @option{libasan}.  If
11471 @file{libasan} is available as a shared library, and the @option{-static}
11472 option is not used, then this links against the shared version of
11473 @file{libasan}.  The @option{-static-libasan} option directs the GCC
11474 driver to link @file{libasan} statically, without necessarily linking
11475 other libraries statically.
11477 @item -static-libtsan
11478 @opindex static-libtsan
11479 When the @option{-fsanitize=thread} option is used to link a program,
11480 the GCC driver automatically links against @option{libtsan}.  If
11481 @file{libtsan} is available as a shared library, and the @option{-static}
11482 option is not used, then this links against the shared version of
11483 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
11484 driver to link @file{libtsan} statically, without necessarily linking
11485 other libraries statically.
11487 @item -static-liblsan
11488 @opindex static-liblsan
11489 When the @option{-fsanitize=leak} option is used to link a program,
11490 the GCC driver automatically links against @option{liblsan}.  If
11491 @file{liblsan} is available as a shared library, and the @option{-static}
11492 option is not used, then this links against the shared version of
11493 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
11494 driver to link @file{liblsan} statically, without necessarily linking
11495 other libraries statically.
11497 @item -static-libubsan
11498 @opindex static-libubsan
11499 When the @option{-fsanitize=undefined} option is used to link a program,
11500 the GCC driver automatically links against @option{libubsan}.  If
11501 @file{libubsan} is available as a shared library, and the @option{-static}
11502 option is not used, then this links against the shared version of
11503 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
11504 driver to link @file{libubsan} statically, without necessarily linking
11505 other libraries statically.
11507 @item -static-libmpx
11508 @opindex static-libmpx
11509 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are
11510 used to link a program, the GCC driver automatically links against
11511 @file{libmpx}.  If @file{libmpx} is available as a shared library,
11512 and the @option{-static} option is not used, then this links against
11513 the shared version of @file{libmpx}.  The @option{-static-libmpx}
11514 option directs the GCC driver to link @file{libmpx} statically,
11515 without necessarily linking other libraries statically.
11517 @item -static-libmpxwrappers
11518 @opindex static-libmpxwrappers
11519 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are used
11520 to link a program without also using @option{-fno-chkp-use-wrappers}, the
11521 GCC driver automatically links against @file{libmpxwrappers}.  If
11522 @file{libmpxwrappers} is available as a shared library, and the
11523 @option{-static} option is not used, then this links against the shared
11524 version of @file{libmpxwrappers}.  The @option{-static-libmpxwrappers}
11525 option directs the GCC driver to link @file{libmpxwrappers} statically,
11526 without necessarily linking other libraries statically.
11528 @item -static-libstdc++
11529 @opindex static-libstdc++
11530 When the @command{g++} program is used to link a C++ program, it
11531 normally automatically links against @option{libstdc++}.  If
11532 @file{libstdc++} is available as a shared library, and the
11533 @option{-static} option is not used, then this links against the
11534 shared version of @file{libstdc++}.  That is normally fine.  However, it
11535 is sometimes useful to freeze the version of @file{libstdc++} used by
11536 the program without going all the way to a fully static link.  The
11537 @option{-static-libstdc++} option directs the @command{g++} driver to
11538 link @file{libstdc++} statically, without necessarily linking other
11539 libraries statically.
11541 @item -symbolic
11542 @opindex symbolic
11543 Bind references to global symbols when building a shared object.  Warn
11544 about any unresolved references (unless overridden by the link editor
11545 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
11546 this option.
11548 @item -T @var{script}
11549 @opindex T
11550 @cindex linker script
11551 Use @var{script} as the linker script.  This option is supported by most
11552 systems using the GNU linker.  On some targets, such as bare-board
11553 targets without an operating system, the @option{-T} option may be required
11554 when linking to avoid references to undefined symbols.
11556 @item -Xlinker @var{option}
11557 @opindex Xlinker
11558 Pass @var{option} as an option to the linker.  You can use this to
11559 supply system-specific linker options that GCC does not recognize.
11561 If you want to pass an option that takes a separate argument, you must use
11562 @option{-Xlinker} twice, once for the option and once for the argument.
11563 For example, to pass @option{-assert definitions}, you must write
11564 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
11565 @option{-Xlinker "-assert definitions"}, because this passes the entire
11566 string as a single argument, which is not what the linker expects.
11568 When using the GNU linker, it is usually more convenient to pass
11569 arguments to linker options using the @option{@var{option}=@var{value}}
11570 syntax than as separate arguments.  For example, you can specify
11571 @option{-Xlinker -Map=output.map} rather than
11572 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
11573 this syntax for command-line options.
11575 @item -Wl,@var{option}
11576 @opindex Wl
11577 Pass @var{option} as an option to the linker.  If @var{option} contains
11578 commas, it is split into multiple options at the commas.  You can use this
11579 syntax to pass an argument to the option.
11580 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
11581 linker.  When using the GNU linker, you can also get the same effect with
11582 @option{-Wl,-Map=output.map}.
11584 @item -u @var{symbol}
11585 @opindex u
11586 Pretend the symbol @var{symbol} is undefined, to force linking of
11587 library modules to define it.  You can use @option{-u} multiple times with
11588 different symbols to force loading of additional library modules.
11590 @item -z @var{keyword}
11591 @opindex z
11592 @option{-z} is passed directly on to the linker along with the keyword
11593 @var{keyword}. See the section in the documentation of your linker for
11594 permitted values and their meanings.
11595 @end table
11597 @node Directory Options
11598 @section Options for Directory Search
11599 @cindex directory options
11600 @cindex options, directory search
11601 @cindex search path
11603 These options specify directories to search for header files, for
11604 libraries and for parts of the compiler:
11606 @table @gcctabopt
11607 @item -I@var{dir}
11608 @opindex I
11609 Add the directory @var{dir} to the head of the list of directories to be
11610 searched for header files.  This can be used to override a system header
11611 file, substituting your own version, since these directories are
11612 searched before the system header file directories.  However, you should
11613 not use this option to add directories that contain vendor-supplied
11614 system header files (use @option{-isystem} for that).  If you use more than
11615 one @option{-I} option, the directories are scanned in left-to-right
11616 order; the standard system directories come after.
11618 If a standard system include directory, or a directory specified with
11619 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
11620 option is ignored.  The directory is still searched but as a
11621 system directory at its normal position in the system include chain.
11622 This is to ensure that GCC's procedure to fix buggy system headers and
11623 the ordering for the @code{include_next} directive are not inadvertently changed.
11624 If you really need to change the search order for system directories,
11625 use the @option{-nostdinc} and/or @option{-isystem} options.
11627 @item -iplugindir=@var{dir}
11628 @opindex iplugindir=
11629 Set the directory to search for plugins that are passed
11630 by @option{-fplugin=@var{name}} instead of
11631 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
11632 to be used by the user, but only passed by the driver.
11634 @item -iquote@var{dir}
11635 @opindex iquote
11636 Add the directory @var{dir} to the head of the list of directories to
11637 be searched for header files only for the case of @code{#include
11638 "@var{file}"}; they are not searched for @code{#include <@var{file}>},
11639 otherwise just like @option{-I}.
11641 @item -L@var{dir}
11642 @opindex L
11643 Add directory @var{dir} to the list of directories to be searched
11644 for @option{-l}.
11646 @item -B@var{prefix}
11647 @opindex B
11648 This option specifies where to find the executables, libraries,
11649 include files, and data files of the compiler itself.
11651 The compiler driver program runs one or more of the subprograms
11652 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
11653 @var{prefix} as a prefix for each program it tries to run, both with and
11654 without @samp{@var{machine}/@var{version}/} for the corresponding target
11655 machine and compiler version.
11657 For each subprogram to be run, the compiler driver first tries the
11658 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
11659 is not specified, the driver tries two standard prefixes, 
11660 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
11661 those results in a file name that is found, the unmodified program
11662 name is searched for using the directories specified in your
11663 @env{PATH} environment variable.
11665 The compiler checks to see if the path provided by @option{-B}
11666 refers to a directory, and if necessary it adds a directory
11667 separator character at the end of the path.
11669 @option{-B} prefixes that effectively specify directory names also apply
11670 to libraries in the linker, because the compiler translates these
11671 options into @option{-L} options for the linker.  They also apply to
11672 include files in the preprocessor, because the compiler translates these
11673 options into @option{-isystem} options for the preprocessor.  In this case,
11674 the compiler appends @samp{include} to the prefix.
11676 The runtime support file @file{libgcc.a} can also be searched for using
11677 the @option{-B} prefix, if needed.  If it is not found there, the two
11678 standard prefixes above are tried, and that is all.  The file is left
11679 out of the link if it is not found by those means.
11681 Another way to specify a prefix much like the @option{-B} prefix is to use
11682 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
11683 Variables}.
11685 As a special kludge, if the path provided by @option{-B} is
11686 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
11687 9, then it is replaced by @file{[dir/]include}.  This is to help
11688 with boot-strapping the compiler.
11690 @item -no-canonical-prefixes
11691 @opindex no-canonical-prefixes
11692 Do not expand any symbolic links, resolve references to @samp{/../}
11693 or @samp{/./}, or make the path absolute when generating a relative
11694 prefix.
11696 @item --sysroot=@var{dir}
11697 @opindex sysroot
11698 Use @var{dir} as the logical root directory for headers and libraries.
11699 For example, if the compiler normally searches for headers in
11700 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
11701 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
11703 If you use both this option and the @option{-isysroot} option, then
11704 the @option{--sysroot} option applies to libraries, but the
11705 @option{-isysroot} option applies to header files.
11707 The GNU linker (beginning with version 2.16) has the necessary support
11708 for this option.  If your linker does not support this option, the
11709 header file aspect of @option{--sysroot} still works, but the
11710 library aspect does not.
11712 @item --no-sysroot-suffix
11713 @opindex no-sysroot-suffix
11714 For some targets, a suffix is added to the root directory specified
11715 with @option{--sysroot}, depending on the other options used, so that
11716 headers may for example be found in
11717 @file{@var{dir}/@var{suffix}/usr/include} instead of
11718 @file{@var{dir}/usr/include}.  This option disables the addition of
11719 such a suffix.
11721 @item -I-
11722 @opindex I-
11723 This option has been deprecated.  Please use @option{-iquote} instead for
11724 @option{-I} directories before the @option{-I-} and remove the @option{-I-}
11725 option.
11726 Any directories you specify with @option{-I} options before the @option{-I-}
11727 option are searched only for the case of @code{#include "@var{file}"};
11728 they are not searched for @code{#include <@var{file}>}.
11730 If additional directories are specified with @option{-I} options after
11731 the @option{-I-} option, these directories are searched for all @code{#include}
11732 directives.  (Ordinarily @emph{all} @option{-I} directories are used
11733 this way.)
11735 In addition, the @option{-I-} option inhibits the use of the current
11736 directory (where the current input file came from) as the first search
11737 directory for @code{#include "@var{file}"}.  There is no way to
11738 override this effect of @option{-I-}.  With @option{-I.} you can specify
11739 searching the directory that is current when the compiler is
11740 invoked.  That is not exactly the same as what the preprocessor does
11741 by default, but it is often satisfactory.
11743 @option{-I-} does not inhibit the use of the standard system directories
11744 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
11745 independent.
11746 @end table
11748 @node Code Gen Options
11749 @section Options for Code Generation Conventions
11750 @cindex code generation conventions
11751 @cindex options, code generation
11752 @cindex run-time options
11754 These machine-independent options control the interface conventions
11755 used in code generation.
11757 Most of them have both positive and negative forms; the negative form
11758 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
11759 one of the forms is listed---the one that is not the default.  You
11760 can figure out the other form by either removing @samp{no-} or adding
11763 @table @gcctabopt
11764 @item -fstack-reuse=@var{reuse-level}
11765 @opindex fstack_reuse
11766 This option controls stack space reuse for user declared local/auto variables
11767 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
11768 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
11769 local variables and temporaries, @samp{named_vars} enables the reuse only for
11770 user defined local variables with names, and @samp{none} disables stack reuse
11771 completely. The default value is @samp{all}. The option is needed when the
11772 program extends the lifetime of a scoped local variable or a compiler generated
11773 temporary beyond the end point defined by the language.  When a lifetime of
11774 a variable ends, and if the variable lives in memory, the optimizing compiler
11775 has the freedom to reuse its stack space with other temporaries or scoped
11776 local variables whose live range does not overlap with it. Legacy code extending
11777 local lifetime is likely to break with the stack reuse optimization.
11779 For example,
11781 @smallexample
11782    int *p;
11783    @{
11784      int local1;
11786      p = &local1;
11787      local1 = 10;
11788      ....
11789    @}
11790    @{
11791       int local2;
11792       local2 = 20;
11793       ...
11794    @}
11796    if (*p == 10)  // out of scope use of local1
11797      @{
11799      @}
11800 @end smallexample
11802 Another example:
11803 @smallexample
11805    struct A
11806    @{
11807        A(int k) : i(k), j(k) @{ @}
11808        int i;
11809        int j;
11810    @};
11812    A *ap;
11814    void foo(const A& ar)
11815    @{
11816       ap = &ar;
11817    @}
11819    void bar()
11820    @{
11821       foo(A(10)); // temp object's lifetime ends when foo returns
11823       @{
11824         A a(20);
11825         ....
11826       @}
11827       ap->i+= 10;  // ap references out of scope temp whose space
11828                    // is reused with a. What is the value of ap->i?
11829    @}
11831 @end smallexample
11833 The lifetime of a compiler generated temporary is well defined by the C++
11834 standard. When a lifetime of a temporary ends, and if the temporary lives
11835 in memory, the optimizing compiler has the freedom to reuse its stack
11836 space with other temporaries or scoped local variables whose live range
11837 does not overlap with it. However some of the legacy code relies on
11838 the behavior of older compilers in which temporaries' stack space is
11839 not reused, the aggressive stack reuse can lead to runtime errors. This
11840 option is used to control the temporary stack reuse optimization.
11842 @item -ftrapv
11843 @opindex ftrapv
11844 This option generates traps for signed overflow on addition, subtraction,
11845 multiplication operations.
11846 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
11847 @option{-ftrapv} @option{-fwrapv} on the command-line results in
11848 @option{-fwrapv} being effective.  Note that only active options override, so
11849 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
11850 results in @option{-ftrapv} being effective.
11852 @item -fwrapv
11853 @opindex fwrapv
11854 This option instructs the compiler to assume that signed arithmetic
11855 overflow of addition, subtraction and multiplication wraps around
11856 using twos-complement representation.  This flag enables some optimizations
11857 and disables others.
11858 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
11859 @option{-ftrapv} @option{-fwrapv} on the command-line results in
11860 @option{-fwrapv} being effective.  Note that only active options override, so
11861 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
11862 results in @option{-ftrapv} being effective.
11864 @item -fexceptions
11865 @opindex fexceptions
11866 Enable exception handling.  Generates extra code needed to propagate
11867 exceptions.  For some targets, this implies GCC generates frame
11868 unwind information for all functions, which can produce significant data
11869 size overhead, although it does not affect execution.  If you do not
11870 specify this option, GCC enables it by default for languages like
11871 C++ that normally require exception handling, and disables it for
11872 languages like C that do not normally require it.  However, you may need
11873 to enable this option when compiling C code that needs to interoperate
11874 properly with exception handlers written in C++.  You may also wish to
11875 disable this option if you are compiling older C++ programs that don't
11876 use exception handling.
11878 @item -fnon-call-exceptions
11879 @opindex fnon-call-exceptions
11880 Generate code that allows trapping instructions to throw exceptions.
11881 Note that this requires platform-specific runtime support that does
11882 not exist everywhere.  Moreover, it only allows @emph{trapping}
11883 instructions to throw exceptions, i.e.@: memory references or floating-point
11884 instructions.  It does not allow exceptions to be thrown from
11885 arbitrary signal handlers such as @code{SIGALRM}.
11887 @item -fdelete-dead-exceptions
11888 @opindex fdelete-dead-exceptions
11889 Consider that instructions that may throw exceptions but don't otherwise
11890 contribute to the execution of the program can be optimized away.
11891 This option is enabled by default for the Ada front end, as permitted by
11892 the Ada language specification.
11893 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
11895 @item -funwind-tables
11896 @opindex funwind-tables
11897 Similar to @option{-fexceptions}, except that it just generates any needed
11898 static data, but does not affect the generated code in any other way.
11899 You normally do not need to enable this option; instead, a language processor
11900 that needs this handling enables it on your behalf.
11902 @item -fasynchronous-unwind-tables
11903 @opindex fasynchronous-unwind-tables
11904 Generate unwind table in DWARF format, if supported by target machine.  The
11905 table is exact at each instruction boundary, so it can be used for stack
11906 unwinding from asynchronous events (such as debugger or garbage collector).
11908 @item -fno-gnu-unique
11909 @opindex fno-gnu-unique
11910 On systems with recent GNU assembler and C library, the C++ compiler
11911 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
11912 of template static data members and static local variables in inline
11913 functions are unique even in the presence of @code{RTLD_LOCAL}; this
11914 is necessary to avoid problems with a library used by two different
11915 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
11916 therefore disagreeing with the other one about the binding of the
11917 symbol.  But this causes @code{dlclose} to be ignored for affected
11918 DSOs; if your program relies on reinitialization of a DSO via
11919 @code{dlclose} and @code{dlopen}, you can use
11920 @option{-fno-gnu-unique}.
11922 @item -fpcc-struct-return
11923 @opindex fpcc-struct-return
11924 Return ``short'' @code{struct} and @code{union} values in memory like
11925 longer ones, rather than in registers.  This convention is less
11926 efficient, but it has the advantage of allowing intercallability between
11927 GCC-compiled files and files compiled with other compilers, particularly
11928 the Portable C Compiler (pcc).
11930 The precise convention for returning structures in memory depends
11931 on the target configuration macros.
11933 Short structures and unions are those whose size and alignment match
11934 that of some integer type.
11936 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
11937 switch is not binary compatible with code compiled with the
11938 @option{-freg-struct-return} switch.
11939 Use it to conform to a non-default application binary interface.
11941 @item -freg-struct-return
11942 @opindex freg-struct-return
11943 Return @code{struct} and @code{union} values in registers when possible.
11944 This is more efficient for small structures than
11945 @option{-fpcc-struct-return}.
11947 If you specify neither @option{-fpcc-struct-return} nor
11948 @option{-freg-struct-return}, GCC defaults to whichever convention is
11949 standard for the target.  If there is no standard convention, GCC
11950 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
11951 the principal compiler.  In those cases, we can choose the standard, and
11952 we chose the more efficient register return alternative.
11954 @strong{Warning:} code compiled with the @option{-freg-struct-return}
11955 switch is not binary compatible with code compiled with the
11956 @option{-fpcc-struct-return} switch.
11957 Use it to conform to a non-default application binary interface.
11959 @item -fshort-enums
11960 @opindex fshort-enums
11961 Allocate to an @code{enum} type only as many bytes as it needs for the
11962 declared range of possible values.  Specifically, the @code{enum} type
11963 is equivalent to the smallest integer type that has enough room.
11965 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
11966 code that is not binary compatible with code generated without that switch.
11967 Use it to conform to a non-default application binary interface.
11969 @item -fshort-wchar
11970 @opindex fshort-wchar
11971 Override the underlying type for @code{wchar_t} to be @code{short
11972 unsigned int} instead of the default for the target.  This option is
11973 useful for building programs to run under WINE@.
11975 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
11976 code that is not binary compatible with code generated without that switch.
11977 Use it to conform to a non-default application binary interface.
11979 @item -fno-common
11980 @opindex fno-common
11981 @cindex tentative definitions
11982 In C code, this option controls the placement of global variables 
11983 defined without an initializer, known as @dfn{tentative definitions} 
11984 in the C standard.  Tentative definitions are distinct from declarations 
11985 of a variable with the @code{extern} keyword, which do not allocate storage.
11987 Unix C compilers have traditionally allocated storage for
11988 uninitialized global variables in a common block.  This allows the
11989 linker to resolve all tentative definitions of the same variable
11990 in different compilation units to the same object, or to a non-tentative
11991 definition.  
11992 This is the behavior specified by @option{-fcommon}, and is the default for 
11993 GCC on most targets.  
11994 On the other hand, this behavior is not required by ISO
11995 C, and on some targets may carry a speed or code size penalty on
11996 variable references.
11998 The @option{-fno-common} option specifies that the compiler should instead
11999 place uninitialized global variables in the data section of the object file.
12000 This inhibits the merging of tentative definitions by the linker so
12001 you get a multiple-definition error if the same 
12002 variable is defined in more than one compilation unit.
12003 Compiling with @option{-fno-common} is useful on targets for which
12004 it provides better performance, or if you wish to verify that the
12005 program will work on other systems that always treat uninitialized
12006 variable definitions this way.
12008 @item -fno-ident
12009 @opindex fno-ident
12010 Ignore the @code{#ident} directive.
12012 @item -finhibit-size-directive
12013 @opindex finhibit-size-directive
12014 Don't output a @code{.size} assembler directive, or anything else that
12015 would cause trouble if the function is split in the middle, and the
12016 two halves are placed at locations far apart in memory.  This option is
12017 used when compiling @file{crtstuff.c}; you should not need to use it
12018 for anything else.
12020 @item -fverbose-asm
12021 @opindex fverbose-asm
12022 Put extra commentary information in the generated assembly code to
12023 make it more readable.  This option is generally only of use to those
12024 who actually need to read the generated assembly code (perhaps while
12025 debugging the compiler itself).
12027 @option{-fno-verbose-asm}, the default, causes the
12028 extra information to be omitted and is useful when comparing two assembler
12029 files.
12031 The added comments include:
12033 @itemize @bullet
12035 @item
12036 information on the compiler version and command-line options,
12038 @item
12039 the source code lines associated with the assembly instructions,
12040 in the form FILENAME:LINENUMBER:CONTENT OF LINE,
12042 @item
12043 hints on which high-level expressions correspond to
12044 the various assembly instruction operands.
12046 @end itemize
12048 For example, given this C source file:
12050 @smallexample
12051 int test (int n)
12053   int i;
12054   int total = 0;
12056   for (i = 0; i < n; i++)
12057     total += i * i;
12059   return total;
12061 @end smallexample
12063 compiling to (x86_64) assembly via @option{-S} and emitting the result
12064 direct to stdout via @option{-o} @option{-}
12066 @smallexample
12067 gcc -S test.c -fverbose-asm -Os -o -
12068 @end smallexample
12070 gives output similar to this:
12072 @smallexample
12073         .file   "test.c"
12074 # GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
12075   [...snip...]
12076 # options passed:
12077   [...snip...]
12079         .text
12080         .globl  test
12081         .type   test, @@function
12082 test:
12083 .LFB0:
12084         .cfi_startproc
12085 # test.c:4:   int total = 0;
12086         xorl    %eax, %eax      # <retval>
12087 # test.c:6:   for (i = 0; i < n; i++)
12088         xorl    %edx, %edx      # i
12089 .L2:
12090 # test.c:6:   for (i = 0; i < n; i++)
12091         cmpl    %edi, %edx      # n, i
12092         jge     .L5     #,
12093 # test.c:7:     total += i * i;
12094         movl    %edx, %ecx      # i, tmp92
12095         imull   %edx, %ecx      # i, tmp92
12096 # test.c:6:   for (i = 0; i < n; i++)
12097         incl    %edx    # i
12098 # test.c:7:     total += i * i;
12099         addl    %ecx, %eax      # tmp92, <retval>
12100         jmp     .L2     #
12101 .L5:
12102 # test.c:10: @}
12103         ret
12104         .cfi_endproc
12105 .LFE0:
12106         .size   test, .-test
12107         .ident  "GCC: (GNU) 7.0.0 20160809 (experimental)"
12108         .section        .note.GNU-stack,"",@@progbits
12109 @end smallexample
12111 The comments are intended for humans rather than machines and hence the
12112 precise format of the comments is subject to change.
12114 @item -frecord-gcc-switches
12115 @opindex frecord-gcc-switches
12116 This switch causes the command line used to invoke the
12117 compiler to be recorded into the object file that is being created.
12118 This switch is only implemented on some targets and the exact format
12119 of the recording is target and binary file format dependent, but it
12120 usually takes the form of a section containing ASCII text.  This
12121 switch is related to the @option{-fverbose-asm} switch, but that
12122 switch only records information in the assembler output file as
12123 comments, so it never reaches the object file.
12124 See also @option{-grecord-gcc-switches} for another
12125 way of storing compiler options into the object file.
12127 @item -fpic
12128 @opindex fpic
12129 @cindex global offset table
12130 @cindex PIC
12131 Generate position-independent code (PIC) suitable for use in a shared
12132 library, if supported for the target machine.  Such code accesses all
12133 constant addresses through a global offset table (GOT)@.  The dynamic
12134 loader resolves the GOT entries when the program starts (the dynamic
12135 loader is not part of GCC; it is part of the operating system).  If
12136 the GOT size for the linked executable exceeds a machine-specific
12137 maximum size, you get an error message from the linker indicating that
12138 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
12139 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
12140 on the m68k and RS/6000.  The x86 has no such limit.)
12142 Position-independent code requires special support, and therefore works
12143 only on certain machines.  For the x86, GCC supports PIC for System V
12144 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
12145 position-independent.
12147 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
12148 are defined to 1.
12150 @item -fPIC
12151 @opindex fPIC
12152 If supported for the target machine, emit position-independent code,
12153 suitable for dynamic linking and avoiding any limit on the size of the
12154 global offset table.  This option makes a difference on AArch64, m68k,
12155 PowerPC and SPARC@.
12157 Position-independent code requires special support, and therefore works
12158 only on certain machines.
12160 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
12161 are defined to 2.
12163 @item -fpie
12164 @itemx -fPIE
12165 @opindex fpie
12166 @opindex fPIE
12167 These options are similar to @option{-fpic} and @option{-fPIC}, but
12168 generated position independent code can be only linked into executables.
12169 Usually these options are used when @option{-pie} GCC option is
12170 used during linking.
12172 @option{-fpie} and @option{-fPIE} both define the macros
12173 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
12174 for @option{-fpie} and 2 for @option{-fPIE}.
12176 @item -fno-plt
12177 @opindex fno-plt
12178 Do not use the PLT for external function calls in position-independent code.
12179 Instead, load the callee address at call sites from the GOT and branch to it.
12180 This leads to more efficient code by eliminating PLT stubs and exposing
12181 GOT loads to optimizations.  On architectures such as 32-bit x86 where
12182 PLT stubs expect the GOT pointer in a specific register, this gives more
12183 register allocation freedom to the compiler.
12184 Lazy binding requires use of the PLT; 
12185 with @option{-fno-plt} all external symbols are resolved at load time.
12187 Alternatively, the function attribute @code{noplt} can be used to avoid calls
12188 through the PLT for specific external functions.
12190 In position-dependent code, a few targets also convert calls to
12191 functions that are marked to not use the PLT to use the GOT instead.
12193 @item -fno-jump-tables
12194 @opindex fno-jump-tables
12195 Do not use jump tables for switch statements even where it would be
12196 more efficient than other code generation strategies.  This option is
12197 of use in conjunction with @option{-fpic} or @option{-fPIC} for
12198 building code that forms part of a dynamic linker and cannot
12199 reference the address of a jump table.  On some targets, jump tables
12200 do not require a GOT and this option is not needed.
12202 @item -ffixed-@var{reg}
12203 @opindex ffixed
12204 Treat the register named @var{reg} as a fixed register; generated code
12205 should never refer to it (except perhaps as a stack pointer, frame
12206 pointer or in some other fixed role).
12208 @var{reg} must be the name of a register.  The register names accepted
12209 are machine-specific and are defined in the @code{REGISTER_NAMES}
12210 macro in the machine description macro file.
12212 This flag does not have a negative form, because it specifies a
12213 three-way choice.
12215 @item -fcall-used-@var{reg}
12216 @opindex fcall-used
12217 Treat the register named @var{reg} as an allocable register that is
12218 clobbered by function calls.  It may be allocated for temporaries or
12219 variables that do not live across a call.  Functions compiled this way
12220 do not save and restore the register @var{reg}.
12222 It is an error to use this flag with the frame pointer or stack pointer.
12223 Use of this flag for other registers that have fixed pervasive roles in
12224 the machine's execution model produces disastrous results.
12226 This flag does not have a negative form, because it specifies a
12227 three-way choice.
12229 @item -fcall-saved-@var{reg}
12230 @opindex fcall-saved
12231 Treat the register named @var{reg} as an allocable register saved by
12232 functions.  It may be allocated even for temporaries or variables that
12233 live across a call.  Functions compiled this way save and restore
12234 the register @var{reg} if they use it.
12236 It is an error to use this flag with the frame pointer or stack pointer.
12237 Use of this flag for other registers that have fixed pervasive roles in
12238 the machine's execution model produces disastrous results.
12240 A different sort of disaster results from the use of this flag for
12241 a register in which function values may be returned.
12243 This flag does not have a negative form, because it specifies a
12244 three-way choice.
12246 @item -fpack-struct[=@var{n}]
12247 @opindex fpack-struct
12248 Without a value specified, pack all structure members together without
12249 holes.  When a value is specified (which must be a small power of two), pack
12250 structure members according to this value, representing the maximum
12251 alignment (that is, objects with default alignment requirements larger than
12252 this are output potentially unaligned at the next fitting location.
12254 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
12255 code that is not binary compatible with code generated without that switch.
12256 Additionally, it makes the code suboptimal.
12257 Use it to conform to a non-default application binary interface.
12259 @item -fleading-underscore
12260 @opindex fleading-underscore
12261 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
12262 change the way C symbols are represented in the object file.  One use
12263 is to help link with legacy assembly code.
12265 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
12266 generate code that is not binary compatible with code generated without that
12267 switch.  Use it to conform to a non-default application binary interface.
12268 Not all targets provide complete support for this switch.
12270 @item -ftls-model=@var{model}
12271 @opindex ftls-model
12272 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
12273 The @var{model} argument should be one of @samp{global-dynamic},
12274 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
12275 Note that the choice is subject to optimization: the compiler may use
12276 a more efficient model for symbols not visible outside of the translation
12277 unit, or if @option{-fpic} is not given on the command line.
12279 The default without @option{-fpic} is @samp{initial-exec}; with
12280 @option{-fpic} the default is @samp{global-dynamic}.
12282 @item -ftrampolines
12283 @opindex ftrampolines
12284 For targets that normally need trampolines for nested functions, always
12285 generate them instead of using descriptors.  Otherwise, for targets that
12286 do not need them, like for example HP-PA or IA-64, do nothing.
12288 A trampoline is a small piece of code that is created at run time on the
12289 stack when the address of a nested function is taken, and is used to call
12290 the nested function indirectly.  Therefore, it requires the stack to be
12291 made executable in order for the program to work properly.
12293 @option{-fno-trampolines} is enabled by default on a language by language
12294 basis to let the compiler avoid generating them, if it computes that this
12295 is safe, and replace them with descriptors.  Descriptors are made up of data
12296 only, but the generated code must be prepared to deal with them.  As of this
12297 writing, @option{-fno-trampolines} is enabled by default only for Ada.
12299 Moreover, code compiled with @option{-ftrampolines} and code compiled with
12300 @option{-fno-trampolines} are not binary compatible if nested functions are
12301 present.  This option must therefore be used on a program-wide basis and be
12302 manipulated with extreme care.
12304 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
12305 @opindex fvisibility
12306 Set the default ELF image symbol visibility to the specified option---all
12307 symbols are marked with this unless overridden within the code.
12308 Using this feature can very substantially improve linking and
12309 load times of shared object libraries, produce more optimized
12310 code, provide near-perfect API export and prevent symbol clashes.
12311 It is @strong{strongly} recommended that you use this in any shared objects
12312 you distribute.
12314 Despite the nomenclature, @samp{default} always means public; i.e.,
12315 available to be linked against from outside the shared object.
12316 @samp{protected} and @samp{internal} are pretty useless in real-world
12317 usage so the only other commonly used option is @samp{hidden}.
12318 The default if @option{-fvisibility} isn't specified is
12319 @samp{default}, i.e., make every symbol public.
12321 A good explanation of the benefits offered by ensuring ELF
12322 symbols have the correct visibility is given by ``How To Write
12323 Shared Libraries'' by Ulrich Drepper (which can be found at
12324 @w{@uref{http://www.akkadia.org/drepper/}})---however a superior
12325 solution made possible by this option to marking things hidden when
12326 the default is public is to make the default hidden and mark things
12327 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
12328 and @code{__attribute__ ((visibility("default")))} instead of
12329 @code{__declspec(dllexport)} you get almost identical semantics with
12330 identical syntax.  This is a great boon to those working with
12331 cross-platform projects.
12333 For those adding visibility support to existing code, you may find
12334 @code{#pragma GCC visibility} of use.  This works by you enclosing
12335 the declarations you wish to set visibility for with (for example)
12336 @code{#pragma GCC visibility push(hidden)} and
12337 @code{#pragma GCC visibility pop}.
12338 Bear in mind that symbol visibility should be viewed @strong{as
12339 part of the API interface contract} and thus all new code should
12340 always specify visibility when it is not the default; i.e., declarations
12341 only for use within the local DSO should @strong{always} be marked explicitly
12342 as hidden as so to avoid PLT indirection overheads---making this
12343 abundantly clear also aids readability and self-documentation of the code.
12344 Note that due to ISO C++ specification requirements, @code{operator new} and
12345 @code{operator delete} must always be of default visibility.
12347 Be aware that headers from outside your project, in particular system
12348 headers and headers from any other library you use, may not be
12349 expecting to be compiled with visibility other than the default.  You
12350 may need to explicitly say @code{#pragma GCC visibility push(default)}
12351 before including any such headers.
12353 @code{extern} declarations are not affected by @option{-fvisibility}, so
12354 a lot of code can be recompiled with @option{-fvisibility=hidden} with
12355 no modifications.  However, this means that calls to @code{extern}
12356 functions with no explicit visibility use the PLT, so it is more
12357 effective to use @code{__attribute ((visibility))} and/or
12358 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
12359 declarations should be treated as hidden.
12361 Note that @option{-fvisibility} does affect C++ vague linkage
12362 entities. This means that, for instance, an exception class that is
12363 be thrown between DSOs must be explicitly marked with default
12364 visibility so that the @samp{type_info} nodes are unified between
12365 the DSOs.
12367 An overview of these techniques, their benefits and how to use them
12368 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
12370 @item -fstrict-volatile-bitfields
12371 @opindex fstrict-volatile-bitfields
12372 This option should be used if accesses to volatile bit-fields (or other
12373 structure fields, although the compiler usually honors those types
12374 anyway) should use a single access of the width of the
12375 field's type, aligned to a natural alignment if possible.  For
12376 example, targets with memory-mapped peripheral registers might require
12377 all such accesses to be 16 bits wide; with this flag you can
12378 declare all peripheral bit-fields as @code{unsigned short} (assuming short
12379 is 16 bits on these targets) to force GCC to use 16-bit accesses
12380 instead of, perhaps, a more efficient 32-bit access.
12382 If this option is disabled, the compiler uses the most efficient
12383 instruction.  In the previous example, that might be a 32-bit load
12384 instruction, even though that accesses bytes that do not contain
12385 any portion of the bit-field, or memory-mapped registers unrelated to
12386 the one being updated.
12388 In some cases, such as when the @code{packed} attribute is applied to a 
12389 structure field, it may not be possible to access the field with a single
12390 read or write that is correctly aligned for the target machine.  In this
12391 case GCC falls back to generating multiple accesses rather than code that 
12392 will fault or truncate the result at run time.
12394 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
12395 not allowed to touch non bit-field members.  It is therefore recommended
12396 to define all bits of the field's type as bit-field members.
12398 The default value of this option is determined by the application binary
12399 interface for the target processor.
12401 @item -fsync-libcalls
12402 @opindex fsync-libcalls
12403 This option controls whether any out-of-line instance of the @code{__sync}
12404 family of functions may be used to implement the C++11 @code{__atomic}
12405 family of functions.
12407 The default value of this option is enabled, thus the only useful form
12408 of the option is @option{-fno-sync-libcalls}.  This option is used in
12409 the implementation of the @file{libatomic} runtime library.
12411 @end table
12413 @node Developer Options
12414 @section GCC Developer Options
12415 @cindex developer options
12416 @cindex debugging GCC
12417 @cindex debug dump options
12418 @cindex dump options
12419 @cindex compilation statistics
12421 This section describes command-line options that are primarily of
12422 interest to GCC developers, including options to support compiler
12423 testing and investigation of compiler bugs and compile-time
12424 performance problems.  This includes options that produce debug dumps
12425 at various points in the compilation; that print statistics such as
12426 memory use and execution time; and that print information about GCC's
12427 configuration, such as where it searches for libraries.  You should
12428 rarely need to use any of these options for ordinary compilation and
12429 linking tasks.
12431 @table @gcctabopt
12433 @item -d@var{letters}
12434 @itemx -fdump-rtl-@var{pass}
12435 @itemx -fdump-rtl-@var{pass}=@var{filename}
12436 @opindex d
12437 @opindex fdump-rtl-@var{pass}
12438 Says to make debugging dumps during compilation at times specified by
12439 @var{letters}.  This is used for debugging the RTL-based passes of the
12440 compiler.  The file names for most of the dumps are made by appending
12441 a pass number and a word to the @var{dumpname}, and the files are
12442 created in the directory of the output file.  In case of
12443 @option{=@var{filename}} option, the dump is output on the given file
12444 instead of the pass numbered dump files.  Note that the pass number is
12445 assigned as passes are registered into the pass manager.  Most passes
12446 are registered in the order that they will execute and for these passes
12447 the number corresponds to the pass execution order.  However, passes
12448 registered by plugins, passes specific to compilation targets, or
12449 passes that are otherwise registered after all the other passes are
12450 numbered higher than a pass named "final", even if they are executed
12451 earlier.  @var{dumpname} is generated from the name of the output
12452 file if explicitly specified and not an executable, otherwise it is
12453 the basename of the source file.  These switches may have different
12454 effects when @option{-E} is used for preprocessing.
12456 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
12457 @option{-d} option @var{letters}.  Here are the possible
12458 letters for use in @var{pass} and @var{letters}, and their meanings:
12460 @table @gcctabopt
12462 @item -fdump-rtl-alignments
12463 @opindex fdump-rtl-alignments
12464 Dump after branch alignments have been computed.
12466 @item -fdump-rtl-asmcons
12467 @opindex fdump-rtl-asmcons
12468 Dump after fixing rtl statements that have unsatisfied in/out constraints.
12470 @item -fdump-rtl-auto_inc_dec
12471 @opindex fdump-rtl-auto_inc_dec
12472 Dump after auto-inc-dec discovery.  This pass is only run on
12473 architectures that have auto inc or auto dec instructions.
12475 @item -fdump-rtl-barriers
12476 @opindex fdump-rtl-barriers
12477 Dump after cleaning up the barrier instructions.
12479 @item -fdump-rtl-bbpart
12480 @opindex fdump-rtl-bbpart
12481 Dump after partitioning hot and cold basic blocks.
12483 @item -fdump-rtl-bbro
12484 @opindex fdump-rtl-bbro
12485 Dump after block reordering.
12487 @item -fdump-rtl-btl1
12488 @itemx -fdump-rtl-btl2
12489 @opindex fdump-rtl-btl2
12490 @opindex fdump-rtl-btl2
12491 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
12492 after the two branch
12493 target load optimization passes.
12495 @item -fdump-rtl-bypass
12496 @opindex fdump-rtl-bypass
12497 Dump after jump bypassing and control flow optimizations.
12499 @item -fdump-rtl-combine
12500 @opindex fdump-rtl-combine
12501 Dump after the RTL instruction combination pass.
12503 @item -fdump-rtl-compgotos
12504 @opindex fdump-rtl-compgotos
12505 Dump after duplicating the computed gotos.
12507 @item -fdump-rtl-ce1
12508 @itemx -fdump-rtl-ce2
12509 @itemx -fdump-rtl-ce3
12510 @opindex fdump-rtl-ce1
12511 @opindex fdump-rtl-ce2
12512 @opindex fdump-rtl-ce3
12513 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
12514 @option{-fdump-rtl-ce3} enable dumping after the three
12515 if conversion passes.
12517 @item -fdump-rtl-cprop_hardreg
12518 @opindex fdump-rtl-cprop_hardreg
12519 Dump after hard register copy propagation.
12521 @item -fdump-rtl-csa
12522 @opindex fdump-rtl-csa
12523 Dump after combining stack adjustments.
12525 @item -fdump-rtl-cse1
12526 @itemx -fdump-rtl-cse2
12527 @opindex fdump-rtl-cse1
12528 @opindex fdump-rtl-cse2
12529 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
12530 the two common subexpression elimination passes.
12532 @item -fdump-rtl-dce
12533 @opindex fdump-rtl-dce
12534 Dump after the standalone dead code elimination passes.
12536 @item -fdump-rtl-dbr
12537 @opindex fdump-rtl-dbr
12538 Dump after delayed branch scheduling.
12540 @item -fdump-rtl-dce1
12541 @itemx -fdump-rtl-dce2
12542 @opindex fdump-rtl-dce1
12543 @opindex fdump-rtl-dce2
12544 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
12545 the two dead store elimination passes.
12547 @item -fdump-rtl-eh
12548 @opindex fdump-rtl-eh
12549 Dump after finalization of EH handling code.
12551 @item -fdump-rtl-eh_ranges
12552 @opindex fdump-rtl-eh_ranges
12553 Dump after conversion of EH handling range regions.
12555 @item -fdump-rtl-expand
12556 @opindex fdump-rtl-expand
12557 Dump after RTL generation.
12559 @item -fdump-rtl-fwprop1
12560 @itemx -fdump-rtl-fwprop2
12561 @opindex fdump-rtl-fwprop1
12562 @opindex fdump-rtl-fwprop2
12563 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
12564 dumping after the two forward propagation passes.
12566 @item -fdump-rtl-gcse1
12567 @itemx -fdump-rtl-gcse2
12568 @opindex fdump-rtl-gcse1
12569 @opindex fdump-rtl-gcse2
12570 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
12571 after global common subexpression elimination.
12573 @item -fdump-rtl-init-regs
12574 @opindex fdump-rtl-init-regs
12575 Dump after the initialization of the registers.
12577 @item -fdump-rtl-initvals
12578 @opindex fdump-rtl-initvals
12579 Dump after the computation of the initial value sets.
12581 @item -fdump-rtl-into_cfglayout
12582 @opindex fdump-rtl-into_cfglayout
12583 Dump after converting to cfglayout mode.
12585 @item -fdump-rtl-ira
12586 @opindex fdump-rtl-ira
12587 Dump after iterated register allocation.
12589 @item -fdump-rtl-jump
12590 @opindex fdump-rtl-jump
12591 Dump after the second jump optimization.
12593 @item -fdump-rtl-loop2
12594 @opindex fdump-rtl-loop2
12595 @option{-fdump-rtl-loop2} enables dumping after the rtl
12596 loop optimization passes.
12598 @item -fdump-rtl-mach
12599 @opindex fdump-rtl-mach
12600 Dump after performing the machine dependent reorganization pass, if that
12601 pass exists.
12603 @item -fdump-rtl-mode_sw
12604 @opindex fdump-rtl-mode_sw
12605 Dump after removing redundant mode switches.
12607 @item -fdump-rtl-rnreg
12608 @opindex fdump-rtl-rnreg
12609 Dump after register renumbering.
12611 @item -fdump-rtl-outof_cfglayout
12612 @opindex fdump-rtl-outof_cfglayout
12613 Dump after converting from cfglayout mode.
12615 @item -fdump-rtl-peephole2
12616 @opindex fdump-rtl-peephole2
12617 Dump after the peephole pass.
12619 @item -fdump-rtl-postreload
12620 @opindex fdump-rtl-postreload
12621 Dump after post-reload optimizations.
12623 @item -fdump-rtl-pro_and_epilogue
12624 @opindex fdump-rtl-pro_and_epilogue
12625 Dump after generating the function prologues and epilogues.
12627 @item -fdump-rtl-sched1
12628 @itemx -fdump-rtl-sched2
12629 @opindex fdump-rtl-sched1
12630 @opindex fdump-rtl-sched2
12631 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
12632 after the basic block scheduling passes.
12634 @item -fdump-rtl-ree
12635 @opindex fdump-rtl-ree
12636 Dump after sign/zero extension elimination.
12638 @item -fdump-rtl-seqabstr
12639 @opindex fdump-rtl-seqabstr
12640 Dump after common sequence discovery.
12642 @item -fdump-rtl-shorten
12643 @opindex fdump-rtl-shorten
12644 Dump after shortening branches.
12646 @item -fdump-rtl-sibling
12647 @opindex fdump-rtl-sibling
12648 Dump after sibling call optimizations.
12650 @item -fdump-rtl-split1
12651 @itemx -fdump-rtl-split2
12652 @itemx -fdump-rtl-split3
12653 @itemx -fdump-rtl-split4
12654 @itemx -fdump-rtl-split5
12655 @opindex fdump-rtl-split1
12656 @opindex fdump-rtl-split2
12657 @opindex fdump-rtl-split3
12658 @opindex fdump-rtl-split4
12659 @opindex fdump-rtl-split5
12660 These options enable dumping after five rounds of
12661 instruction splitting.
12663 @item -fdump-rtl-sms
12664 @opindex fdump-rtl-sms
12665 Dump after modulo scheduling.  This pass is only run on some
12666 architectures.
12668 @item -fdump-rtl-stack
12669 @opindex fdump-rtl-stack
12670 Dump after conversion from GCC's ``flat register file'' registers to the
12671 x87's stack-like registers.  This pass is only run on x86 variants.
12673 @item -fdump-rtl-subreg1
12674 @itemx -fdump-rtl-subreg2
12675 @opindex fdump-rtl-subreg1
12676 @opindex fdump-rtl-subreg2
12677 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
12678 the two subreg expansion passes.
12680 @item -fdump-rtl-unshare
12681 @opindex fdump-rtl-unshare
12682 Dump after all rtl has been unshared.
12684 @item -fdump-rtl-vartrack
12685 @opindex fdump-rtl-vartrack
12686 Dump after variable tracking.
12688 @item -fdump-rtl-vregs
12689 @opindex fdump-rtl-vregs
12690 Dump after converting virtual registers to hard registers.
12692 @item -fdump-rtl-web
12693 @opindex fdump-rtl-web
12694 Dump after live range splitting.
12696 @item -fdump-rtl-regclass
12697 @itemx -fdump-rtl-subregs_of_mode_init
12698 @itemx -fdump-rtl-subregs_of_mode_finish
12699 @itemx -fdump-rtl-dfinit
12700 @itemx -fdump-rtl-dfinish
12701 @opindex fdump-rtl-regclass
12702 @opindex fdump-rtl-subregs_of_mode_init
12703 @opindex fdump-rtl-subregs_of_mode_finish
12704 @opindex fdump-rtl-dfinit
12705 @opindex fdump-rtl-dfinish
12706 These dumps are defined but always produce empty files.
12708 @item -da
12709 @itemx -fdump-rtl-all
12710 @opindex da
12711 @opindex fdump-rtl-all
12712 Produce all the dumps listed above.
12714 @item -dA
12715 @opindex dA
12716 Annotate the assembler output with miscellaneous debugging information.
12718 @item -dD
12719 @opindex dD
12720 Dump all macro definitions, at the end of preprocessing, in addition to
12721 normal output.
12723 @item -dH
12724 @opindex dH
12725 Produce a core dump whenever an error occurs.
12727 @item -dp
12728 @opindex dp
12729 Annotate the assembler output with a comment indicating which
12730 pattern and alternative is used.  The length of each instruction is
12731 also printed.
12733 @item -dP
12734 @opindex dP
12735 Dump the RTL in the assembler output as a comment before each instruction.
12736 Also turns on @option{-dp} annotation.
12738 @item -dx
12739 @opindex dx
12740 Just generate RTL for a function instead of compiling it.  Usually used
12741 with @option{-fdump-rtl-expand}.
12742 @end table
12744 @item -fdump-noaddr
12745 @opindex fdump-noaddr
12746 When doing debugging dumps, suppress address output.  This makes it more
12747 feasible to use diff on debugging dumps for compiler invocations with
12748 different compiler binaries and/or different
12749 text / bss / data / heap / stack / dso start locations.
12751 @item -freport-bug
12752 @opindex freport-bug
12753 Collect and dump debug information into a temporary file if an
12754 internal compiler error (ICE) occurs.
12756 @item -fdump-unnumbered
12757 @opindex fdump-unnumbered
12758 When doing debugging dumps, suppress instruction numbers and address output.
12759 This makes it more feasible to use diff on debugging dumps for compiler
12760 invocations with different options, in particular with and without
12761 @option{-g}.
12763 @item -fdump-unnumbered-links
12764 @opindex fdump-unnumbered-links
12765 When doing debugging dumps (see @option{-d} option above), suppress
12766 instruction numbers for the links to the previous and next instructions
12767 in a sequence.
12769 @item -fdump-translation-unit @r{(C++ only)}
12770 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
12771 @opindex fdump-translation-unit
12772 Dump a representation of the tree structure for the entire translation
12773 unit to a file.  The file name is made by appending @file{.tu} to the
12774 source file name, and the file is created in the same directory as the
12775 output file.  If the @samp{-@var{options}} form is used, @var{options}
12776 controls the details of the dump as described for the
12777 @option{-fdump-tree} options.
12779 @item -fdump-class-hierarchy @r{(C++ only)}
12780 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
12781 @opindex fdump-class-hierarchy
12782 Dump a representation of each class's hierarchy and virtual function
12783 table layout to a file.  The file name is made by appending
12784 @file{.class} to the source file name, and the file is created in the
12785 same directory as the output file.  If the @samp{-@var{options}} form
12786 is used, @var{options} controls the details of the dump as described
12787 for the @option{-fdump-tree} options.
12789 @item -fdump-ipa-@var{switch}
12790 @opindex fdump-ipa
12791 Control the dumping at various stages of inter-procedural analysis
12792 language tree to a file.  The file name is generated by appending a
12793 switch specific suffix to the source file name, and the file is created
12794 in the same directory as the output file.  The following dumps are
12795 possible:
12797 @table @samp
12798 @item all
12799 Enables all inter-procedural analysis dumps.
12801 @item cgraph
12802 Dumps information about call-graph optimization, unused function removal,
12803 and inlining decisions.
12805 @item inline
12806 Dump after function inlining.
12808 @end table
12810 @item -fdump-passes
12811 @opindex fdump-passes
12812 Dump the list of optimization passes that are turned on and off by
12813 the current command-line options.
12815 @item -fdump-statistics-@var{option}
12816 @opindex fdump-statistics
12817 Enable and control dumping of pass statistics in a separate file.  The
12818 file name is generated by appending a suffix ending in
12819 @samp{.statistics} to the source file name, and the file is created in
12820 the same directory as the output file.  If the @samp{-@var{option}}
12821 form is used, @samp{-stats} causes counters to be summed over the
12822 whole compilation unit while @samp{-details} dumps every event as
12823 the passes generate them.  The default with no option is to sum
12824 counters for each function compiled.
12826 @item -fdump-tree-@var{switch}
12827 @itemx -fdump-tree-@var{switch}-@var{options}
12828 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
12829 @opindex fdump-tree
12830 Control the dumping at various stages of processing the intermediate
12831 language tree to a file.  The file name is generated by appending a
12832 switch-specific suffix to the source file name, and the file is
12833 created in the same directory as the output file. In case of
12834 @option{=@var{filename}} option, the dump is output on the given file
12835 instead of the auto named dump files.  If the @samp{-@var{options}}
12836 form is used, @var{options} is a list of @samp{-} separated options
12837 which control the details of the dump.  Not all options are applicable
12838 to all dumps; those that are not meaningful are ignored.  The
12839 following options are available
12841 @table @samp
12842 @item address
12843 Print the address of each node.  Usually this is not meaningful as it
12844 changes according to the environment and source file.  Its primary use
12845 is for tying up a dump file with a debug environment.
12846 @item asmname
12847 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
12848 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
12849 use working backward from mangled names in the assembly file.
12850 @item slim
12851 When dumping front-end intermediate representations, inhibit dumping
12852 of members of a scope or body of a function merely because that scope
12853 has been reached.  Only dump such items when they are directly reachable
12854 by some other path.
12856 When dumping pretty-printed trees, this option inhibits dumping the
12857 bodies of control structures.
12859 When dumping RTL, print the RTL in slim (condensed) form instead of
12860 the default LISP-like representation.
12861 @item raw
12862 Print a raw representation of the tree.  By default, trees are
12863 pretty-printed into a C-like representation.
12864 @item details
12865 Enable more detailed dumps (not honored by every dump option). Also
12866 include information from the optimization passes.
12867 @item stats
12868 Enable dumping various statistics about the pass (not honored by every dump
12869 option).
12870 @item blocks
12871 Enable showing basic block boundaries (disabled in raw dumps).
12872 @item graph
12873 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
12874 dump a representation of the control flow graph suitable for viewing with
12875 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
12876 the file is pretty-printed as a subgraph, so that GraphViz can render them
12877 all in a single plot.
12879 This option currently only works for RTL dumps, and the RTL is always
12880 dumped in slim form.
12881 @item vops
12882 Enable showing virtual operands for every statement.
12883 @item lineno
12884 Enable showing line numbers for statements.
12885 @item uid
12886 Enable showing the unique ID (@code{DECL_UID}) for each variable.
12887 @item verbose
12888 Enable showing the tree dump for each statement.
12889 @item eh
12890 Enable showing the EH region number holding each statement.
12891 @item scev
12892 Enable showing scalar evolution analysis details.
12893 @item optimized
12894 Enable showing optimization information (only available in certain
12895 passes).
12896 @item missed
12897 Enable showing missed optimization information (only available in certain
12898 passes).
12899 @item note
12900 Enable other detailed optimization information (only available in
12901 certain passes).
12902 @item =@var{filename}
12903 Instead of an auto named dump file, output into the given file
12904 name. The file names @file{stdout} and @file{stderr} are treated
12905 specially and are considered already open standard streams. For
12906 example,
12908 @smallexample
12909 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
12910      -fdump-tree-pre=stderr file.c
12911 @end smallexample
12913 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
12914 output on to @file{stderr}. If two conflicting dump filenames are
12915 given for the same pass, then the latter option overrides the earlier
12916 one.
12918 @item split-paths
12919 @opindex fdump-tree-split-paths
12920 Dump each function after splitting paths to loop backedges.  The file
12921 name is made by appending @file{.split-paths} to the source file name.
12923 @item all
12924 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
12925 and @option{lineno}.
12927 @item optall
12928 Turn on all optimization options, i.e., @option{optimized},
12929 @option{missed}, and @option{note}.
12930 @end table
12932 The following tree dumps are possible:
12933 @table @samp
12935 @item original
12936 @opindex fdump-tree-original
12937 Dump before any tree based optimization, to @file{@var{file}.original}.
12939 @item optimized
12940 @opindex fdump-tree-optimized
12941 Dump after all tree based optimization, to @file{@var{file}.optimized}.
12943 @item gimple
12944 @opindex fdump-tree-gimple
12945 Dump each function before and after the gimplification pass to a file.  The
12946 file name is made by appending @file{.gimple} to the source file name.
12948 @item cfg
12949 @opindex fdump-tree-cfg
12950 Dump the control flow graph of each function to a file.  The file name is
12951 made by appending @file{.cfg} to the source file name.
12953 @item ch
12954 @opindex fdump-tree-ch
12955 Dump each function after copying loop headers.  The file name is made by
12956 appending @file{.ch} to the source file name.
12958 @item ssa
12959 @opindex fdump-tree-ssa
12960 Dump SSA related information to a file.  The file name is made by appending
12961 @file{.ssa} to the source file name.
12963 @item alias
12964 @opindex fdump-tree-alias
12965 Dump aliasing information for each function.  The file name is made by
12966 appending @file{.alias} to the source file name.
12968 @item ccp
12969 @opindex fdump-tree-ccp
12970 Dump each function after CCP@.  The file name is made by appending
12971 @file{.ccp} to the source file name.
12973 @item storeccp
12974 @opindex fdump-tree-storeccp
12975 Dump each function after STORE-CCP@.  The file name is made by appending
12976 @file{.storeccp} to the source file name.
12978 @item pre
12979 @opindex fdump-tree-pre
12980 Dump trees after partial redundancy elimination and/or code hoisting.
12981 The file name is made by appending @file{.pre} to the source file name.
12983 @item fre
12984 @opindex fdump-tree-fre
12985 Dump trees after full redundancy elimination.  The file name is made
12986 by appending @file{.fre} to the source file name.
12988 @item copyprop
12989 @opindex fdump-tree-copyprop
12990 Dump trees after copy propagation.  The file name is made
12991 by appending @file{.copyprop} to the source file name.
12993 @item store_copyprop
12994 @opindex fdump-tree-store_copyprop
12995 Dump trees after store copy-propagation.  The file name is made
12996 by appending @file{.store_copyprop} to the source file name.
12998 @item dce
12999 @opindex fdump-tree-dce
13000 Dump each function after dead code elimination.  The file name is made by
13001 appending @file{.dce} to the source file name.
13003 @item sra
13004 @opindex fdump-tree-sra
13005 Dump each function after performing scalar replacement of aggregates.  The
13006 file name is made by appending @file{.sra} to the source file name.
13008 @item sink
13009 @opindex fdump-tree-sink
13010 Dump each function after performing code sinking.  The file name is made
13011 by appending @file{.sink} to the source file name.
13013 @item dom
13014 @opindex fdump-tree-dom
13015 Dump each function after applying dominator tree optimizations.  The file
13016 name is made by appending @file{.dom} to the source file name.
13018 @item dse
13019 @opindex fdump-tree-dse
13020 Dump each function after applying dead store elimination.  The file
13021 name is made by appending @file{.dse} to the source file name.
13023 @item phiopt
13024 @opindex fdump-tree-phiopt
13025 Dump each function after optimizing PHI nodes into straightline code.  The file
13026 name is made by appending @file{.phiopt} to the source file name.
13028 @item backprop
13029 @opindex fdump-tree-backprop
13030 Dump each function after back-propagating use information up the definition
13031 chain.  The file name is made by appending @file{.backprop} to the
13032 source file name.
13034 @item forwprop
13035 @opindex fdump-tree-forwprop
13036 Dump each function after forward propagating single use variables.  The file
13037 name is made by appending @file{.forwprop} to the source file name.
13039 @item nrv
13040 @opindex fdump-tree-nrv
13041 Dump each function after applying the named return value optimization on
13042 generic trees.  The file name is made by appending @file{.nrv} to the source
13043 file name.
13045 @item vect
13046 @opindex fdump-tree-vect
13047 Dump each function after applying vectorization of loops.  The file name is
13048 made by appending @file{.vect} to the source file name.
13050 @item slp
13051 @opindex fdump-tree-slp
13052 Dump each function after applying vectorization of basic blocks.  The file name
13053 is made by appending @file{.slp} to the source file name.
13055 @item vrp
13056 @opindex fdump-tree-vrp
13057 Dump each function after Value Range Propagation (VRP).  The file name
13058 is made by appending @file{.vrp} to the source file name.
13060 @item early vrp
13061 @opindex fdump-tree-evrp
13062 Dump each function after Early Value Range Propagation (EVRP).  The file name
13063 is made by appending @file{.evrp} to the source file name.
13065 @item oaccdevlow
13066 @opindex fdump-tree-oaccdevlow
13067 Dump each function after applying device-specific OpenACC transformations.
13068 The file name is made by appending @file{.oaccdevlow} to the source file name.
13070 @item all
13071 @opindex fdump-tree-all
13072 Enable all the available tree dumps with the flags provided in this option.
13073 @end table
13075 @item -fopt-info
13076 @itemx -fopt-info-@var{options}
13077 @itemx -fopt-info-@var{options}=@var{filename}
13078 @opindex fopt-info
13079 Controls optimization dumps from various optimization passes. If the
13080 @samp{-@var{options}} form is used, @var{options} is a list of
13081 @samp{-} separated option keywords to select the dump details and
13082 optimizations.  
13084 The @var{options} can be divided into two groups: options describing the
13085 verbosity of the dump, and options describing which optimizations
13086 should be included. The options from both the groups can be freely
13087 mixed as they are non-overlapping. However, in case of any conflicts,
13088 the later options override the earlier options on the command
13089 line. 
13091 The following options control the dump verbosity:
13093 @table @samp
13094 @item optimized
13095 Print information when an optimization is successfully applied. It is
13096 up to a pass to decide which information is relevant. For example, the
13097 vectorizer passes print the source location of loops which are
13098 successfully vectorized.
13099 @item missed
13100 Print information about missed optimizations. Individual passes
13101 control which information to include in the output. 
13102 @item note
13103 Print verbose information about optimizations, such as certain
13104 transformations, more detailed messages about decisions etc.
13105 @item all
13106 Print detailed optimization information. This includes
13107 @samp{optimized}, @samp{missed}, and @samp{note}.
13108 @end table
13110 One or more of the following option keywords can be used to describe a
13111 group of optimizations:
13113 @table @samp
13114 @item ipa
13115 Enable dumps from all interprocedural optimizations.
13116 @item loop
13117 Enable dumps from all loop optimizations.
13118 @item inline
13119 Enable dumps from all inlining optimizations.
13120 @item vec
13121 Enable dumps from all vectorization optimizations.
13122 @item optall
13123 Enable dumps from all optimizations. This is a superset of
13124 the optimization groups listed above.
13125 @end table
13127 If @var{options} is
13128 omitted, it defaults to @samp{optimized-optall}, which means to dump all
13129 info about successful optimizations from all the passes.  
13131 If the @var{filename} is provided, then the dumps from all the
13132 applicable optimizations are concatenated into the @var{filename}.
13133 Otherwise the dump is output onto @file{stderr}. Though multiple
13134 @option{-fopt-info} options are accepted, only one of them can include
13135 a @var{filename}. If other filenames are provided then all but the
13136 first such option are ignored.
13138 Note that the output @var{filename} is overwritten
13139 in case of multiple translation units. If a combined output from
13140 multiple translation units is desired, @file{stderr} should be used
13141 instead.
13143 In the following example, the optimization info is output to
13144 @file{stderr}:
13146 @smallexample
13147 gcc -O3 -fopt-info
13148 @end smallexample
13150 This example:
13151 @smallexample
13152 gcc -O3 -fopt-info-missed=missed.all
13153 @end smallexample
13155 @noindent
13156 outputs missed optimization report from all the passes into
13157 @file{missed.all}, and this one:
13159 @smallexample
13160 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
13161 @end smallexample
13163 @noindent
13164 prints information about missed optimization opportunities from
13165 vectorization passes on @file{stderr}.  
13166 Note that @option{-fopt-info-vec-missed} is equivalent to 
13167 @option{-fopt-info-missed-vec}.
13169 As another example,
13170 @smallexample
13171 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
13172 @end smallexample
13174 @noindent
13175 outputs information about missed optimizations as well as
13176 optimized locations from all the inlining passes into
13177 @file{inline.txt}.
13179 Finally, consider:
13181 @smallexample
13182 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
13183 @end smallexample
13185 @noindent
13186 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
13187 in conflict since only one output file is allowed. In this case, only
13188 the first option takes effect and the subsequent options are
13189 ignored. Thus only @file{vec.miss} is produced which contains
13190 dumps from the vectorizer about missed opportunities.
13192 @item -fsched-verbose=@var{n}
13193 @opindex fsched-verbose
13194 On targets that use instruction scheduling, this option controls the
13195 amount of debugging output the scheduler prints to the dump files.
13197 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
13198 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
13199 For @var{n} greater than one, it also output basic block probabilities,
13200 detailed ready list information and unit/insn info.  For @var{n} greater
13201 than two, it includes RTL at abort point, control-flow and regions info.
13202 And for @var{n} over four, @option{-fsched-verbose} also includes
13203 dependence info.
13207 @item -fenable-@var{kind}-@var{pass}
13208 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
13209 @opindex fdisable-
13210 @opindex fenable-
13212 This is a set of options that are used to explicitly disable/enable
13213 optimization passes.  These options are intended for use for debugging GCC.
13214 Compiler users should use regular options for enabling/disabling
13215 passes instead.
13217 @table @gcctabopt
13219 @item -fdisable-ipa-@var{pass}
13220 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
13221 statically invoked in the compiler multiple times, the pass name should be
13222 appended with a sequential number starting from 1.
13224 @item -fdisable-rtl-@var{pass}
13225 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
13226 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
13227 statically invoked in the compiler multiple times, the pass name should be
13228 appended with a sequential number starting from 1.  @var{range-list} is a 
13229 comma-separated list of function ranges or assembler names.  Each range is a number
13230 pair separated by a colon.  The range is inclusive in both ends.  If the range
13231 is trivial, the number pair can be simplified as a single number.  If the
13232 function's call graph node's @var{uid} falls within one of the specified ranges,
13233 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
13234 function header of a dump file, and the pass names can be dumped by using
13235 option @option{-fdump-passes}.
13237 @item -fdisable-tree-@var{pass}
13238 @itemx -fdisable-tree-@var{pass}=@var{range-list}
13239 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
13240 option arguments.
13242 @item -fenable-ipa-@var{pass}
13243 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
13244 statically invoked in the compiler multiple times, the pass name should be
13245 appended with a sequential number starting from 1.
13247 @item -fenable-rtl-@var{pass}
13248 @itemx -fenable-rtl-@var{pass}=@var{range-list}
13249 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
13250 description and examples.
13252 @item -fenable-tree-@var{pass}
13253 @itemx -fenable-tree-@var{pass}=@var{range-list}
13254 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
13255 of option arguments.
13257 @end table
13259 Here are some examples showing uses of these options.
13261 @smallexample
13263 # disable ccp1 for all functions
13264    -fdisable-tree-ccp1
13265 # disable complete unroll for function whose cgraph node uid is 1
13266    -fenable-tree-cunroll=1
13267 # disable gcse2 for functions at the following ranges [1,1],
13268 # [300,400], and [400,1000]
13269 # disable gcse2 for functions foo and foo2
13270    -fdisable-rtl-gcse2=foo,foo2
13271 # disable early inlining
13272    -fdisable-tree-einline
13273 # disable ipa inlining
13274    -fdisable-ipa-inline
13275 # enable tree full unroll
13276    -fenable-tree-unroll
13278 @end smallexample
13280 @item -fchecking
13281 @itemx -fchecking=@var{n}
13282 @opindex fchecking
13283 @opindex fno-checking
13284 Enable internal consistency checking.  The default depends on
13285 the compiler configuration.  @option{-fchecking=2} enables further
13286 internal consistency checking that might affect code generation.
13288 @item -frandom-seed=@var{string}
13289 @opindex frandom-seed
13290 This option provides a seed that GCC uses in place of
13291 random numbers in generating certain symbol names
13292 that have to be different in every compiled file.  It is also used to
13293 place unique stamps in coverage data files and the object files that
13294 produce them.  You can use the @option{-frandom-seed} option to produce
13295 reproducibly identical object files.
13297 The @var{string} can either be a number (decimal, octal or hex) or an
13298 arbitrary string (in which case it's converted to a number by
13299 computing CRC32).
13301 The @var{string} should be different for every file you compile.
13303 @item -save-temps
13304 @itemx -save-temps=cwd
13305 @opindex save-temps
13306 Store the usual ``temporary'' intermediate files permanently; place them
13307 in the current directory and name them based on the source file.  Thus,
13308 compiling @file{foo.c} with @option{-c -save-temps} produces files
13309 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
13310 preprocessed @file{foo.i} output file even though the compiler now
13311 normally uses an integrated preprocessor.
13313 When used in combination with the @option{-x} command-line option,
13314 @option{-save-temps} is sensible enough to avoid over writing an
13315 input source file with the same extension as an intermediate file.
13316 The corresponding intermediate file may be obtained by renaming the
13317 source file before using @option{-save-temps}.
13319 If you invoke GCC in parallel, compiling several different source
13320 files that share a common base name in different subdirectories or the
13321 same source file compiled for multiple output destinations, it is
13322 likely that the different parallel compilers will interfere with each
13323 other, and overwrite the temporary files.  For instance:
13325 @smallexample
13326 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
13327 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
13328 @end smallexample
13330 may result in @file{foo.i} and @file{foo.o} being written to
13331 simultaneously by both compilers.
13333 @item -save-temps=obj
13334 @opindex save-temps=obj
13335 Store the usual ``temporary'' intermediate files permanently.  If the
13336 @option{-o} option is used, the temporary files are based on the
13337 object file.  If the @option{-o} option is not used, the
13338 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
13340 For example:
13342 @smallexample
13343 gcc -save-temps=obj -c foo.c
13344 gcc -save-temps=obj -c bar.c -o dir/xbar.o
13345 gcc -save-temps=obj foobar.c -o dir2/yfoobar
13346 @end smallexample
13348 @noindent
13349 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
13350 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
13351 @file{dir2/yfoobar.o}.
13353 @item -time@r{[}=@var{file}@r{]}
13354 @opindex time
13355 Report the CPU time taken by each subprocess in the compilation
13356 sequence.  For C source files, this is the compiler proper and assembler
13357 (plus the linker if linking is done).
13359 Without the specification of an output file, the output looks like this:
13361 @smallexample
13362 # cc1 0.12 0.01
13363 # as 0.00 0.01
13364 @end smallexample
13366 The first number on each line is the ``user time'', that is time spent
13367 executing the program itself.  The second number is ``system time'',
13368 time spent executing operating system routines on behalf of the program.
13369 Both numbers are in seconds.
13371 With the specification of an output file, the output is appended to the
13372 named file, and it looks like this:
13374 @smallexample
13375 0.12 0.01 cc1 @var{options}
13376 0.00 0.01 as @var{options}
13377 @end smallexample
13379 The ``user time'' and the ``system time'' are moved before the program
13380 name, and the options passed to the program are displayed, so that one
13381 can later tell what file was being compiled, and with which options.
13383 @item -fdump-final-insns@r{[}=@var{file}@r{]}
13384 @opindex fdump-final-insns
13385 Dump the final internal representation (RTL) to @var{file}.  If the
13386 optional argument is omitted (or if @var{file} is @code{.}), the name
13387 of the dump file is determined by appending @code{.gkd} to the
13388 compilation output file name.
13390 @item -fcompare-debug@r{[}=@var{opts}@r{]}
13391 @opindex fcompare-debug
13392 @opindex fno-compare-debug
13393 If no error occurs during compilation, run the compiler a second time,
13394 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
13395 passed to the second compilation.  Dump the final internal
13396 representation in both compilations, and print an error if they differ.
13398 If the equal sign is omitted, the default @option{-gtoggle} is used.
13400 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
13401 and nonzero, implicitly enables @option{-fcompare-debug}.  If
13402 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
13403 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
13404 is used.
13406 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
13407 is equivalent to @option{-fno-compare-debug}, which disables the dumping
13408 of the final representation and the second compilation, preventing even
13409 @env{GCC_COMPARE_DEBUG} from taking effect.
13411 To verify full coverage during @option{-fcompare-debug} testing, set
13412 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
13413 which GCC rejects as an invalid option in any actual compilation
13414 (rather than preprocessing, assembly or linking).  To get just a
13415 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
13416 not overridden} will do.
13418 @item -fcompare-debug-second
13419 @opindex fcompare-debug-second
13420 This option is implicitly passed to the compiler for the second
13421 compilation requested by @option{-fcompare-debug}, along with options to
13422 silence warnings, and omitting other options that would cause
13423 side-effect compiler outputs to files or to the standard output.  Dump
13424 files and preserved temporary files are renamed so as to contain the
13425 @code{.gk} additional extension during the second compilation, to avoid
13426 overwriting those generated by the first.
13428 When this option is passed to the compiler driver, it causes the
13429 @emph{first} compilation to be skipped, which makes it useful for little
13430 other than debugging the compiler proper.
13432 @item -gtoggle
13433 @opindex gtoggle
13434 Turn off generation of debug info, if leaving out this option
13435 generates it, or turn it on at level 2 otherwise.  The position of this
13436 argument in the command line does not matter; it takes effect after all
13437 other options are processed, and it does so only once, no matter how
13438 many times it is given.  This is mainly intended to be used with
13439 @option{-fcompare-debug}.
13441 @item -fvar-tracking-assignments-toggle
13442 @opindex fvar-tracking-assignments-toggle
13443 @opindex fno-var-tracking-assignments-toggle
13444 Toggle @option{-fvar-tracking-assignments}, in the same way that
13445 @option{-gtoggle} toggles @option{-g}.
13447 @item -Q
13448 @opindex Q
13449 Makes the compiler print out each function name as it is compiled, and
13450 print some statistics about each pass when it finishes.
13452 @item -ftime-report
13453 @opindex ftime-report
13454 Makes the compiler print some statistics about the time consumed by each
13455 pass when it finishes.
13457 @item -ftime-report-details
13458 @opindex ftime-report-details
13459 Record the time consumed by infrastructure parts separately for each pass.
13461 @item -fira-verbose=@var{n}
13462 @opindex fira-verbose
13463 Control the verbosity of the dump file for the integrated register allocator.
13464 The default value is 5.  If the value @var{n} is greater or equal to 10,
13465 the dump output is sent to stderr using the same format as @var{n} minus 10.
13467 @item -flto-report
13468 @opindex flto-report
13469 Prints a report with internal details on the workings of the link-time
13470 optimizer.  The contents of this report vary from version to version.
13471 It is meant to be useful to GCC developers when processing object
13472 files in LTO mode (via @option{-flto}).
13474 Disabled by default.
13476 @item -flto-report-wpa
13477 @opindex flto-report-wpa
13478 Like @option{-flto-report}, but only print for the WPA phase of Link
13479 Time Optimization.
13481 @item -fmem-report
13482 @opindex fmem-report
13483 Makes the compiler print some statistics about permanent memory
13484 allocation when it finishes.
13486 @item -fmem-report-wpa
13487 @opindex fmem-report-wpa
13488 Makes the compiler print some statistics about permanent memory
13489 allocation for the WPA phase only.
13491 @item -fpre-ipa-mem-report
13492 @opindex fpre-ipa-mem-report
13493 @item -fpost-ipa-mem-report
13494 @opindex fpost-ipa-mem-report
13495 Makes the compiler print some statistics about permanent memory
13496 allocation before or after interprocedural optimization.
13498 @item -fprofile-report
13499 @opindex fprofile-report
13500 Makes the compiler print some statistics about consistency of the
13501 (estimated) profile and effect of individual passes.
13503 @item -fstack-usage
13504 @opindex fstack-usage
13505 Makes the compiler output stack usage information for the program, on a
13506 per-function basis.  The filename for the dump is made by appending
13507 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
13508 the output file, if explicitly specified and it is not an executable,
13509 otherwise it is the basename of the source file.  An entry is made up
13510 of three fields:
13512 @itemize
13513 @item
13514 The name of the function.
13515 @item
13516 A number of bytes.
13517 @item
13518 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
13519 @end itemize
13521 The qualifier @code{static} means that the function manipulates the stack
13522 statically: a fixed number of bytes are allocated for the frame on function
13523 entry and released on function exit; no stack adjustments are otherwise made
13524 in the function.  The second field is this fixed number of bytes.
13526 The qualifier @code{dynamic} means that the function manipulates the stack
13527 dynamically: in addition to the static allocation described above, stack
13528 adjustments are made in the body of the function, for example to push/pop
13529 arguments around function calls.  If the qualifier @code{bounded} is also
13530 present, the amount of these adjustments is bounded at compile time and
13531 the second field is an upper bound of the total amount of stack used by
13532 the function.  If it is not present, the amount of these adjustments is
13533 not bounded at compile time and the second field only represents the
13534 bounded part.
13536 @item -fstats
13537 @opindex fstats
13538 Emit statistics about front-end processing at the end of the compilation.
13539 This option is supported only by the C++ front end, and
13540 the information is generally only useful to the G++ development team.
13542 @item -fdbg-cnt-list
13543 @opindex fdbg-cnt-list
13544 Print the name and the counter upper bound for all debug counters.
13547 @item -fdbg-cnt=@var{counter-value-list}
13548 @opindex fdbg-cnt
13549 Set the internal debug counter upper bound.  @var{counter-value-list}
13550 is a comma-separated list of @var{name}:@var{value} pairs
13551 which sets the upper bound of each debug counter @var{name} to @var{value}.
13552 All debug counters have the initial upper bound of @code{UINT_MAX};
13553 thus @code{dbg_cnt} returns true always unless the upper bound
13554 is set by this option.
13555 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
13556 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
13558 @item -print-file-name=@var{library}
13559 @opindex print-file-name
13560 Print the full absolute name of the library file @var{library} that
13561 would be used when linking---and don't do anything else.  With this
13562 option, GCC does not compile or link anything; it just prints the
13563 file name.
13565 @item -print-multi-directory
13566 @opindex print-multi-directory
13567 Print the directory name corresponding to the multilib selected by any
13568 other switches present in the command line.  This directory is supposed
13569 to exist in @env{GCC_EXEC_PREFIX}.
13571 @item -print-multi-lib
13572 @opindex print-multi-lib
13573 Print the mapping from multilib directory names to compiler switches
13574 that enable them.  The directory name is separated from the switches by
13575 @samp{;}, and each switch starts with an @samp{@@} instead of the
13576 @samp{-}, without spaces between multiple switches.  This is supposed to
13577 ease shell processing.
13579 @item -print-multi-os-directory
13580 @opindex print-multi-os-directory
13581 Print the path to OS libraries for the selected
13582 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
13583 present in the @file{lib} subdirectory and no multilibs are used, this is
13584 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
13585 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
13586 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
13587 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
13589 @item -print-multiarch
13590 @opindex print-multiarch
13591 Print the path to OS libraries for the selected multiarch,
13592 relative to some @file{lib} subdirectory.
13594 @item -print-prog-name=@var{program}
13595 @opindex print-prog-name
13596 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
13598 @item -print-libgcc-file-name
13599 @opindex print-libgcc-file-name
13600 Same as @option{-print-file-name=libgcc.a}.
13602 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
13603 but you do want to link with @file{libgcc.a}.  You can do:
13605 @smallexample
13606 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
13607 @end smallexample
13609 @item -print-search-dirs
13610 @opindex print-search-dirs
13611 Print the name of the configured installation directory and a list of
13612 program and library directories @command{gcc} searches---and don't do anything else.
13614 This is useful when @command{gcc} prints the error message
13615 @samp{installation problem, cannot exec cpp0: No such file or directory}.
13616 To resolve this you either need to put @file{cpp0} and the other compiler
13617 components where @command{gcc} expects to find them, or you can set the environment
13618 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
13619 Don't forget the trailing @samp{/}.
13620 @xref{Environment Variables}.
13622 @item -print-sysroot
13623 @opindex print-sysroot
13624 Print the target sysroot directory that is used during
13625 compilation.  This is the target sysroot specified either at configure
13626 time or using the @option{--sysroot} option, possibly with an extra
13627 suffix that depends on compilation options.  If no target sysroot is
13628 specified, the option prints nothing.
13630 @item -print-sysroot-headers-suffix
13631 @opindex print-sysroot-headers-suffix
13632 Print the suffix added to the target sysroot when searching for
13633 headers, or give an error if the compiler is not configured with such
13634 a suffix---and don't do anything else.
13636 @item -dumpmachine
13637 @opindex dumpmachine
13638 Print the compiler's target machine (for example,
13639 @samp{i686-pc-linux-gnu})---and don't do anything else.
13641 @item -dumpversion
13642 @opindex dumpversion
13643 Print the compiler version (for example, @code{3.0})---and don't do
13644 anything else.
13646 @item -dumpspecs
13647 @opindex dumpspecs
13648 Print the compiler's built-in specs---and don't do anything else.  (This
13649 is used when GCC itself is being built.)  @xref{Spec Files}.
13650 @end table
13652 @node Submodel Options
13653 @section Machine-Dependent Options
13654 @cindex submodel options
13655 @cindex specifying hardware config
13656 @cindex hardware models and configurations, specifying
13657 @cindex target-dependent options
13658 @cindex machine-dependent options
13660 Each target machine supported by GCC can have its own options---for
13661 example, to allow you to compile for a particular processor variant or
13662 ABI, or to control optimizations specific to that machine.  By
13663 convention, the names of machine-specific options start with
13664 @samp{-m}.
13666 Some configurations of the compiler also support additional target-specific
13667 options, usually for compatibility with other compilers on the same
13668 platform.
13670 @c This list is ordered alphanumerically by subsection name.
13671 @c It should be the same order and spelling as these options are listed
13672 @c in Machine Dependent Options
13674 @menu
13675 * AArch64 Options::
13676 * Adapteva Epiphany Options::
13677 * ARC Options::
13678 * ARM Options::
13679 * AVR Options::
13680 * Blackfin Options::
13681 * C6X Options::
13682 * CRIS Options::
13683 * CR16 Options::
13684 * Darwin Options::
13685 * DEC Alpha Options::
13686 * FR30 Options::
13687 * FT32 Options::
13688 * FRV Options::
13689 * GNU/Linux Options::
13690 * H8/300 Options::
13691 * HPPA Options::
13692 * IA-64 Options::
13693 * LM32 Options::
13694 * M32C Options::
13695 * M32R/D Options::
13696 * M680x0 Options::
13697 * MCore Options::
13698 * MeP Options::
13699 * MicroBlaze Options::
13700 * MIPS Options::
13701 * MMIX Options::
13702 * MN10300 Options::
13703 * Moxie Options::
13704 * MSP430 Options::
13705 * NDS32 Options::
13706 * Nios II Options::
13707 * Nvidia PTX Options::
13708 * PDP-11 Options::
13709 * picoChip Options::
13710 * PowerPC Options::
13711 * RL78 Options::
13712 * RS/6000 and PowerPC Options::
13713 * RX Options::
13714 * S/390 and zSeries Options::
13715 * Score Options::
13716 * SH Options::
13717 * Solaris 2 Options::
13718 * SPARC Options::
13719 * SPU Options::
13720 * System V Options::
13721 * TILE-Gx Options::
13722 * TILEPro Options::
13723 * V850 Options::
13724 * VAX Options::
13725 * Visium Options::
13726 * VMS Options::
13727 * VxWorks Options::
13728 * x86 Options::
13729 * x86 Windows Options::
13730 * Xstormy16 Options::
13731 * Xtensa Options::
13732 * zSeries Options::
13733 @end menu
13735 @node AArch64 Options
13736 @subsection AArch64 Options
13737 @cindex AArch64 Options
13739 These options are defined for AArch64 implementations:
13741 @table @gcctabopt
13743 @item -mabi=@var{name}
13744 @opindex mabi
13745 Generate code for the specified data model.  Permissible values
13746 are @samp{ilp32} for SysV-like data model where int, long int and pointers
13747 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
13748 but long int and pointers are 64 bits.
13750 The default depends on the specific target configuration.  Note that
13751 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
13752 entire program with the same ABI, and link with a compatible set of libraries.
13754 @item -mbig-endian
13755 @opindex mbig-endian
13756 Generate big-endian code.  This is the default when GCC is configured for an
13757 @samp{aarch64_be-*-*} target.
13759 @item -mgeneral-regs-only
13760 @opindex mgeneral-regs-only
13761 Generate code which uses only the general-purpose registers.  This will prevent
13762 the compiler from using floating-point and Advanced SIMD registers but will not
13763 impose any restrictions on the assembler.
13765 @item -mlittle-endian
13766 @opindex mlittle-endian
13767 Generate little-endian code.  This is the default when GCC is configured for an
13768 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
13770 @item -mcmodel=tiny
13771 @opindex mcmodel=tiny
13772 Generate code for the tiny code model.  The program and its statically defined
13773 symbols must be within 1MB of each other.  Programs can be statically or
13774 dynamically linked.
13776 @item -mcmodel=small
13777 @opindex mcmodel=small
13778 Generate code for the small code model.  The program and its statically defined
13779 symbols must be within 4GB of each other.  Programs can be statically or
13780 dynamically linked.  This is the default code model.
13782 @item -mcmodel=large
13783 @opindex mcmodel=large
13784 Generate code for the large code model.  This makes no assumptions about
13785 addresses and sizes of sections.  Programs can be statically linked only.
13787 @item -mstrict-align
13788 @opindex mstrict-align
13789 Avoid generating memory accesses that may not be aligned on a natural object
13790 boundary as described in the architecture specification.
13792 @item -momit-leaf-frame-pointer
13793 @itemx -mno-omit-leaf-frame-pointer
13794 @opindex momit-leaf-frame-pointer
13795 @opindex mno-omit-leaf-frame-pointer
13796 Omit or keep the frame pointer in leaf functions.  The former behavior is the
13797 default.
13799 @item -mtls-dialect=desc
13800 @opindex mtls-dialect=desc
13801 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
13802 of TLS variables.  This is the default.
13804 @item -mtls-dialect=traditional
13805 @opindex mtls-dialect=traditional
13806 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
13807 of TLS variables.
13809 @item -mtls-size=@var{size}
13810 @opindex mtls-size
13811 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
13812 This option requires binutils 2.26 or newer.
13814 @item -mfix-cortex-a53-835769
13815 @itemx -mno-fix-cortex-a53-835769
13816 @opindex mfix-cortex-a53-835769
13817 @opindex mno-fix-cortex-a53-835769
13818 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
13819 This involves inserting a NOP instruction between memory instructions and
13820 64-bit integer multiply-accumulate instructions.
13822 @item -mfix-cortex-a53-843419
13823 @itemx -mno-fix-cortex-a53-843419
13824 @opindex mfix-cortex-a53-843419
13825 @opindex mno-fix-cortex-a53-843419
13826 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
13827 This erratum workaround is made at link time and this will only pass the
13828 corresponding flag to the linker.
13830 @item -mlow-precision-recip-sqrt
13831 @item -mno-low-precision-recip-sqrt
13832 @opindex mlow-precision-recip-sqrt
13833 @opindex mno-low-precision-recip-sqrt
13834 Enable or disable the reciprocal square root approximation.
13835 This option only has an effect if @option{-ffast-math} or
13836 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
13837 precision of reciprocal square root results to about 16 bits for
13838 single precision and to 32 bits for double precision.
13840 @item -mlow-precision-sqrt
13841 @item -mno-low-precision-sqrt
13842 @opindex -mlow-precision-sqrt
13843 @opindex -mno-low-precision-sqrt
13844 Enable or disable the square root approximation.
13845 This option only has an effect if @option{-ffast-math} or
13846 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
13847 precision of square root results to about 16 bits for
13848 single precision and to 32 bits for double precision.
13849 If enabled, it implies @option{-mlow-precision-recip-sqrt}.
13851 @item -mlow-precision-div
13852 @item -mno-low-precision-div
13853 @opindex -mlow-precision-div
13854 @opindex -mno-low-precision-div
13855 Enable or disable the division approximation.
13856 This option only has an effect if @option{-ffast-math} or
13857 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
13858 precision of division results to about 16 bits for
13859 single precision and to 32 bits for double precision.
13861 @item -march=@var{name}
13862 @opindex march
13863 Specify the name of the target architecture and, optionally, one or
13864 more feature modifiers.  This option has the form
13865 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
13867 The permissible values for @var{arch} are @samp{armv8-a},
13868 @samp{armv8.1-a}, @samp{armv8.2-a} or @var{native}.
13870 The value @samp{armv8.2-a} implies @samp{armv8.1-a} and enables compiler
13871 support for the ARMv8.2-A architecture extensions.
13873 The value @samp{armv8.1-a} implies @samp{armv8-a} and enables compiler
13874 support for the ARMv8.1-A architecture extension.  In particular, it
13875 enables the @samp{+crc} and @samp{+lse} features.
13877 The value @samp{native} is available on native AArch64 GNU/Linux and
13878 causes the compiler to pick the architecture of the host system.  This
13879 option has no effect if the compiler is unable to recognize the
13880 architecture of the host system,
13882 The permissible values for @var{feature} are listed in the sub-section
13883 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
13884 Feature Modifiers}.  Where conflicting feature modifiers are
13885 specified, the right-most feature is used.
13887 GCC uses @var{name} to determine what kind of instructions it can emit
13888 when generating assembly code.  If @option{-march} is specified
13889 without either of @option{-mtune} or @option{-mcpu} also being
13890 specified, the code is tuned to perform well across a range of target
13891 processors implementing the target architecture.
13893 @item -mtune=@var{name}
13894 @opindex mtune
13895 Specify the name of the target processor for which GCC should tune the
13896 performance of the code.  Permissible values for this option are:
13897 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a57},
13898 @samp{cortex-a72}, @samp{cortex-a73}, @samp{exynos-m1}, @samp{falkor},
13899 @samp{qdf24xx}, @samp{thunderx}, @samp{xgene1}, @samp{vulcan},
13900 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
13901 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53}, @samp{native}.
13903 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
13904 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53}
13905 specify that GCC should tune for a big.LITTLE system.
13907 Additionally on native AArch64 GNU/Linux systems the value
13908 @samp{native} tunes performance to the host system.  This option has no effect
13909 if the compiler is unable to recognize the processor of the host system.
13911 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
13912 are specified, the code is tuned to perform well across a range
13913 of target processors.
13915 This option cannot be suffixed by feature modifiers.
13917 @item -mcpu=@var{name}
13918 @opindex mcpu
13919 Specify the name of the target processor, optionally suffixed by one
13920 or more feature modifiers.  This option has the form
13921 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
13922 the permissible values for @var{cpu} are the same as those available
13923 for @option{-mtune}.  The permissible values for @var{feature} are
13924 documented in the sub-section on
13925 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
13926 Feature Modifiers}.  Where conflicting feature modifiers are
13927 specified, the right-most feature is used.
13929 GCC uses @var{name} to determine what kind of instructions it can emit when
13930 generating assembly code (as if by @option{-march}) and to determine
13931 the target processor for which to tune for performance (as if
13932 by @option{-mtune}).  Where this option is used in conjunction
13933 with @option{-march} or @option{-mtune}, those options take precedence
13934 over the appropriate part of this option.
13936 @item -moverride=@var{string}
13937 @opindex moverride
13938 Override tuning decisions made by the back-end in response to a
13939 @option{-mtune=} switch.  The syntax, semantics, and accepted values
13940 for @var{string} in this option are not guaranteed to be consistent
13941 across releases.
13943 This option is only intended to be useful when developing GCC.
13945 @item -mpc-relative-literal-loads
13946 @opindex mpc-relative-literal-loads
13947 Enable PC-relative literal loads.  With this option literal pools are
13948 accessed using a single instruction and emitted after each function.  This
13949 limits the maximum size of functions to 1MB.  This is enabled by default for
13950 @option{-mcmodel=tiny}.
13952 @end table
13954 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
13955 @anchor{aarch64-feature-modifiers}
13956 @cindex @option{-march} feature modifiers
13957 @cindex @option{-mcpu} feature modifiers
13958 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
13959 the following and their inverses @option{no@var{feature}}:
13961 @table @samp
13962 @item crc
13963 Enable CRC extension.  This is on by default for
13964 @option{-march=armv8.1-a}.
13965 @item crypto
13966 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
13967 instructions.
13968 @item fp
13969 Enable floating-point instructions.  This is on by default for all possible
13970 values for options @option{-march} and @option{-mcpu}.
13971 @item simd
13972 Enable Advanced SIMD instructions.  This also enables floating-point
13973 instructions.  This is on by default for all possible values for options
13974 @option{-march} and @option{-mcpu}.
13975 @item lse
13976 Enable Large System Extension instructions.  This is on by default for
13977 @option{-march=armv8.1-a}.
13978 @item fp16
13979 Enable FP16 extension.  This also enables floating-point instructions.
13981 @end table
13983 Feature @option{crypto} implies @option{simd}, which implies @option{fp}.
13984 Conversely, @option{nofp} implies @option{nosimd}, which implies
13985 @option{nocrypto}.
13987 @node Adapteva Epiphany Options
13988 @subsection Adapteva Epiphany Options
13990 These @samp{-m} options are defined for Adapteva Epiphany:
13992 @table @gcctabopt
13993 @item -mhalf-reg-file
13994 @opindex mhalf-reg-file
13995 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
13996 That allows code to run on hardware variants that lack these registers.
13998 @item -mprefer-short-insn-regs
13999 @opindex mprefer-short-insn-regs
14000 Preferentially allocate registers that allow short instruction generation.
14001 This can result in increased instruction count, so this may either reduce or
14002 increase overall code size.
14004 @item -mbranch-cost=@var{num}
14005 @opindex mbranch-cost
14006 Set the cost of branches to roughly @var{num} ``simple'' instructions.
14007 This cost is only a heuristic and is not guaranteed to produce
14008 consistent results across releases.
14010 @item -mcmove
14011 @opindex mcmove
14012 Enable the generation of conditional moves.
14014 @item -mnops=@var{num}
14015 @opindex mnops
14016 Emit @var{num} NOPs before every other generated instruction.
14018 @item -mno-soft-cmpsf
14019 @opindex mno-soft-cmpsf
14020 For single-precision floating-point comparisons, emit an @code{fsub} instruction
14021 and test the flags.  This is faster than a software comparison, but can
14022 get incorrect results in the presence of NaNs, or when two different small
14023 numbers are compared such that their difference is calculated as zero.
14024 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
14025 software comparisons.
14027 @item -mstack-offset=@var{num}
14028 @opindex mstack-offset
14029 Set the offset between the top of the stack and the stack pointer.
14030 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
14031 can be used by leaf functions without stack allocation.
14032 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
14033 Note also that this option changes the ABI; compiling a program with a
14034 different stack offset than the libraries have been compiled with
14035 generally does not work.
14036 This option can be useful if you want to evaluate if a different stack
14037 offset would give you better code, but to actually use a different stack
14038 offset to build working programs, it is recommended to configure the
14039 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
14041 @item -mno-round-nearest
14042 @opindex mno-round-nearest
14043 Make the scheduler assume that the rounding mode has been set to
14044 truncating.  The default is @option{-mround-nearest}.
14046 @item -mlong-calls
14047 @opindex mlong-calls
14048 If not otherwise specified by an attribute, assume all calls might be beyond
14049 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
14050 function address into a register before performing a (otherwise direct) call.
14051 This is the default.
14053 @item -mshort-calls
14054 @opindex short-calls
14055 If not otherwise specified by an attribute, assume all direct calls are
14056 in the range of the @code{b} / @code{bl} instructions, so use these instructions
14057 for direct calls.  The default is @option{-mlong-calls}.
14059 @item -msmall16
14060 @opindex msmall16
14061 Assume addresses can be loaded as 16-bit unsigned values.  This does not
14062 apply to function addresses for which @option{-mlong-calls} semantics
14063 are in effect.
14065 @item -mfp-mode=@var{mode}
14066 @opindex mfp-mode
14067 Set the prevailing mode of the floating-point unit.
14068 This determines the floating-point mode that is provided and expected
14069 at function call and return time.  Making this mode match the mode you
14070 predominantly need at function start can make your programs smaller and
14071 faster by avoiding unnecessary mode switches.
14073 @var{mode} can be set to one the following values:
14075 @table @samp
14076 @item caller
14077 Any mode at function entry is valid, and retained or restored when
14078 the function returns, and when it calls other functions.
14079 This mode is useful for compiling libraries or other compilation units
14080 you might want to incorporate into different programs with different
14081 prevailing FPU modes, and the convenience of being able to use a single
14082 object file outweighs the size and speed overhead for any extra
14083 mode switching that might be needed, compared with what would be needed
14084 with a more specific choice of prevailing FPU mode.
14086 @item truncate
14087 This is the mode used for floating-point calculations with
14088 truncating (i.e.@: round towards zero) rounding mode.  That includes
14089 conversion from floating point to integer.
14091 @item round-nearest
14092 This is the mode used for floating-point calculations with
14093 round-to-nearest-or-even rounding mode.
14095 @item int
14096 This is the mode used to perform integer calculations in the FPU, e.g.@:
14097 integer multiply, or integer multiply-and-accumulate.
14098 @end table
14100 The default is @option{-mfp-mode=caller}
14102 @item -mnosplit-lohi
14103 @itemx -mno-postinc
14104 @itemx -mno-postmodify
14105 @opindex mnosplit-lohi
14106 @opindex mno-postinc
14107 @opindex mno-postmodify
14108 Code generation tweaks that disable, respectively, splitting of 32-bit
14109 loads, generation of post-increment addresses, and generation of
14110 post-modify addresses.  The defaults are @option{msplit-lohi},
14111 @option{-mpost-inc}, and @option{-mpost-modify}.
14113 @item -mnovect-double
14114 @opindex mno-vect-double
14115 Change the preferred SIMD mode to SImode.  The default is
14116 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
14118 @item -max-vect-align=@var{num}
14119 @opindex max-vect-align
14120 The maximum alignment for SIMD vector mode types.
14121 @var{num} may be 4 or 8.  The default is 8.
14122 Note that this is an ABI change, even though many library function
14123 interfaces are unaffected if they don't use SIMD vector modes
14124 in places that affect size and/or alignment of relevant types.
14126 @item -msplit-vecmove-early
14127 @opindex msplit-vecmove-early
14128 Split vector moves into single word moves before reload.  In theory this
14129 can give better register allocation, but so far the reverse seems to be
14130 generally the case.
14132 @item -m1reg-@var{reg}
14133 @opindex m1reg-
14134 Specify a register to hold the constant @minus{}1, which makes loading small negative
14135 constants and certain bitmasks faster.
14136 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
14137 which specify use of that register as a fixed register,
14138 and @samp{none}, which means that no register is used for this
14139 purpose.  The default is @option{-m1reg-none}.
14141 @end table
14143 @node ARC Options
14144 @subsection ARC Options
14145 @cindex ARC options
14147 The following options control the architecture variant for which code
14148 is being compiled:
14150 @c architecture variants
14151 @table @gcctabopt
14153 @item -mbarrel-shifter
14154 @opindex mbarrel-shifter
14155 Generate instructions supported by barrel shifter.  This is the default
14156 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
14158 @item -mcpu=@var{cpu}
14159 @opindex mcpu
14160 Set architecture type, register usage, and instruction scheduling
14161 parameters for @var{cpu}.  There are also shortcut alias options
14162 available for backward compatibility and convenience.  Supported
14163 values for @var{cpu} are
14165 @table @samp
14166 @opindex mA6
14167 @opindex mARC600
14168 @item arc600
14169 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
14171 @item arc601
14172 @opindex mARC601
14173 Compile for ARC601.  Alias: @option{-mARC601}.
14175 @item arc700
14176 @opindex mA7
14177 @opindex mARC700
14178 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
14179 This is the default when configured with @option{--with-cpu=arc700}@.
14181 @item arcem
14182 Compile for ARC EM.
14184 @item archs
14185 Compile for ARC HS.
14187 @item em
14188 @opindex em
14189 Compile for ARC EM cpu with no hardware extension.
14191 @item em4
14192 @opindex em4
14193 Compile for ARC EM4 cpu.
14195 @item em4_dmips
14196 @opindex em4_dmips
14197 Compile for ARC EM4 DMIPS cpu.
14199 @item em4_fpus
14200 @opindex em4_fpus
14201 Compile for ARC EM4 DMIPS cpu with single precision floating point
14202 extension.
14204 @item em4_fpuda
14205 @opindex em4_fpuda
14206 Compile for ARC EM4 DMIPS cpu with single precision floating point and
14207 double assists instructions.
14209 @item hs
14210 @opindex hs
14211 Compile for ARC HS cpu with no hardware extension, except the atomic
14212 instructions.
14214 @item hs34
14215 @opindex hs34
14216 Compile for ARC HS34 cpu.
14218 @item hs38
14219 @opindex hs38
14220 Compile for ARC HS38 cpu.
14222 @item hs38_linux
14223 @opindex hs38_linux
14224 Compile for ARC HS38 cpu with all hardware extensions on.
14226 @item arc600_norm
14227 @opindex arc600_norm
14228 Compile for ARC 600 cpu with norm instruction enabled.
14230 @item arc600_mul32x16
14231 @opindex arc600_mul32x16
14232 Compile for ARC 600 cpu with norm and mul32x16 instructions enabled.
14234 @item arc600_mul64
14235 @opindex arc600_mul64
14236 Compile for ARC 600 cpu with norm and mul64 instructions enabled.
14238 @item arc601_norm
14239 @opindex arc601_norm
14240 Compile for ARC 601 cpu with norm instruction enabled.
14242 @item arc601_mul32x16
14243 @opindex arc601_mul32x16
14244 Compile for ARC 601 cpu with norm and mul32x16 instructions enabled.
14246 @item arc601_mul64
14247 @opindex arc601_mul64
14248 Compile for ARC 601 cpu with norm and mul64 instructions enabled.
14250 @item nps400
14251 @opindex nps400
14252 Compile for ARC 700 on NPS400 chip.
14254 @end table
14256 @item -mdpfp
14257 @opindex mdpfp
14258 @itemx -mdpfp-compact
14259 @opindex mdpfp-compact
14260 FPX: Generate Double Precision FPX instructions, tuned for the compact
14261 implementation.
14263 @item -mdpfp-fast
14264 @opindex mdpfp-fast
14265 FPX: Generate Double Precision FPX instructions, tuned for the fast
14266 implementation.
14268 @item -mno-dpfp-lrsr
14269 @opindex mno-dpfp-lrsr
14270 Disable LR and SR instructions from using FPX extension aux registers.
14272 @item -mea
14273 @opindex mea
14274 Generate Extended arithmetic instructions.  Currently only
14275 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
14276 supported.  This is always enabled for @option{-mcpu=ARC700}.
14278 @item -mno-mpy
14279 @opindex mno-mpy
14280 Do not generate mpy instructions for ARC700.  This instruction is
14281 deprecated.
14283 @item -mmul32x16
14284 @opindex mmul32x16
14285 Generate 32x16 bit multiply and mac instructions.
14287 @item -mmul64
14288 @opindex mmul64
14289 Generate mul64 and mulu64 instructions.  Only valid for @option{-mcpu=ARC600}.
14291 @item -mnorm
14292 @opindex mnorm
14293 Generate norm instruction.  This is the default if @option{-mcpu=ARC700}
14294 is in effect.
14296 @item -mspfp
14297 @opindex mspfp
14298 @itemx -mspfp-compact
14299 @opindex mspfp-compact
14300 FPX: Generate Single Precision FPX instructions, tuned for the compact
14301 implementation.
14303 @item -mspfp-fast
14304 @opindex mspfp-fast
14305 FPX: Generate Single Precision FPX instructions, tuned for the fast
14306 implementation.
14308 @item -msimd
14309 @opindex msimd
14310 Enable generation of ARC SIMD instructions via target-specific
14311 builtins.  Only valid for @option{-mcpu=ARC700}.
14313 @item -msoft-float
14314 @opindex msoft-float
14315 This option ignored; it is provided for compatibility purposes only.
14316 Software floating point code is emitted by default, and this default
14317 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
14318 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
14319 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
14321 @item -mswap
14322 @opindex mswap
14323 Generate swap instructions.
14325 @item -matomic
14326 @opindex matomic
14327 This enables Locked Load/Store Conditional extension to implement
14328 atomic memopry built-in functions.  Not available for ARC 6xx or ARC
14329 EM cores.
14331 @item -mdiv-rem
14332 @opindex mdiv-rem
14333 Enable DIV/REM instructions for ARCv2 cores.
14335 @item -mcode-density
14336 @opindex mcode-density
14337 Enable code density instructions for ARC EM, default on for ARC HS.
14339 @item -mll64
14340 @opindex mll64
14341 Enable double load/store operations for ARC HS cores.
14343 @item -mtp-regno=@var{regno}
14344 @opindex mtp-regno
14345 Specify thread pointer register number.
14347 @item -mmpy-option=@var{multo}
14348 @opindex mmpy-option
14349 Compile ARCv2 code with a multiplier design option.  @samp{wlh1} is
14350 the default value.  The recognized values for @var{multo} are:
14352 @table @samp
14353 @item 0
14354 No multiplier available.
14356 @item 1
14357 @opindex w
14358 The multiply option is set to w: 16x16 multiplier, fully pipelined.
14359 The following instructions are enabled: MPYW, and MPYUW.
14361 @item 2
14362 @opindex wlh1
14363 The multiply option is set to wlh1: 32x32 multiplier, fully
14364 pipelined (1 stage).  The following instructions are additionally
14365 enabled: MPY, MPYU, MPYM, MPYMU, and MPY_S.
14367 @item 3
14368 @opindex wlh2
14369 The multiply option is set to wlh2: 32x32 multiplier, fully pipelined
14370 (2 stages).  The following instructions are additionally enabled: MPY,
14371 MPYU, MPYM, MPYMU, and MPY_S.
14373 @item 4
14374 @opindex wlh3
14375 The multiply option is set to wlh3: Two 16x16 multiplier, blocking,
14376 sequential.  The following instructions are additionally enabled: MPY,
14377 MPYU, MPYM, MPYMU, and MPY_S.
14379 @item 5
14380 @opindex wlh4
14381 The multiply option is set to wlh4: One 16x16 multiplier, blocking,
14382 sequential.  The following instructions are additionally enabled: MPY,
14383 MPYU, MPYM, MPYMU, and MPY_S.
14385 @item 6
14386 @opindex wlh5
14387 The multiply option is set to wlh5: One 32x4 multiplier, blocking,
14388 sequential.  The following instructions are additionally enabled: MPY,
14389 MPYU, MPYM, MPYMU, and MPY_S.
14391 @end table
14393 This option is only available for ARCv2 cores@.
14395 @item -mfpu=@var{fpu}
14396 @opindex mfpu
14397 Enables specific floating-point hardware extension for ARCv2
14398 core.  Supported values for @var{fpu} are:
14400 @table @samp
14402 @item fpus
14403 @opindex fpus
14404 Enables support for single precision floating point hardware
14405 extensions@.
14407 @item fpud
14408 @opindex fpud
14409 Enables support for double precision floating point hardware
14410 extensions.  The single precision floating point extension is also
14411 enabled.  Not available for ARC EM@.
14413 @item fpuda
14414 @opindex fpuda
14415 Enables support for double precision floating point hardware
14416 extensions using double precision assist instructions.  The single
14417 precision floating point extension is also enabled.  This option is
14418 only available for ARC EM@.
14420 @item fpuda_div
14421 @opindex fpuda_div
14422 Enables support for double precision floating point hardware
14423 extensions using double precision assist instructions, and simple
14424 precision square-root and divide hardware extensions.  The single
14425 precision floating point extension is also enabled.  This option is
14426 only available for ARC EM@.
14428 @item fpuda_fma
14429 @opindex fpuda_fma
14430 Enables support for double precision floating point hardware
14431 extensions using double precision assist instructions, and simple
14432 precision fused multiple and add hardware extension.  The single
14433 precision floating point extension is also enabled.  This option is
14434 only available for ARC EM@.
14436 @item fpuda_all
14437 @opindex fpuda_all
14438 Enables support for double precision floating point hardware
14439 extensions using double precision assist instructions, and all simple
14440 precision hardware extensions.  The single precision floating point
14441 extension is also enabled.  This option is only available for ARC EM@.
14443 @item fpus_div
14444 @opindex fpus_div
14445 Enables support for single precision floating point, and single
14446 precision square-root and divide hardware extensions@.
14448 @item fpud_div
14449 @opindex fpud_div
14450 Enables support for double precision floating point, and double
14451 precision square-root and divide hardware extensions.  This option
14452 includes option @samp{fpus_div}. Not available for ARC EM@.
14454 @item fpus_fma
14455 @opindex fpus_fma
14456 Enables support for single precision floating point, and single
14457 precision fused multiple and add hardware extensions@.
14459 @item fpud_fma
14460 @opindex fpud_fma
14461 Enables support for double precision floating point, and double
14462 precision fused multiple and add hardware extensions.  This option
14463 includes option @samp{fpus_fma}.  Not available for ARC EM@.
14465 @item fpus_all
14466 @opindex fpus_all
14467 Enables support for all single precision floating point hardware
14468 extensions@.
14470 @item fpud_all
14471 @opindex fpud_all
14472 Enables support for all single and double precision floating point
14473 hardware extensions.  Not available for ARC EM@.
14475 @end table
14477 @end table
14479 The following options are passed through to the assembler, and also
14480 define preprocessor macro symbols.
14482 @c Flags used by the assembler, but for which we define preprocessor
14483 @c macro symbols as well.
14484 @table @gcctabopt
14485 @item -mdsp-packa
14486 @opindex mdsp-packa
14487 Passed down to the assembler to enable the DSP Pack A extensions.
14488 Also sets the preprocessor symbol @code{__Xdsp_packa}.  This option is
14489 deprecated.
14491 @item -mdvbf
14492 @opindex mdvbf
14493 Passed down to the assembler to enable the dual viterbi butterfly
14494 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.  This
14495 option is deprecated.
14497 @c ARC700 4.10 extension instruction
14498 @item -mlock
14499 @opindex mlock
14500 Passed down to the assembler to enable the Locked Load/Store
14501 Conditional extension.  Also sets the preprocessor symbol
14502 @code{__Xlock}.
14504 @item -mmac-d16
14505 @opindex mmac-d16
14506 Passed down to the assembler.  Also sets the preprocessor symbol
14507 @code{__Xxmac_d16}.  This option is deprecated.
14509 @item -mmac-24
14510 @opindex mmac-24
14511 Passed down to the assembler.  Also sets the preprocessor symbol
14512 @code{__Xxmac_24}.  This option is deprecated.
14514 @c ARC700 4.10 extension instruction
14515 @item -mrtsc
14516 @opindex mrtsc
14517 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
14518 extension instruction.  Also sets the preprocessor symbol
14519 @code{__Xrtsc}.  This option is deprecated.
14521 @c ARC700 4.10 extension instruction
14522 @item -mswape
14523 @opindex mswape
14524 Passed down to the assembler to enable the swap byte ordering
14525 extension instruction.  Also sets the preprocessor symbol
14526 @code{__Xswape}.
14528 @item -mtelephony
14529 @opindex mtelephony
14530 Passed down to the assembler to enable dual and single operand
14531 instructions for telephony.  Also sets the preprocessor symbol
14532 @code{__Xtelephony}.  This option is deprecated.
14534 @item -mxy
14535 @opindex mxy
14536 Passed down to the assembler to enable the XY Memory extension.  Also
14537 sets the preprocessor symbol @code{__Xxy}.
14539 @end table
14541 The following options control how the assembly code is annotated:
14543 @c Assembly annotation options
14544 @table @gcctabopt
14545 @item -misize
14546 @opindex misize
14547 Annotate assembler instructions with estimated addresses.
14549 @item -mannotate-align
14550 @opindex mannotate-align
14551 Explain what alignment considerations lead to the decision to make an
14552 instruction short or long.
14554 @end table
14556 The following options are passed through to the linker:
14558 @c options passed through to the linker
14559 @table @gcctabopt
14560 @item -marclinux
14561 @opindex marclinux
14562 Passed through to the linker, to specify use of the @code{arclinux} emulation.
14563 This option is enabled by default in tool chains built for
14564 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
14565 when profiling is not requested.
14567 @item -marclinux_prof
14568 @opindex marclinux_prof
14569 Passed through to the linker, to specify use of the
14570 @code{arclinux_prof} emulation.  This option is enabled by default in
14571 tool chains built for @w{@code{arc-linux-uclibc}} and
14572 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
14574 @end table
14576 The following options control the semantics of generated code:
14578 @c semantically relevant code generation options
14579 @table @gcctabopt
14580 @item -mlong-calls
14581 @opindex mlong-calls
14582 Generate call insns as register indirect calls, thus providing access
14583 to the full 32-bit address range.
14585 @item -mmedium-calls
14586 @opindex mmedium-calls
14587 Don't use less than 25 bit addressing range for calls, which is the
14588 offset available for an unconditional branch-and-link
14589 instruction.  Conditional execution of function calls is suppressed, to
14590 allow use of the 25-bit range, rather than the 21-bit range with
14591 conditional branch-and-link.  This is the default for tool chains built
14592 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
14594 @item -mno-sdata
14595 @opindex mno-sdata
14596 Do not generate sdata references.  This is the default for tool chains
14597 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
14598 targets.
14600 @item -mucb-mcount
14601 @opindex mucb-mcount
14602 Instrument with mcount calls as used in UCB code.  I.e. do the
14603 counting in the callee, not the caller.  By default ARC instrumentation
14604 counts in the caller.
14606 @item -mvolatile-cache
14607 @opindex mvolatile-cache
14608 Use ordinarily cached memory accesses for volatile references.  This is the
14609 default.
14611 @item -mno-volatile-cache
14612 @opindex mno-volatile-cache
14613 Enable cache bypass for volatile references.
14615 @end table
14617 The following options fine tune code generation:
14618 @c code generation tuning options
14619 @table @gcctabopt
14620 @item -malign-call
14621 @opindex malign-call
14622 Do alignment optimizations for call instructions.
14624 @item -mauto-modify-reg
14625 @opindex mauto-modify-reg
14626 Enable the use of pre/post modify with register displacement.
14628 @item -mbbit-peephole
14629 @opindex mbbit-peephole
14630 Enable bbit peephole2.
14632 @item -mno-brcc
14633 @opindex mno-brcc
14634 This option disables a target-specific pass in @file{arc_reorg} to
14635 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
14636 generation driven by the combiner pass.
14638 @item -mcase-vector-pcrel
14639 @opindex mcase-vector-pcrel
14640 Use pc-relative switch case tables - this enables case table shortening.
14641 This is the default for @option{-Os}.
14643 @item -mcompact-casesi
14644 @opindex mcompact-casesi
14645 Enable compact casesi pattern.  This is the default for @option{-Os},
14646 and only available for ARCv1 cores.
14648 @item -mno-cond-exec
14649 @opindex mno-cond-exec
14650 Disable ARCompact specific pass to generate conditional execution instructions.
14651 Due to delay slot scheduling and interactions between operand numbers,
14652 literal sizes, instruction lengths, and the support for conditional execution,
14653 the target-independent pass to generate conditional execution is often lacking,
14654 so the ARC port has kept a special pass around that tries to find more
14655 conditional execution generating opportunities after register allocation,
14656 branch shortening, and delay slot scheduling have been done.  This pass
14657 generally, but not always, improves performance and code size, at the cost of
14658 extra compilation time, which is why there is an option to switch it off.
14659 If you have a problem with call instructions exceeding their allowable
14660 offset range because they are conditionalized, you should consider using
14661 @option{-mmedium-calls} instead.
14663 @item -mearly-cbranchsi
14664 @opindex mearly-cbranchsi
14665 Enable pre-reload use of the cbranchsi pattern.
14667 @item -mexpand-adddi
14668 @opindex mexpand-adddi
14669 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
14670 @code{add.f}, @code{adc} etc.
14672 @item -mindexed-loads
14673 @opindex mindexed-loads
14674 Enable the use of indexed loads.  This can be problematic because some
14675 optimizers then assume that indexed stores exist, which is not
14676 the case.
14678 @opindex mlra
14679 Enable Local Register Allocation.  This is still experimental for ARC,
14680 so by default the compiler uses standard reload
14681 (i.e. @option{-mno-lra}).
14683 @item -mlra-priority-none
14684 @opindex mlra-priority-none
14685 Don't indicate any priority for target registers.
14687 @item -mlra-priority-compact
14688 @opindex mlra-priority-compact
14689 Indicate target register priority for r0..r3 / r12..r15.
14691 @item -mlra-priority-noncompact
14692 @opindex mlra-priority-noncompact
14693 Reduce target register priority for r0..r3 / r12..r15.
14695 @item -mno-millicode
14696 @opindex mno-millicode
14697 When optimizing for size (using @option{-Os}), prologues and epilogues
14698 that have to save or restore a large number of registers are often
14699 shortened by using call to a special function in libgcc; this is
14700 referred to as a @emph{millicode} call.  As these calls can pose
14701 performance issues, and/or cause linking issues when linking in a
14702 nonstandard way, this option is provided to turn off millicode call
14703 generation.
14705 @item -mmixed-code
14706 @opindex mmixed-code
14707 Tweak register allocation to help 16-bit instruction generation.
14708 This generally has the effect of decreasing the average instruction size
14709 while increasing the instruction count.
14711 @item -mq-class
14712 @opindex mq-class
14713 Enable 'q' instruction alternatives.
14714 This is the default for @option{-Os}.
14716 @item -mRcq
14717 @opindex mRcq
14718 Enable Rcq constraint handling - most short code generation depends on this.
14719 This is the default.
14721 @item -mRcw
14722 @opindex mRcw
14723 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
14724 This is the default.
14726 @item -msize-level=@var{level}
14727 @opindex msize-level
14728 Fine-tune size optimization with regards to instruction lengths and alignment.
14729 The recognized values for @var{level} are:
14730 @table @samp
14731 @item 0
14732 No size optimization.  This level is deprecated and treated like @samp{1}.
14734 @item 1
14735 Short instructions are used opportunistically.
14737 @item 2
14738 In addition, alignment of loops and of code after barriers are dropped.
14740 @item 3
14741 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
14743 @end table
14745 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
14746 the behavior when this is not set is equivalent to level @samp{1}.
14748 @item -mtune=@var{cpu}
14749 @opindex mtune
14750 Set instruction scheduling parameters for @var{cpu}, overriding any implied
14751 by @option{-mcpu=}.
14753 Supported values for @var{cpu} are
14755 @table @samp
14756 @item ARC600
14757 Tune for ARC600 cpu.
14759 @item ARC601
14760 Tune for ARC601 cpu.
14762 @item ARC700
14763 Tune for ARC700 cpu with standard multiplier block.
14765 @item ARC700-xmac
14766 Tune for ARC700 cpu with XMAC block.
14768 @item ARC725D
14769 Tune for ARC725D cpu.
14771 @item ARC750D
14772 Tune for ARC750D cpu.
14774 @end table
14776 @item -mmultcost=@var{num}
14777 @opindex mmultcost
14778 Cost to assume for a multiply instruction, with @samp{4} being equal to a
14779 normal instruction.
14781 @item -munalign-prob-threshold=@var{probability}
14782 @opindex munalign-prob-threshold
14783 Set probability threshold for unaligning branches.
14784 When tuning for @samp{ARC700} and optimizing for speed, branches without
14785 filled delay slot are preferably emitted unaligned and long, unless
14786 profiling indicates that the probability for the branch to be taken
14787 is below @var{probability}.  @xref{Cross-profiling}.
14788 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
14790 @end table
14792 The following options are maintained for backward compatibility, but
14793 are now deprecated and will be removed in a future release:
14795 @c Deprecated options
14796 @table @gcctabopt
14798 @item -margonaut
14799 @opindex margonaut
14800 Obsolete FPX.
14802 @item -mbig-endian
14803 @opindex mbig-endian
14804 @itemx -EB
14805 @opindex EB
14806 Compile code for big endian targets.  Use of these options is now
14807 deprecated.  Users wanting big-endian code, should use the
14808 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
14809 building the tool chain, for which big-endian is the default.
14811 @item -mlittle-endian
14812 @opindex mlittle-endian
14813 @itemx -EL
14814 @opindex EL
14815 Compile code for little endian targets.  Use of these options is now
14816 deprecated.  Users wanting little-endian code should use the
14817 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
14818 building the tool chain, for which little-endian is the default.
14820 @item -mbarrel_shifter
14821 @opindex mbarrel_shifter
14822 Replaced by @option{-mbarrel-shifter}.
14824 @item -mdpfp_compact
14825 @opindex mdpfp_compact
14826 Replaced by @option{-mdpfp-compact}.
14828 @item -mdpfp_fast
14829 @opindex mdpfp_fast
14830 Replaced by @option{-mdpfp-fast}.
14832 @item -mdsp_packa
14833 @opindex mdsp_packa
14834 Replaced by @option{-mdsp-packa}.
14836 @item -mEA
14837 @opindex mEA
14838 Replaced by @option{-mea}.
14840 @item -mmac_24
14841 @opindex mmac_24
14842 Replaced by @option{-mmac-24}.
14844 @item -mmac_d16
14845 @opindex mmac_d16
14846 Replaced by @option{-mmac-d16}.
14848 @item -mspfp_compact
14849 @opindex mspfp_compact
14850 Replaced by @option{-mspfp-compact}.
14852 @item -mspfp_fast
14853 @opindex mspfp_fast
14854 Replaced by @option{-mspfp-fast}.
14856 @item -mtune=@var{cpu}
14857 @opindex mtune
14858 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
14859 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
14860 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
14862 @item -multcost=@var{num}
14863 @opindex multcost
14864 Replaced by @option{-mmultcost}.
14866 @end table
14868 @node ARM Options
14869 @subsection ARM Options
14870 @cindex ARM options
14872 These @samp{-m} options are defined for the ARM port:
14874 @table @gcctabopt
14875 @item -mabi=@var{name}
14876 @opindex mabi
14877 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
14878 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
14880 @item -mapcs-frame
14881 @opindex mapcs-frame
14882 Generate a stack frame that is compliant with the ARM Procedure Call
14883 Standard for all functions, even if this is not strictly necessary for
14884 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
14885 with this option causes the stack frames not to be generated for
14886 leaf functions.  The default is @option{-mno-apcs-frame}.
14887 This option is deprecated.
14889 @item -mapcs
14890 @opindex mapcs
14891 This is a synonym for @option{-mapcs-frame} and is deprecated.
14893 @ignore
14894 @c not currently implemented
14895 @item -mapcs-stack-check
14896 @opindex mapcs-stack-check
14897 Generate code to check the amount of stack space available upon entry to
14898 every function (that actually uses some stack space).  If there is
14899 insufficient space available then either the function
14900 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
14901 called, depending upon the amount of stack space required.  The runtime
14902 system is required to provide these functions.  The default is
14903 @option{-mno-apcs-stack-check}, since this produces smaller code.
14905 @c not currently implemented
14906 @item -mapcs-float
14907 @opindex mapcs-float
14908 Pass floating-point arguments using the floating-point registers.  This is
14909 one of the variants of the APCS@.  This option is recommended if the
14910 target hardware has a floating-point unit or if a lot of floating-point
14911 arithmetic is going to be performed by the code.  The default is
14912 @option{-mno-apcs-float}, since the size of integer-only code is 
14913 slightly increased if @option{-mapcs-float} is used.
14915 @c not currently implemented
14916 @item -mapcs-reentrant
14917 @opindex mapcs-reentrant
14918 Generate reentrant, position-independent code.  The default is
14919 @option{-mno-apcs-reentrant}.
14920 @end ignore
14922 @item -mthumb-interwork
14923 @opindex mthumb-interwork
14924 Generate code that supports calling between the ARM and Thumb
14925 instruction sets.  Without this option, on pre-v5 architectures, the
14926 two instruction sets cannot be reliably used inside one program.  The
14927 default is @option{-mno-thumb-interwork}, since slightly larger code
14928 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
14929 configurations this option is meaningless.
14931 @item -mno-sched-prolog
14932 @opindex mno-sched-prolog
14933 Prevent the reordering of instructions in the function prologue, or the
14934 merging of those instruction with the instructions in the function's
14935 body.  This means that all functions start with a recognizable set
14936 of instructions (or in fact one of a choice from a small set of
14937 different function prologues), and this information can be used to
14938 locate the start of functions inside an executable piece of code.  The
14939 default is @option{-msched-prolog}.
14941 @item -mfloat-abi=@var{name}
14942 @opindex mfloat-abi
14943 Specifies which floating-point ABI to use.  Permissible values
14944 are: @samp{soft}, @samp{softfp} and @samp{hard}.
14946 Specifying @samp{soft} causes GCC to generate output containing
14947 library calls for floating-point operations.
14948 @samp{softfp} allows the generation of code using hardware floating-point
14949 instructions, but still uses the soft-float calling conventions.
14950 @samp{hard} allows generation of floating-point instructions
14951 and uses FPU-specific calling conventions.
14953 The default depends on the specific target configuration.  Note that
14954 the hard-float and soft-float ABIs are not link-compatible; you must
14955 compile your entire program with the same ABI, and link with a
14956 compatible set of libraries.
14958 @item -mlittle-endian
14959 @opindex mlittle-endian
14960 Generate code for a processor running in little-endian mode.  This is
14961 the default for all standard configurations.
14963 @item -mbig-endian
14964 @opindex mbig-endian
14965 Generate code for a processor running in big-endian mode; the default is
14966 to compile code for a little-endian processor.
14968 @item -march=@var{name}
14969 @opindex march
14970 This specifies the name of the target ARM architecture.  GCC uses this
14971 name to determine what kind of instructions it can emit when generating
14972 assembly code.  This option can be used in conjunction with or instead
14973 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
14974 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
14975 @samp{armv5}, @samp{armv5e}, @samp{armv5t}, @samp{armv5te},
14976 @samp{armv6}, @samp{armv6-m}, @samp{armv6j}, @samp{armv6k},
14977 @samp{armv6kz}, @samp{armv6s-m},
14978 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk},
14979 @samp{armv7}, @samp{armv7-a}, @samp{armv7-m}, @samp{armv7-r}, @samp{armv7e-m},
14980 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc}, @samp{armv8.1-a},
14981 @samp{armv8.1-a+crc}, @samp{armv8-m.base}, @samp{armv8-m.main},
14982 @samp{armv8-m.main+dsp}, @samp{iwmmxt}, @samp{iwmmxt2}.
14984 Architecture revisions older than @samp{armv4t} are deprecated.
14986 @option{-march=armv6s-m} is the @samp{armv6-m} architecture with support for
14987 the (now mandatory) SVC instruction.
14989 @option{-march=armv6zk} is an alias for @samp{armv6kz}, existing for backwards
14990 compatibility.
14992 @option{-march=armv7ve} is the @samp{armv7-a} architecture with virtualization
14993 extensions.
14995 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
14996 architecture together with the optional CRC32 extensions.
14998 @option{-march=armv8.1-a} enables compiler support for the ARMv8.1-A
14999 architecture.  This also enables the features provided by
15000 @option{-march=armv8-a+crc}.
15002 @option{-march=armv8.2-a} enables compiler support for the ARMv8.2-A
15003 architecture.  This also enables the features provided by
15004 @option{-march=armv8.1-a}.
15006 @option{-march=armv8.2-a+fp16} enables compiler support for the
15007 ARMv8.2-A architecture with the optional FP16 instructions extension.
15008 This also enables the features provided by @option{-march=armv8.1-a}
15009 and implies @option{-mfp16-format=ieee}.
15011 @option{-march=native} causes the compiler to auto-detect the architecture
15012 of the build computer.  At present, this feature is only supported on
15013 GNU/Linux, and not all architectures are recognized.  If the auto-detect
15014 is unsuccessful the option has no effect.
15016 @item -mtune=@var{name}
15017 @opindex mtune
15018 This option specifies the name of the target ARM processor for
15019 which GCC should tune the performance of the code.
15020 For some ARM implementations better performance can be obtained by using
15021 this option.
15022 Permissible names are: @samp{arm2}, @samp{arm250},
15023 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
15024 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
15025 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
15026 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
15027 @samp{arm720},
15028 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
15029 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
15030 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
15031 @samp{strongarm1110},
15032 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
15033 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
15034 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
15035 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
15036 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
15037 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
15038 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
15039 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
15040 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
15041 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a57},
15042 @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-r4},
15043 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
15044 @samp{cortex-m33},
15045 @samp{cortex-m23},
15046 @samp{cortex-m7},
15047 @samp{cortex-m4},
15048 @samp{cortex-m3},
15049 @samp{cortex-m1},
15050 @samp{cortex-m0},
15051 @samp{cortex-m0plus},
15052 @samp{cortex-m1.small-multiply},
15053 @samp{cortex-m0.small-multiply},
15054 @samp{cortex-m0plus.small-multiply},
15055 @samp{exynos-m1},
15056 @samp{falkor},
15057 @samp{qdf24xx},
15058 @samp{marvell-pj4},
15059 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
15060 @samp{fa526}, @samp{fa626},
15061 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
15062 @samp{xgene1}.
15064 Additionally, this option can specify that GCC should tune the performance
15065 of the code for a big.LITTLE system.  Permissible names are:
15066 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
15067 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
15068 @samp{cortex-a72.cortex-a35}, @samp{cortex-a73.cortex-a53}.
15070 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
15071 performance for a blend of processors within architecture @var{arch}.
15072 The aim is to generate code that run well on the current most popular
15073 processors, balancing between optimizations that benefit some CPUs in the
15074 range, and avoiding performance pitfalls of other CPUs.  The effects of
15075 this option may change in future GCC versions as CPU models come and go.
15077 @option{-mtune=native} causes the compiler to auto-detect the CPU
15078 of the build computer.  At present, this feature is only supported on
15079 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
15080 unsuccessful the option has no effect.
15082 @item -mcpu=@var{name}
15083 @opindex mcpu
15084 This specifies the name of the target ARM processor.  GCC uses this name
15085 to derive the name of the target ARM architecture (as if specified
15086 by @option{-march}) and the ARM processor type for which to tune for
15087 performance (as if specified by @option{-mtune}).  Where this option
15088 is used in conjunction with @option{-march} or @option{-mtune},
15089 those options take precedence over the appropriate part of this option.
15091 Permissible names for this option are the same as those for
15092 @option{-mtune}.
15094 @option{-mcpu=generic-@var{arch}} is also permissible, and is
15095 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
15096 See @option{-mtune} for more information.
15098 @option{-mcpu=native} causes the compiler to auto-detect the CPU
15099 of the build computer.  At present, this feature is only supported on
15100 GNU/Linux, and not all architectures are recognized.  If the auto-detect
15101 is unsuccessful the option has no effect.
15103 @item -mfpu=@var{name}
15104 @opindex mfpu
15105 This specifies what floating-point hardware (or hardware emulation) is
15106 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
15107 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
15108 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
15109 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
15110 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
15111 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
15113 If @option{-msoft-float} is specified this specifies the format of
15114 floating-point values.
15116 If the selected floating-point hardware includes the NEON extension
15117 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
15118 operations are not generated by GCC's auto-vectorization pass unless
15119 @option{-funsafe-math-optimizations} is also specified.  This is
15120 because NEON hardware does not fully implement the IEEE 754 standard for
15121 floating-point arithmetic (in particular denormal values are treated as
15122 zero), so the use of NEON instructions may lead to a loss of precision.
15124 You can also set the fpu name at function level by using the @code{target("fpu=")} function attributes (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
15126 @item -mfp16-format=@var{name}
15127 @opindex mfp16-format
15128 Specify the format of the @code{__fp16} half-precision floating-point type.
15129 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
15130 the default is @samp{none}, in which case the @code{__fp16} type is not
15131 defined.  @xref{Half-Precision}, for more information.
15133 @item -mstructure-size-boundary=@var{n}
15134 @opindex mstructure-size-boundary
15135 The sizes of all structures and unions are rounded up to a multiple
15136 of the number of bits set by this option.  Permissible values are 8, 32
15137 and 64.  The default value varies for different toolchains.  For the COFF
15138 targeted toolchain the default value is 8.  A value of 64 is only allowed
15139 if the underlying ABI supports it.
15141 Specifying a larger number can produce faster, more efficient code, but
15142 can also increase the size of the program.  Different values are potentially
15143 incompatible.  Code compiled with one value cannot necessarily expect to
15144 work with code or libraries compiled with another value, if they exchange
15145 information using structures or unions.
15147 @item -mabort-on-noreturn
15148 @opindex mabort-on-noreturn
15149 Generate a call to the function @code{abort} at the end of a
15150 @code{noreturn} function.  It is executed if the function tries to
15151 return.
15153 @item -mlong-calls
15154 @itemx -mno-long-calls
15155 @opindex mlong-calls
15156 @opindex mno-long-calls
15157 Tells the compiler to perform function calls by first loading the
15158 address of the function into a register and then performing a subroutine
15159 call on this register.  This switch is needed if the target function
15160 lies outside of the 64-megabyte addressing range of the offset-based
15161 version of subroutine call instruction.
15163 Even if this switch is enabled, not all function calls are turned
15164 into long calls.  The heuristic is that static functions, functions
15165 that have the @code{short_call} attribute, functions that are inside
15166 the scope of a @code{#pragma no_long_calls} directive, and functions whose
15167 definitions have already been compiled within the current compilation
15168 unit are not turned into long calls.  The exceptions to this rule are
15169 that weak function definitions, functions with the @code{long_call}
15170 attribute or the @code{section} attribute, and functions that are within
15171 the scope of a @code{#pragma long_calls} directive are always
15172 turned into long calls.
15174 This feature is not enabled by default.  Specifying
15175 @option{-mno-long-calls} restores the default behavior, as does
15176 placing the function calls within the scope of a @code{#pragma
15177 long_calls_off} directive.  Note these switches have no effect on how
15178 the compiler generates code to handle function calls via function
15179 pointers.
15181 @item -msingle-pic-base
15182 @opindex msingle-pic-base
15183 Treat the register used for PIC addressing as read-only, rather than
15184 loading it in the prologue for each function.  The runtime system is
15185 responsible for initializing this register with an appropriate value
15186 before execution begins.
15188 @item -mpic-register=@var{reg}
15189 @opindex mpic-register
15190 Specify the register to be used for PIC addressing.
15191 For standard PIC base case, the default is any suitable register
15192 determined by compiler.  For single PIC base case, the default is
15193 @samp{R9} if target is EABI based or stack-checking is enabled,
15194 otherwise the default is @samp{R10}.
15196 @item -mpic-data-is-text-relative
15197 @opindex mpic-data-is-text-relative
15198 Assume that the displacement between the text and data segments is fixed
15199 at static link time.  This permits using PC-relative addressing
15200 operations to access data known to be in the data segment.  For
15201 non-VxWorks RTP targets, this option is enabled by default.  When
15202 disabled on such targets, it will enable @option{-msingle-pic-base} by
15203 default.
15205 @item -mpoke-function-name
15206 @opindex mpoke-function-name
15207 Write the name of each function into the text section, directly
15208 preceding the function prologue.  The generated code is similar to this:
15210 @smallexample
15211      t0
15212          .ascii "arm_poke_function_name", 0
15213          .align
15214      t1
15215          .word 0xff000000 + (t1 - t0)
15216      arm_poke_function_name
15217          mov     ip, sp
15218          stmfd   sp!, @{fp, ip, lr, pc@}
15219          sub     fp, ip, #4
15220 @end smallexample
15222 When performing a stack backtrace, code can inspect the value of
15223 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
15224 location @code{pc - 12} and the top 8 bits are set, then we know that
15225 there is a function name embedded immediately preceding this location
15226 and has length @code{((pc[-3]) & 0xff000000)}.
15228 @item -mthumb
15229 @itemx -marm
15230 @opindex marm
15231 @opindex mthumb
15233 Select between generating code that executes in ARM and Thumb
15234 states.  The default for most configurations is to generate code
15235 that executes in ARM state, but the default can be changed by
15236 configuring GCC with the @option{--with-mode=}@var{state}
15237 configure option.
15239 You can also override the ARM and Thumb mode for each function
15240 by using the @code{target("thumb")} and @code{target("arm")} function attributes
15241 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
15243 @item -mtpcs-frame
15244 @opindex mtpcs-frame
15245 Generate a stack frame that is compliant with the Thumb Procedure Call
15246 Standard for all non-leaf functions.  (A leaf function is one that does
15247 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
15249 @item -mtpcs-leaf-frame
15250 @opindex mtpcs-leaf-frame
15251 Generate a stack frame that is compliant with the Thumb Procedure Call
15252 Standard for all leaf functions.  (A leaf function is one that does
15253 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
15255 @item -mcallee-super-interworking
15256 @opindex mcallee-super-interworking
15257 Gives all externally visible functions in the file being compiled an ARM
15258 instruction set header which switches to Thumb mode before executing the
15259 rest of the function.  This allows these functions to be called from
15260 non-interworking code.  This option is not valid in AAPCS configurations
15261 because interworking is enabled by default.
15263 @item -mcaller-super-interworking
15264 @opindex mcaller-super-interworking
15265 Allows calls via function pointers (including virtual functions) to
15266 execute correctly regardless of whether the target code has been
15267 compiled for interworking or not.  There is a small overhead in the cost
15268 of executing a function pointer if this option is enabled.  This option
15269 is not valid in AAPCS configurations because interworking is enabled
15270 by default.
15272 @item -mtp=@var{name}
15273 @opindex mtp
15274 Specify the access model for the thread local storage pointer.  The valid
15275 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
15276 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
15277 (supported in the arm6k architecture), and @samp{auto}, which uses the
15278 best available method for the selected processor.  The default setting is
15279 @samp{auto}.
15281 @item -mtls-dialect=@var{dialect}
15282 @opindex mtls-dialect
15283 Specify the dialect to use for accessing thread local storage.  Two
15284 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
15285 @samp{gnu} dialect selects the original GNU scheme for supporting
15286 local and global dynamic TLS models.  The @samp{gnu2} dialect
15287 selects the GNU descriptor scheme, which provides better performance
15288 for shared libraries.  The GNU descriptor scheme is compatible with
15289 the original scheme, but does require new assembler, linker and
15290 library support.  Initial and local exec TLS models are unaffected by
15291 this option and always use the original scheme.
15293 @item -mword-relocations
15294 @opindex mword-relocations
15295 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
15296 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
15297 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
15298 is specified.
15300 @item -mfix-cortex-m3-ldrd
15301 @opindex mfix-cortex-m3-ldrd
15302 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
15303 with overlapping destination and base registers are used.  This option avoids
15304 generating these instructions.  This option is enabled by default when
15305 @option{-mcpu=cortex-m3} is specified.
15307 @item -munaligned-access
15308 @itemx -mno-unaligned-access
15309 @opindex munaligned-access
15310 @opindex mno-unaligned-access
15311 Enables (or disables) reading and writing of 16- and 32- bit values
15312 from addresses that are not 16- or 32- bit aligned.  By default
15313 unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
15314 ARMv8-M Baseline architectures, and enabled for all other
15315 architectures.  If unaligned access is not enabled then words in packed
15316 data structures are accessed a byte at a time.
15318 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
15319 generated object file to either true or false, depending upon the
15320 setting of this option.  If unaligned access is enabled then the
15321 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
15322 defined.
15324 @item -mneon-for-64bits
15325 @opindex mneon-for-64bits
15326 Enables using Neon to handle scalar 64-bits operations. This is
15327 disabled by default since the cost of moving data from core registers
15328 to Neon is high.
15330 @item -mslow-flash-data
15331 @opindex mslow-flash-data
15332 Assume loading data from flash is slower than fetching instruction.
15333 Therefore literal load is minimized for better performance.
15334 This option is only supported when compiling for ARMv7 M-profile and
15335 off by default.
15337 @item -masm-syntax-unified
15338 @opindex masm-syntax-unified
15339 Assume inline assembler is using unified asm syntax.  The default is
15340 currently off which implies divided syntax.  This option has no impact
15341 on Thumb2. However, this may change in future releases of GCC.
15342 Divided syntax should be considered deprecated.
15344 @item -mrestrict-it
15345 @opindex mrestrict-it
15346 Restricts generation of IT blocks to conform to the rules of ARMv8.
15347 IT blocks can only contain a single 16-bit instruction from a select
15348 set of instructions. This option is on by default for ARMv8 Thumb mode.
15350 @item -mprint-tune-info
15351 @opindex mprint-tune-info
15352 Print CPU tuning information as comment in assembler file.  This is
15353 an option used only for regression testing of the compiler and not
15354 intended for ordinary use in compiling code.  This option is disabled
15355 by default.
15357 @item -mpure-code
15358 @opindex mpure-code
15359 Do not allow constant data to be placed in code sections.
15360 Additionally, when compiling for ELF object format give all text sections the
15361 ELF processor-specific section attribute @code{SHF_ARM_PURECODE}.  This option
15362 is only available when generating non-pic code for ARMv7-M targets.
15364 @end table
15366 @node AVR Options
15367 @subsection AVR Options
15368 @cindex AVR Options
15370 These options are defined for AVR implementations:
15372 @table @gcctabopt
15373 @item -mmcu=@var{mcu}
15374 @opindex mmcu
15375 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
15377 The default for this option is@tie{}@samp{avr2}.
15379 GCC supports the following AVR devices and ISAs:
15381 @include avr-mmcu.texi
15383 @item -mabsdata
15384 @opindex mabsdata
15386 Assume that all data in static storage can be accessed by LDS / STS
15387 instructions.  This option has only an effect on reduced Tiny devices like
15388 ATtiny40.
15390 @item -maccumulate-args
15391 @opindex maccumulate-args
15392 Accumulate outgoing function arguments and acquire/release the needed
15393 stack space for outgoing function arguments once in function
15394 prologue/epilogue.  Without this option, outgoing arguments are pushed
15395 before calling a function and popped afterwards.
15397 Popping the arguments after the function call can be expensive on
15398 AVR so that accumulating the stack space might lead to smaller
15399 executables because arguments need not to be removed from the
15400 stack after such a function call.
15402 This option can lead to reduced code size for functions that perform
15403 several calls to functions that get their arguments on the stack like
15404 calls to printf-like functions.
15406 @item -mbranch-cost=@var{cost}
15407 @opindex mbranch-cost
15408 Set the branch costs for conditional branch instructions to
15409 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
15410 integers. The default branch cost is 0.
15412 @item -mcall-prologues
15413 @opindex mcall-prologues
15414 Functions prologues/epilogues are expanded as calls to appropriate
15415 subroutines.  Code size is smaller.
15417 @item -mint8
15418 @opindex mint8
15419 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
15420 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
15421 and @code{long long} is 4 bytes.  Please note that this option does not
15422 conform to the C standards, but it results in smaller code
15423 size.
15425 @item -mn-flash=@var{num}
15426 @opindex mn-flash
15427 Assume that the flash memory has a size of 
15428 @var{num} times 64@tie{}KiB.
15430 @item -mno-interrupts
15431 @opindex mno-interrupts
15432 Generated code is not compatible with hardware interrupts.
15433 Code size is smaller.
15435 @item -mrelax
15436 @opindex mrelax
15437 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
15438 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
15439 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
15440 the assembler's command line and the @option{--relax} option to the
15441 linker's command line.
15443 Jump relaxing is performed by the linker because jump offsets are not
15444 known before code is located. Therefore, the assembler code generated by the
15445 compiler is the same, but the instructions in the executable may
15446 differ from instructions in the assembler code.
15448 Relaxing must be turned on if linker stubs are needed, see the
15449 section on @code{EIND} and linker stubs below.
15451 @item -mrmw
15452 @opindex mrmw
15453 Assume that the device supports the Read-Modify-Write
15454 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
15456 @item -msp8
15457 @opindex msp8
15458 Treat the stack pointer register as an 8-bit register,
15459 i.e.@: assume the high byte of the stack pointer is zero.
15460 In general, you don't need to set this option by hand.
15462 This option is used internally by the compiler to select and
15463 build multilibs for architectures @code{avr2} and @code{avr25}.
15464 These architectures mix devices with and without @code{SPH}.
15465 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
15466 the compiler driver adds or removes this option from the compiler
15467 proper's command line, because the compiler then knows if the device
15468 or architecture has an 8-bit stack pointer and thus no @code{SPH}
15469 register or not.
15471 @item -mstrict-X
15472 @opindex mstrict-X
15473 Use address register @code{X} in a way proposed by the hardware.  This means
15474 that @code{X} is only used in indirect, post-increment or
15475 pre-decrement addressing.
15477 Without this option, the @code{X} register may be used in the same way
15478 as @code{Y} or @code{Z} which then is emulated by additional
15479 instructions.  
15480 For example, loading a value with @code{X+const} addressing with a
15481 small non-negative @code{const < 64} to a register @var{Rn} is
15482 performed as
15484 @example
15485 adiw r26, const   ; X += const
15486 ld   @var{Rn}, X        ; @var{Rn} = *X
15487 sbiw r26, const   ; X -= const
15488 @end example
15490 @item -mtiny-stack
15491 @opindex mtiny-stack
15492 Only change the lower 8@tie{}bits of the stack pointer.
15494 @item -mfract-convert-truncate
15495 @opindex mfract-convert-truncate
15496 Allow to use truncation instead of rounding towards zero for fractional fixed-point types.
15498 @item -nodevicelib
15499 @opindex nodevicelib
15500 Don't link against AVR-LibC's device specific library @code{lib<mcu>.a}.
15502 @item -Waddr-space-convert
15503 @opindex Waddr-space-convert
15504 Warn about conversions between address spaces in the case where the
15505 resulting address space is not contained in the incoming address space.
15507 @item -Wmisspelled-isr
15508 @opindex Wmisspelled-isr
15509 Warn if the ISR is misspelled, i.e. without __vector prefix.
15510 Enabled by default.
15511 @end table
15513 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
15514 @cindex @code{EIND}
15515 Pointers in the implementation are 16@tie{}bits wide.
15516 The address of a function or label is represented as word address so
15517 that indirect jumps and calls can target any code address in the
15518 range of 64@tie{}Ki words.
15520 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
15521 bytes of program memory space, there is a special function register called
15522 @code{EIND} that serves as most significant part of the target address
15523 when @code{EICALL} or @code{EIJMP} instructions are used.
15525 Indirect jumps and calls on these devices are handled as follows by
15526 the compiler and are subject to some limitations:
15528 @itemize @bullet
15530 @item
15531 The compiler never sets @code{EIND}.
15533 @item
15534 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
15535 instructions or might read @code{EIND} directly in order to emulate an
15536 indirect call/jump by means of a @code{RET} instruction.
15538 @item
15539 The compiler assumes that @code{EIND} never changes during the startup
15540 code or during the application. In particular, @code{EIND} is not
15541 saved/restored in function or interrupt service routine
15542 prologue/epilogue.
15544 @item
15545 For indirect calls to functions and computed goto, the linker
15546 generates @emph{stubs}. Stubs are jump pads sometimes also called
15547 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
15548 The stub contains a direct jump to the desired address.
15550 @item
15551 Linker relaxation must be turned on so that the linker generates
15552 the stubs correctly in all situations. See the compiler option
15553 @option{-mrelax} and the linker option @option{--relax}.
15554 There are corner cases where the linker is supposed to generate stubs
15555 but aborts without relaxation and without a helpful error message.
15557 @item
15558 The default linker script is arranged for code with @code{EIND = 0}.
15559 If code is supposed to work for a setup with @code{EIND != 0}, a custom
15560 linker script has to be used in order to place the sections whose
15561 name start with @code{.trampolines} into the segment where @code{EIND}
15562 points to.
15564 @item
15565 The startup code from libgcc never sets @code{EIND}.
15566 Notice that startup code is a blend of code from libgcc and AVR-LibC.
15567 For the impact of AVR-LibC on @code{EIND}, see the
15568 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
15570 @item
15571 It is legitimate for user-specific startup code to set up @code{EIND}
15572 early, for example by means of initialization code located in
15573 section @code{.init3}. Such code runs prior to general startup code
15574 that initializes RAM and calls constructors, but after the bit
15575 of startup code from AVR-LibC that sets @code{EIND} to the segment
15576 where the vector table is located.
15577 @example
15578 #include <avr/io.h>
15580 static void
15581 __attribute__((section(".init3"),naked,used,no_instrument_function))
15582 init3_set_eind (void)
15584   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
15585                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
15587 @end example
15589 @noindent
15590 The @code{__trampolines_start} symbol is defined in the linker script.
15592 @item
15593 Stubs are generated automatically by the linker if
15594 the following two conditions are met:
15595 @itemize @minus
15597 @item The address of a label is taken by means of the @code{gs} modifier
15598 (short for @emph{generate stubs}) like so:
15599 @example
15600 LDI r24, lo8(gs(@var{func}))
15601 LDI r25, hi8(gs(@var{func}))
15602 @end example
15603 @item The final location of that label is in a code segment
15604 @emph{outside} the segment where the stubs are located.
15605 @end itemize
15607 @item
15608 The compiler emits such @code{gs} modifiers for code labels in the
15609 following situations:
15610 @itemize @minus
15611 @item Taking address of a function or code label.
15612 @item Computed goto.
15613 @item If prologue-save function is used, see @option{-mcall-prologues}
15614 command-line option.
15615 @item Switch/case dispatch tables. If you do not want such dispatch
15616 tables you can specify the @option{-fno-jump-tables} command-line option.
15617 @item C and C++ constructors/destructors called during startup/shutdown.
15618 @item If the tools hit a @code{gs()} modifier explained above.
15619 @end itemize
15621 @item
15622 Jumping to non-symbolic addresses like so is @emph{not} supported:
15624 @example
15625 int main (void)
15627     /* Call function at word address 0x2 */
15628     return ((int(*)(void)) 0x2)();
15630 @end example
15632 Instead, a stub has to be set up, i.e.@: the function has to be called
15633 through a symbol (@code{func_4} in the example):
15635 @example
15636 int main (void)
15638     extern int func_4 (void);
15640     /* Call function at byte address 0x4 */
15641     return func_4();
15643 @end example
15645 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
15646 Alternatively, @code{func_4} can be defined in the linker script.
15647 @end itemize
15649 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
15650 @cindex @code{RAMPD}
15651 @cindex @code{RAMPX}
15652 @cindex @code{RAMPY}
15653 @cindex @code{RAMPZ}
15654 Some AVR devices support memories larger than the 64@tie{}KiB range
15655 that can be accessed with 16-bit pointers.  To access memory locations
15656 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
15657 register is used as high part of the address:
15658 The @code{X}, @code{Y}, @code{Z} address register is concatenated
15659 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
15660 register, respectively, to get a wide address. Similarly,
15661 @code{RAMPD} is used together with direct addressing.
15663 @itemize
15664 @item
15665 The startup code initializes the @code{RAMP} special function
15666 registers with zero.
15668 @item
15669 If a @ref{AVR Named Address Spaces,named address space} other than
15670 generic or @code{__flash} is used, then @code{RAMPZ} is set
15671 as needed before the operation.
15673 @item
15674 If the device supports RAM larger than 64@tie{}KiB and the compiler
15675 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
15676 is reset to zero after the operation.
15678 @item
15679 If the device comes with a specific @code{RAMP} register, the ISR
15680 prologue/epilogue saves/restores that SFR and initializes it with
15681 zero in case the ISR code might (implicitly) use it.
15683 @item
15684 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
15685 If you use inline assembler to read from locations outside the
15686 16-bit address range and change one of the @code{RAMP} registers,
15687 you must reset it to zero after the access.
15689 @end itemize
15691 @subsubsection AVR Built-in Macros
15693 GCC defines several built-in macros so that the user code can test
15694 for the presence or absence of features.  Almost any of the following
15695 built-in macros are deduced from device capabilities and thus
15696 triggered by the @option{-mmcu=} command-line option.
15698 For even more AVR-specific built-in macros see
15699 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
15701 @table @code
15703 @item __AVR_ARCH__
15704 Build-in macro that resolves to a decimal number that identifies the
15705 architecture and depends on the @option{-mmcu=@var{mcu}} option.
15706 Possible values are:
15708 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
15709 @code{4}, @code{5}, @code{51}, @code{6}
15711 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
15712 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
15714 respectively and
15716 @code{100}, @code{102}, @code{104},
15717 @code{105}, @code{106}, @code{107}
15719 for @var{mcu}=@code{avrtiny}, @code{avrxmega2}, @code{avrxmega4},
15720 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
15721 If @var{mcu} specifies a device, this built-in macro is set
15722 accordingly. For example, with @option{-mmcu=atmega8} the macro is
15723 defined to @code{4}.
15725 @item __AVR_@var{Device}__
15726 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
15727 the device's name. For example, @option{-mmcu=atmega8} defines the
15728 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
15729 @code{__AVR_ATtiny261A__}, etc.
15731 The built-in macros' names follow
15732 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
15733 the device name as from the AVR user manual. The difference between
15734 @var{Device} in the built-in macro and @var{device} in
15735 @option{-mmcu=@var{device}} is that the latter is always lowercase.
15737 If @var{device} is not a device but only a core architecture like
15738 @samp{avr51}, this macro is not defined.
15740 @item __AVR_DEVICE_NAME__
15741 Setting @option{-mmcu=@var{device}} defines this built-in macro to
15742 the device's name. For example, with @option{-mmcu=atmega8} the macro
15743 is defined to @code{atmega8}.
15745 If @var{device} is not a device but only a core architecture like
15746 @samp{avr51}, this macro is not defined.
15748 @item __AVR_XMEGA__
15749 The device / architecture belongs to the XMEGA family of devices.
15751 @item __AVR_HAVE_ELPM__
15752 The device has the @code{ELPM} instruction.
15754 @item __AVR_HAVE_ELPMX__
15755 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
15756 R@var{n},Z+} instructions.
15758 @item __AVR_HAVE_MOVW__
15759 The device has the @code{MOVW} instruction to perform 16-bit
15760 register-register moves.
15762 @item __AVR_HAVE_LPMX__
15763 The device has the @code{LPM R@var{n},Z} and
15764 @code{LPM R@var{n},Z+} instructions.
15766 @item __AVR_HAVE_MUL__
15767 The device has a hardware multiplier. 
15769 @item __AVR_HAVE_JMP_CALL__
15770 The device has the @code{JMP} and @code{CALL} instructions.
15771 This is the case for devices with at least 16@tie{}KiB of program
15772 memory.
15774 @item __AVR_HAVE_EIJMP_EICALL__
15775 @itemx __AVR_3_BYTE_PC__
15776 The device has the @code{EIJMP} and @code{EICALL} instructions.
15777 This is the case for devices with more than 128@tie{}KiB of program memory.
15778 This also means that the program counter
15779 (PC) is 3@tie{}bytes wide.
15781 @item __AVR_2_BYTE_PC__
15782 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
15783 with up to 128@tie{}KiB of program memory.
15785 @item __AVR_HAVE_8BIT_SP__
15786 @itemx __AVR_HAVE_16BIT_SP__
15787 The stack pointer (SP) register is treated as 8-bit respectively
15788 16-bit register by the compiler.
15789 The definition of these macros is affected by @option{-mtiny-stack}.
15791 @item __AVR_HAVE_SPH__
15792 @itemx __AVR_SP8__
15793 The device has the SPH (high part of stack pointer) special function
15794 register or has an 8-bit stack pointer, respectively.
15795 The definition of these macros is affected by @option{-mmcu=} and
15796 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
15797 by @option{-msp8}.
15799 @item __AVR_HAVE_RAMPD__
15800 @itemx __AVR_HAVE_RAMPX__
15801 @itemx __AVR_HAVE_RAMPY__
15802 @itemx __AVR_HAVE_RAMPZ__
15803 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
15804 @code{RAMPZ} special function register, respectively.
15806 @item __NO_INTERRUPTS__
15807 This macro reflects the @option{-mno-interrupts} command-line option.
15809 @item __AVR_ERRATA_SKIP__
15810 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
15811 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
15812 instructions because of a hardware erratum.  Skip instructions are
15813 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
15814 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
15815 set.
15817 @item __AVR_ISA_RMW__
15818 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
15820 @item __AVR_SFR_OFFSET__=@var{offset}
15821 Instructions that can address I/O special function registers directly
15822 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
15823 address as if addressed by an instruction to access RAM like @code{LD}
15824 or @code{STS}. This offset depends on the device architecture and has
15825 to be subtracted from the RAM address in order to get the
15826 respective I/O@tie{}address.
15828 @item __WITH_AVRLIBC__
15829 The compiler is configured to be used together with AVR-Libc.
15830 See the @option{--with-avrlibc} configure option.
15832 @end table
15834 @node Blackfin Options
15835 @subsection Blackfin Options
15836 @cindex Blackfin Options
15838 @table @gcctabopt
15839 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
15840 @opindex mcpu=
15841 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
15842 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
15843 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
15844 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
15845 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
15846 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
15847 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
15848 @samp{bf561}, @samp{bf592}.
15850 The optional @var{sirevision} specifies the silicon revision of the target
15851 Blackfin processor.  Any workarounds available for the targeted silicon revision
15852 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
15853 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
15854 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
15855 hexadecimal digits representing the major and minor numbers in the silicon
15856 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
15857 is not defined.  If @var{sirevision} is @samp{any}, the
15858 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
15859 If this optional @var{sirevision} is not used, GCC assumes the latest known
15860 silicon revision of the targeted Blackfin processor.
15862 GCC defines a preprocessor macro for the specified @var{cpu}.
15863 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
15864 provided by libgloss to be linked in if @option{-msim} is not given.
15866 Without this option, @samp{bf532} is used as the processor by default.
15868 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
15869 only the preprocessor macro is defined.
15871 @item -msim
15872 @opindex msim
15873 Specifies that the program will be run on the simulator.  This causes
15874 the simulator BSP provided by libgloss to be linked in.  This option
15875 has effect only for @samp{bfin-elf} toolchain.
15876 Certain other options, such as @option{-mid-shared-library} and
15877 @option{-mfdpic}, imply @option{-msim}.
15879 @item -momit-leaf-frame-pointer
15880 @opindex momit-leaf-frame-pointer
15881 Don't keep the frame pointer in a register for leaf functions.  This
15882 avoids the instructions to save, set up and restore frame pointers and
15883 makes an extra register available in leaf functions.  The option
15884 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
15885 which might make debugging harder.
15887 @item -mspecld-anomaly
15888 @opindex mspecld-anomaly
15889 When enabled, the compiler ensures that the generated code does not
15890 contain speculative loads after jump instructions. If this option is used,
15891 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
15893 @item -mno-specld-anomaly
15894 @opindex mno-specld-anomaly
15895 Don't generate extra code to prevent speculative loads from occurring.
15897 @item -mcsync-anomaly
15898 @opindex mcsync-anomaly
15899 When enabled, the compiler ensures that the generated code does not
15900 contain CSYNC or SSYNC instructions too soon after conditional branches.
15901 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
15903 @item -mno-csync-anomaly
15904 @opindex mno-csync-anomaly
15905 Don't generate extra code to prevent CSYNC or SSYNC instructions from
15906 occurring too soon after a conditional branch.
15908 @item -mlow-64k
15909 @opindex mlow-64k
15910 When enabled, the compiler is free to take advantage of the knowledge that
15911 the entire program fits into the low 64k of memory.
15913 @item -mno-low-64k
15914 @opindex mno-low-64k
15915 Assume that the program is arbitrarily large.  This is the default.
15917 @item -mstack-check-l1
15918 @opindex mstack-check-l1
15919 Do stack checking using information placed into L1 scratchpad memory by the
15920 uClinux kernel.
15922 @item -mid-shared-library
15923 @opindex mid-shared-library
15924 Generate code that supports shared libraries via the library ID method.
15925 This allows for execute in place and shared libraries in an environment
15926 without virtual memory management.  This option implies @option{-fPIC}.
15927 With a @samp{bfin-elf} target, this option implies @option{-msim}.
15929 @item -mno-id-shared-library
15930 @opindex mno-id-shared-library
15931 Generate code that doesn't assume ID-based shared libraries are being used.
15932 This is the default.
15934 @item -mleaf-id-shared-library
15935 @opindex mleaf-id-shared-library
15936 Generate code that supports shared libraries via the library ID method,
15937 but assumes that this library or executable won't link against any other
15938 ID shared libraries.  That allows the compiler to use faster code for jumps
15939 and calls.
15941 @item -mno-leaf-id-shared-library
15942 @opindex mno-leaf-id-shared-library
15943 Do not assume that the code being compiled won't link against any ID shared
15944 libraries.  Slower code is generated for jump and call insns.
15946 @item -mshared-library-id=n
15947 @opindex mshared-library-id
15948 Specifies the identification number of the ID-based shared library being
15949 compiled.  Specifying a value of 0 generates more compact code; specifying
15950 other values forces the allocation of that number to the current
15951 library but is no more space- or time-efficient than omitting this option.
15953 @item -msep-data
15954 @opindex msep-data
15955 Generate code that allows the data segment to be located in a different
15956 area of memory from the text segment.  This allows for execute in place in
15957 an environment without virtual memory management by eliminating relocations
15958 against the text section.
15960 @item -mno-sep-data
15961 @opindex mno-sep-data
15962 Generate code that assumes that the data segment follows the text segment.
15963 This is the default.
15965 @item -mlong-calls
15966 @itemx -mno-long-calls
15967 @opindex mlong-calls
15968 @opindex mno-long-calls
15969 Tells the compiler to perform function calls by first loading the
15970 address of the function into a register and then performing a subroutine
15971 call on this register.  This switch is needed if the target function
15972 lies outside of the 24-bit addressing range of the offset-based
15973 version of subroutine call instruction.
15975 This feature is not enabled by default.  Specifying
15976 @option{-mno-long-calls} restores the default behavior.  Note these
15977 switches have no effect on how the compiler generates code to handle
15978 function calls via function pointers.
15980 @item -mfast-fp
15981 @opindex mfast-fp
15982 Link with the fast floating-point library. This library relaxes some of
15983 the IEEE floating-point standard's rules for checking inputs against
15984 Not-a-Number (NAN), in the interest of performance.
15986 @item -minline-plt
15987 @opindex minline-plt
15988 Enable inlining of PLT entries in function calls to functions that are
15989 not known to bind locally.  It has no effect without @option{-mfdpic}.
15991 @item -mmulticore
15992 @opindex mmulticore
15993 Build a standalone application for multicore Blackfin processors. 
15994 This option causes proper start files and link scripts supporting 
15995 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
15996 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
15998 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
15999 selects the one-application-per-core programming model.  Without
16000 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
16001 programming model is used. In this model, the main function of Core B
16002 should be named as @code{coreb_main}.
16004 If this option is not used, the single-core application programming
16005 model is used.
16007 @item -mcorea
16008 @opindex mcorea
16009 Build a standalone application for Core A of BF561 when using
16010 the one-application-per-core programming model. Proper start files
16011 and link scripts are used to support Core A, and the macro
16012 @code{__BFIN_COREA} is defined.
16013 This option can only be used in conjunction with @option{-mmulticore}.
16015 @item -mcoreb
16016 @opindex mcoreb
16017 Build a standalone application for Core B of BF561 when using
16018 the one-application-per-core programming model. Proper start files
16019 and link scripts are used to support Core B, and the macro
16020 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
16021 should be used instead of @code{main}. 
16022 This option can only be used in conjunction with @option{-mmulticore}.
16024 @item -msdram
16025 @opindex msdram
16026 Build a standalone application for SDRAM. Proper start files and
16027 link scripts are used to put the application into SDRAM, and the macro
16028 @code{__BFIN_SDRAM} is defined.
16029 The loader should initialize SDRAM before loading the application.
16031 @item -micplb
16032 @opindex micplb
16033 Assume that ICPLBs are enabled at run time.  This has an effect on certain
16034 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
16035 are enabled; for standalone applications the default is off.
16036 @end table
16038 @node C6X Options
16039 @subsection C6X Options
16040 @cindex C6X Options
16042 @table @gcctabopt
16043 @item -march=@var{name}
16044 @opindex march
16045 This specifies the name of the target architecture.  GCC uses this
16046 name to determine what kind of instructions it can emit when generating
16047 assembly code.  Permissible names are: @samp{c62x},
16048 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
16050 @item -mbig-endian
16051 @opindex mbig-endian
16052 Generate code for a big-endian target.
16054 @item -mlittle-endian
16055 @opindex mlittle-endian
16056 Generate code for a little-endian target.  This is the default.
16058 @item -msim
16059 @opindex msim
16060 Choose startup files and linker script suitable for the simulator.
16062 @item -msdata=default
16063 @opindex msdata=default
16064 Put small global and static data in the @code{.neardata} section,
16065 which is pointed to by register @code{B14}.  Put small uninitialized
16066 global and static data in the @code{.bss} section, which is adjacent
16067 to the @code{.neardata} section.  Put small read-only data into the
16068 @code{.rodata} section.  The corresponding sections used for large
16069 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
16071 @item -msdata=all
16072 @opindex msdata=all
16073 Put all data, not just small objects, into the sections reserved for
16074 small data, and use addressing relative to the @code{B14} register to
16075 access them.
16077 @item -msdata=none
16078 @opindex msdata=none
16079 Make no use of the sections reserved for small data, and use absolute
16080 addresses to access all data.  Put all initialized global and static
16081 data in the @code{.fardata} section, and all uninitialized data in the
16082 @code{.far} section.  Put all constant data into the @code{.const}
16083 section.
16084 @end table
16086 @node CRIS Options
16087 @subsection CRIS Options
16088 @cindex CRIS Options
16090 These options are defined specifically for the CRIS ports.
16092 @table @gcctabopt
16093 @item -march=@var{architecture-type}
16094 @itemx -mcpu=@var{architecture-type}
16095 @opindex march
16096 @opindex mcpu
16097 Generate code for the specified architecture.  The choices for
16098 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
16099 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
16100 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
16101 @samp{v10}.
16103 @item -mtune=@var{architecture-type}
16104 @opindex mtune
16105 Tune to @var{architecture-type} everything applicable about the generated
16106 code, except for the ABI and the set of available instructions.  The
16107 choices for @var{architecture-type} are the same as for
16108 @option{-march=@var{architecture-type}}.
16110 @item -mmax-stack-frame=@var{n}
16111 @opindex mmax-stack-frame
16112 Warn when the stack frame of a function exceeds @var{n} bytes.
16114 @item -metrax4
16115 @itemx -metrax100
16116 @opindex metrax4
16117 @opindex metrax100
16118 The options @option{-metrax4} and @option{-metrax100} are synonyms for
16119 @option{-march=v3} and @option{-march=v8} respectively.
16121 @item -mmul-bug-workaround
16122 @itemx -mno-mul-bug-workaround
16123 @opindex mmul-bug-workaround
16124 @opindex mno-mul-bug-workaround
16125 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
16126 models where it applies.  This option is active by default.
16128 @item -mpdebug
16129 @opindex mpdebug
16130 Enable CRIS-specific verbose debug-related information in the assembly
16131 code.  This option also has the effect of turning off the @samp{#NO_APP}
16132 formatted-code indicator to the assembler at the beginning of the
16133 assembly file.
16135 @item -mcc-init
16136 @opindex mcc-init
16137 Do not use condition-code results from previous instruction; always emit
16138 compare and test instructions before use of condition codes.
16140 @item -mno-side-effects
16141 @opindex mno-side-effects
16142 Do not emit instructions with side effects in addressing modes other than
16143 post-increment.
16145 @item -mstack-align
16146 @itemx -mno-stack-align
16147 @itemx -mdata-align
16148 @itemx -mno-data-align
16149 @itemx -mconst-align
16150 @itemx -mno-const-align
16151 @opindex mstack-align
16152 @opindex mno-stack-align
16153 @opindex mdata-align
16154 @opindex mno-data-align
16155 @opindex mconst-align
16156 @opindex mno-const-align
16157 These options (@samp{no-} options) arrange (eliminate arrangements) for the
16158 stack frame, individual data and constants to be aligned for the maximum
16159 single data access size for the chosen CPU model.  The default is to
16160 arrange for 32-bit alignment.  ABI details such as structure layout are
16161 not affected by these options.
16163 @item -m32-bit
16164 @itemx -m16-bit
16165 @itemx -m8-bit
16166 @opindex m32-bit
16167 @opindex m16-bit
16168 @opindex m8-bit
16169 Similar to the stack- data- and const-align options above, these options
16170 arrange for stack frame, writable data and constants to all be 32-bit,
16171 16-bit or 8-bit aligned.  The default is 32-bit alignment.
16173 @item -mno-prologue-epilogue
16174 @itemx -mprologue-epilogue
16175 @opindex mno-prologue-epilogue
16176 @opindex mprologue-epilogue
16177 With @option{-mno-prologue-epilogue}, the normal function prologue and
16178 epilogue which set up the stack frame are omitted and no return
16179 instructions or return sequences are generated in the code.  Use this
16180 option only together with visual inspection of the compiled code: no
16181 warnings or errors are generated when call-saved registers must be saved,
16182 or storage for local variables needs to be allocated.
16184 @item -mno-gotplt
16185 @itemx -mgotplt
16186 @opindex mno-gotplt
16187 @opindex mgotplt
16188 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
16189 instruction sequences that load addresses for functions from the PLT part
16190 of the GOT rather than (traditional on other architectures) calls to the
16191 PLT@.  The default is @option{-mgotplt}.
16193 @item -melf
16194 @opindex melf
16195 Legacy no-op option only recognized with the cris-axis-elf and
16196 cris-axis-linux-gnu targets.
16198 @item -mlinux
16199 @opindex mlinux
16200 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
16202 @item -sim
16203 @opindex sim
16204 This option, recognized for the cris-axis-elf, arranges
16205 to link with input-output functions from a simulator library.  Code,
16206 initialized data and zero-initialized data are allocated consecutively.
16208 @item -sim2
16209 @opindex sim2
16210 Like @option{-sim}, but pass linker options to locate initialized data at
16211 0x40000000 and zero-initialized data at 0x80000000.
16212 @end table
16214 @node CR16 Options
16215 @subsection CR16 Options
16216 @cindex CR16 Options
16218 These options are defined specifically for the CR16 ports.
16220 @table @gcctabopt
16222 @item -mmac
16223 @opindex mmac
16224 Enable the use of multiply-accumulate instructions. Disabled by default.
16226 @item -mcr16cplus
16227 @itemx -mcr16c
16228 @opindex mcr16cplus
16229 @opindex mcr16c
16230 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
16231 is default.
16233 @item -msim
16234 @opindex msim
16235 Links the library libsim.a which is in compatible with simulator. Applicable
16236 to ELF compiler only.
16238 @item -mint32
16239 @opindex mint32
16240 Choose integer type as 32-bit wide.
16242 @item -mbit-ops
16243 @opindex mbit-ops
16244 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
16246 @item -mdata-model=@var{model}
16247 @opindex mdata-model
16248 Choose a data model. The choices for @var{model} are @samp{near},
16249 @samp{far} or @samp{medium}. @samp{medium} is default.
16250 However, @samp{far} is not valid with @option{-mcr16c}, as the
16251 CR16C architecture does not support the far data model.
16252 @end table
16254 @node Darwin Options
16255 @subsection Darwin Options
16256 @cindex Darwin options
16258 These options are defined for all architectures running the Darwin operating
16259 system.
16261 FSF GCC on Darwin does not create ``fat'' object files; it creates
16262 an object file for the single architecture that GCC was built to
16263 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
16264 @option{-arch} options are used; it does so by running the compiler or
16265 linker multiple times and joining the results together with
16266 @file{lipo}.
16268 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
16269 @samp{i686}) is determined by the flags that specify the ISA
16270 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
16271 @option{-force_cpusubtype_ALL} option can be used to override this.
16273 The Darwin tools vary in their behavior when presented with an ISA
16274 mismatch.  The assembler, @file{as}, only permits instructions to
16275 be used that are valid for the subtype of the file it is generating,
16276 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
16277 The linker for shared libraries, @file{/usr/bin/libtool}, fails
16278 and prints an error if asked to create a shared library with a less
16279 restrictive subtype than its input files (for instance, trying to put
16280 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
16281 for executables, @command{ld}, quietly gives the executable the most
16282 restrictive subtype of any of its input files.
16284 @table @gcctabopt
16285 @item -F@var{dir}
16286 @opindex F
16287 Add the framework directory @var{dir} to the head of the list of
16288 directories to be searched for header files.  These directories are
16289 interleaved with those specified by @option{-I} options and are
16290 scanned in a left-to-right order.
16292 A framework directory is a directory with frameworks in it.  A
16293 framework is a directory with a @file{Headers} and/or
16294 @file{PrivateHeaders} directory contained directly in it that ends
16295 in @file{.framework}.  The name of a framework is the name of this
16296 directory excluding the @file{.framework}.  Headers associated with
16297 the framework are found in one of those two directories, with
16298 @file{Headers} being searched first.  A subframework is a framework
16299 directory that is in a framework's @file{Frameworks} directory.
16300 Includes of subframework headers can only appear in a header of a
16301 framework that contains the subframework, or in a sibling subframework
16302 header.  Two subframeworks are siblings if they occur in the same
16303 framework.  A subframework should not have the same name as a
16304 framework; a warning is issued if this is violated.  Currently a
16305 subframework cannot have subframeworks; in the future, the mechanism
16306 may be extended to support this.  The standard frameworks can be found
16307 in @file{/System/Library/Frameworks} and
16308 @file{/Library/Frameworks}.  An example include looks like
16309 @code{#include <Framework/header.h>}, where @file{Framework} denotes
16310 the name of the framework and @file{header.h} is found in the
16311 @file{PrivateHeaders} or @file{Headers} directory.
16313 @item -iframework@var{dir}
16314 @opindex iframework
16315 Like @option{-F} except the directory is a treated as a system
16316 directory.  The main difference between this @option{-iframework} and
16317 @option{-F} is that with @option{-iframework} the compiler does not
16318 warn about constructs contained within header files found via
16319 @var{dir}.  This option is valid only for the C family of languages.
16321 @item -gused
16322 @opindex gused
16323 Emit debugging information for symbols that are used.  For stabs
16324 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
16325 This is by default ON@.
16327 @item -gfull
16328 @opindex gfull
16329 Emit debugging information for all symbols and types.
16331 @item -mmacosx-version-min=@var{version}
16332 The earliest version of MacOS X that this executable will run on
16333 is @var{version}.  Typical values of @var{version} include @code{10.1},
16334 @code{10.2}, and @code{10.3.9}.
16336 If the compiler was built to use the system's headers by default,
16337 then the default for this option is the system version on which the
16338 compiler is running, otherwise the default is to make choices that
16339 are compatible with as many systems and code bases as possible.
16341 @item -mkernel
16342 @opindex mkernel
16343 Enable kernel development mode.  The @option{-mkernel} option sets
16344 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
16345 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
16346 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
16347 applicable.  This mode also sets @option{-mno-altivec},
16348 @option{-msoft-float}, @option{-fno-builtin} and
16349 @option{-mlong-branch} for PowerPC targets.
16351 @item -mone-byte-bool
16352 @opindex mone-byte-bool
16353 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
16354 By default @code{sizeof(bool)} is @code{4} when compiling for
16355 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
16356 option has no effect on x86.
16358 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
16359 to generate code that is not binary compatible with code generated
16360 without that switch.  Using this switch may require recompiling all
16361 other modules in a program, including system libraries.  Use this
16362 switch to conform to a non-default data model.
16364 @item -mfix-and-continue
16365 @itemx -ffix-and-continue
16366 @itemx -findirect-data
16367 @opindex mfix-and-continue
16368 @opindex ffix-and-continue
16369 @opindex findirect-data
16370 Generate code suitable for fast turnaround development, such as to
16371 allow GDB to dynamically load @file{.o} files into already-running
16372 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
16373 are provided for backwards compatibility.
16375 @item -all_load
16376 @opindex all_load
16377 Loads all members of static archive libraries.
16378 See man ld(1) for more information.
16380 @item -arch_errors_fatal
16381 @opindex arch_errors_fatal
16382 Cause the errors having to do with files that have the wrong architecture
16383 to be fatal.
16385 @item -bind_at_load
16386 @opindex bind_at_load
16387 Causes the output file to be marked such that the dynamic linker will
16388 bind all undefined references when the file is loaded or launched.
16390 @item -bundle
16391 @opindex bundle
16392 Produce a Mach-o bundle format file.
16393 See man ld(1) for more information.
16395 @item -bundle_loader @var{executable}
16396 @opindex bundle_loader
16397 This option specifies the @var{executable} that will load the build
16398 output file being linked.  See man ld(1) for more information.
16400 @item -dynamiclib
16401 @opindex dynamiclib
16402 When passed this option, GCC produces a dynamic library instead of
16403 an executable when linking, using the Darwin @file{libtool} command.
16405 @item -force_cpusubtype_ALL
16406 @opindex force_cpusubtype_ALL
16407 This causes GCC's output file to have the @samp{ALL} subtype, instead of
16408 one controlled by the @option{-mcpu} or @option{-march} option.
16410 @item -allowable_client  @var{client_name}
16411 @itemx -client_name
16412 @itemx -compatibility_version
16413 @itemx -current_version
16414 @itemx -dead_strip
16415 @itemx -dependency-file
16416 @itemx -dylib_file
16417 @itemx -dylinker_install_name
16418 @itemx -dynamic
16419 @itemx -exported_symbols_list
16420 @itemx -filelist
16421 @need 800
16422 @itemx -flat_namespace
16423 @itemx -force_flat_namespace
16424 @itemx -headerpad_max_install_names
16425 @itemx -image_base
16426 @itemx -init
16427 @itemx -install_name
16428 @itemx -keep_private_externs
16429 @itemx -multi_module
16430 @itemx -multiply_defined
16431 @itemx -multiply_defined_unused
16432 @need 800
16433 @itemx -noall_load
16434 @itemx -no_dead_strip_inits_and_terms
16435 @itemx -nofixprebinding
16436 @itemx -nomultidefs
16437 @itemx -noprebind
16438 @itemx -noseglinkedit
16439 @itemx -pagezero_size
16440 @itemx -prebind
16441 @itemx -prebind_all_twolevel_modules
16442 @itemx -private_bundle
16443 @need 800
16444 @itemx -read_only_relocs
16445 @itemx -sectalign
16446 @itemx -sectobjectsymbols
16447 @itemx -whyload
16448 @itemx -seg1addr
16449 @itemx -sectcreate
16450 @itemx -sectobjectsymbols
16451 @itemx -sectorder
16452 @itemx -segaddr
16453 @itemx -segs_read_only_addr
16454 @need 800
16455 @itemx -segs_read_write_addr
16456 @itemx -seg_addr_table
16457 @itemx -seg_addr_table_filename
16458 @itemx -seglinkedit
16459 @itemx -segprot
16460 @itemx -segs_read_only_addr
16461 @itemx -segs_read_write_addr
16462 @itemx -single_module
16463 @itemx -static
16464 @itemx -sub_library
16465 @need 800
16466 @itemx -sub_umbrella
16467 @itemx -twolevel_namespace
16468 @itemx -umbrella
16469 @itemx -undefined
16470 @itemx -unexported_symbols_list
16471 @itemx -weak_reference_mismatches
16472 @itemx -whatsloaded
16473 @opindex allowable_client
16474 @opindex client_name
16475 @opindex compatibility_version
16476 @opindex current_version
16477 @opindex dead_strip
16478 @opindex dependency-file
16479 @opindex dylib_file
16480 @opindex dylinker_install_name
16481 @opindex dynamic
16482 @opindex exported_symbols_list
16483 @opindex filelist
16484 @opindex flat_namespace
16485 @opindex force_flat_namespace
16486 @opindex headerpad_max_install_names
16487 @opindex image_base
16488 @opindex init
16489 @opindex install_name
16490 @opindex keep_private_externs
16491 @opindex multi_module
16492 @opindex multiply_defined
16493 @opindex multiply_defined_unused
16494 @opindex noall_load
16495 @opindex no_dead_strip_inits_and_terms
16496 @opindex nofixprebinding
16497 @opindex nomultidefs
16498 @opindex noprebind
16499 @opindex noseglinkedit
16500 @opindex pagezero_size
16501 @opindex prebind
16502 @opindex prebind_all_twolevel_modules
16503 @opindex private_bundle
16504 @opindex read_only_relocs
16505 @opindex sectalign
16506 @opindex sectobjectsymbols
16507 @opindex whyload
16508 @opindex seg1addr
16509 @opindex sectcreate
16510 @opindex sectobjectsymbols
16511 @opindex sectorder
16512 @opindex segaddr
16513 @opindex segs_read_only_addr
16514 @opindex segs_read_write_addr
16515 @opindex seg_addr_table
16516 @opindex seg_addr_table_filename
16517 @opindex seglinkedit
16518 @opindex segprot
16519 @opindex segs_read_only_addr
16520 @opindex segs_read_write_addr
16521 @opindex single_module
16522 @opindex static
16523 @opindex sub_library
16524 @opindex sub_umbrella
16525 @opindex twolevel_namespace
16526 @opindex umbrella
16527 @opindex undefined
16528 @opindex unexported_symbols_list
16529 @opindex weak_reference_mismatches
16530 @opindex whatsloaded
16531 These options are passed to the Darwin linker.  The Darwin linker man page
16532 describes them in detail.
16533 @end table
16535 @node DEC Alpha Options
16536 @subsection DEC Alpha Options
16538 These @samp{-m} options are defined for the DEC Alpha implementations:
16540 @table @gcctabopt
16541 @item -mno-soft-float
16542 @itemx -msoft-float
16543 @opindex mno-soft-float
16544 @opindex msoft-float
16545 Use (do not use) the hardware floating-point instructions for
16546 floating-point operations.  When @option{-msoft-float} is specified,
16547 functions in @file{libgcc.a} are used to perform floating-point
16548 operations.  Unless they are replaced by routines that emulate the
16549 floating-point operations, or compiled in such a way as to call such
16550 emulations routines, these routines issue floating-point
16551 operations.   If you are compiling for an Alpha without floating-point
16552 operations, you must ensure that the library is built so as not to call
16553 them.
16555 Note that Alpha implementations without floating-point operations are
16556 required to have floating-point registers.
16558 @item -mfp-reg
16559 @itemx -mno-fp-regs
16560 @opindex mfp-reg
16561 @opindex mno-fp-regs
16562 Generate code that uses (does not use) the floating-point register set.
16563 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
16564 register set is not used, floating-point operands are passed in integer
16565 registers as if they were integers and floating-point results are passed
16566 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
16567 so any function with a floating-point argument or return value called by code
16568 compiled with @option{-mno-fp-regs} must also be compiled with that
16569 option.
16571 A typical use of this option is building a kernel that does not use,
16572 and hence need not save and restore, any floating-point registers.
16574 @item -mieee
16575 @opindex mieee
16576 The Alpha architecture implements floating-point hardware optimized for
16577 maximum performance.  It is mostly compliant with the IEEE floating-point
16578 standard.  However, for full compliance, software assistance is
16579 required.  This option generates code fully IEEE-compliant code
16580 @emph{except} that the @var{inexact-flag} is not maintained (see below).
16581 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
16582 defined during compilation.  The resulting code is less efficient but is
16583 able to correctly support denormalized numbers and exceptional IEEE
16584 values such as not-a-number and plus/minus infinity.  Other Alpha
16585 compilers call this option @option{-ieee_with_no_inexact}.
16587 @item -mieee-with-inexact
16588 @opindex mieee-with-inexact
16589 This is like @option{-mieee} except the generated code also maintains
16590 the IEEE @var{inexact-flag}.  Turning on this option causes the
16591 generated code to implement fully-compliant IEEE math.  In addition to
16592 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
16593 macro.  On some Alpha implementations the resulting code may execute
16594 significantly slower than the code generated by default.  Since there is
16595 very little code that depends on the @var{inexact-flag}, you should
16596 normally not specify this option.  Other Alpha compilers call this
16597 option @option{-ieee_with_inexact}.
16599 @item -mfp-trap-mode=@var{trap-mode}
16600 @opindex mfp-trap-mode
16601 This option controls what floating-point related traps are enabled.
16602 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
16603 The trap mode can be set to one of four values:
16605 @table @samp
16606 @item n
16607 This is the default (normal) setting.  The only traps that are enabled
16608 are the ones that cannot be disabled in software (e.g., division by zero
16609 trap).
16611 @item u
16612 In addition to the traps enabled by @samp{n}, underflow traps are enabled
16613 as well.
16615 @item su
16616 Like @samp{u}, but the instructions are marked to be safe for software
16617 completion (see Alpha architecture manual for details).
16619 @item sui
16620 Like @samp{su}, but inexact traps are enabled as well.
16621 @end table
16623 @item -mfp-rounding-mode=@var{rounding-mode}
16624 @opindex mfp-rounding-mode
16625 Selects the IEEE rounding mode.  Other Alpha compilers call this option
16626 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
16629 @table @samp
16630 @item n
16631 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
16632 the nearest machine number or towards the even machine number in case
16633 of a tie.
16635 @item m
16636 Round towards minus infinity.
16638 @item c
16639 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
16641 @item d
16642 Dynamic rounding mode.  A field in the floating-point control register
16643 (@var{fpcr}, see Alpha architecture reference manual) controls the
16644 rounding mode in effect.  The C library initializes this register for
16645 rounding towards plus infinity.  Thus, unless your program modifies the
16646 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
16647 @end table
16649 @item -mtrap-precision=@var{trap-precision}
16650 @opindex mtrap-precision
16651 In the Alpha architecture, floating-point traps are imprecise.  This
16652 means without software assistance it is impossible to recover from a
16653 floating trap and program execution normally needs to be terminated.
16654 GCC can generate code that can assist operating system trap handlers
16655 in determining the exact location that caused a floating-point trap.
16656 Depending on the requirements of an application, different levels of
16657 precisions can be selected:
16659 @table @samp
16660 @item p
16661 Program precision.  This option is the default and means a trap handler
16662 can only identify which program caused a floating-point exception.
16664 @item f
16665 Function precision.  The trap handler can determine the function that
16666 caused a floating-point exception.
16668 @item i
16669 Instruction precision.  The trap handler can determine the exact
16670 instruction that caused a floating-point exception.
16671 @end table
16673 Other Alpha compilers provide the equivalent options called
16674 @option{-scope_safe} and @option{-resumption_safe}.
16676 @item -mieee-conformant
16677 @opindex mieee-conformant
16678 This option marks the generated code as IEEE conformant.  You must not
16679 use this option unless you also specify @option{-mtrap-precision=i} and either
16680 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
16681 is to emit the line @samp{.eflag 48} in the function prologue of the
16682 generated assembly file.
16684 @item -mbuild-constants
16685 @opindex mbuild-constants
16686 Normally GCC examines a 32- or 64-bit integer constant to
16687 see if it can construct it from smaller constants in two or three
16688 instructions.  If it cannot, it outputs the constant as a literal and
16689 generates code to load it from the data segment at run time.
16691 Use this option to require GCC to construct @emph{all} integer constants
16692 using code, even if it takes more instructions (the maximum is six).
16694 You typically use this option to build a shared library dynamic
16695 loader.  Itself a shared library, it must relocate itself in memory
16696 before it can find the variables and constants in its own data segment.
16698 @item -mbwx
16699 @itemx -mno-bwx
16700 @itemx -mcix
16701 @itemx -mno-cix
16702 @itemx -mfix
16703 @itemx -mno-fix
16704 @itemx -mmax
16705 @itemx -mno-max
16706 @opindex mbwx
16707 @opindex mno-bwx
16708 @opindex mcix
16709 @opindex mno-cix
16710 @opindex mfix
16711 @opindex mno-fix
16712 @opindex mmax
16713 @opindex mno-max
16714 Indicate whether GCC should generate code to use the optional BWX,
16715 CIX, FIX and MAX instruction sets.  The default is to use the instruction
16716 sets supported by the CPU type specified via @option{-mcpu=} option or that
16717 of the CPU on which GCC was built if none is specified.
16719 @item -mfloat-vax
16720 @itemx -mfloat-ieee
16721 @opindex mfloat-vax
16722 @opindex mfloat-ieee
16723 Generate code that uses (does not use) VAX F and G floating-point
16724 arithmetic instead of IEEE single and double precision.
16726 @item -mexplicit-relocs
16727 @itemx -mno-explicit-relocs
16728 @opindex mexplicit-relocs
16729 @opindex mno-explicit-relocs
16730 Older Alpha assemblers provided no way to generate symbol relocations
16731 except via assembler macros.  Use of these macros does not allow
16732 optimal instruction scheduling.  GNU binutils as of version 2.12
16733 supports a new syntax that allows the compiler to explicitly mark
16734 which relocations should apply to which instructions.  This option
16735 is mostly useful for debugging, as GCC detects the capabilities of
16736 the assembler when it is built and sets the default accordingly.
16738 @item -msmall-data
16739 @itemx -mlarge-data
16740 @opindex msmall-data
16741 @opindex mlarge-data
16742 When @option{-mexplicit-relocs} is in effect, static data is
16743 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
16744 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
16745 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
16746 16-bit relocations off of the @code{$gp} register.  This limits the
16747 size of the small data area to 64KB, but allows the variables to be
16748 directly accessed via a single instruction.
16750 The default is @option{-mlarge-data}.  With this option the data area
16751 is limited to just below 2GB@.  Programs that require more than 2GB of
16752 data must use @code{malloc} or @code{mmap} to allocate the data in the
16753 heap instead of in the program's data segment.
16755 When generating code for shared libraries, @option{-fpic} implies
16756 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
16758 @item -msmall-text
16759 @itemx -mlarge-text
16760 @opindex msmall-text
16761 @opindex mlarge-text
16762 When @option{-msmall-text} is used, the compiler assumes that the
16763 code of the entire program (or shared library) fits in 4MB, and is
16764 thus reachable with a branch instruction.  When @option{-msmall-data}
16765 is used, the compiler can assume that all local symbols share the
16766 same @code{$gp} value, and thus reduce the number of instructions
16767 required for a function call from 4 to 1.
16769 The default is @option{-mlarge-text}.
16771 @item -mcpu=@var{cpu_type}
16772 @opindex mcpu
16773 Set the instruction set and instruction scheduling parameters for
16774 machine type @var{cpu_type}.  You can specify either the @samp{EV}
16775 style name or the corresponding chip number.  GCC supports scheduling
16776 parameters for the EV4, EV5 and EV6 family of processors and
16777 chooses the default values for the instruction set from the processor
16778 you specify.  If you do not specify a processor type, GCC defaults
16779 to the processor on which the compiler was built.
16781 Supported values for @var{cpu_type} are
16783 @table @samp
16784 @item ev4
16785 @itemx ev45
16786 @itemx 21064
16787 Schedules as an EV4 and has no instruction set extensions.
16789 @item ev5
16790 @itemx 21164
16791 Schedules as an EV5 and has no instruction set extensions.
16793 @item ev56
16794 @itemx 21164a
16795 Schedules as an EV5 and supports the BWX extension.
16797 @item pca56
16798 @itemx 21164pc
16799 @itemx 21164PC
16800 Schedules as an EV5 and supports the BWX and MAX extensions.
16802 @item ev6
16803 @itemx 21264
16804 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
16806 @item ev67
16807 @itemx 21264a
16808 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
16809 @end table
16811 Native toolchains also support the value @samp{native},
16812 which selects the best architecture option for the host processor.
16813 @option{-mcpu=native} has no effect if GCC does not recognize
16814 the processor.
16816 @item -mtune=@var{cpu_type}
16817 @opindex mtune
16818 Set only the instruction scheduling parameters for machine type
16819 @var{cpu_type}.  The instruction set is not changed.
16821 Native toolchains also support the value @samp{native},
16822 which selects the best architecture option for the host processor.
16823 @option{-mtune=native} has no effect if GCC does not recognize
16824 the processor.
16826 @item -mmemory-latency=@var{time}
16827 @opindex mmemory-latency
16828 Sets the latency the scheduler should assume for typical memory
16829 references as seen by the application.  This number is highly
16830 dependent on the memory access patterns used by the application
16831 and the size of the external cache on the machine.
16833 Valid options for @var{time} are
16835 @table @samp
16836 @item @var{number}
16837 A decimal number representing clock cycles.
16839 @item L1
16840 @itemx L2
16841 @itemx L3
16842 @itemx main
16843 The compiler contains estimates of the number of clock cycles for
16844 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
16845 (also called Dcache, Scache, and Bcache), as well as to main memory.
16846 Note that L3 is only valid for EV5.
16848 @end table
16849 @end table
16851 @node FR30 Options
16852 @subsection FR30 Options
16853 @cindex FR30 Options
16855 These options are defined specifically for the FR30 port.
16857 @table @gcctabopt
16859 @item -msmall-model
16860 @opindex msmall-model
16861 Use the small address space model.  This can produce smaller code, but
16862 it does assume that all symbolic values and addresses fit into a
16863 20-bit range.
16865 @item -mno-lsim
16866 @opindex mno-lsim
16867 Assume that runtime support has been provided and so there is no need
16868 to include the simulator library (@file{libsim.a}) on the linker
16869 command line.
16871 @end table
16873 @node FT32 Options
16874 @subsection FT32 Options
16875 @cindex FT32 Options
16877 These options are defined specifically for the FT32 port.
16879 @table @gcctabopt
16881 @item -msim
16882 @opindex msim
16883 Specifies that the program will be run on the simulator.  This causes
16884 an alternate runtime startup and library to be linked.
16885 You must not use this option when generating programs that will run on
16886 real hardware; you must provide your own runtime library for whatever
16887 I/O functions are needed.
16889 @item -mlra
16890 @opindex mlra
16891 Enable Local Register Allocation.  This is still experimental for FT32,
16892 so by default the compiler uses standard reload.
16894 @item -mnodiv
16895 @opindex mnodiv
16896 Do not use div and mod instructions.
16898 @end table
16900 @node FRV Options
16901 @subsection FRV Options
16902 @cindex FRV Options
16904 @table @gcctabopt
16905 @item -mgpr-32
16906 @opindex mgpr-32
16908 Only use the first 32 general-purpose registers.
16910 @item -mgpr-64
16911 @opindex mgpr-64
16913 Use all 64 general-purpose registers.
16915 @item -mfpr-32
16916 @opindex mfpr-32
16918 Use only the first 32 floating-point registers.
16920 @item -mfpr-64
16921 @opindex mfpr-64
16923 Use all 64 floating-point registers.
16925 @item -mhard-float
16926 @opindex mhard-float
16928 Use hardware instructions for floating-point operations.
16930 @item -msoft-float
16931 @opindex msoft-float
16933 Use library routines for floating-point operations.
16935 @item -malloc-cc
16936 @opindex malloc-cc
16938 Dynamically allocate condition code registers.
16940 @item -mfixed-cc
16941 @opindex mfixed-cc
16943 Do not try to dynamically allocate condition code registers, only
16944 use @code{icc0} and @code{fcc0}.
16946 @item -mdword
16947 @opindex mdword
16949 Change ABI to use double word insns.
16951 @item -mno-dword
16952 @opindex mno-dword
16954 Do not use double word instructions.
16956 @item -mdouble
16957 @opindex mdouble
16959 Use floating-point double instructions.
16961 @item -mno-double
16962 @opindex mno-double
16964 Do not use floating-point double instructions.
16966 @item -mmedia
16967 @opindex mmedia
16969 Use media instructions.
16971 @item -mno-media
16972 @opindex mno-media
16974 Do not use media instructions.
16976 @item -mmuladd
16977 @opindex mmuladd
16979 Use multiply and add/subtract instructions.
16981 @item -mno-muladd
16982 @opindex mno-muladd
16984 Do not use multiply and add/subtract instructions.
16986 @item -mfdpic
16987 @opindex mfdpic
16989 Select the FDPIC ABI, which uses function descriptors to represent
16990 pointers to functions.  Without any PIC/PIE-related options, it
16991 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
16992 assumes GOT entries and small data are within a 12-bit range from the
16993 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
16994 are computed with 32 bits.
16995 With a @samp{bfin-elf} target, this option implies @option{-msim}.
16997 @item -minline-plt
16998 @opindex minline-plt
17000 Enable inlining of PLT entries in function calls to functions that are
17001 not known to bind locally.  It has no effect without @option{-mfdpic}.
17002 It's enabled by default if optimizing for speed and compiling for
17003 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
17004 optimization option such as @option{-O3} or above is present in the
17005 command line.
17007 @item -mTLS
17008 @opindex mTLS
17010 Assume a large TLS segment when generating thread-local code.
17012 @item -mtls
17013 @opindex mtls
17015 Do not assume a large TLS segment when generating thread-local code.
17017 @item -mgprel-ro
17018 @opindex mgprel-ro
17020 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
17021 that is known to be in read-only sections.  It's enabled by default,
17022 except for @option{-fpic} or @option{-fpie}: even though it may help
17023 make the global offset table smaller, it trades 1 instruction for 4.
17024 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
17025 one of which may be shared by multiple symbols, and it avoids the need
17026 for a GOT entry for the referenced symbol, so it's more likely to be a
17027 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
17029 @item -multilib-library-pic
17030 @opindex multilib-library-pic
17032 Link with the (library, not FD) pic libraries.  It's implied by
17033 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
17034 @option{-fpic} without @option{-mfdpic}.  You should never have to use
17035 it explicitly.
17037 @item -mlinked-fp
17038 @opindex mlinked-fp
17040 Follow the EABI requirement of always creating a frame pointer whenever
17041 a stack frame is allocated.  This option is enabled by default and can
17042 be disabled with @option{-mno-linked-fp}.
17044 @item -mlong-calls
17045 @opindex mlong-calls
17047 Use indirect addressing to call functions outside the current
17048 compilation unit.  This allows the functions to be placed anywhere
17049 within the 32-bit address space.
17051 @item -malign-labels
17052 @opindex malign-labels
17054 Try to align labels to an 8-byte boundary by inserting NOPs into the
17055 previous packet.  This option only has an effect when VLIW packing
17056 is enabled.  It doesn't create new packets; it merely adds NOPs to
17057 existing ones.
17059 @item -mlibrary-pic
17060 @opindex mlibrary-pic
17062 Generate position-independent EABI code.
17064 @item -macc-4
17065 @opindex macc-4
17067 Use only the first four media accumulator registers.
17069 @item -macc-8
17070 @opindex macc-8
17072 Use all eight media accumulator registers.
17074 @item -mpack
17075 @opindex mpack
17077 Pack VLIW instructions.
17079 @item -mno-pack
17080 @opindex mno-pack
17082 Do not pack VLIW instructions.
17084 @item -mno-eflags
17085 @opindex mno-eflags
17087 Do not mark ABI switches in e_flags.
17089 @item -mcond-move
17090 @opindex mcond-move
17092 Enable the use of conditional-move instructions (default).
17094 This switch is mainly for debugging the compiler and will likely be removed
17095 in a future version.
17097 @item -mno-cond-move
17098 @opindex mno-cond-move
17100 Disable the use of conditional-move instructions.
17102 This switch is mainly for debugging the compiler and will likely be removed
17103 in a future version.
17105 @item -mscc
17106 @opindex mscc
17108 Enable the use of conditional set instructions (default).
17110 This switch is mainly for debugging the compiler and will likely be removed
17111 in a future version.
17113 @item -mno-scc
17114 @opindex mno-scc
17116 Disable the use of conditional set instructions.
17118 This switch is mainly for debugging the compiler and will likely be removed
17119 in a future version.
17121 @item -mcond-exec
17122 @opindex mcond-exec
17124 Enable the use of conditional execution (default).
17126 This switch is mainly for debugging the compiler and will likely be removed
17127 in a future version.
17129 @item -mno-cond-exec
17130 @opindex mno-cond-exec
17132 Disable the use of conditional execution.
17134 This switch is mainly for debugging the compiler and will likely be removed
17135 in a future version.
17137 @item -mvliw-branch
17138 @opindex mvliw-branch
17140 Run a pass to pack branches into VLIW instructions (default).
17142 This switch is mainly for debugging the compiler and will likely be removed
17143 in a future version.
17145 @item -mno-vliw-branch
17146 @opindex mno-vliw-branch
17148 Do not run a pass to pack branches into VLIW instructions.
17150 This switch is mainly for debugging the compiler and will likely be removed
17151 in a future version.
17153 @item -mmulti-cond-exec
17154 @opindex mmulti-cond-exec
17156 Enable optimization of @code{&&} and @code{||} in conditional execution
17157 (default).
17159 This switch is mainly for debugging the compiler and will likely be removed
17160 in a future version.
17162 @item -mno-multi-cond-exec
17163 @opindex mno-multi-cond-exec
17165 Disable optimization of @code{&&} and @code{||} in conditional execution.
17167 This switch is mainly for debugging the compiler and will likely be removed
17168 in a future version.
17170 @item -mnested-cond-exec
17171 @opindex mnested-cond-exec
17173 Enable nested conditional execution optimizations (default).
17175 This switch is mainly for debugging the compiler and will likely be removed
17176 in a future version.
17178 @item -mno-nested-cond-exec
17179 @opindex mno-nested-cond-exec
17181 Disable nested conditional execution optimizations.
17183 This switch is mainly for debugging the compiler and will likely be removed
17184 in a future version.
17186 @item -moptimize-membar
17187 @opindex moptimize-membar
17189 This switch removes redundant @code{membar} instructions from the
17190 compiler-generated code.  It is enabled by default.
17192 @item -mno-optimize-membar
17193 @opindex mno-optimize-membar
17195 This switch disables the automatic removal of redundant @code{membar}
17196 instructions from the generated code.
17198 @item -mtomcat-stats
17199 @opindex mtomcat-stats
17201 Cause gas to print out tomcat statistics.
17203 @item -mcpu=@var{cpu}
17204 @opindex mcpu
17206 Select the processor type for which to generate code.  Possible values are
17207 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
17208 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
17210 @end table
17212 @node GNU/Linux Options
17213 @subsection GNU/Linux Options
17215 These @samp{-m} options are defined for GNU/Linux targets:
17217 @table @gcctabopt
17218 @item -mglibc
17219 @opindex mglibc
17220 Use the GNU C library.  This is the default except
17221 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
17222 @samp{*-*-linux-*android*} targets.
17224 @item -muclibc
17225 @opindex muclibc
17226 Use uClibc C library.  This is the default on
17227 @samp{*-*-linux-*uclibc*} targets.
17229 @item -mmusl
17230 @opindex mmusl
17231 Use the musl C library.  This is the default on
17232 @samp{*-*-linux-*musl*} targets.
17234 @item -mbionic
17235 @opindex mbionic
17236 Use Bionic C library.  This is the default on
17237 @samp{*-*-linux-*android*} targets.
17239 @item -mandroid
17240 @opindex mandroid
17241 Compile code compatible with Android platform.  This is the default on
17242 @samp{*-*-linux-*android*} targets.
17244 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
17245 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
17246 this option makes the GCC driver pass Android-specific options to the linker.
17247 Finally, this option causes the preprocessor macro @code{__ANDROID__}
17248 to be defined.
17250 @item -tno-android-cc
17251 @opindex tno-android-cc
17252 Disable compilation effects of @option{-mandroid}, i.e., do not enable
17253 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
17254 @option{-fno-rtti} by default.
17256 @item -tno-android-ld
17257 @opindex tno-android-ld
17258 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
17259 linking options to the linker.
17261 @end table
17263 @node H8/300 Options
17264 @subsection H8/300 Options
17266 These @samp{-m} options are defined for the H8/300 implementations:
17268 @table @gcctabopt
17269 @item -mrelax
17270 @opindex mrelax
17271 Shorten some address references at link time, when possible; uses the
17272 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
17273 ld, Using ld}, for a fuller description.
17275 @item -mh
17276 @opindex mh
17277 Generate code for the H8/300H@.
17279 @item -ms
17280 @opindex ms
17281 Generate code for the H8S@.
17283 @item -mn
17284 @opindex mn
17285 Generate code for the H8S and H8/300H in the normal mode.  This switch
17286 must be used either with @option{-mh} or @option{-ms}.
17288 @item -ms2600
17289 @opindex ms2600
17290 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
17292 @item -mexr
17293 @opindex mexr
17294 Extended registers are stored on stack before execution of function
17295 with monitor attribute. Default option is @option{-mexr}.
17296 This option is valid only for H8S targets.
17298 @item -mno-exr
17299 @opindex mno-exr
17300 Extended registers are not stored on stack before execution of function 
17301 with monitor attribute. Default option is @option{-mno-exr}. 
17302 This option is valid only for H8S targets.
17304 @item -mint32
17305 @opindex mint32
17306 Make @code{int} data 32 bits by default.
17308 @item -malign-300
17309 @opindex malign-300
17310 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
17311 The default for the H8/300H and H8S is to align longs and floats on
17312 4-byte boundaries.
17313 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
17314 This option has no effect on the H8/300.
17315 @end table
17317 @node HPPA Options
17318 @subsection HPPA Options
17319 @cindex HPPA Options
17321 These @samp{-m} options are defined for the HPPA family of computers:
17323 @table @gcctabopt
17324 @item -march=@var{architecture-type}
17325 @opindex march
17326 Generate code for the specified architecture.  The choices for
17327 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
17328 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
17329 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
17330 architecture option for your machine.  Code compiled for lower numbered
17331 architectures runs on higher numbered architectures, but not the
17332 other way around.
17334 @item -mpa-risc-1-0
17335 @itemx -mpa-risc-1-1
17336 @itemx -mpa-risc-2-0
17337 @opindex mpa-risc-1-0
17338 @opindex mpa-risc-1-1
17339 @opindex mpa-risc-2-0
17340 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
17342 @item -mjump-in-delay
17343 @opindex mjump-in-delay
17344 This option is ignored and provided for compatibility purposes only.
17346 @item -mdisable-fpregs
17347 @opindex mdisable-fpregs
17348 Prevent floating-point registers from being used in any manner.  This is
17349 necessary for compiling kernels that perform lazy context switching of
17350 floating-point registers.  If you use this option and attempt to perform
17351 floating-point operations, the compiler aborts.
17353 @item -mdisable-indexing
17354 @opindex mdisable-indexing
17355 Prevent the compiler from using indexing address modes.  This avoids some
17356 rather obscure problems when compiling MIG generated code under MACH@.
17358 @item -mno-space-regs
17359 @opindex mno-space-regs
17360 Generate code that assumes the target has no space registers.  This allows
17361 GCC to generate faster indirect calls and use unscaled index address modes.
17363 Such code is suitable for level 0 PA systems and kernels.
17365 @item -mfast-indirect-calls
17366 @opindex mfast-indirect-calls
17367 Generate code that assumes calls never cross space boundaries.  This
17368 allows GCC to emit code that performs faster indirect calls.
17370 This option does not work in the presence of shared libraries or nested
17371 functions.
17373 @item -mfixed-range=@var{register-range}
17374 @opindex mfixed-range
17375 Generate code treating the given register range as fixed registers.
17376 A fixed register is one that the register allocator cannot use.  This is
17377 useful when compiling kernel code.  A register range is specified as
17378 two registers separated by a dash.  Multiple register ranges can be
17379 specified separated by a comma.
17381 @item -mlong-load-store
17382 @opindex mlong-load-store
17383 Generate 3-instruction load and store sequences as sometimes required by
17384 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
17385 the HP compilers.
17387 @item -mportable-runtime
17388 @opindex mportable-runtime
17389 Use the portable calling conventions proposed by HP for ELF systems.
17391 @item -mgas
17392 @opindex mgas
17393 Enable the use of assembler directives only GAS understands.
17395 @item -mschedule=@var{cpu-type}
17396 @opindex mschedule
17397 Schedule code according to the constraints for the machine type
17398 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
17399 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
17400 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
17401 proper scheduling option for your machine.  The default scheduling is
17402 @samp{8000}.
17404 @item -mlinker-opt
17405 @opindex mlinker-opt
17406 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
17407 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
17408 linkers in which they give bogus error messages when linking some programs.
17410 @item -msoft-float
17411 @opindex msoft-float
17412 Generate output containing library calls for floating point.
17413 @strong{Warning:} the requisite libraries are not available for all HPPA
17414 targets.  Normally the facilities of the machine's usual C compiler are
17415 used, but this cannot be done directly in cross-compilation.  You must make
17416 your own arrangements to provide suitable library functions for
17417 cross-compilation.
17419 @option{-msoft-float} changes the calling convention in the output file;
17420 therefore, it is only useful if you compile @emph{all} of a program with
17421 this option.  In particular, you need to compile @file{libgcc.a}, the
17422 library that comes with GCC, with @option{-msoft-float} in order for
17423 this to work.
17425 @item -msio
17426 @opindex msio
17427 Generate the predefine, @code{_SIO}, for server IO@.  The default is
17428 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
17429 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
17430 options are available under HP-UX and HI-UX@.
17432 @item -mgnu-ld
17433 @opindex mgnu-ld
17434 Use options specific to GNU @command{ld}.
17435 This passes @option{-shared} to @command{ld} when
17436 building a shared library.  It is the default when GCC is configured,
17437 explicitly or implicitly, with the GNU linker.  This option does not
17438 affect which @command{ld} is called; it only changes what parameters
17439 are passed to that @command{ld}.
17440 The @command{ld} that is called is determined by the
17441 @option{--with-ld} configure option, GCC's program search path, and
17442 finally by the user's @env{PATH}.  The linker used by GCC can be printed
17443 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
17444 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
17446 @item -mhp-ld
17447 @opindex mhp-ld
17448 Use options specific to HP @command{ld}.
17449 This passes @option{-b} to @command{ld} when building
17450 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
17451 links.  It is the default when GCC is configured, explicitly or
17452 implicitly, with the HP linker.  This option does not affect
17453 which @command{ld} is called; it only changes what parameters are passed to that
17454 @command{ld}.
17455 The @command{ld} that is called is determined by the @option{--with-ld}
17456 configure option, GCC's program search path, and finally by the user's
17457 @env{PATH}.  The linker used by GCC can be printed using @samp{which
17458 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
17459 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
17461 @item -mlong-calls
17462 @opindex mno-long-calls
17463 Generate code that uses long call sequences.  This ensures that a call
17464 is always able to reach linker generated stubs.  The default is to generate
17465 long calls only when the distance from the call site to the beginning
17466 of the function or translation unit, as the case may be, exceeds a
17467 predefined limit set by the branch type being used.  The limits for
17468 normal calls are 7,600,000 and 240,000 bytes, respectively for the
17469 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
17470 240,000 bytes.
17472 Distances are measured from the beginning of functions when using the
17473 @option{-ffunction-sections} option, or when using the @option{-mgas}
17474 and @option{-mno-portable-runtime} options together under HP-UX with
17475 the SOM linker.
17477 It is normally not desirable to use this option as it degrades
17478 performance.  However, it may be useful in large applications,
17479 particularly when partial linking is used to build the application.
17481 The types of long calls used depends on the capabilities of the
17482 assembler and linker, and the type of code being generated.  The
17483 impact on systems that support long absolute calls, and long pic
17484 symbol-difference or pc-relative calls should be relatively small.
17485 However, an indirect call is used on 32-bit ELF systems in pic code
17486 and it is quite long.
17488 @item -munix=@var{unix-std}
17489 @opindex march
17490 Generate compiler predefines and select a startfile for the specified
17491 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
17492 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
17493 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
17494 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
17495 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
17496 and later.
17498 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
17499 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
17500 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
17501 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
17502 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
17503 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
17505 It is @emph{important} to note that this option changes the interfaces
17506 for various library routines.  It also affects the operational behavior
17507 of the C library.  Thus, @emph{extreme} care is needed in using this
17508 option.
17510 Library code that is intended to operate with more than one UNIX
17511 standard must test, set and restore the variable @code{__xpg4_extended_mask}
17512 as appropriate.  Most GNU software doesn't provide this capability.
17514 @item -nolibdld
17515 @opindex nolibdld
17516 Suppress the generation of link options to search libdld.sl when the
17517 @option{-static} option is specified on HP-UX 10 and later.
17519 @item -static
17520 @opindex static
17521 The HP-UX implementation of setlocale in libc has a dependency on
17522 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
17523 when the @option{-static} option is specified, special link options
17524 are needed to resolve this dependency.
17526 On HP-UX 10 and later, the GCC driver adds the necessary options to
17527 link with libdld.sl when the @option{-static} option is specified.
17528 This causes the resulting binary to be dynamic.  On the 64-bit port,
17529 the linkers generate dynamic binaries by default in any case.  The
17530 @option{-nolibdld} option can be used to prevent the GCC driver from
17531 adding these link options.
17533 @item -threads
17534 @opindex threads
17535 Add support for multithreading with the @dfn{dce thread} library
17536 under HP-UX@.  This option sets flags for both the preprocessor and
17537 linker.
17538 @end table
17540 @node IA-64 Options
17541 @subsection IA-64 Options
17542 @cindex IA-64 Options
17544 These are the @samp{-m} options defined for the Intel IA-64 architecture.
17546 @table @gcctabopt
17547 @item -mbig-endian
17548 @opindex mbig-endian
17549 Generate code for a big-endian target.  This is the default for HP-UX@.
17551 @item -mlittle-endian
17552 @opindex mlittle-endian
17553 Generate code for a little-endian target.  This is the default for AIX5
17554 and GNU/Linux.
17556 @item -mgnu-as
17557 @itemx -mno-gnu-as
17558 @opindex mgnu-as
17559 @opindex mno-gnu-as
17560 Generate (or don't) code for the GNU assembler.  This is the default.
17561 @c Also, this is the default if the configure option @option{--with-gnu-as}
17562 @c is used.
17564 @item -mgnu-ld
17565 @itemx -mno-gnu-ld
17566 @opindex mgnu-ld
17567 @opindex mno-gnu-ld
17568 Generate (or don't) code for the GNU linker.  This is the default.
17569 @c Also, this is the default if the configure option @option{--with-gnu-ld}
17570 @c is used.
17572 @item -mno-pic
17573 @opindex mno-pic
17574 Generate code that does not use a global pointer register.  The result
17575 is not position independent code, and violates the IA-64 ABI@.
17577 @item -mvolatile-asm-stop
17578 @itemx -mno-volatile-asm-stop
17579 @opindex mvolatile-asm-stop
17580 @opindex mno-volatile-asm-stop
17581 Generate (or don't) a stop bit immediately before and after volatile asm
17582 statements.
17584 @item -mregister-names
17585 @itemx -mno-register-names
17586 @opindex mregister-names
17587 @opindex mno-register-names
17588 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
17589 the stacked registers.  This may make assembler output more readable.
17591 @item -mno-sdata
17592 @itemx -msdata
17593 @opindex mno-sdata
17594 @opindex msdata
17595 Disable (or enable) optimizations that use the small data section.  This may
17596 be useful for working around optimizer bugs.
17598 @item -mconstant-gp
17599 @opindex mconstant-gp
17600 Generate code that uses a single constant global pointer value.  This is
17601 useful when compiling kernel code.
17603 @item -mauto-pic
17604 @opindex mauto-pic
17605 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
17606 This is useful when compiling firmware code.
17608 @item -minline-float-divide-min-latency
17609 @opindex minline-float-divide-min-latency
17610 Generate code for inline divides of floating-point values
17611 using the minimum latency algorithm.
17613 @item -minline-float-divide-max-throughput
17614 @opindex minline-float-divide-max-throughput
17615 Generate code for inline divides of floating-point values
17616 using the maximum throughput algorithm.
17618 @item -mno-inline-float-divide
17619 @opindex mno-inline-float-divide
17620 Do not generate inline code for divides of floating-point values.
17622 @item -minline-int-divide-min-latency
17623 @opindex minline-int-divide-min-latency
17624 Generate code for inline divides of integer values
17625 using the minimum latency algorithm.
17627 @item -minline-int-divide-max-throughput
17628 @opindex minline-int-divide-max-throughput
17629 Generate code for inline divides of integer values
17630 using the maximum throughput algorithm.
17632 @item -mno-inline-int-divide
17633 @opindex mno-inline-int-divide
17634 Do not generate inline code for divides of integer values.
17636 @item -minline-sqrt-min-latency
17637 @opindex minline-sqrt-min-latency
17638 Generate code for inline square roots
17639 using the minimum latency algorithm.
17641 @item -minline-sqrt-max-throughput
17642 @opindex minline-sqrt-max-throughput
17643 Generate code for inline square roots
17644 using the maximum throughput algorithm.
17646 @item -mno-inline-sqrt
17647 @opindex mno-inline-sqrt
17648 Do not generate inline code for @code{sqrt}.
17650 @item -mfused-madd
17651 @itemx -mno-fused-madd
17652 @opindex mfused-madd
17653 @opindex mno-fused-madd
17654 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
17655 instructions.  The default is to use these instructions.
17657 @item -mno-dwarf2-asm
17658 @itemx -mdwarf2-asm
17659 @opindex mno-dwarf2-asm
17660 @opindex mdwarf2-asm
17661 Don't (or do) generate assembler code for the DWARF line number debugging
17662 info.  This may be useful when not using the GNU assembler.
17664 @item -mearly-stop-bits
17665 @itemx -mno-early-stop-bits
17666 @opindex mearly-stop-bits
17667 @opindex mno-early-stop-bits
17668 Allow stop bits to be placed earlier than immediately preceding the
17669 instruction that triggered the stop bit.  This can improve instruction
17670 scheduling, but does not always do so.
17672 @item -mfixed-range=@var{register-range}
17673 @opindex mfixed-range
17674 Generate code treating the given register range as fixed registers.
17675 A fixed register is one that the register allocator cannot use.  This is
17676 useful when compiling kernel code.  A register range is specified as
17677 two registers separated by a dash.  Multiple register ranges can be
17678 specified separated by a comma.
17680 @item -mtls-size=@var{tls-size}
17681 @opindex mtls-size
17682 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
17685 @item -mtune=@var{cpu-type}
17686 @opindex mtune
17687 Tune the instruction scheduling for a particular CPU, Valid values are
17688 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
17689 and @samp{mckinley}.
17691 @item -milp32
17692 @itemx -mlp64
17693 @opindex milp32
17694 @opindex mlp64
17695 Generate code for a 32-bit or 64-bit environment.
17696 The 32-bit environment sets int, long and pointer to 32 bits.
17697 The 64-bit environment sets int to 32 bits and long and pointer
17698 to 64 bits.  These are HP-UX specific flags.
17700 @item -mno-sched-br-data-spec
17701 @itemx -msched-br-data-spec
17702 @opindex mno-sched-br-data-spec
17703 @opindex msched-br-data-spec
17704 (Dis/En)able data speculative scheduling before reload.
17705 This results in generation of @code{ld.a} instructions and
17706 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
17707 The default setting is disabled.
17709 @item -msched-ar-data-spec
17710 @itemx -mno-sched-ar-data-spec
17711 @opindex msched-ar-data-spec
17712 @opindex mno-sched-ar-data-spec
17713 (En/Dis)able data speculative scheduling after reload.
17714 This results in generation of @code{ld.a} instructions and
17715 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
17716 The default setting is enabled.
17718 @item -mno-sched-control-spec
17719 @itemx -msched-control-spec
17720 @opindex mno-sched-control-spec
17721 @opindex msched-control-spec
17722 (Dis/En)able control speculative scheduling.  This feature is
17723 available only during region scheduling (i.e.@: before reload).
17724 This results in generation of the @code{ld.s} instructions and
17725 the corresponding check instructions @code{chk.s}.
17726 The default setting is disabled.
17728 @item -msched-br-in-data-spec
17729 @itemx -mno-sched-br-in-data-spec
17730 @opindex msched-br-in-data-spec
17731 @opindex mno-sched-br-in-data-spec
17732 (En/Dis)able speculative scheduling of the instructions that
17733 are dependent on the data speculative loads before reload.
17734 This is effective only with @option{-msched-br-data-spec} enabled.
17735 The default setting is enabled.
17737 @item -msched-ar-in-data-spec
17738 @itemx -mno-sched-ar-in-data-spec
17739 @opindex msched-ar-in-data-spec
17740 @opindex mno-sched-ar-in-data-spec
17741 (En/Dis)able speculative scheduling of the instructions that
17742 are dependent on the data speculative loads after reload.
17743 This is effective only with @option{-msched-ar-data-spec} enabled.
17744 The default setting is enabled.
17746 @item -msched-in-control-spec
17747 @itemx -mno-sched-in-control-spec
17748 @opindex msched-in-control-spec
17749 @opindex mno-sched-in-control-spec
17750 (En/Dis)able speculative scheduling of the instructions that
17751 are dependent on the control speculative loads.
17752 This is effective only with @option{-msched-control-spec} enabled.
17753 The default setting is enabled.
17755 @item -mno-sched-prefer-non-data-spec-insns
17756 @itemx -msched-prefer-non-data-spec-insns
17757 @opindex mno-sched-prefer-non-data-spec-insns
17758 @opindex msched-prefer-non-data-spec-insns
17759 If enabled, data-speculative instructions are chosen for schedule
17760 only if there are no other choices at the moment.  This makes
17761 the use of the data speculation much more conservative.
17762 The default setting is disabled.
17764 @item -mno-sched-prefer-non-control-spec-insns
17765 @itemx -msched-prefer-non-control-spec-insns
17766 @opindex mno-sched-prefer-non-control-spec-insns
17767 @opindex msched-prefer-non-control-spec-insns
17768 If enabled, control-speculative instructions are chosen for schedule
17769 only if there are no other choices at the moment.  This makes
17770 the use of the control speculation much more conservative.
17771 The default setting is disabled.
17773 @item -mno-sched-count-spec-in-critical-path
17774 @itemx -msched-count-spec-in-critical-path
17775 @opindex mno-sched-count-spec-in-critical-path
17776 @opindex msched-count-spec-in-critical-path
17777 If enabled, speculative dependencies are considered during
17778 computation of the instructions priorities.  This makes the use of the
17779 speculation a bit more conservative.
17780 The default setting is disabled.
17782 @item -msched-spec-ldc
17783 @opindex msched-spec-ldc
17784 Use a simple data speculation check.  This option is on by default.
17786 @item -msched-control-spec-ldc
17787 @opindex msched-spec-ldc
17788 Use a simple check for control speculation.  This option is on by default.
17790 @item -msched-stop-bits-after-every-cycle
17791 @opindex msched-stop-bits-after-every-cycle
17792 Place a stop bit after every cycle when scheduling.  This option is on
17793 by default.
17795 @item -msched-fp-mem-deps-zero-cost
17796 @opindex msched-fp-mem-deps-zero-cost
17797 Assume that floating-point stores and loads are not likely to cause a conflict
17798 when placed into the same instruction group.  This option is disabled by
17799 default.
17801 @item -msel-sched-dont-check-control-spec
17802 @opindex msel-sched-dont-check-control-spec
17803 Generate checks for control speculation in selective scheduling.
17804 This flag is disabled by default.
17806 @item -msched-max-memory-insns=@var{max-insns}
17807 @opindex msched-max-memory-insns
17808 Limit on the number of memory insns per instruction group, giving lower
17809 priority to subsequent memory insns attempting to schedule in the same
17810 instruction group. Frequently useful to prevent cache bank conflicts.
17811 The default value is 1.
17813 @item -msched-max-memory-insns-hard-limit
17814 @opindex msched-max-memory-insns-hard-limit
17815 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
17816 disallowing more than that number in an instruction group.
17817 Otherwise, the limit is ``soft'', meaning that non-memory operations
17818 are preferred when the limit is reached, but memory operations may still
17819 be scheduled.
17821 @end table
17823 @node LM32 Options
17824 @subsection LM32 Options
17825 @cindex LM32 options
17827 These @option{-m} options are defined for the LatticeMico32 architecture:
17829 @table @gcctabopt
17830 @item -mbarrel-shift-enabled
17831 @opindex mbarrel-shift-enabled
17832 Enable barrel-shift instructions.
17834 @item -mdivide-enabled
17835 @opindex mdivide-enabled
17836 Enable divide and modulus instructions.
17838 @item -mmultiply-enabled
17839 @opindex multiply-enabled
17840 Enable multiply instructions.
17842 @item -msign-extend-enabled
17843 @opindex msign-extend-enabled
17844 Enable sign extend instructions.
17846 @item -muser-enabled
17847 @opindex muser-enabled
17848 Enable user-defined instructions.
17850 @end table
17852 @node M32C Options
17853 @subsection M32C Options
17854 @cindex M32C options
17856 @table @gcctabopt
17857 @item -mcpu=@var{name}
17858 @opindex mcpu=
17859 Select the CPU for which code is generated.  @var{name} may be one of
17860 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
17861 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
17862 the M32C/80 series.
17864 @item -msim
17865 @opindex msim
17866 Specifies that the program will be run on the simulator.  This causes
17867 an alternate runtime library to be linked in which supports, for
17868 example, file I/O@.  You must not use this option when generating
17869 programs that will run on real hardware; you must provide your own
17870 runtime library for whatever I/O functions are needed.
17872 @item -memregs=@var{number}
17873 @opindex memregs=
17874 Specifies the number of memory-based pseudo-registers GCC uses
17875 during code generation.  These pseudo-registers are used like real
17876 registers, so there is a tradeoff between GCC's ability to fit the
17877 code into available registers, and the performance penalty of using
17878 memory instead of registers.  Note that all modules in a program must
17879 be compiled with the same value for this option.  Because of that, you
17880 must not use this option with GCC's default runtime libraries.
17882 @end table
17884 @node M32R/D Options
17885 @subsection M32R/D Options
17886 @cindex M32R/D options
17888 These @option{-m} options are defined for Renesas M32R/D architectures:
17890 @table @gcctabopt
17891 @item -m32r2
17892 @opindex m32r2
17893 Generate code for the M32R/2@.
17895 @item -m32rx
17896 @opindex m32rx
17897 Generate code for the M32R/X@.
17899 @item -m32r
17900 @opindex m32r
17901 Generate code for the M32R@.  This is the default.
17903 @item -mmodel=small
17904 @opindex mmodel=small
17905 Assume all objects live in the lower 16MB of memory (so that their addresses
17906 can be loaded with the @code{ld24} instruction), and assume all subroutines
17907 are reachable with the @code{bl} instruction.
17908 This is the default.
17910 The addressability of a particular object can be set with the
17911 @code{model} attribute.
17913 @item -mmodel=medium
17914 @opindex mmodel=medium
17915 Assume objects may be anywhere in the 32-bit address space (the compiler
17916 generates @code{seth/add3} instructions to load their addresses), and
17917 assume all subroutines are reachable with the @code{bl} instruction.
17919 @item -mmodel=large
17920 @opindex mmodel=large
17921 Assume objects may be anywhere in the 32-bit address space (the compiler
17922 generates @code{seth/add3} instructions to load their addresses), and
17923 assume subroutines may not be reachable with the @code{bl} instruction
17924 (the compiler generates the much slower @code{seth/add3/jl}
17925 instruction sequence).
17927 @item -msdata=none
17928 @opindex msdata=none
17929 Disable use of the small data area.  Variables are put into
17930 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
17931 @code{section} attribute has been specified).
17932 This is the default.
17934 The small data area consists of sections @code{.sdata} and @code{.sbss}.
17935 Objects may be explicitly put in the small data area with the
17936 @code{section} attribute using one of these sections.
17938 @item -msdata=sdata
17939 @opindex msdata=sdata
17940 Put small global and static data in the small data area, but do not
17941 generate special code to reference them.
17943 @item -msdata=use
17944 @opindex msdata=use
17945 Put small global and static data in the small data area, and generate
17946 special instructions to reference them.
17948 @item -G @var{num}
17949 @opindex G
17950 @cindex smaller data references
17951 Put global and static objects less than or equal to @var{num} bytes
17952 into the small data or BSS sections instead of the normal data or BSS
17953 sections.  The default value of @var{num} is 8.
17954 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
17955 for this option to have any effect.
17957 All modules should be compiled with the same @option{-G @var{num}} value.
17958 Compiling with different values of @var{num} may or may not work; if it
17959 doesn't the linker gives an error message---incorrect code is not
17960 generated.
17962 @item -mdebug
17963 @opindex mdebug
17964 Makes the M32R-specific code in the compiler display some statistics
17965 that might help in debugging programs.
17967 @item -malign-loops
17968 @opindex malign-loops
17969 Align all loops to a 32-byte boundary.
17971 @item -mno-align-loops
17972 @opindex mno-align-loops
17973 Do not enforce a 32-byte alignment for loops.  This is the default.
17975 @item -missue-rate=@var{number}
17976 @opindex missue-rate=@var{number}
17977 Issue @var{number} instructions per cycle.  @var{number} can only be 1
17978 or 2.
17980 @item -mbranch-cost=@var{number}
17981 @opindex mbranch-cost=@var{number}
17982 @var{number} can only be 1 or 2.  If it is 1 then branches are
17983 preferred over conditional code, if it is 2, then the opposite applies.
17985 @item -mflush-trap=@var{number}
17986 @opindex mflush-trap=@var{number}
17987 Specifies the trap number to use to flush the cache.  The default is
17988 12.  Valid numbers are between 0 and 15 inclusive.
17990 @item -mno-flush-trap
17991 @opindex mno-flush-trap
17992 Specifies that the cache cannot be flushed by using a trap.
17994 @item -mflush-func=@var{name}
17995 @opindex mflush-func=@var{name}
17996 Specifies the name of the operating system function to call to flush
17997 the cache.  The default is @samp{_flush_cache}, but a function call
17998 is only used if a trap is not available.
18000 @item -mno-flush-func
18001 @opindex mno-flush-func
18002 Indicates that there is no OS function for flushing the cache.
18004 @end table
18006 @node M680x0 Options
18007 @subsection M680x0 Options
18008 @cindex M680x0 options
18010 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
18011 The default settings depend on which architecture was selected when
18012 the compiler was configured; the defaults for the most common choices
18013 are given below.
18015 @table @gcctabopt
18016 @item -march=@var{arch}
18017 @opindex march
18018 Generate code for a specific M680x0 or ColdFire instruction set
18019 architecture.  Permissible values of @var{arch} for M680x0
18020 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
18021 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
18022 architectures are selected according to Freescale's ISA classification
18023 and the permissible values are: @samp{isaa}, @samp{isaaplus},
18024 @samp{isab} and @samp{isac}.
18026 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
18027 code for a ColdFire target.  The @var{arch} in this macro is one of the
18028 @option{-march} arguments given above.
18030 When used together, @option{-march} and @option{-mtune} select code
18031 that runs on a family of similar processors but that is optimized
18032 for a particular microarchitecture.
18034 @item -mcpu=@var{cpu}
18035 @opindex mcpu
18036 Generate code for a specific M680x0 or ColdFire processor.
18037 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
18038 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
18039 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
18040 below, which also classifies the CPUs into families:
18042 @multitable @columnfractions 0.20 0.80
18043 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
18044 @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}
18045 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
18046 @item @samp{5206e} @tab @samp{5206e}
18047 @item @samp{5208} @tab @samp{5207} @samp{5208}
18048 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
18049 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
18050 @item @samp{5216} @tab @samp{5214} @samp{5216}
18051 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
18052 @item @samp{5225} @tab @samp{5224} @samp{5225}
18053 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
18054 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
18055 @item @samp{5249} @tab @samp{5249}
18056 @item @samp{5250} @tab @samp{5250}
18057 @item @samp{5271} @tab @samp{5270} @samp{5271}
18058 @item @samp{5272} @tab @samp{5272}
18059 @item @samp{5275} @tab @samp{5274} @samp{5275}
18060 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
18061 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
18062 @item @samp{5307} @tab @samp{5307}
18063 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
18064 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
18065 @item @samp{5407} @tab @samp{5407}
18066 @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}
18067 @end multitable
18069 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
18070 @var{arch} is compatible with @var{cpu}.  Other combinations of
18071 @option{-mcpu} and @option{-march} are rejected.
18073 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
18074 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
18075 where the value of @var{family} is given by the table above.
18077 @item -mtune=@var{tune}
18078 @opindex mtune
18079 Tune the code for a particular microarchitecture within the
18080 constraints set by @option{-march} and @option{-mcpu}.
18081 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
18082 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
18083 and @samp{cpu32}.  The ColdFire microarchitectures
18084 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
18086 You can also use @option{-mtune=68020-40} for code that needs
18087 to run relatively well on 68020, 68030 and 68040 targets.
18088 @option{-mtune=68020-60} is similar but includes 68060 targets
18089 as well.  These two options select the same tuning decisions as
18090 @option{-m68020-40} and @option{-m68020-60} respectively.
18092 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
18093 when tuning for 680x0 architecture @var{arch}.  It also defines
18094 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
18095 option is used.  If GCC is tuning for a range of architectures,
18096 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
18097 it defines the macros for every architecture in the range.
18099 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
18100 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
18101 of the arguments given above.
18103 @item -m68000
18104 @itemx -mc68000
18105 @opindex m68000
18106 @opindex mc68000
18107 Generate output for a 68000.  This is the default
18108 when the compiler is configured for 68000-based systems.
18109 It is equivalent to @option{-march=68000}.
18111 Use this option for microcontrollers with a 68000 or EC000 core,
18112 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
18114 @item -m68010
18115 @opindex m68010
18116 Generate output for a 68010.  This is the default
18117 when the compiler is configured for 68010-based systems.
18118 It is equivalent to @option{-march=68010}.
18120 @item -m68020
18121 @itemx -mc68020
18122 @opindex m68020
18123 @opindex mc68020
18124 Generate output for a 68020.  This is the default
18125 when the compiler is configured for 68020-based systems.
18126 It is equivalent to @option{-march=68020}.
18128 @item -m68030
18129 @opindex m68030
18130 Generate output for a 68030.  This is the default when the compiler is
18131 configured for 68030-based systems.  It is equivalent to
18132 @option{-march=68030}.
18134 @item -m68040
18135 @opindex m68040
18136 Generate output for a 68040.  This is the default when the compiler is
18137 configured for 68040-based systems.  It is equivalent to
18138 @option{-march=68040}.
18140 This option inhibits the use of 68881/68882 instructions that have to be
18141 emulated by software on the 68040.  Use this option if your 68040 does not
18142 have code to emulate those instructions.
18144 @item -m68060
18145 @opindex m68060
18146 Generate output for a 68060.  This is the default when the compiler is
18147 configured for 68060-based systems.  It is equivalent to
18148 @option{-march=68060}.
18150 This option inhibits the use of 68020 and 68881/68882 instructions that
18151 have to be emulated by software on the 68060.  Use this option if your 68060
18152 does not have code to emulate those instructions.
18154 @item -mcpu32
18155 @opindex mcpu32
18156 Generate output for a CPU32.  This is the default
18157 when the compiler is configured for CPU32-based systems.
18158 It is equivalent to @option{-march=cpu32}.
18160 Use this option for microcontrollers with a
18161 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
18162 68336, 68340, 68341, 68349 and 68360.
18164 @item -m5200
18165 @opindex m5200
18166 Generate output for a 520X ColdFire CPU@.  This is the default
18167 when the compiler is configured for 520X-based systems.
18168 It is equivalent to @option{-mcpu=5206}, and is now deprecated
18169 in favor of that option.
18171 Use this option for microcontroller with a 5200 core, including
18172 the MCF5202, MCF5203, MCF5204 and MCF5206.
18174 @item -m5206e
18175 @opindex m5206e
18176 Generate output for a 5206e ColdFire CPU@.  The option is now
18177 deprecated in favor of the equivalent @option{-mcpu=5206e}.
18179 @item -m528x
18180 @opindex m528x
18181 Generate output for a member of the ColdFire 528X family.
18182 The option is now deprecated in favor of the equivalent
18183 @option{-mcpu=528x}.
18185 @item -m5307
18186 @opindex m5307
18187 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
18188 in favor of the equivalent @option{-mcpu=5307}.
18190 @item -m5407
18191 @opindex m5407
18192 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
18193 in favor of the equivalent @option{-mcpu=5407}.
18195 @item -mcfv4e
18196 @opindex mcfv4e
18197 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
18198 This includes use of hardware floating-point instructions.
18199 The option is equivalent to @option{-mcpu=547x}, and is now
18200 deprecated in favor of that option.
18202 @item -m68020-40
18203 @opindex m68020-40
18204 Generate output for a 68040, without using any of the new instructions.
18205 This results in code that can run relatively efficiently on either a
18206 68020/68881 or a 68030 or a 68040.  The generated code does use the
18207 68881 instructions that are emulated on the 68040.
18209 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
18211 @item -m68020-60
18212 @opindex m68020-60
18213 Generate output for a 68060, without using any of the new instructions.
18214 This results in code that can run relatively efficiently on either a
18215 68020/68881 or a 68030 or a 68040.  The generated code does use the
18216 68881 instructions that are emulated on the 68060.
18218 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
18220 @item -mhard-float
18221 @itemx -m68881
18222 @opindex mhard-float
18223 @opindex m68881
18224 Generate floating-point instructions.  This is the default for 68020
18225 and above, and for ColdFire devices that have an FPU@.  It defines the
18226 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
18227 on ColdFire targets.
18229 @item -msoft-float
18230 @opindex msoft-float
18231 Do not generate floating-point instructions; use library calls instead.
18232 This is the default for 68000, 68010, and 68832 targets.  It is also
18233 the default for ColdFire devices that have no FPU.
18235 @item -mdiv
18236 @itemx -mno-div
18237 @opindex mdiv
18238 @opindex mno-div
18239 Generate (do not generate) ColdFire hardware divide and remainder
18240 instructions.  If @option{-march} is used without @option{-mcpu},
18241 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
18242 architectures.  Otherwise, the default is taken from the target CPU
18243 (either the default CPU, or the one specified by @option{-mcpu}).  For
18244 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
18245 @option{-mcpu=5206e}.
18247 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
18249 @item -mshort
18250 @opindex mshort
18251 Consider type @code{int} to be 16 bits wide, like @code{short int}.
18252 Additionally, parameters passed on the stack are also aligned to a
18253 16-bit boundary even on targets whose API mandates promotion to 32-bit.
18255 @item -mno-short
18256 @opindex mno-short
18257 Do not consider type @code{int} to be 16 bits wide.  This is the default.
18259 @item -mnobitfield
18260 @itemx -mno-bitfield
18261 @opindex mnobitfield
18262 @opindex mno-bitfield
18263 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
18264 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
18266 @item -mbitfield
18267 @opindex mbitfield
18268 Do use the bit-field instructions.  The @option{-m68020} option implies
18269 @option{-mbitfield}.  This is the default if you use a configuration
18270 designed for a 68020.
18272 @item -mrtd
18273 @opindex mrtd
18274 Use a different function-calling convention, in which functions
18275 that take a fixed number of arguments return with the @code{rtd}
18276 instruction, which pops their arguments while returning.  This
18277 saves one instruction in the caller since there is no need to pop
18278 the arguments there.
18280 This calling convention is incompatible with the one normally
18281 used on Unix, so you cannot use it if you need to call libraries
18282 compiled with the Unix compiler.
18284 Also, you must provide function prototypes for all functions that
18285 take variable numbers of arguments (including @code{printf});
18286 otherwise incorrect code is generated for calls to those
18287 functions.
18289 In addition, seriously incorrect code results if you call a
18290 function with too many arguments.  (Normally, extra arguments are
18291 harmlessly ignored.)
18293 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
18294 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
18296 @item -mno-rtd
18297 @opindex mno-rtd
18298 Do not use the calling conventions selected by @option{-mrtd}.
18299 This is the default.
18301 @item -malign-int
18302 @itemx -mno-align-int
18303 @opindex malign-int
18304 @opindex mno-align-int
18305 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
18306 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
18307 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
18308 Aligning variables on 32-bit boundaries produces code that runs somewhat
18309 faster on processors with 32-bit busses at the expense of more memory.
18311 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
18312 aligns structures containing the above types differently than
18313 most published application binary interface specifications for the m68k.
18315 @item -mpcrel
18316 @opindex mpcrel
18317 Use the pc-relative addressing mode of the 68000 directly, instead of
18318 using a global offset table.  At present, this option implies @option{-fpic},
18319 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
18320 not presently supported with @option{-mpcrel}, though this could be supported for
18321 68020 and higher processors.
18323 @item -mno-strict-align
18324 @itemx -mstrict-align
18325 @opindex mno-strict-align
18326 @opindex mstrict-align
18327 Do not (do) assume that unaligned memory references are handled by
18328 the system.
18330 @item -msep-data
18331 Generate code that allows the data segment to be located in a different
18332 area of memory from the text segment.  This allows for execute-in-place in
18333 an environment without virtual memory management.  This option implies
18334 @option{-fPIC}.
18336 @item -mno-sep-data
18337 Generate code that assumes that the data segment follows the text segment.
18338 This is the default.
18340 @item -mid-shared-library
18341 Generate code that supports shared libraries via the library ID method.
18342 This allows for execute-in-place and shared libraries in an environment
18343 without virtual memory management.  This option implies @option{-fPIC}.
18345 @item -mno-id-shared-library
18346 Generate code that doesn't assume ID-based shared libraries are being used.
18347 This is the default.
18349 @item -mshared-library-id=n
18350 Specifies the identification number of the ID-based shared library being
18351 compiled.  Specifying a value of 0 generates more compact code; specifying
18352 other values forces the allocation of that number to the current
18353 library, but is no more space- or time-efficient than omitting this option.
18355 @item -mxgot
18356 @itemx -mno-xgot
18357 @opindex mxgot
18358 @opindex mno-xgot
18359 When generating position-independent code for ColdFire, generate code
18360 that works if the GOT has more than 8192 entries.  This code is
18361 larger and slower than code generated without this option.  On M680x0
18362 processors, this option is not needed; @option{-fPIC} suffices.
18364 GCC normally uses a single instruction to load values from the GOT@.
18365 While this is relatively efficient, it only works if the GOT
18366 is smaller than about 64k.  Anything larger causes the linker
18367 to report an error such as:
18369 @cindex relocation truncated to fit (ColdFire)
18370 @smallexample
18371 relocation truncated to fit: R_68K_GOT16O foobar
18372 @end smallexample
18374 If this happens, you should recompile your code with @option{-mxgot}.
18375 It should then work with very large GOTs.  However, code generated with
18376 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
18377 the value of a global symbol.
18379 Note that some linkers, including newer versions of the GNU linker,
18380 can create multiple GOTs and sort GOT entries.  If you have such a linker,
18381 you should only need to use @option{-mxgot} when compiling a single
18382 object file that accesses more than 8192 GOT entries.  Very few do.
18384 These options have no effect unless GCC is generating
18385 position-independent code.
18387 @end table
18389 @node MCore Options
18390 @subsection MCore Options
18391 @cindex MCore options
18393 These are the @samp{-m} options defined for the Motorola M*Core
18394 processors.
18396 @table @gcctabopt
18398 @item -mhardlit
18399 @itemx -mno-hardlit
18400 @opindex mhardlit
18401 @opindex mno-hardlit
18402 Inline constants into the code stream if it can be done in two
18403 instructions or less.
18405 @item -mdiv
18406 @itemx -mno-div
18407 @opindex mdiv
18408 @opindex mno-div
18409 Use the divide instruction.  (Enabled by default).
18411 @item -mrelax-immediate
18412 @itemx -mno-relax-immediate
18413 @opindex mrelax-immediate
18414 @opindex mno-relax-immediate
18415 Allow arbitrary-sized immediates in bit operations.
18417 @item -mwide-bitfields
18418 @itemx -mno-wide-bitfields
18419 @opindex mwide-bitfields
18420 @opindex mno-wide-bitfields
18421 Always treat bit-fields as @code{int}-sized.
18423 @item -m4byte-functions
18424 @itemx -mno-4byte-functions
18425 @opindex m4byte-functions
18426 @opindex mno-4byte-functions
18427 Force all functions to be aligned to a 4-byte boundary.
18429 @item -mcallgraph-data
18430 @itemx -mno-callgraph-data
18431 @opindex mcallgraph-data
18432 @opindex mno-callgraph-data
18433 Emit callgraph information.
18435 @item -mslow-bytes
18436 @itemx -mno-slow-bytes
18437 @opindex mslow-bytes
18438 @opindex mno-slow-bytes
18439 Prefer word access when reading byte quantities.
18441 @item -mlittle-endian
18442 @itemx -mbig-endian
18443 @opindex mlittle-endian
18444 @opindex mbig-endian
18445 Generate code for a little-endian target.
18447 @item -m210
18448 @itemx -m340
18449 @opindex m210
18450 @opindex m340
18451 Generate code for the 210 processor.
18453 @item -mno-lsim
18454 @opindex mno-lsim
18455 Assume that runtime support has been provided and so omit the
18456 simulator library (@file{libsim.a)} from the linker command line.
18458 @item -mstack-increment=@var{size}
18459 @opindex mstack-increment
18460 Set the maximum amount for a single stack increment operation.  Large
18461 values can increase the speed of programs that contain functions
18462 that need a large amount of stack space, but they can also trigger a
18463 segmentation fault if the stack is extended too much.  The default
18464 value is 0x1000.
18466 @end table
18468 @node MeP Options
18469 @subsection MeP Options
18470 @cindex MeP options
18472 @table @gcctabopt
18474 @item -mabsdiff
18475 @opindex mabsdiff
18476 Enables the @code{abs} instruction, which is the absolute difference
18477 between two registers.
18479 @item -mall-opts
18480 @opindex mall-opts
18481 Enables all the optional instructions---average, multiply, divide, bit
18482 operations, leading zero, absolute difference, min/max, clip, and
18483 saturation.
18486 @item -maverage
18487 @opindex maverage
18488 Enables the @code{ave} instruction, which computes the average of two
18489 registers.
18491 @item -mbased=@var{n}
18492 @opindex mbased=
18493 Variables of size @var{n} bytes or smaller are placed in the
18494 @code{.based} section by default.  Based variables use the @code{$tp}
18495 register as a base register, and there is a 128-byte limit to the
18496 @code{.based} section.
18498 @item -mbitops
18499 @opindex mbitops
18500 Enables the bit operation instructions---bit test (@code{btstm}), set
18501 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
18502 test-and-set (@code{tas}).
18504 @item -mc=@var{name}
18505 @opindex mc=
18506 Selects which section constant data is placed in.  @var{name} may
18507 be @samp{tiny}, @samp{near}, or @samp{far}.
18509 @item -mclip
18510 @opindex mclip
18511 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
18512 useful unless you also provide @option{-mminmax}.
18514 @item -mconfig=@var{name}
18515 @opindex mconfig=
18516 Selects one of the built-in core configurations.  Each MeP chip has
18517 one or more modules in it; each module has a core CPU and a variety of
18518 coprocessors, optional instructions, and peripherals.  The
18519 @code{MeP-Integrator} tool, not part of GCC, provides these
18520 configurations through this option; using this option is the same as
18521 using all the corresponding command-line options.  The default
18522 configuration is @samp{default}.
18524 @item -mcop
18525 @opindex mcop
18526 Enables the coprocessor instructions.  By default, this is a 32-bit
18527 coprocessor.  Note that the coprocessor is normally enabled via the
18528 @option{-mconfig=} option.
18530 @item -mcop32
18531 @opindex mcop32
18532 Enables the 32-bit coprocessor's instructions.
18534 @item -mcop64
18535 @opindex mcop64
18536 Enables the 64-bit coprocessor's instructions.
18538 @item -mivc2
18539 @opindex mivc2
18540 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
18542 @item -mdc
18543 @opindex mdc
18544 Causes constant variables to be placed in the @code{.near} section.
18546 @item -mdiv
18547 @opindex mdiv
18548 Enables the @code{div} and @code{divu} instructions.
18550 @item -meb
18551 @opindex meb
18552 Generate big-endian code.
18554 @item -mel
18555 @opindex mel
18556 Generate little-endian code.
18558 @item -mio-volatile
18559 @opindex mio-volatile
18560 Tells the compiler that any variable marked with the @code{io}
18561 attribute is to be considered volatile.
18563 @item -ml
18564 @opindex ml
18565 Causes variables to be assigned to the @code{.far} section by default.
18567 @item -mleadz
18568 @opindex mleadz
18569 Enables the @code{leadz} (leading zero) instruction.
18571 @item -mm
18572 @opindex mm
18573 Causes variables to be assigned to the @code{.near} section by default.
18575 @item -mminmax
18576 @opindex mminmax
18577 Enables the @code{min} and @code{max} instructions.
18579 @item -mmult
18580 @opindex mmult
18581 Enables the multiplication and multiply-accumulate instructions.
18583 @item -mno-opts
18584 @opindex mno-opts
18585 Disables all the optional instructions enabled by @option{-mall-opts}.
18587 @item -mrepeat
18588 @opindex mrepeat
18589 Enables the @code{repeat} and @code{erepeat} instructions, used for
18590 low-overhead looping.
18592 @item -ms
18593 @opindex ms
18594 Causes all variables to default to the @code{.tiny} section.  Note
18595 that there is a 65536-byte limit to this section.  Accesses to these
18596 variables use the @code{%gp} base register.
18598 @item -msatur
18599 @opindex msatur
18600 Enables the saturation instructions.  Note that the compiler does not
18601 currently generate these itself, but this option is included for
18602 compatibility with other tools, like @code{as}.
18604 @item -msdram
18605 @opindex msdram
18606 Link the SDRAM-based runtime instead of the default ROM-based runtime.
18608 @item -msim
18609 @opindex msim
18610 Link the simulator run-time libraries.
18612 @item -msimnovec
18613 @opindex msimnovec
18614 Link the simulator runtime libraries, excluding built-in support
18615 for reset and exception vectors and tables.
18617 @item -mtf
18618 @opindex mtf
18619 Causes all functions to default to the @code{.far} section.  Without
18620 this option, functions default to the @code{.near} section.
18622 @item -mtiny=@var{n}
18623 @opindex mtiny=
18624 Variables that are @var{n} bytes or smaller are allocated to the
18625 @code{.tiny} section.  These variables use the @code{$gp} base
18626 register.  The default for this option is 4, but note that there's a
18627 65536-byte limit to the @code{.tiny} section.
18629 @end table
18631 @node MicroBlaze Options
18632 @subsection MicroBlaze Options
18633 @cindex MicroBlaze Options
18635 @table @gcctabopt
18637 @item -msoft-float
18638 @opindex msoft-float
18639 Use software emulation for floating point (default).
18641 @item -mhard-float
18642 @opindex mhard-float
18643 Use hardware floating-point instructions.
18645 @item -mmemcpy
18646 @opindex mmemcpy
18647 Do not optimize block moves, use @code{memcpy}.
18649 @item -mno-clearbss
18650 @opindex mno-clearbss
18651 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
18653 @item -mcpu=@var{cpu-type}
18654 @opindex mcpu=
18655 Use features of, and schedule code for, the given CPU.
18656 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
18657 where @var{X} is a major version, @var{YY} is the minor version, and
18658 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
18659 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
18661 @item -mxl-soft-mul
18662 @opindex mxl-soft-mul
18663 Use software multiply emulation (default).
18665 @item -mxl-soft-div
18666 @opindex mxl-soft-div
18667 Use software emulation for divides (default).
18669 @item -mxl-barrel-shift
18670 @opindex mxl-barrel-shift
18671 Use the hardware barrel shifter.
18673 @item -mxl-pattern-compare
18674 @opindex mxl-pattern-compare
18675 Use pattern compare instructions.
18677 @item -msmall-divides
18678 @opindex msmall-divides
18679 Use table lookup optimization for small signed integer divisions.
18681 @item -mxl-stack-check
18682 @opindex mxl-stack-check
18683 This option is deprecated.  Use @option{-fstack-check} instead.
18685 @item -mxl-gp-opt
18686 @opindex mxl-gp-opt
18687 Use GP-relative @code{.sdata}/@code{.sbss} sections.
18689 @item -mxl-multiply-high
18690 @opindex mxl-multiply-high
18691 Use multiply high instructions for high part of 32x32 multiply.
18693 @item -mxl-float-convert
18694 @opindex mxl-float-convert
18695 Use hardware floating-point conversion instructions.
18697 @item -mxl-float-sqrt
18698 @opindex mxl-float-sqrt
18699 Use hardware floating-point square root instruction.
18701 @item -mbig-endian
18702 @opindex mbig-endian
18703 Generate code for a big-endian target.
18705 @item -mlittle-endian
18706 @opindex mlittle-endian
18707 Generate code for a little-endian target.
18709 @item -mxl-reorder
18710 @opindex mxl-reorder
18711 Use reorder instructions (swap and byte reversed load/store).
18713 @item -mxl-mode-@var{app-model}
18714 Select application model @var{app-model}.  Valid models are
18715 @table @samp
18716 @item executable
18717 normal executable (default), uses startup code @file{crt0.o}.
18719 @item xmdstub
18720 for use with Xilinx Microprocessor Debugger (XMD) based
18721 software intrusive debug agent called xmdstub. This uses startup file
18722 @file{crt1.o} and sets the start address of the program to 0x800.
18724 @item bootstrap
18725 for applications that are loaded using a bootloader.
18726 This model uses startup file @file{crt2.o} which does not contain a processor
18727 reset vector handler. This is suitable for transferring control on a
18728 processor reset to the bootloader rather than the application.
18730 @item novectors
18731 for applications that do not require any of the
18732 MicroBlaze vectors. This option may be useful for applications running
18733 within a monitoring application. This model uses @file{crt3.o} as a startup file.
18734 @end table
18736 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
18737 @option{-mxl-mode-@var{app-model}}.
18739 @end table
18741 @node MIPS Options
18742 @subsection MIPS Options
18743 @cindex MIPS options
18745 @table @gcctabopt
18747 @item -EB
18748 @opindex EB
18749 Generate big-endian code.
18751 @item -EL
18752 @opindex EL
18753 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
18754 configurations.
18756 @item -march=@var{arch}
18757 @opindex march
18758 Generate code that runs on @var{arch}, which can be the name of a
18759 generic MIPS ISA, or the name of a particular processor.
18760 The ISA names are:
18761 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
18762 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
18763 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
18764 @samp{mips64r5} and @samp{mips64r6}.
18765 The processor names are:
18766 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
18767 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
18768 @samp{5kc}, @samp{5kf},
18769 @samp{20kc},
18770 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
18771 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
18772 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
18773 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
18774 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
18775 @samp{i6400},
18776 @samp{interaptiv},
18777 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
18778 @samp{m4k},
18779 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
18780 @samp{m5100}, @samp{m5101},
18781 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
18782 @samp{orion},
18783 @samp{p5600},
18784 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
18785 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
18786 @samp{rm7000}, @samp{rm9000},
18787 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
18788 @samp{sb1},
18789 @samp{sr71000},
18790 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
18791 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
18792 @samp{xlr} and @samp{xlp}.
18793 The special value @samp{from-abi} selects the
18794 most compatible architecture for the selected ABI (that is,
18795 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
18797 The native Linux/GNU toolchain also supports the value @samp{native},
18798 which selects the best architecture option for the host processor.
18799 @option{-march=native} has no effect if GCC does not recognize
18800 the processor.
18802 In processor names, a final @samp{000} can be abbreviated as @samp{k}
18803 (for example, @option{-march=r2k}).  Prefixes are optional, and
18804 @samp{vr} may be written @samp{r}.
18806 Names of the form @samp{@var{n}f2_1} refer to processors with
18807 FPUs clocked at half the rate of the core, names of the form
18808 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
18809 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
18810 processors with FPUs clocked a ratio of 3:2 with respect to the core.
18811 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
18812 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
18813 accepted as synonyms for @samp{@var{n}f1_1}.
18815 GCC defines two macros based on the value of this option.  The first
18816 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
18817 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
18818 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
18819 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
18820 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
18822 Note that the @code{_MIPS_ARCH} macro uses the processor names given
18823 above.  In other words, it has the full prefix and does not
18824 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
18825 the macro names the resolved architecture (either @code{"mips1"} or
18826 @code{"mips3"}).  It names the default architecture when no
18827 @option{-march} option is given.
18829 @item -mtune=@var{arch}
18830 @opindex mtune
18831 Optimize for @var{arch}.  Among other things, this option controls
18832 the way instructions are scheduled, and the perceived cost of arithmetic
18833 operations.  The list of @var{arch} values is the same as for
18834 @option{-march}.
18836 When this option is not used, GCC optimizes for the processor
18837 specified by @option{-march}.  By using @option{-march} and
18838 @option{-mtune} together, it is possible to generate code that
18839 runs on a family of processors, but optimize the code for one
18840 particular member of that family.
18842 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
18843 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
18844 @option{-march} ones described above.
18846 @item -mips1
18847 @opindex mips1
18848 Equivalent to @option{-march=mips1}.
18850 @item -mips2
18851 @opindex mips2
18852 Equivalent to @option{-march=mips2}.
18854 @item -mips3
18855 @opindex mips3
18856 Equivalent to @option{-march=mips3}.
18858 @item -mips4
18859 @opindex mips4
18860 Equivalent to @option{-march=mips4}.
18862 @item -mips32
18863 @opindex mips32
18864 Equivalent to @option{-march=mips32}.
18866 @item -mips32r3
18867 @opindex mips32r3
18868 Equivalent to @option{-march=mips32r3}.
18870 @item -mips32r5
18871 @opindex mips32r5
18872 Equivalent to @option{-march=mips32r5}.
18874 @item -mips32r6
18875 @opindex mips32r6
18876 Equivalent to @option{-march=mips32r6}.
18878 @item -mips64
18879 @opindex mips64
18880 Equivalent to @option{-march=mips64}.
18882 @item -mips64r2
18883 @opindex mips64r2
18884 Equivalent to @option{-march=mips64r2}.
18886 @item -mips64r3
18887 @opindex mips64r3
18888 Equivalent to @option{-march=mips64r3}.
18890 @item -mips64r5
18891 @opindex mips64r5
18892 Equivalent to @option{-march=mips64r5}.
18894 @item -mips64r6
18895 @opindex mips64r6
18896 Equivalent to @option{-march=mips64r6}.
18898 @item -mips16
18899 @itemx -mno-mips16
18900 @opindex mips16
18901 @opindex mno-mips16
18902 Generate (do not generate) MIPS16 code.  If GCC is targeting a
18903 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
18905 MIPS16 code generation can also be controlled on a per-function basis
18906 by means of @code{mips16} and @code{nomips16} attributes.
18907 @xref{Function Attributes}, for more information.
18909 @item -mflip-mips16
18910 @opindex mflip-mips16
18911 Generate MIPS16 code on alternating functions.  This option is provided
18912 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
18913 not intended for ordinary use in compiling user code.
18915 @item -minterlink-compressed
18916 @item -mno-interlink-compressed
18917 @opindex minterlink-compressed
18918 @opindex mno-interlink-compressed
18919 Require (do not require) that code using the standard (uncompressed) MIPS ISA
18920 be link-compatible with MIPS16 and microMIPS code, and vice versa.
18922 For example, code using the standard ISA encoding cannot jump directly
18923 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
18924 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
18925 knows that the target of the jump is not compressed.
18927 @item -minterlink-mips16
18928 @itemx -mno-interlink-mips16
18929 @opindex minterlink-mips16
18930 @opindex mno-interlink-mips16
18931 Aliases of @option{-minterlink-compressed} and
18932 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
18933 and are retained for backwards compatibility.
18935 @item -mabi=32
18936 @itemx -mabi=o64
18937 @itemx -mabi=n32
18938 @itemx -mabi=64
18939 @itemx -mabi=eabi
18940 @opindex mabi=32
18941 @opindex mabi=o64
18942 @opindex mabi=n32
18943 @opindex mabi=64
18944 @opindex mabi=eabi
18945 Generate code for the given ABI@.
18947 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
18948 generates 64-bit code when you select a 64-bit architecture, but you
18949 can use @option{-mgp32} to get 32-bit code instead.
18951 For information about the O64 ABI, see
18952 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
18954 GCC supports a variant of the o32 ABI in which floating-point registers
18955 are 64 rather than 32 bits wide.  You can select this combination with
18956 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
18957 and @code{mfhc1} instructions and is therefore only supported for
18958 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
18960 The register assignments for arguments and return values remain the
18961 same, but each scalar value is passed in a single 64-bit register
18962 rather than a pair of 32-bit registers.  For example, scalar
18963 floating-point values are returned in @samp{$f0} only, not a
18964 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
18965 remains the same in that the even-numbered double-precision registers
18966 are saved.
18968 Two additional variants of the o32 ABI are supported to enable
18969 a transition from 32-bit to 64-bit registers.  These are FPXX
18970 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
18971 The FPXX extension mandates that all code must execute correctly
18972 when run using 32-bit or 64-bit registers.  The code can be interlinked
18973 with either FP32 or FP64, but not both.
18974 The FP64A extension is similar to the FP64 extension but forbids the
18975 use of odd-numbered single-precision registers.  This can be used
18976 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
18977 processors and allows both FP32 and FP64A code to interlink and
18978 run in the same process without changing FPU modes.
18980 @item -mabicalls
18981 @itemx -mno-abicalls
18982 @opindex mabicalls
18983 @opindex mno-abicalls
18984 Generate (do not generate) code that is suitable for SVR4-style
18985 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
18986 systems.
18988 @item -mshared
18989 @itemx -mno-shared
18990 Generate (do not generate) code that is fully position-independent,
18991 and that can therefore be linked into shared libraries.  This option
18992 only affects @option{-mabicalls}.
18994 All @option{-mabicalls} code has traditionally been position-independent,
18995 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
18996 as an extension, the GNU toolchain allows executables to use absolute
18997 accesses for locally-binding symbols.  It can also use shorter GP
18998 initialization sequences and generate direct calls to locally-defined
18999 functions.  This mode is selected by @option{-mno-shared}.
19001 @option{-mno-shared} depends on binutils 2.16 or higher and generates
19002 objects that can only be linked by the GNU linker.  However, the option
19003 does not affect the ABI of the final executable; it only affects the ABI
19004 of relocatable objects.  Using @option{-mno-shared} generally makes
19005 executables both smaller and quicker.
19007 @option{-mshared} is the default.
19009 @item -mplt
19010 @itemx -mno-plt
19011 @opindex mplt
19012 @opindex mno-plt
19013 Assume (do not assume) that the static and dynamic linkers
19014 support PLTs and copy relocations.  This option only affects
19015 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
19016 has no effect without @option{-msym32}.
19018 You can make @option{-mplt} the default by configuring
19019 GCC with @option{--with-mips-plt}.  The default is
19020 @option{-mno-plt} otherwise.
19022 @item -mxgot
19023 @itemx -mno-xgot
19024 @opindex mxgot
19025 @opindex mno-xgot
19026 Lift (do not lift) the usual restrictions on the size of the global
19027 offset table.
19029 GCC normally uses a single instruction to load values from the GOT@.
19030 While this is relatively efficient, it only works if the GOT
19031 is smaller than about 64k.  Anything larger causes the linker
19032 to report an error such as:
19034 @cindex relocation truncated to fit (MIPS)
19035 @smallexample
19036 relocation truncated to fit: R_MIPS_GOT16 foobar
19037 @end smallexample
19039 If this happens, you should recompile your code with @option{-mxgot}.
19040 This works with very large GOTs, although the code is also
19041 less efficient, since it takes three instructions to fetch the
19042 value of a global symbol.
19044 Note that some linkers can create multiple GOTs.  If you have such a
19045 linker, you should only need to use @option{-mxgot} when a single object
19046 file accesses more than 64k's worth of GOT entries.  Very few do.
19048 These options have no effect unless GCC is generating position
19049 independent code.
19051 @item -mgp32
19052 @opindex mgp32
19053 Assume that general-purpose registers are 32 bits wide.
19055 @item -mgp64
19056 @opindex mgp64
19057 Assume that general-purpose registers are 64 bits wide.
19059 @item -mfp32
19060 @opindex mfp32
19061 Assume that floating-point registers are 32 bits wide.
19063 @item -mfp64
19064 @opindex mfp64
19065 Assume that floating-point registers are 64 bits wide.
19067 @item -mfpxx
19068 @opindex mfpxx
19069 Do not assume the width of floating-point registers.
19071 @item -mhard-float
19072 @opindex mhard-float
19073 Use floating-point coprocessor instructions.
19075 @item -msoft-float
19076 @opindex msoft-float
19077 Do not use floating-point coprocessor instructions.  Implement
19078 floating-point calculations using library calls instead.
19080 @item -mno-float
19081 @opindex mno-float
19082 Equivalent to @option{-msoft-float}, but additionally asserts that the
19083 program being compiled does not perform any floating-point operations.
19084 This option is presently supported only by some bare-metal MIPS
19085 configurations, where it may select a special set of libraries
19086 that lack all floating-point support (including, for example, the
19087 floating-point @code{printf} formats).  
19088 If code compiled with @option{-mno-float} accidentally contains
19089 floating-point operations, it is likely to suffer a link-time
19090 or run-time failure.
19092 @item -msingle-float
19093 @opindex msingle-float
19094 Assume that the floating-point coprocessor only supports single-precision
19095 operations.
19097 @item -mdouble-float
19098 @opindex mdouble-float
19099 Assume that the floating-point coprocessor supports double-precision
19100 operations.  This is the default.
19102 @item -modd-spreg
19103 @itemx -mno-odd-spreg
19104 @opindex modd-spreg
19105 @opindex mno-odd-spreg
19106 Enable the use of odd-numbered single-precision floating-point registers
19107 for the o32 ABI.  This is the default for processors that are known to
19108 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
19109 is set by default.
19111 @item -mabs=2008
19112 @itemx -mabs=legacy
19113 @opindex mabs=2008
19114 @opindex mabs=legacy
19115 These options control the treatment of the special not-a-number (NaN)
19116 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
19117 @code{neg.@i{fmt}} machine instructions.
19119 By default or when @option{-mabs=legacy} is used the legacy
19120 treatment is selected.  In this case these instructions are considered
19121 arithmetic and avoided where correct operation is required and the
19122 input operand might be a NaN.  A longer sequence of instructions that
19123 manipulate the sign bit of floating-point datum manually is used
19124 instead unless the @option{-ffinite-math-only} option has also been
19125 specified.
19127 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
19128 this case these instructions are considered non-arithmetic and therefore
19129 operating correctly in all cases, including in particular where the
19130 input operand is a NaN.  These instructions are therefore always used
19131 for the respective operations.
19133 @item -mnan=2008
19134 @itemx -mnan=legacy
19135 @opindex mnan=2008
19136 @opindex mnan=legacy
19137 These options control the encoding of the special not-a-number (NaN)
19138 IEEE 754 floating-point data.
19140 The @option{-mnan=legacy} option selects the legacy encoding.  In this
19141 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
19142 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
19143 by the first bit of their trailing significand field being 1.
19145 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
19146 this case qNaNs are denoted by the first bit of their trailing
19147 significand field being 1, whereas sNaNs are denoted by the first bit of
19148 their trailing significand field being 0.
19150 The default is @option{-mnan=legacy} unless GCC has been configured with
19151 @option{--with-nan=2008}.
19153 @item -mllsc
19154 @itemx -mno-llsc
19155 @opindex mllsc
19156 @opindex mno-llsc
19157 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
19158 implement atomic memory built-in functions.  When neither option is
19159 specified, GCC uses the instructions if the target architecture
19160 supports them.
19162 @option{-mllsc} is useful if the runtime environment can emulate the
19163 instructions and @option{-mno-llsc} can be useful when compiling for
19164 nonstandard ISAs.  You can make either option the default by
19165 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
19166 respectively.  @option{--with-llsc} is the default for some
19167 configurations; see the installation documentation for details.
19169 @item -mdsp
19170 @itemx -mno-dsp
19171 @opindex mdsp
19172 @opindex mno-dsp
19173 Use (do not use) revision 1 of the MIPS DSP ASE@.
19174 @xref{MIPS DSP Built-in Functions}.  This option defines the
19175 preprocessor macro @code{__mips_dsp}.  It also defines
19176 @code{__mips_dsp_rev} to 1.
19178 @item -mdspr2
19179 @itemx -mno-dspr2
19180 @opindex mdspr2
19181 @opindex mno-dspr2
19182 Use (do not use) revision 2 of the MIPS DSP ASE@.
19183 @xref{MIPS DSP Built-in Functions}.  This option defines the
19184 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
19185 It also defines @code{__mips_dsp_rev} to 2.
19187 @item -msmartmips
19188 @itemx -mno-smartmips
19189 @opindex msmartmips
19190 @opindex mno-smartmips
19191 Use (do not use) the MIPS SmartMIPS ASE.
19193 @item -mpaired-single
19194 @itemx -mno-paired-single
19195 @opindex mpaired-single
19196 @opindex mno-paired-single
19197 Use (do not use) paired-single floating-point instructions.
19198 @xref{MIPS Paired-Single Support}.  This option requires
19199 hardware floating-point support to be enabled.
19201 @item -mdmx
19202 @itemx -mno-mdmx
19203 @opindex mdmx
19204 @opindex mno-mdmx
19205 Use (do not use) MIPS Digital Media Extension instructions.
19206 This option can only be used when generating 64-bit code and requires
19207 hardware floating-point support to be enabled.
19209 @item -mips3d
19210 @itemx -mno-mips3d
19211 @opindex mips3d
19212 @opindex mno-mips3d
19213 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
19214 The option @option{-mips3d} implies @option{-mpaired-single}.
19216 @item -mmicromips
19217 @itemx -mno-micromips
19218 @opindex mmicromips
19219 @opindex mno-mmicromips
19220 Generate (do not generate) microMIPS code.
19222 MicroMIPS code generation can also be controlled on a per-function basis
19223 by means of @code{micromips} and @code{nomicromips} attributes.
19224 @xref{Function Attributes}, for more information.
19226 @item -mmt
19227 @itemx -mno-mt
19228 @opindex mmt
19229 @opindex mno-mt
19230 Use (do not use) MT Multithreading instructions.
19232 @item -mmcu
19233 @itemx -mno-mcu
19234 @opindex mmcu
19235 @opindex mno-mcu
19236 Use (do not use) the MIPS MCU ASE instructions.
19238 @item -meva
19239 @itemx -mno-eva
19240 @opindex meva
19241 @opindex mno-eva
19242 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
19244 @item -mvirt
19245 @itemx -mno-virt
19246 @opindex mvirt
19247 @opindex mno-virt
19248 Use (do not use) the MIPS Virtualization Application Specific instructions.
19250 @item -mxpa
19251 @itemx -mno-xpa
19252 @opindex mxpa
19253 @opindex mno-xpa
19254 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
19256 @item -mlong64
19257 @opindex mlong64
19258 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
19259 an explanation of the default and the way that the pointer size is
19260 determined.
19262 @item -mlong32
19263 @opindex mlong32
19264 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
19266 The default size of @code{int}s, @code{long}s and pointers depends on
19267 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
19268 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
19269 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
19270 or the same size as integer registers, whichever is smaller.
19272 @item -msym32
19273 @itemx -mno-sym32
19274 @opindex msym32
19275 @opindex mno-sym32
19276 Assume (do not assume) that all symbols have 32-bit values, regardless
19277 of the selected ABI@.  This option is useful in combination with
19278 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
19279 to generate shorter and faster references to symbolic addresses.
19281 @item -G @var{num}
19282 @opindex G
19283 Put definitions of externally-visible data in a small data section
19284 if that data is no bigger than @var{num} bytes.  GCC can then generate
19285 more efficient accesses to the data; see @option{-mgpopt} for details.
19287 The default @option{-G} option depends on the configuration.
19289 @item -mlocal-sdata
19290 @itemx -mno-local-sdata
19291 @opindex mlocal-sdata
19292 @opindex mno-local-sdata
19293 Extend (do not extend) the @option{-G} behavior to local data too,
19294 such as to static variables in C@.  @option{-mlocal-sdata} is the
19295 default for all configurations.
19297 If the linker complains that an application is using too much small data,
19298 you might want to try rebuilding the less performance-critical parts with
19299 @option{-mno-local-sdata}.  You might also want to build large
19300 libraries with @option{-mno-local-sdata}, so that the libraries leave
19301 more room for the main program.
19303 @item -mextern-sdata
19304 @itemx -mno-extern-sdata
19305 @opindex mextern-sdata
19306 @opindex mno-extern-sdata
19307 Assume (do not assume) that externally-defined data is in
19308 a small data section if the size of that data is within the @option{-G} limit.
19309 @option{-mextern-sdata} is the default for all configurations.
19311 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
19312 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
19313 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
19314 is placed in a small data section.  If @var{Var} is defined by another
19315 module, you must either compile that module with a high-enough
19316 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
19317 definition.  If @var{Var} is common, you must link the application
19318 with a high-enough @option{-G} setting.
19320 The easiest way of satisfying these restrictions is to compile
19321 and link every module with the same @option{-G} option.  However,
19322 you may wish to build a library that supports several different
19323 small data limits.  You can do this by compiling the library with
19324 the highest supported @option{-G} setting and additionally using
19325 @option{-mno-extern-sdata} to stop the library from making assumptions
19326 about externally-defined data.
19328 @item -mgpopt
19329 @itemx -mno-gpopt
19330 @opindex mgpopt
19331 @opindex mno-gpopt
19332 Use (do not use) GP-relative accesses for symbols that are known to be
19333 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
19334 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
19335 configurations.
19337 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
19338 might not hold the value of @code{_gp}.  For example, if the code is
19339 part of a library that might be used in a boot monitor, programs that
19340 call boot monitor routines pass an unknown value in @code{$gp}.
19341 (In such situations, the boot monitor itself is usually compiled
19342 with @option{-G0}.)
19344 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
19345 @option{-mno-extern-sdata}.
19347 @item -membedded-data
19348 @itemx -mno-embedded-data
19349 @opindex membedded-data
19350 @opindex mno-embedded-data
19351 Allocate variables to the read-only data section first if possible, then
19352 next in the small data section if possible, otherwise in data.  This gives
19353 slightly slower code than the default, but reduces the amount of RAM required
19354 when executing, and thus may be preferred for some embedded systems.
19356 @item -muninit-const-in-rodata
19357 @itemx -mno-uninit-const-in-rodata
19358 @opindex muninit-const-in-rodata
19359 @opindex mno-uninit-const-in-rodata
19360 Put uninitialized @code{const} variables in the read-only data section.
19361 This option is only meaningful in conjunction with @option{-membedded-data}.
19363 @item -mcode-readable=@var{setting}
19364 @opindex mcode-readable
19365 Specify whether GCC may generate code that reads from executable sections.
19366 There are three possible settings:
19368 @table @gcctabopt
19369 @item -mcode-readable=yes
19370 Instructions may freely access executable sections.  This is the
19371 default setting.
19373 @item -mcode-readable=pcrel
19374 MIPS16 PC-relative load instructions can access executable sections,
19375 but other instructions must not do so.  This option is useful on 4KSc
19376 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
19377 It is also useful on processors that can be configured to have a dual
19378 instruction/data SRAM interface and that, like the M4K, automatically
19379 redirect PC-relative loads to the instruction RAM.
19381 @item -mcode-readable=no
19382 Instructions must not access executable sections.  This option can be
19383 useful on targets that are configured to have a dual instruction/data
19384 SRAM interface but that (unlike the M4K) do not automatically redirect
19385 PC-relative loads to the instruction RAM.
19386 @end table
19388 @item -msplit-addresses
19389 @itemx -mno-split-addresses
19390 @opindex msplit-addresses
19391 @opindex mno-split-addresses
19392 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
19393 relocation operators.  This option has been superseded by
19394 @option{-mexplicit-relocs} but is retained for backwards compatibility.
19396 @item -mexplicit-relocs
19397 @itemx -mno-explicit-relocs
19398 @opindex mexplicit-relocs
19399 @opindex mno-explicit-relocs
19400 Use (do not use) assembler relocation operators when dealing with symbolic
19401 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
19402 is to use assembler macros instead.
19404 @option{-mexplicit-relocs} is the default if GCC was configured
19405 to use an assembler that supports relocation operators.
19407 @item -mcheck-zero-division
19408 @itemx -mno-check-zero-division
19409 @opindex mcheck-zero-division
19410 @opindex mno-check-zero-division
19411 Trap (do not trap) on integer division by zero.
19413 The default is @option{-mcheck-zero-division}.
19415 @item -mdivide-traps
19416 @itemx -mdivide-breaks
19417 @opindex mdivide-traps
19418 @opindex mdivide-breaks
19419 MIPS systems check for division by zero by generating either a
19420 conditional trap or a break instruction.  Using traps results in
19421 smaller code, but is only supported on MIPS II and later.  Also, some
19422 versions of the Linux kernel have a bug that prevents trap from
19423 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
19424 allow conditional traps on architectures that support them and
19425 @option{-mdivide-breaks} to force the use of breaks.
19427 The default is usually @option{-mdivide-traps}, but this can be
19428 overridden at configure time using @option{--with-divide=breaks}.
19429 Divide-by-zero checks can be completely disabled using
19430 @option{-mno-check-zero-division}.
19432 @item -mmemcpy
19433 @itemx -mno-memcpy
19434 @opindex mmemcpy
19435 @opindex mno-memcpy
19436 Force (do not force) the use of @code{memcpy} for non-trivial block
19437 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
19438 most constant-sized copies.
19440 @item -mlong-calls
19441 @itemx -mno-long-calls
19442 @opindex mlong-calls
19443 @opindex mno-long-calls
19444 Disable (do not disable) use of the @code{jal} instruction.  Calling
19445 functions using @code{jal} is more efficient but requires the caller
19446 and callee to be in the same 256 megabyte segment.
19448 This option has no effect on abicalls code.  The default is
19449 @option{-mno-long-calls}.
19451 @item -mmad
19452 @itemx -mno-mad
19453 @opindex mmad
19454 @opindex mno-mad
19455 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
19456 instructions, as provided by the R4650 ISA@.
19458 @item -mimadd
19459 @itemx -mno-imadd
19460 @opindex mimadd
19461 @opindex mno-imadd
19462 Enable (disable) use of the @code{madd} and @code{msub} integer
19463 instructions.  The default is @option{-mimadd} on architectures
19464 that support @code{madd} and @code{msub} except for the 74k 
19465 architecture where it was found to generate slower code.
19467 @item -mfused-madd
19468 @itemx -mno-fused-madd
19469 @opindex mfused-madd
19470 @opindex mno-fused-madd
19471 Enable (disable) use of the floating-point multiply-accumulate
19472 instructions, when they are available.  The default is
19473 @option{-mfused-madd}.
19475 On the R8000 CPU when multiply-accumulate instructions are used,
19476 the intermediate product is calculated to infinite precision
19477 and is not subject to the FCSR Flush to Zero bit.  This may be
19478 undesirable in some circumstances.  On other processors the result
19479 is numerically identical to the equivalent computation using
19480 separate multiply, add, subtract and negate instructions.
19482 @item -nocpp
19483 @opindex nocpp
19484 Tell the MIPS assembler to not run its preprocessor over user
19485 assembler files (with a @samp{.s} suffix) when assembling them.
19487 @item -mfix-24k
19488 @item -mno-fix-24k
19489 @opindex mfix-24k
19490 @opindex mno-fix-24k
19491 Work around the 24K E48 (lost data on stores during refill) errata.
19492 The workarounds are implemented by the assembler rather than by GCC@.
19494 @item -mfix-r4000
19495 @itemx -mno-fix-r4000
19496 @opindex mfix-r4000
19497 @opindex mno-fix-r4000
19498 Work around certain R4000 CPU errata:
19499 @itemize @minus
19500 @item
19501 A double-word or a variable shift may give an incorrect result if executed
19502 immediately after starting an integer division.
19503 @item
19504 A double-word or a variable shift may give an incorrect result if executed
19505 while an integer multiplication is in progress.
19506 @item
19507 An integer division may give an incorrect result if started in a delay slot
19508 of a taken branch or a jump.
19509 @end itemize
19511 @item -mfix-r4400
19512 @itemx -mno-fix-r4400
19513 @opindex mfix-r4400
19514 @opindex mno-fix-r4400
19515 Work around certain R4400 CPU errata:
19516 @itemize @minus
19517 @item
19518 A double-word or a variable shift may give an incorrect result if executed
19519 immediately after starting an integer division.
19520 @end itemize
19522 @item -mfix-r10000
19523 @itemx -mno-fix-r10000
19524 @opindex mfix-r10000
19525 @opindex mno-fix-r10000
19526 Work around certain R10000 errata:
19527 @itemize @minus
19528 @item
19529 @code{ll}/@code{sc} sequences may not behave atomically on revisions
19530 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
19531 @end itemize
19533 This option can only be used if the target architecture supports
19534 branch-likely instructions.  @option{-mfix-r10000} is the default when
19535 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
19536 otherwise.
19538 @item -mfix-rm7000
19539 @itemx -mno-fix-rm7000
19540 @opindex mfix-rm7000
19541 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
19542 workarounds are implemented by the assembler rather than by GCC@.
19544 @item -mfix-vr4120
19545 @itemx -mno-fix-vr4120
19546 @opindex mfix-vr4120
19547 Work around certain VR4120 errata:
19548 @itemize @minus
19549 @item
19550 @code{dmultu} does not always produce the correct result.
19551 @item
19552 @code{div} and @code{ddiv} do not always produce the correct result if one
19553 of the operands is negative.
19554 @end itemize
19555 The workarounds for the division errata rely on special functions in
19556 @file{libgcc.a}.  At present, these functions are only provided by
19557 the @code{mips64vr*-elf} configurations.
19559 Other VR4120 errata require a NOP to be inserted between certain pairs of
19560 instructions.  These errata are handled by the assembler, not by GCC itself.
19562 @item -mfix-vr4130
19563 @opindex mfix-vr4130
19564 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
19565 workarounds are implemented by the assembler rather than by GCC,
19566 although GCC avoids using @code{mflo} and @code{mfhi} if the
19567 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
19568 instructions are available instead.
19570 @item -mfix-sb1
19571 @itemx -mno-fix-sb1
19572 @opindex mfix-sb1
19573 Work around certain SB-1 CPU core errata.
19574 (This flag currently works around the SB-1 revision 2
19575 ``F1'' and ``F2'' floating-point errata.)
19577 @item -mr10k-cache-barrier=@var{setting}
19578 @opindex mr10k-cache-barrier
19579 Specify whether GCC should insert cache barriers to avoid the
19580 side-effects of speculation on R10K processors.
19582 In common with many processors, the R10K tries to predict the outcome
19583 of a conditional branch and speculatively executes instructions from
19584 the ``taken'' branch.  It later aborts these instructions if the
19585 predicted outcome is wrong.  However, on the R10K, even aborted
19586 instructions can have side effects.
19588 This problem only affects kernel stores and, depending on the system,
19589 kernel loads.  As an example, a speculatively-executed store may load
19590 the target memory into cache and mark the cache line as dirty, even if
19591 the store itself is later aborted.  If a DMA operation writes to the
19592 same area of memory before the ``dirty'' line is flushed, the cached
19593 data overwrites the DMA-ed data.  See the R10K processor manual
19594 for a full description, including other potential problems.
19596 One workaround is to insert cache barrier instructions before every memory
19597 access that might be speculatively executed and that might have side
19598 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
19599 controls GCC's implementation of this workaround.  It assumes that
19600 aborted accesses to any byte in the following regions does not have
19601 side effects:
19603 @enumerate
19604 @item
19605 the memory occupied by the current function's stack frame;
19607 @item
19608 the memory occupied by an incoming stack argument;
19610 @item
19611 the memory occupied by an object with a link-time-constant address.
19612 @end enumerate
19614 It is the kernel's responsibility to ensure that speculative
19615 accesses to these regions are indeed safe.
19617 If the input program contains a function declaration such as:
19619 @smallexample
19620 void foo (void);
19621 @end smallexample
19623 then the implementation of @code{foo} must allow @code{j foo} and
19624 @code{jal foo} to be executed speculatively.  GCC honors this
19625 restriction for functions it compiles itself.  It expects non-GCC
19626 functions (such as hand-written assembly code) to do the same.
19628 The option has three forms:
19630 @table @gcctabopt
19631 @item -mr10k-cache-barrier=load-store
19632 Insert a cache barrier before a load or store that might be
19633 speculatively executed and that might have side effects even
19634 if aborted.
19636 @item -mr10k-cache-barrier=store
19637 Insert a cache barrier before a store that might be speculatively
19638 executed and that might have side effects even if aborted.
19640 @item -mr10k-cache-barrier=none
19641 Disable the insertion of cache barriers.  This is the default setting.
19642 @end table
19644 @item -mflush-func=@var{func}
19645 @itemx -mno-flush-func
19646 @opindex mflush-func
19647 Specifies the function to call to flush the I and D caches, or to not
19648 call any such function.  If called, the function must take the same
19649 arguments as the common @code{_flush_func}, that is, the address of the
19650 memory range for which the cache is being flushed, the size of the
19651 memory range, and the number 3 (to flush both caches).  The default
19652 depends on the target GCC was configured for, but commonly is either
19653 @code{_flush_func} or @code{__cpu_flush}.
19655 @item mbranch-cost=@var{num}
19656 @opindex mbranch-cost
19657 Set the cost of branches to roughly @var{num} ``simple'' instructions.
19658 This cost is only a heuristic and is not guaranteed to produce
19659 consistent results across releases.  A zero cost redundantly selects
19660 the default, which is based on the @option{-mtune} setting.
19662 @item -mbranch-likely
19663 @itemx -mno-branch-likely
19664 @opindex mbranch-likely
19665 @opindex mno-branch-likely
19666 Enable or disable use of Branch Likely instructions, regardless of the
19667 default for the selected architecture.  By default, Branch Likely
19668 instructions may be generated if they are supported by the selected
19669 architecture.  An exception is for the MIPS32 and MIPS64 architectures
19670 and processors that implement those architectures; for those, Branch
19671 Likely instructions are not be generated by default because the MIPS32
19672 and MIPS64 architectures specifically deprecate their use.
19674 @item -mcompact-branches=never
19675 @itemx -mcompact-branches=optimal
19676 @itemx -mcompact-branches=always
19677 @opindex mcompact-branches=never
19678 @opindex mcompact-branches=optimal
19679 @opindex mcompact-branches=always
19680 These options control which form of branches will be generated.  The
19681 default is @option{-mcompact-branches=optimal}.
19683 The @option{-mcompact-branches=never} option ensures that compact branch
19684 instructions will never be generated.
19686 The @option{-mcompact-branches=always} option ensures that a compact
19687 branch instruction will be generated if available.  If a compact branch
19688 instruction is not available, a delay slot form of the branch will be
19689 used instead.
19691 This option is supported from MIPS Release 6 onwards.
19693 The @option{-mcompact-branches=optimal} option will cause a delay slot
19694 branch to be used if one is available in the current ISA and the delay
19695 slot is successfully filled.  If the delay slot is not filled, a compact
19696 branch will be chosen if one is available.
19698 @item -mfp-exceptions
19699 @itemx -mno-fp-exceptions
19700 @opindex mfp-exceptions
19701 Specifies whether FP exceptions are enabled.  This affects how
19702 FP instructions are scheduled for some processors.
19703 The default is that FP exceptions are
19704 enabled.
19706 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
19707 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
19708 FP pipe.
19710 @item -mvr4130-align
19711 @itemx -mno-vr4130-align
19712 @opindex mvr4130-align
19713 The VR4130 pipeline is two-way superscalar, but can only issue two
19714 instructions together if the first one is 8-byte aligned.  When this
19715 option is enabled, GCC aligns pairs of instructions that it
19716 thinks should execute in parallel.
19718 This option only has an effect when optimizing for the VR4130.
19719 It normally makes code faster, but at the expense of making it bigger.
19720 It is enabled by default at optimization level @option{-O3}.
19722 @item -msynci
19723 @itemx -mno-synci
19724 @opindex msynci
19725 Enable (disable) generation of @code{synci} instructions on
19726 architectures that support it.  The @code{synci} instructions (if
19727 enabled) are generated when @code{__builtin___clear_cache} is
19728 compiled.
19730 This option defaults to @option{-mno-synci}, but the default can be
19731 overridden by configuring GCC with @option{--with-synci}.
19733 When compiling code for single processor systems, it is generally safe
19734 to use @code{synci}.  However, on many multi-core (SMP) systems, it
19735 does not invalidate the instruction caches on all cores and may lead
19736 to undefined behavior.
19738 @item -mrelax-pic-calls
19739 @itemx -mno-relax-pic-calls
19740 @opindex mrelax-pic-calls
19741 Try to turn PIC calls that are normally dispatched via register
19742 @code{$25} into direct calls.  This is only possible if the linker can
19743 resolve the destination at link time and if the destination is within
19744 range for a direct call.
19746 @option{-mrelax-pic-calls} is the default if GCC was configured to use
19747 an assembler and a linker that support the @code{.reloc} assembly
19748 directive and @option{-mexplicit-relocs} is in effect.  With
19749 @option{-mno-explicit-relocs}, this optimization can be performed by the
19750 assembler and the linker alone without help from the compiler.
19752 @item -mmcount-ra-address
19753 @itemx -mno-mcount-ra-address
19754 @opindex mmcount-ra-address
19755 @opindex mno-mcount-ra-address
19756 Emit (do not emit) code that allows @code{_mcount} to modify the
19757 calling function's return address.  When enabled, this option extends
19758 the usual @code{_mcount} interface with a new @var{ra-address}
19759 parameter, which has type @code{intptr_t *} and is passed in register
19760 @code{$12}.  @code{_mcount} can then modify the return address by
19761 doing both of the following:
19762 @itemize
19763 @item
19764 Returning the new address in register @code{$31}.
19765 @item
19766 Storing the new address in @code{*@var{ra-address}},
19767 if @var{ra-address} is nonnull.
19768 @end itemize
19770 The default is @option{-mno-mcount-ra-address}.
19772 @item -mframe-header-opt
19773 @itemx -mno-frame-header-opt
19774 @opindex mframe-header-opt
19775 Enable (disable) frame header optimization in the o32 ABI.  When using the
19776 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
19777 function to write out register arguments.  When enabled, this optimization
19778 will suppress the allocation of the frame header if it can be determined that
19779 it is unused.
19781 This optimization is off by default at all optimization levels.
19783 @end table
19785 @node MMIX Options
19786 @subsection MMIX Options
19787 @cindex MMIX Options
19789 These options are defined for the MMIX:
19791 @table @gcctabopt
19792 @item -mlibfuncs
19793 @itemx -mno-libfuncs
19794 @opindex mlibfuncs
19795 @opindex mno-libfuncs
19796 Specify that intrinsic library functions are being compiled, passing all
19797 values in registers, no matter the size.
19799 @item -mepsilon
19800 @itemx -mno-epsilon
19801 @opindex mepsilon
19802 @opindex mno-epsilon
19803 Generate floating-point comparison instructions that compare with respect
19804 to the @code{rE} epsilon register.
19806 @item -mabi=mmixware
19807 @itemx -mabi=gnu
19808 @opindex mabi=mmixware
19809 @opindex mabi=gnu
19810 Generate code that passes function parameters and return values that (in
19811 the called function) are seen as registers @code{$0} and up, as opposed to
19812 the GNU ABI which uses global registers @code{$231} and up.
19814 @item -mzero-extend
19815 @itemx -mno-zero-extend
19816 @opindex mzero-extend
19817 @opindex mno-zero-extend
19818 When reading data from memory in sizes shorter than 64 bits, use (do not
19819 use) zero-extending load instructions by default, rather than
19820 sign-extending ones.
19822 @item -mknuthdiv
19823 @itemx -mno-knuthdiv
19824 @opindex mknuthdiv
19825 @opindex mno-knuthdiv
19826 Make the result of a division yielding a remainder have the same sign as
19827 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
19828 remainder follows the sign of the dividend.  Both methods are
19829 arithmetically valid, the latter being almost exclusively used.
19831 @item -mtoplevel-symbols
19832 @itemx -mno-toplevel-symbols
19833 @opindex mtoplevel-symbols
19834 @opindex mno-toplevel-symbols
19835 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
19836 code can be used with the @code{PREFIX} assembly directive.
19838 @item -melf
19839 @opindex melf
19840 Generate an executable in the ELF format, rather than the default
19841 @samp{mmo} format used by the @command{mmix} simulator.
19843 @item -mbranch-predict
19844 @itemx -mno-branch-predict
19845 @opindex mbranch-predict
19846 @opindex mno-branch-predict
19847 Use (do not use) the probable-branch instructions, when static branch
19848 prediction indicates a probable branch.
19850 @item -mbase-addresses
19851 @itemx -mno-base-addresses
19852 @opindex mbase-addresses
19853 @opindex mno-base-addresses
19854 Generate (do not generate) code that uses @emph{base addresses}.  Using a
19855 base address automatically generates a request (handled by the assembler
19856 and the linker) for a constant to be set up in a global register.  The
19857 register is used for one or more base address requests within the range 0
19858 to 255 from the value held in the register.  The generally leads to short
19859 and fast code, but the number of different data items that can be
19860 addressed is limited.  This means that a program that uses lots of static
19861 data may require @option{-mno-base-addresses}.
19863 @item -msingle-exit
19864 @itemx -mno-single-exit
19865 @opindex msingle-exit
19866 @opindex mno-single-exit
19867 Force (do not force) generated code to have a single exit point in each
19868 function.
19869 @end table
19871 @node MN10300 Options
19872 @subsection MN10300 Options
19873 @cindex MN10300 options
19875 These @option{-m} options are defined for Matsushita MN10300 architectures:
19877 @table @gcctabopt
19878 @item -mmult-bug
19879 @opindex mmult-bug
19880 Generate code to avoid bugs in the multiply instructions for the MN10300
19881 processors.  This is the default.
19883 @item -mno-mult-bug
19884 @opindex mno-mult-bug
19885 Do not generate code to avoid bugs in the multiply instructions for the
19886 MN10300 processors.
19888 @item -mam33
19889 @opindex mam33
19890 Generate code using features specific to the AM33 processor.
19892 @item -mno-am33
19893 @opindex mno-am33
19894 Do not generate code using features specific to the AM33 processor.  This
19895 is the default.
19897 @item -mam33-2
19898 @opindex mam33-2
19899 Generate code using features specific to the AM33/2.0 processor.
19901 @item -mam34
19902 @opindex mam34
19903 Generate code using features specific to the AM34 processor.
19905 @item -mtune=@var{cpu-type}
19906 @opindex mtune
19907 Use the timing characteristics of the indicated CPU type when
19908 scheduling instructions.  This does not change the targeted processor
19909 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
19910 @samp{am33-2} or @samp{am34}.
19912 @item -mreturn-pointer-on-d0
19913 @opindex mreturn-pointer-on-d0
19914 When generating a function that returns a pointer, return the pointer
19915 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
19916 only in @code{a0}, and attempts to call such functions without a prototype
19917 result in errors.  Note that this option is on by default; use
19918 @option{-mno-return-pointer-on-d0} to disable it.
19920 @item -mno-crt0
19921 @opindex mno-crt0
19922 Do not link in the C run-time initialization object file.
19924 @item -mrelax
19925 @opindex mrelax
19926 Indicate to the linker that it should perform a relaxation optimization pass
19927 to shorten branches, calls and absolute memory addresses.  This option only
19928 has an effect when used on the command line for the final link step.
19930 This option makes symbolic debugging impossible.
19932 @item -mliw
19933 @opindex mliw
19934 Allow the compiler to generate @emph{Long Instruction Word}
19935 instructions if the target is the @samp{AM33} or later.  This is the
19936 default.  This option defines the preprocessor macro @code{__LIW__}.
19938 @item -mnoliw
19939 @opindex mnoliw
19940 Do not allow the compiler to generate @emph{Long Instruction Word}
19941 instructions.  This option defines the preprocessor macro
19942 @code{__NO_LIW__}.
19944 @item -msetlb
19945 @opindex msetlb
19946 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
19947 instructions if the target is the @samp{AM33} or later.  This is the
19948 default.  This option defines the preprocessor macro @code{__SETLB__}.
19950 @item -mnosetlb
19951 @opindex mnosetlb
19952 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
19953 instructions.  This option defines the preprocessor macro
19954 @code{__NO_SETLB__}.
19956 @end table
19958 @node Moxie Options
19959 @subsection Moxie Options
19960 @cindex Moxie Options
19962 @table @gcctabopt
19964 @item -meb
19965 @opindex meb
19966 Generate big-endian code.  This is the default for @samp{moxie-*-*}
19967 configurations.
19969 @item -mel
19970 @opindex mel
19971 Generate little-endian code.
19973 @item -mmul.x
19974 @opindex mmul.x
19975 Generate mul.x and umul.x instructions.  This is the default for
19976 @samp{moxiebox-*-*} configurations.
19978 @item -mno-crt0
19979 @opindex mno-crt0
19980 Do not link in the C run-time initialization object file.
19982 @end table
19984 @node MSP430 Options
19985 @subsection MSP430 Options
19986 @cindex MSP430 Options
19988 These options are defined for the MSP430:
19990 @table @gcctabopt
19992 @item -masm-hex
19993 @opindex masm-hex
19994 Force assembly output to always use hex constants.  Normally such
19995 constants are signed decimals, but this option is available for
19996 testsuite and/or aesthetic purposes.
19998 @item -mmcu=
19999 @opindex mmcu=
20000 Select the MCU to target.  This is used to create a C preprocessor
20001 symbol based upon the MCU name, converted to upper case and pre- and
20002 post-fixed with @samp{__}.  This in turn is used by the
20003 @file{msp430.h} header file to select an MCU-specific supplementary
20004 header file.
20006 The option also sets the ISA to use.  If the MCU name is one that is
20007 known to only support the 430 ISA then that is selected, otherwise the
20008 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
20009 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
20010 name selects the 430X ISA.
20012 In addition an MCU-specific linker script is added to the linker
20013 command line.  The script's name is the name of the MCU with
20014 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
20015 command line defines the C preprocessor symbol @code{__XXX__} and
20016 cause the linker to search for a script called @file{xxx.ld}.
20018 This option is also passed on to the assembler.
20020 @item -mwarn-mcu
20021 @itemx -mno-warn-mcu
20022 @opindex mwarn-mcu
20023 @opindex mno-warn-mcu
20024 This option enables or disables warnings about conflicts between the
20025 MCU name specified by the @option{-mmcu} option and the ISA set by the
20026 @option{-mcpu} option and/or the hardware multiply support set by the
20027 @option{-mhwmult} option.  It also toggles warnings about unrecognized
20028 MCU names.  This option is on by default.
20030 @item -mcpu=
20031 @opindex mcpu=
20032 Specifies the ISA to use.  Accepted values are @samp{msp430},
20033 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
20034 @option{-mmcu=} option should be used to select the ISA.
20036 @item -msim
20037 @opindex msim
20038 Link to the simulator runtime libraries and linker script.  Overrides
20039 any scripts that would be selected by the @option{-mmcu=} option.
20041 @item -mlarge
20042 @opindex mlarge
20043 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
20045 @item -msmall
20046 @opindex msmall
20047 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
20049 @item -mrelax
20050 @opindex mrelax
20051 This option is passed to the assembler and linker, and allows the
20052 linker to perform certain optimizations that cannot be done until
20053 the final link.
20055 @item mhwmult=
20056 @opindex mhwmult=
20057 Describes the type of hardware multiply supported by the target.
20058 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
20059 for the original 16-bit-only multiply supported by early MCUs.
20060 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
20061 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
20062 A value of @samp{auto} can also be given.  This tells GCC to deduce
20063 the hardware multiply support based upon the MCU name provided by the
20064 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
20065 the MCU name is not recognized then no hardware multiply support is
20066 assumed.  @code{auto} is the default setting.
20068 Hardware multiplies are normally performed by calling a library
20069 routine.  This saves space in the generated code.  When compiling at
20070 @option{-O3} or higher however the hardware multiplier is invoked
20071 inline.  This makes for bigger, but faster code.
20073 The hardware multiply routines disable interrupts whilst running and
20074 restore the previous interrupt state when they finish.  This makes
20075 them safe to use inside interrupt handlers as well as in normal code.
20077 @item -minrt
20078 @opindex minrt
20079 Enable the use of a minimum runtime environment - no static
20080 initializers or constructors.  This is intended for memory-constrained
20081 devices.  The compiler includes special symbols in some objects
20082 that tell the linker and runtime which code fragments are required.
20084 @item -mcode-region=
20085 @itemx -mdata-region=
20086 @opindex mcode-region
20087 @opindex mdata-region
20088 These options tell the compiler where to place functions and data that
20089 do not have one of the @code{lower}, @code{upper}, @code{either} or
20090 @code{section} attributes.  Possible values are @code{lower},
20091 @code{upper}, @code{either} or @code{any}.  The first three behave
20092 like the corresponding attribute.  The fourth possible value -
20093 @code{any} - is the default.  It leaves placement entirely up to the
20094 linker script and how it assigns the standard sections
20095 (@code{.text}, @code{.data}, etc) to the memory regions.
20097 @item -msilicon-errata=
20098 @opindex msilicon-errata
20099 This option passes on a request to assembler to enable the fixes for
20100 the named silicon errata.
20102 @item -msilicon-errata-warn=
20103 @opindex msilicon-errata-warn
20104 This option passes on a request to the assembler to enable warning
20105 messages when a silicon errata might need to be applied.
20107 @end table
20109 @node NDS32 Options
20110 @subsection NDS32 Options
20111 @cindex NDS32 Options
20113 These options are defined for NDS32 implementations:
20115 @table @gcctabopt
20117 @item -mbig-endian
20118 @opindex mbig-endian
20119 Generate code in big-endian mode.
20121 @item -mlittle-endian
20122 @opindex mlittle-endian
20123 Generate code in little-endian mode.
20125 @item -mreduced-regs
20126 @opindex mreduced-regs
20127 Use reduced-set registers for register allocation.
20129 @item -mfull-regs
20130 @opindex mfull-regs
20131 Use full-set registers for register allocation.
20133 @item -mcmov
20134 @opindex mcmov
20135 Generate conditional move instructions.
20137 @item -mno-cmov
20138 @opindex mno-cmov
20139 Do not generate conditional move instructions.
20141 @item -mperf-ext
20142 @opindex mperf-ext
20143 Generate performance extension instructions.
20145 @item -mno-perf-ext
20146 @opindex mno-perf-ext
20147 Do not generate performance extension instructions.
20149 @item -mv3push
20150 @opindex mv3push
20151 Generate v3 push25/pop25 instructions.
20153 @item -mno-v3push
20154 @opindex mno-v3push
20155 Do not generate v3 push25/pop25 instructions.
20157 @item -m16-bit
20158 @opindex m16-bit
20159 Generate 16-bit instructions.
20161 @item -mno-16-bit
20162 @opindex mno-16-bit
20163 Do not generate 16-bit instructions.
20165 @item -misr-vector-size=@var{num}
20166 @opindex misr-vector-size
20167 Specify the size of each interrupt vector, which must be 4 or 16.
20169 @item -mcache-block-size=@var{num}
20170 @opindex mcache-block-size
20171 Specify the size of each cache block,
20172 which must be a power of 2 between 4 and 512.
20174 @item -march=@var{arch}
20175 @opindex march
20176 Specify the name of the target architecture.
20178 @item -mcmodel=@var{code-model}
20179 @opindex mcmodel
20180 Set the code model to one of
20181 @table @asis
20182 @item @samp{small}
20183 All the data and read-only data segments must be within 512KB addressing space.
20184 The text segment must be within 16MB addressing space.
20185 @item @samp{medium}
20186 The data segment must be within 512KB while the read-only data segment can be
20187 within 4GB addressing space.  The text segment should be still within 16MB
20188 addressing space.
20189 @item @samp{large}
20190 All the text and data segments can be within 4GB addressing space.
20191 @end table
20193 @item -mctor-dtor
20194 @opindex mctor-dtor
20195 Enable constructor/destructor feature.
20197 @item -mrelax
20198 @opindex mrelax
20199 Guide linker to relax instructions.
20201 @end table
20203 @node Nios II Options
20204 @subsection Nios II Options
20205 @cindex Nios II options
20206 @cindex Altera Nios II options
20208 These are the options defined for the Altera Nios II processor.
20210 @table @gcctabopt
20212 @item -G @var{num}
20213 @opindex G
20214 @cindex smaller data references
20215 Put global and static objects less than or equal to @var{num} bytes
20216 into the small data or BSS sections instead of the normal data or BSS
20217 sections.  The default value of @var{num} is 8.
20219 @item -mgpopt=@var{option}
20220 @item -mgpopt
20221 @itemx -mno-gpopt
20222 @opindex mgpopt
20223 @opindex mno-gpopt
20224 Generate (do not generate) GP-relative accesses.  The following 
20225 @var{option} names are recognized:
20227 @table @samp
20229 @item none
20230 Do not generate GP-relative accesses.
20232 @item local
20233 Generate GP-relative accesses for small data objects that are not 
20234 external, weak, or uninitialized common symbols.  
20235 Also use GP-relative addressing for objects that
20236 have been explicitly placed in a small data section via a @code{section}
20237 attribute.
20239 @item global
20240 As for @samp{local}, but also generate GP-relative accesses for
20241 small data objects that are external, weak, or common.  If you use this option,
20242 you must ensure that all parts of your program (including libraries) are
20243 compiled with the same @option{-G} setting.
20245 @item data
20246 Generate GP-relative accesses for all data objects in the program.  If you
20247 use this option, the entire data and BSS segments
20248 of your program must fit in 64K of memory and you must use an appropriate
20249 linker script to allocate them within the addressable range of the
20250 global pointer.
20252 @item all
20253 Generate GP-relative addresses for function pointers as well as data
20254 pointers.  If you use this option, the entire text, data, and BSS segments
20255 of your program must fit in 64K of memory and you must use an appropriate
20256 linker script to allocate them within the addressable range of the
20257 global pointer.
20259 @end table
20261 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
20262 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
20264 The default is @option{-mgpopt} except when @option{-fpic} or
20265 @option{-fPIC} is specified to generate position-independent code.
20266 Note that the Nios II ABI does not permit GP-relative accesses from
20267 shared libraries.
20269 You may need to specify @option{-mno-gpopt} explicitly when building
20270 programs that include large amounts of small data, including large
20271 GOT data sections.  In this case, the 16-bit offset for GP-relative
20272 addressing may not be large enough to allow access to the entire 
20273 small data section.
20275 @item -mel
20276 @itemx -meb
20277 @opindex mel
20278 @opindex meb
20279 Generate little-endian (default) or big-endian (experimental) code,
20280 respectively.
20282 @item -march=@var{arch}
20283 @opindex march
20284 This specifies the name of the target Nios II architecture.  GCC uses this
20285 name to determine what kind of instructions it can emit when generating
20286 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
20288 The preprocessor macro @code{__nios2_arch__} is available to programs,
20289 with value 1 or 2, indicating the targeted ISA level.
20291 @item -mbypass-cache
20292 @itemx -mno-bypass-cache
20293 @opindex mno-bypass-cache
20294 @opindex mbypass-cache
20295 Force all load and store instructions to always bypass cache by 
20296 using I/O variants of the instructions. The default is not to
20297 bypass the cache.
20299 @item -mno-cache-volatile 
20300 @itemx -mcache-volatile       
20301 @opindex mcache-volatile 
20302 @opindex mno-cache-volatile
20303 Volatile memory access bypass the cache using the I/O variants of 
20304 the load and store instructions. The default is not to bypass the cache.
20306 @item -mno-fast-sw-div
20307 @itemx -mfast-sw-div
20308 @opindex mno-fast-sw-div
20309 @opindex mfast-sw-div
20310 Do not use table-based fast divide for small numbers. The default 
20311 is to use the fast divide at @option{-O3} and above.
20313 @item -mno-hw-mul
20314 @itemx -mhw-mul
20315 @itemx -mno-hw-mulx
20316 @itemx -mhw-mulx
20317 @itemx -mno-hw-div
20318 @itemx -mhw-div
20319 @opindex mno-hw-mul
20320 @opindex mhw-mul
20321 @opindex mno-hw-mulx
20322 @opindex mhw-mulx
20323 @opindex mno-hw-div
20324 @opindex mhw-div
20325 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
20326 instructions by the compiler. The default is to emit @code{mul}
20327 and not emit @code{div} and @code{mulx}.
20329 @item -mbmx
20330 @itemx -mno-bmx
20331 @itemx -mcdx
20332 @itemx -mno-cdx
20333 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
20334 CDX (code density) instructions.  Enabling these instructions also
20335 requires @option{-march=r2}.  Since these instructions are optional
20336 extensions to the R2 architecture, the default is not to emit them.
20338 @item -mcustom-@var{insn}=@var{N}
20339 @itemx -mno-custom-@var{insn}
20340 @opindex mcustom-@var{insn}
20341 @opindex mno-custom-@var{insn}
20342 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
20343 custom instruction with encoding @var{N} when generating code that uses 
20344 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
20345 instruction 253 for single-precision floating-point add operations instead
20346 of the default behavior of using a library call.
20348 The following values of @var{insn} are supported.  Except as otherwise
20349 noted, floating-point operations are expected to be implemented with
20350 normal IEEE 754 semantics and correspond directly to the C operators or the
20351 equivalent GCC built-in functions (@pxref{Other Builtins}).
20353 Single-precision floating point:
20354 @table @asis
20356 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
20357 Binary arithmetic operations.
20359 @item @samp{fnegs}
20360 Unary negation.
20362 @item @samp{fabss}
20363 Unary absolute value.
20365 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
20366 Comparison operations.
20368 @item @samp{fmins}, @samp{fmaxs}
20369 Floating-point minimum and maximum.  These instructions are only
20370 generated if @option{-ffinite-math-only} is specified.
20372 @item @samp{fsqrts}
20373 Unary square root operation.
20375 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
20376 Floating-point trigonometric and exponential functions.  These instructions
20377 are only generated if @option{-funsafe-math-optimizations} is also specified.
20379 @end table
20381 Double-precision floating point:
20382 @table @asis
20384 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
20385 Binary arithmetic operations.
20387 @item @samp{fnegd}
20388 Unary negation.
20390 @item @samp{fabsd}
20391 Unary absolute value.
20393 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
20394 Comparison operations.
20396 @item @samp{fmind}, @samp{fmaxd}
20397 Double-precision minimum and maximum.  These instructions are only
20398 generated if @option{-ffinite-math-only} is specified.
20400 @item @samp{fsqrtd}
20401 Unary square root operation.
20403 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
20404 Double-precision trigonometric and exponential functions.  These instructions
20405 are only generated if @option{-funsafe-math-optimizations} is also specified.
20407 @end table
20409 Conversions:
20410 @table @asis
20411 @item @samp{fextsd}
20412 Conversion from single precision to double precision.
20414 @item @samp{ftruncds}
20415 Conversion from double precision to single precision.
20417 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
20418 Conversion from floating point to signed or unsigned integer types, with
20419 truncation towards zero.
20421 @item @samp{round}
20422 Conversion from single-precision floating point to signed integer,
20423 rounding to the nearest integer and ties away from zero.
20424 This corresponds to the @code{__builtin_lroundf} function when
20425 @option{-fno-math-errno} is used.
20427 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
20428 Conversion from signed or unsigned integer types to floating-point types.
20430 @end table
20432 In addition, all of the following transfer instructions for internal
20433 registers X and Y must be provided to use any of the double-precision
20434 floating-point instructions.  Custom instructions taking two
20435 double-precision source operands expect the first operand in the
20436 64-bit register X.  The other operand (or only operand of a unary
20437 operation) is given to the custom arithmetic instruction with the
20438 least significant half in source register @var{src1} and the most
20439 significant half in @var{src2}.  A custom instruction that returns a
20440 double-precision result returns the most significant 32 bits in the
20441 destination register and the other half in 32-bit register Y.  
20442 GCC automatically generates the necessary code sequences to write
20443 register X and/or read register Y when double-precision floating-point
20444 instructions are used.
20446 @table @asis
20448 @item @samp{fwrx}
20449 Write @var{src1} into the least significant half of X and @var{src2} into
20450 the most significant half of X.
20452 @item @samp{fwry}
20453 Write @var{src1} into Y.
20455 @item @samp{frdxhi}, @samp{frdxlo}
20456 Read the most or least (respectively) significant half of X and store it in
20457 @var{dest}.
20459 @item @samp{frdy}
20460 Read the value of Y and store it into @var{dest}.
20461 @end table
20463 Note that you can gain more local control over generation of Nios II custom
20464 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
20465 and @code{target("no-custom-@var{insn}")} function attributes
20466 (@pxref{Function Attributes})
20467 or pragmas (@pxref{Function Specific Option Pragmas}).
20469 @item -mcustom-fpu-cfg=@var{name}
20470 @opindex mcustom-fpu-cfg
20472 This option enables a predefined, named set of custom instruction encodings
20473 (see @option{-mcustom-@var{insn}} above).  
20474 Currently, the following sets are defined:
20476 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
20477 @gccoptlist{-mcustom-fmuls=252 @gol
20478 -mcustom-fadds=253 @gol
20479 -mcustom-fsubs=254 @gol
20480 -fsingle-precision-constant}
20482 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
20483 @gccoptlist{-mcustom-fmuls=252 @gol
20484 -mcustom-fadds=253 @gol
20485 -mcustom-fsubs=254 @gol
20486 -mcustom-fdivs=255 @gol
20487 -fsingle-precision-constant}
20489 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
20490 @gccoptlist{-mcustom-floatus=243 @gol
20491 -mcustom-fixsi=244 @gol
20492 -mcustom-floatis=245 @gol
20493 -mcustom-fcmpgts=246 @gol
20494 -mcustom-fcmples=249 @gol
20495 -mcustom-fcmpeqs=250 @gol
20496 -mcustom-fcmpnes=251 @gol
20497 -mcustom-fmuls=252 @gol
20498 -mcustom-fadds=253 @gol
20499 -mcustom-fsubs=254 @gol
20500 -mcustom-fdivs=255 @gol
20501 -fsingle-precision-constant}
20503 Custom instruction assignments given by individual
20504 @option{-mcustom-@var{insn}=} options override those given by
20505 @option{-mcustom-fpu-cfg=}, regardless of the
20506 order of the options on the command line.
20508 Note that you can gain more local control over selection of a FPU
20509 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
20510 function attribute (@pxref{Function Attributes})
20511 or pragma (@pxref{Function Specific Option Pragmas}).
20513 @end table
20515 These additional @samp{-m} options are available for the Altera Nios II
20516 ELF (bare-metal) target:
20518 @table @gcctabopt
20520 @item -mhal
20521 @opindex mhal
20522 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
20523 startup and termination code, and is typically used in conjunction with
20524 @option{-msys-crt0=} to specify the location of the alternate startup code
20525 provided by the HAL BSP.
20527 @item -msmallc
20528 @opindex msmallc
20529 Link with a limited version of the C library, @option{-lsmallc}, rather than
20530 Newlib.
20532 @item -msys-crt0=@var{startfile}
20533 @opindex msys-crt0
20534 @var{startfile} is the file name of the startfile (crt0) to use 
20535 when linking.  This option is only useful in conjunction with @option{-mhal}.
20537 @item -msys-lib=@var{systemlib}
20538 @opindex msys-lib
20539 @var{systemlib} is the library name of the library that provides
20540 low-level system calls required by the C library,
20541 e.g. @code{read} and @code{write}.
20542 This option is typically used to link with a library provided by a HAL BSP.
20544 @end table
20546 @node Nvidia PTX Options
20547 @subsection Nvidia PTX Options
20548 @cindex Nvidia PTX options
20549 @cindex nvptx options
20551 These options are defined for Nvidia PTX:
20553 @table @gcctabopt
20555 @item -m32
20556 @itemx -m64
20557 @opindex m32
20558 @opindex m64
20559 Generate code for 32-bit or 64-bit ABI.
20561 @item -mmainkernel
20562 @opindex mmainkernel
20563 Link in code for a __main kernel.  This is for stand-alone instead of
20564 offloading execution.
20566 @item -moptimize
20567 @opindex moptimize
20568 Apply partitioned execution optimizations.  This is the default when any
20569 level of optimization is selected.
20571 @end table
20573 @node PDP-11 Options
20574 @subsection PDP-11 Options
20575 @cindex PDP-11 Options
20577 These options are defined for the PDP-11:
20579 @table @gcctabopt
20580 @item -mfpu
20581 @opindex mfpu
20582 Use hardware FPP floating point.  This is the default.  (FIS floating
20583 point on the PDP-11/40 is not supported.)
20585 @item -msoft-float
20586 @opindex msoft-float
20587 Do not use hardware floating point.
20589 @item -mac0
20590 @opindex mac0
20591 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
20593 @item -mno-ac0
20594 @opindex mno-ac0
20595 Return floating-point results in memory.  This is the default.
20597 @item -m40
20598 @opindex m40
20599 Generate code for a PDP-11/40.
20601 @item -m45
20602 @opindex m45
20603 Generate code for a PDP-11/45.  This is the default.
20605 @item -m10
20606 @opindex m10
20607 Generate code for a PDP-11/10.
20609 @item -mbcopy-builtin
20610 @opindex mbcopy-builtin
20611 Use inline @code{movmemhi} patterns for copying memory.  This is the
20612 default.
20614 @item -mbcopy
20615 @opindex mbcopy
20616 Do not use inline @code{movmemhi} patterns for copying memory.
20618 @item -mint16
20619 @itemx -mno-int32
20620 @opindex mint16
20621 @opindex mno-int32
20622 Use 16-bit @code{int}.  This is the default.
20624 @item -mint32
20625 @itemx -mno-int16
20626 @opindex mint32
20627 @opindex mno-int16
20628 Use 32-bit @code{int}.
20630 @item -mfloat64
20631 @itemx -mno-float32
20632 @opindex mfloat64
20633 @opindex mno-float32
20634 Use 64-bit @code{float}.  This is the default.
20636 @item -mfloat32
20637 @itemx -mno-float64
20638 @opindex mfloat32
20639 @opindex mno-float64
20640 Use 32-bit @code{float}.
20642 @item -mabshi
20643 @opindex mabshi
20644 Use @code{abshi2} pattern.  This is the default.
20646 @item -mno-abshi
20647 @opindex mno-abshi
20648 Do not use @code{abshi2} pattern.
20650 @item -mbranch-expensive
20651 @opindex mbranch-expensive
20652 Pretend that branches are expensive.  This is for experimenting with
20653 code generation only.
20655 @item -mbranch-cheap
20656 @opindex mbranch-cheap
20657 Do not pretend that branches are expensive.  This is the default.
20659 @item -munix-asm
20660 @opindex munix-asm
20661 Use Unix assembler syntax.  This is the default when configured for
20662 @samp{pdp11-*-bsd}.
20664 @item -mdec-asm
20665 @opindex mdec-asm
20666 Use DEC assembler syntax.  This is the default when configured for any
20667 PDP-11 target other than @samp{pdp11-*-bsd}.
20668 @end table
20670 @node picoChip Options
20671 @subsection picoChip Options
20672 @cindex picoChip options
20674 These @samp{-m} options are defined for picoChip implementations:
20676 @table @gcctabopt
20678 @item -mae=@var{ae_type}
20679 @opindex mcpu
20680 Set the instruction set, register set, and instruction scheduling
20681 parameters for array element type @var{ae_type}.  Supported values
20682 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
20684 @option{-mae=ANY} selects a completely generic AE type.  Code
20685 generated with this option runs on any of the other AE types.  The
20686 code is not as efficient as it would be if compiled for a specific
20687 AE type, and some types of operation (e.g., multiplication) do not
20688 work properly on all types of AE.
20690 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
20691 for compiled code, and is the default.
20693 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
20694 option may suffer from poor performance of byte (char) manipulation,
20695 since the DSP AE does not provide hardware support for byte load/stores.
20697 @item -msymbol-as-address
20698 Enable the compiler to directly use a symbol name as an address in a
20699 load/store instruction, without first loading it into a
20700 register.  Typically, the use of this option generates larger
20701 programs, which run faster than when the option isn't used.  However, the
20702 results vary from program to program, so it is left as a user option,
20703 rather than being permanently enabled.
20705 @item -mno-inefficient-warnings
20706 Disables warnings about the generation of inefficient code.  These
20707 warnings can be generated, for example, when compiling code that
20708 performs byte-level memory operations on the MAC AE type.  The MAC AE has
20709 no hardware support for byte-level memory operations, so all byte
20710 load/stores must be synthesized from word load/store operations.  This is
20711 inefficient and a warning is generated to indicate
20712 that you should rewrite the code to avoid byte operations, or to target
20713 an AE type that has the necessary hardware support.  This option disables
20714 these warnings.
20716 @end table
20718 @node PowerPC Options
20719 @subsection PowerPC Options
20720 @cindex PowerPC options
20722 These are listed under @xref{RS/6000 and PowerPC Options}.
20724 @node RL78 Options
20725 @subsection RL78 Options
20726 @cindex RL78 Options
20728 @table @gcctabopt
20730 @item -msim
20731 @opindex msim
20732 Links in additional target libraries to support operation within a
20733 simulator.
20735 @item -mmul=none
20736 @itemx -mmul=g10
20737 @itemx -mmul=g13
20738 @itemx -mmul=g14
20739 @itemx -mmul=rl78
20740 @opindex mmul
20741 Specifies the type of hardware multiplication and division support to
20742 be used.  The simplest is @code{none}, which uses software for both
20743 multiplication and division.  This is the default.  The @code{g13}
20744 value is for the hardware multiply/divide peripheral found on the
20745 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
20746 the multiplication and division instructions supported by the RL78/G14
20747 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
20748 the value @code{mg10} is an alias for @code{none}.
20750 In addition a C preprocessor macro is defined, based upon the setting
20751 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
20752 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
20754 @item -mcpu=g10
20755 @itemx -mcpu=g13
20756 @itemx -mcpu=g14
20757 @itemx -mcpu=rl78
20758 @opindex mcpu
20759 Specifies the RL78 core to target.  The default is the G14 core, also
20760 known as an S3 core or just RL78.  The G13 or S2 core does not have
20761 multiply or divide instructions, instead it uses a hardware peripheral
20762 for these operations.  The G10 or S1 core does not have register
20763 banks, so it uses a different calling convention.
20765 If this option is set it also selects the type of hardware multiply
20766 support to use, unless this is overridden by an explicit
20767 @option{-mmul=none} option on the command line.  Thus specifying
20768 @option{-mcpu=g13} enables the use of the G13 hardware multiply
20769 peripheral and specifying @option{-mcpu=g10} disables the use of
20770 hardware multiplications altogether.
20772 Note, although the RL78/G14 core is the default target, specifying
20773 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
20774 change the behavior of the toolchain since it also enables G14
20775 hardware multiply support.  If these options are not specified on the
20776 command line then software multiplication routines will be used even
20777 though the code targets the RL78 core.  This is for backwards
20778 compatibility with older toolchains which did not have hardware
20779 multiply and divide support.
20781 In addition a C preprocessor macro is defined, based upon the setting
20782 of this option.  Possible values are: @code{__RL78_G10__},
20783 @code{__RL78_G13__} or @code{__RL78_G14__}.
20785 @item -mg10
20786 @itemx -mg13
20787 @itemx -mg14
20788 @itemx -mrl78
20789 @opindex mg10
20790 @opindex mg13
20791 @opindex mg14
20792 @opindex mrl78
20793 These are aliases for the corresponding @option{-mcpu=} option.  They
20794 are provided for backwards compatibility.
20796 @item -mallregs
20797 @opindex mallregs
20798 Allow the compiler to use all of the available registers.  By default
20799 registers @code{r24..r31} are reserved for use in interrupt handlers.
20800 With this option enabled these registers can be used in ordinary
20801 functions as well.
20803 @item -m64bit-doubles
20804 @itemx -m32bit-doubles
20805 @opindex m64bit-doubles
20806 @opindex m32bit-doubles
20807 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
20808 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
20809 @option{-m32bit-doubles}.
20811 @item -msave-mduc-in-interrupts
20812 @item -mno-save-mduc-in-interrupts
20813 @opindex msave-mduc-in-interrupts
20814 @opindex mno-save-mduc-in-interrupts
20815 Specifies that interrupt handler functions should preserve the
20816 MDUC registers.  This is only necessary if normal code might use
20817 the MDUC registers, for example because it performs multiplication
20818 and division operations.  The default is to ignore the MDUC registers
20819 as this makes the interrupt handlers faster.  The target option -mg13
20820 needs to be passed for this to work as this feature is only available
20821 on the G13 target (S2 core).  The MDUC registers will only be saved
20822 if the interrupt handler performs a multiplication or division
20823 operation or it calls another function.
20825 @end table
20827 @node RS/6000 and PowerPC Options
20828 @subsection IBM RS/6000 and PowerPC Options
20829 @cindex RS/6000 and PowerPC Options
20830 @cindex IBM RS/6000 and PowerPC Options
20832 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
20833 @table @gcctabopt
20834 @item -mpowerpc-gpopt
20835 @itemx -mno-powerpc-gpopt
20836 @itemx -mpowerpc-gfxopt
20837 @itemx -mno-powerpc-gfxopt
20838 @need 800
20839 @itemx -mpowerpc64
20840 @itemx -mno-powerpc64
20841 @itemx -mmfcrf
20842 @itemx -mno-mfcrf
20843 @itemx -mpopcntb
20844 @itemx -mno-popcntb
20845 @itemx -mpopcntd
20846 @itemx -mno-popcntd
20847 @itemx -mfprnd
20848 @itemx -mno-fprnd
20849 @need 800
20850 @itemx -mcmpb
20851 @itemx -mno-cmpb
20852 @itemx -mmfpgpr
20853 @itemx -mno-mfpgpr
20854 @itemx -mhard-dfp
20855 @itemx -mno-hard-dfp
20856 @opindex mpowerpc-gpopt
20857 @opindex mno-powerpc-gpopt
20858 @opindex mpowerpc-gfxopt
20859 @opindex mno-powerpc-gfxopt
20860 @opindex mpowerpc64
20861 @opindex mno-powerpc64
20862 @opindex mmfcrf
20863 @opindex mno-mfcrf
20864 @opindex mpopcntb
20865 @opindex mno-popcntb
20866 @opindex mpopcntd
20867 @opindex mno-popcntd
20868 @opindex mfprnd
20869 @opindex mno-fprnd
20870 @opindex mcmpb
20871 @opindex mno-cmpb
20872 @opindex mmfpgpr
20873 @opindex mno-mfpgpr
20874 @opindex mhard-dfp
20875 @opindex mno-hard-dfp
20876 You use these options to specify which instructions are available on the
20877 processor you are using.  The default value of these options is
20878 determined when configuring GCC@.  Specifying the
20879 @option{-mcpu=@var{cpu_type}} overrides the specification of these
20880 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
20881 rather than the options listed above.
20883 Specifying @option{-mpowerpc-gpopt} allows
20884 GCC to use the optional PowerPC architecture instructions in the
20885 General Purpose group, including floating-point square root.  Specifying
20886 @option{-mpowerpc-gfxopt} allows GCC to
20887 use the optional PowerPC architecture instructions in the Graphics
20888 group, including floating-point select.
20890 The @option{-mmfcrf} option allows GCC to generate the move from
20891 condition register field instruction implemented on the POWER4
20892 processor and other processors that support the PowerPC V2.01
20893 architecture.
20894 The @option{-mpopcntb} option allows GCC to generate the popcount and
20895 double-precision FP reciprocal estimate instruction implemented on the
20896 POWER5 processor and other processors that support the PowerPC V2.02
20897 architecture.
20898 The @option{-mpopcntd} option allows GCC to generate the popcount
20899 instruction implemented on the POWER7 processor and other processors
20900 that support the PowerPC V2.06 architecture.
20901 The @option{-mfprnd} option allows GCC to generate the FP round to
20902 integer instructions implemented on the POWER5+ processor and other
20903 processors that support the PowerPC V2.03 architecture.
20904 The @option{-mcmpb} option allows GCC to generate the compare bytes
20905 instruction implemented on the POWER6 processor and other processors
20906 that support the PowerPC V2.05 architecture.
20907 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
20908 general-purpose register instructions implemented on the POWER6X
20909 processor and other processors that support the extended PowerPC V2.05
20910 architecture.
20911 The @option{-mhard-dfp} option allows GCC to generate the decimal
20912 floating-point instructions implemented on some POWER processors.
20914 The @option{-mpowerpc64} option allows GCC to generate the additional
20915 64-bit instructions that are found in the full PowerPC64 architecture
20916 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
20917 @option{-mno-powerpc64}.
20919 @item -mcpu=@var{cpu_type}
20920 @opindex mcpu
20921 Set architecture type, register usage, and
20922 instruction scheduling parameters for machine type @var{cpu_type}.
20923 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
20924 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
20925 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
20926 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
20927 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
20928 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
20929 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
20930 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
20931 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
20932 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
20933 @samp{power9}, @samp{powerpc}, @samp{powerpc64}, @samp{powerpc64le},
20934 and @samp{rs64}.
20936 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
20937 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
20938 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
20939 architecture machine types, with an appropriate, generic processor
20940 model assumed for scheduling purposes.
20942 The other options specify a specific processor.  Code generated under
20943 those options runs best on that processor, and may not run at all on
20944 others.
20946 The @option{-mcpu} options automatically enable or disable the
20947 following options:
20949 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
20950 -mpopcntb -mpopcntd  -mpowerpc64 @gol
20951 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
20952 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
20953 -mcrypto -mdirect-move -mhtm -mpower8-fusion -mpower8-vector @gol
20954 -mquad-memory -mquad-memory-atomic -mfloat128 -mfloat128-hardware}
20956 The particular options set for any particular CPU varies between
20957 compiler versions, depending on what setting seems to produce optimal
20958 code for that CPU; it doesn't necessarily reflect the actual hardware's
20959 capabilities.  If you wish to set an individual option to a particular
20960 value, you may specify it after the @option{-mcpu} option, like
20961 @option{-mcpu=970 -mno-altivec}.
20963 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
20964 not enabled or disabled by the @option{-mcpu} option at present because
20965 AIX does not have full support for these options.  You may still
20966 enable or disable them individually if you're sure it'll work in your
20967 environment.
20969 @item -mtune=@var{cpu_type}
20970 @opindex mtune
20971 Set the instruction scheduling parameters for machine type
20972 @var{cpu_type}, but do not set the architecture type or register usage,
20973 as @option{-mcpu=@var{cpu_type}} does.  The same
20974 values for @var{cpu_type} are used for @option{-mtune} as for
20975 @option{-mcpu}.  If both are specified, the code generated uses the
20976 architecture and registers set by @option{-mcpu}, but the
20977 scheduling parameters set by @option{-mtune}.
20979 @item -mcmodel=small
20980 @opindex mcmodel=small
20981 Generate PowerPC64 code for the small model: The TOC is limited to
20982 64k.
20984 @item -mcmodel=medium
20985 @opindex mcmodel=medium
20986 Generate PowerPC64 code for the medium model: The TOC and other static
20987 data may be up to a total of 4G in size.
20989 @item -mcmodel=large
20990 @opindex mcmodel=large
20991 Generate PowerPC64 code for the large model: The TOC may be up to 4G
20992 in size.  Other data and code is only limited by the 64-bit address
20993 space.
20995 @item -maltivec
20996 @itemx -mno-altivec
20997 @opindex maltivec
20998 @opindex mno-altivec
20999 Generate code that uses (does not use) AltiVec instructions, and also
21000 enable the use of built-in functions that allow more direct access to
21001 the AltiVec instruction set.  You may also need to set
21002 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
21003 enhancements.
21005 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
21006 @option{-maltivec=be}, the element order for AltiVec intrinsics such
21007 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
21008 match array element order corresponding to the endianness of the
21009 target.  That is, element zero identifies the leftmost element in a
21010 vector register when targeting a big-endian platform, and identifies
21011 the rightmost element in a vector register when targeting a
21012 little-endian platform.
21014 @item -maltivec=be
21015 @opindex maltivec=be
21016 Generate AltiVec instructions using big-endian element order,
21017 regardless of whether the target is big- or little-endian.  This is
21018 the default when targeting a big-endian platform.
21020 The element order is used to interpret element numbers in AltiVec
21021 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
21022 @code{vec_insert}.  By default, these match array element order
21023 corresponding to the endianness for the target.
21025 @item -maltivec=le
21026 @opindex maltivec=le
21027 Generate AltiVec instructions using little-endian element order,
21028 regardless of whether the target is big- or little-endian.  This is
21029 the default when targeting a little-endian platform.  This option is
21030 currently ignored when targeting a big-endian platform.
21032 The element order is used to interpret element numbers in AltiVec
21033 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
21034 @code{vec_insert}.  By default, these match array element order
21035 corresponding to the endianness for the target.
21037 @item -mvrsave
21038 @itemx -mno-vrsave
21039 @opindex mvrsave
21040 @opindex mno-vrsave
21041 Generate VRSAVE instructions when generating AltiVec code.
21043 @item -mgen-cell-microcode
21044 @opindex mgen-cell-microcode
21045 Generate Cell microcode instructions.
21047 @item -mwarn-cell-microcode
21048 @opindex mwarn-cell-microcode
21049 Warn when a Cell microcode instruction is emitted.  An example
21050 of a Cell microcode instruction is a variable shift.
21052 @item -msecure-plt
21053 @opindex msecure-plt
21054 Generate code that allows @command{ld} and @command{ld.so}
21055 to build executables and shared
21056 libraries with non-executable @code{.plt} and @code{.got} sections.
21057 This is a PowerPC
21058 32-bit SYSV ABI option.
21060 @item -mbss-plt
21061 @opindex mbss-plt
21062 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
21063 fills in, and
21064 requires @code{.plt} and @code{.got}
21065 sections that are both writable and executable.
21066 This is a PowerPC 32-bit SYSV ABI option.
21068 @item -misel
21069 @itemx -mno-isel
21070 @opindex misel
21071 @opindex mno-isel
21072 This switch enables or disables the generation of ISEL instructions.
21074 @item -misel=@var{yes/no}
21075 This switch has been deprecated.  Use @option{-misel} and
21076 @option{-mno-isel} instead.
21078 @item -mlra
21079 @opindex mlra
21080 Enable Local Register Allocation.  This is still experimental for PowerPC,
21081 so by default the compiler uses standard reload
21082 (i.e. @option{-mno-lra}).
21084 @item -mspe
21085 @itemx -mno-spe
21086 @opindex mspe
21087 @opindex mno-spe
21088 This switch enables or disables the generation of SPE simd
21089 instructions.
21091 @item -mpaired
21092 @itemx -mno-paired
21093 @opindex mpaired
21094 @opindex mno-paired
21095 This switch enables or disables the generation of PAIRED simd
21096 instructions.
21098 @item -mspe=@var{yes/no}
21099 This option has been deprecated.  Use @option{-mspe} and
21100 @option{-mno-spe} instead.
21102 @item -mvsx
21103 @itemx -mno-vsx
21104 @opindex mvsx
21105 @opindex mno-vsx
21106 Generate code that uses (does not use) vector/scalar (VSX)
21107 instructions, and also enable the use of built-in functions that allow
21108 more direct access to the VSX instruction set.
21110 @item -mcrypto
21111 @itemx -mno-crypto
21112 @opindex mcrypto
21113 @opindex mno-crypto
21114 Enable the use (disable) of the built-in functions that allow direct
21115 access to the cryptographic instructions that were added in version
21116 2.07 of the PowerPC ISA.
21118 @item -mdirect-move
21119 @itemx -mno-direct-move
21120 @opindex mdirect-move
21121 @opindex mno-direct-move
21122 Generate code that uses (does not use) the instructions to move data
21123 between the general purpose registers and the vector/scalar (VSX)
21124 registers that were added in version 2.07 of the PowerPC ISA.
21126 @item -mhtm
21127 @itemx -mno-htm
21128 @opindex mhtm
21129 @opindex mno-htm
21130 Enable (disable) the use of the built-in functions that allow direct
21131 access to the Hardware Transactional Memory (HTM) instructions that
21132 were added in version 2.07 of the PowerPC ISA.
21134 @item -mpower8-fusion
21135 @itemx -mno-power8-fusion
21136 @opindex mpower8-fusion
21137 @opindex mno-power8-fusion
21138 Generate code that keeps (does not keeps) some integer operations
21139 adjacent so that the instructions can be fused together on power8 and
21140 later processors.
21142 @item -mpower8-vector
21143 @itemx -mno-power8-vector
21144 @opindex mpower8-vector
21145 @opindex mno-power8-vector
21146 Generate code that uses (does not use) the vector and scalar
21147 instructions that were added in version 2.07 of the PowerPC ISA.  Also
21148 enable the use of built-in functions that allow more direct access to
21149 the vector instructions.
21151 @item -mquad-memory
21152 @itemx -mno-quad-memory
21153 @opindex mquad-memory
21154 @opindex mno-quad-memory
21155 Generate code that uses (does not use) the non-atomic quad word memory
21156 instructions.  The @option{-mquad-memory} option requires use of
21157 64-bit mode.
21159 @item -mquad-memory-atomic
21160 @itemx -mno-quad-memory-atomic
21161 @opindex mquad-memory-atomic
21162 @opindex mno-quad-memory-atomic
21163 Generate code that uses (does not use) the atomic quad word memory
21164 instructions.  The @option{-mquad-memory-atomic} option requires use of
21165 64-bit mode.
21167 @item -mupper-regs-di
21168 @itemx -mno-upper-regs-di
21169 @opindex mupper-regs-di
21170 @opindex mno-upper-regs-di
21171 Generate code that uses (does not use) the scalar instructions that
21172 target all 64 registers in the vector/scalar floating point register
21173 set that were added in version 2.06 of the PowerPC ISA when processing
21174 integers.  @option{-mupper-regs-di} is turned on by default if you use
21175 any of the @option{-mcpu=power7}, @option{-mcpu=power8},
21176 @option{-mcpu=power9}, or @option{-mvsx} options.
21178 @item -mupper-regs-df
21179 @itemx -mno-upper-regs-df
21180 @opindex mupper-regs-df
21181 @opindex mno-upper-regs-df
21182 Generate code that uses (does not use) the scalar double precision
21183 instructions that target all 64 registers in the vector/scalar
21184 floating point register set that were added in version 2.06 of the
21185 PowerPC ISA.  @option{-mupper-regs-df} is turned on by default if you
21186 use any of the @option{-mcpu=power7}, @option{-mcpu=power8},
21187 @option{-mcpu=power9}, or @option{-mvsx} options.
21189 @item -mupper-regs-sf
21190 @itemx -mno-upper-regs-sf
21191 @opindex mupper-regs-sf
21192 @opindex mno-upper-regs-sf
21193 Generate code that uses (does not use) the scalar single precision
21194 instructions that target all 64 registers in the vector/scalar
21195 floating point register set that were added in version 2.07 of the
21196 PowerPC ISA.  @option{-mupper-regs-sf} is turned on by default if you
21197 use either of the @option{-mcpu=power8}, @option{-mpower8-vector}, or
21198 @option{-mcpu=power9} options.
21200 @item -mupper-regs
21201 @itemx -mno-upper-regs
21202 @opindex mupper-regs
21203 @opindex mno-upper-regs
21204 Generate code that uses (does not use) the scalar
21205 instructions that target all 64 registers in the vector/scalar
21206 floating point register set, depending on the model of the machine.
21208 If the @option{-mno-upper-regs} option is used, it turns off both
21209 @option{-mupper-regs-sf} and @option{-mupper-regs-df} options.
21211 @item -mfloat128
21212 @itemx -mno-float128
21213 @opindex mfloat128
21214 @opindex mno-float128
21215 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
21216 and use either software emulation for IEEE 128-bit floating point or
21217 hardware instructions.
21219 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7}, or
21220 @option{-mcpu=power8}) must be enabled to use the @option{-mfloat128}
21221 option.  The @option{-mfloat128} option only works on PowerPC 64-bit
21222 Linux systems.
21224 If you use the ISA 3.0 instruction set (@option{-mcpu=power9}), the
21225 @option{-mfloat128} option will also enable the generation of ISA 3.0
21226 IEEE 128-bit floating point instructions.  Otherwise, IEEE 128-bit
21227 floating point will be done with software emulation.
21229 @item -mfloat128-hardware
21230 @itemx -mno-float128-hardware
21231 @opindex mfloat128-hardware
21232 @opindex mno-float128-hardware
21233 Enable/disable using ISA 3.0 hardware instructions to support the
21234 @var{__float128} data type.
21236 If you use @option{-mfloat128-hardware}, it will enable the option
21237 @option{-mfloat128} as well.
21239 If you select ISA 3.0 instructions with @option{-mcpu=power9}, but do
21240 not use either @option{-mfloat128} or @option{-mfloat128-hardware},
21241 the IEEE 128-bit floating point support will not be enabled.
21243 @item -mfloat-gprs=@var{yes/single/double/no}
21244 @itemx -mfloat-gprs
21245 @opindex mfloat-gprs
21246 This switch enables or disables the generation of floating-point
21247 operations on the general-purpose registers for architectures that
21248 support it.
21250 The argument @samp{yes} or @samp{single} enables the use of
21251 single-precision floating-point operations.
21253 The argument @samp{double} enables the use of single and
21254 double-precision floating-point operations.
21256 The argument @samp{no} disables floating-point operations on the
21257 general-purpose registers.
21259 This option is currently only available on the MPC854x.
21261 @item -m32
21262 @itemx -m64
21263 @opindex m32
21264 @opindex m64
21265 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
21266 targets (including GNU/Linux).  The 32-bit environment sets int, long
21267 and pointer to 32 bits and generates code that runs on any PowerPC
21268 variant.  The 64-bit environment sets int to 32 bits and long and
21269 pointer to 64 bits, and generates code for PowerPC64, as for
21270 @option{-mpowerpc64}.
21272 @item -mfull-toc
21273 @itemx -mno-fp-in-toc
21274 @itemx -mno-sum-in-toc
21275 @itemx -mminimal-toc
21276 @opindex mfull-toc
21277 @opindex mno-fp-in-toc
21278 @opindex mno-sum-in-toc
21279 @opindex mminimal-toc
21280 Modify generation of the TOC (Table Of Contents), which is created for
21281 every executable file.  The @option{-mfull-toc} option is selected by
21282 default.  In that case, GCC allocates at least one TOC entry for
21283 each unique non-automatic variable reference in your program.  GCC
21284 also places floating-point constants in the TOC@.  However, only
21285 16,384 entries are available in the TOC@.
21287 If you receive a linker error message that saying you have overflowed
21288 the available TOC space, you can reduce the amount of TOC space used
21289 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
21290 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
21291 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
21292 generate code to calculate the sum of an address and a constant at
21293 run time instead of putting that sum into the TOC@.  You may specify one
21294 or both of these options.  Each causes GCC to produce very slightly
21295 slower and larger code at the expense of conserving TOC space.
21297 If you still run out of space in the TOC even when you specify both of
21298 these options, specify @option{-mminimal-toc} instead.  This option causes
21299 GCC to make only one TOC entry for every file.  When you specify this
21300 option, GCC produces code that is slower and larger but which
21301 uses extremely little TOC space.  You may wish to use this option
21302 only on files that contain less frequently-executed code.
21304 @item -maix64
21305 @itemx -maix32
21306 @opindex maix64
21307 @opindex maix32
21308 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
21309 @code{long} type, and the infrastructure needed to support them.
21310 Specifying @option{-maix64} implies @option{-mpowerpc64},
21311 while @option{-maix32} disables the 64-bit ABI and
21312 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
21314 @item -mxl-compat
21315 @itemx -mno-xl-compat
21316 @opindex mxl-compat
21317 @opindex mno-xl-compat
21318 Produce code that conforms more closely to IBM XL compiler semantics
21319 when using AIX-compatible ABI@.  Pass floating-point arguments to
21320 prototyped functions beyond the register save area (RSA) on the stack
21321 in addition to argument FPRs.  Do not assume that most significant
21322 double in 128-bit long double value is properly rounded when comparing
21323 values and converting to double.  Use XL symbol names for long double
21324 support routines.
21326 The AIX calling convention was extended but not initially documented to
21327 handle an obscure K&R C case of calling a function that takes the
21328 address of its arguments with fewer arguments than declared.  IBM XL
21329 compilers access floating-point arguments that do not fit in the
21330 RSA from the stack when a subroutine is compiled without
21331 optimization.  Because always storing floating-point arguments on the
21332 stack is inefficient and rarely needed, this option is not enabled by
21333 default and only is necessary when calling subroutines compiled by IBM
21334 XL compilers without optimization.
21336 @item -mpe
21337 @opindex mpe
21338 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
21339 application written to use message passing with special startup code to
21340 enable the application to run.  The system must have PE installed in the
21341 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
21342 must be overridden with the @option{-specs=} option to specify the
21343 appropriate directory location.  The Parallel Environment does not
21344 support threads, so the @option{-mpe} option and the @option{-pthread}
21345 option are incompatible.
21347 @item -malign-natural
21348 @itemx -malign-power
21349 @opindex malign-natural
21350 @opindex malign-power
21351 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
21352 @option{-malign-natural} overrides the ABI-defined alignment of larger
21353 types, such as floating-point doubles, on their natural size-based boundary.
21354 The option @option{-malign-power} instructs GCC to follow the ABI-specified
21355 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
21357 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
21358 is not supported.
21360 @item -msoft-float
21361 @itemx -mhard-float
21362 @opindex msoft-float
21363 @opindex mhard-float
21364 Generate code that does not use (uses) the floating-point register set.
21365 Software floating-point emulation is provided if you use the
21366 @option{-msoft-float} option, and pass the option to GCC when linking.
21368 @item -msingle-float
21369 @itemx -mdouble-float
21370 @opindex msingle-float
21371 @opindex mdouble-float
21372 Generate code for single- or double-precision floating-point operations.
21373 @option{-mdouble-float} implies @option{-msingle-float}.
21375 @item -msimple-fpu
21376 @opindex msimple-fpu
21377 Do not generate @code{sqrt} and @code{div} instructions for hardware
21378 floating-point unit.
21380 @item -mfpu=@var{name}
21381 @opindex mfpu
21382 Specify type of floating-point unit.  Valid values for @var{name} are
21383 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
21384 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
21385 @samp{sp_full} (equivalent to @option{-msingle-float}),
21386 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
21388 @item -mxilinx-fpu
21389 @opindex mxilinx-fpu
21390 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
21392 @item -mmultiple
21393 @itemx -mno-multiple
21394 @opindex mmultiple
21395 @opindex mno-multiple
21396 Generate code that uses (does not use) the load multiple word
21397 instructions and the store multiple word instructions.  These
21398 instructions are generated by default on POWER systems, and not
21399 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
21400 PowerPC systems, since those instructions do not work when the
21401 processor is in little-endian mode.  The exceptions are PPC740 and
21402 PPC750 which permit these instructions in little-endian mode.
21404 @item -mstring
21405 @itemx -mno-string
21406 @opindex mstring
21407 @opindex mno-string
21408 Generate code that uses (does not use) the load string instructions
21409 and the store string word instructions to save multiple registers and
21410 do small block moves.  These instructions are generated by default on
21411 POWER systems, and not generated on PowerPC systems.  Do not use
21412 @option{-mstring} on little-endian PowerPC systems, since those
21413 instructions do not work when the processor is in little-endian mode.
21414 The exceptions are PPC740 and PPC750 which permit these instructions
21415 in little-endian mode.
21417 @item -mupdate
21418 @itemx -mno-update
21419 @opindex mupdate
21420 @opindex mno-update
21421 Generate code that uses (does not use) the load or store instructions
21422 that update the base register to the address of the calculated memory
21423 location.  These instructions are generated by default.  If you use
21424 @option{-mno-update}, there is a small window between the time that the
21425 stack pointer is updated and the address of the previous frame is
21426 stored, which means code that walks the stack frame across interrupts or
21427 signals may get corrupted data.
21429 @item -mavoid-indexed-addresses
21430 @itemx -mno-avoid-indexed-addresses
21431 @opindex mavoid-indexed-addresses
21432 @opindex mno-avoid-indexed-addresses
21433 Generate code that tries to avoid (not avoid) the use of indexed load
21434 or store instructions. These instructions can incur a performance
21435 penalty on Power6 processors in certain situations, such as when
21436 stepping through large arrays that cross a 16M boundary.  This option
21437 is enabled by default when targeting Power6 and disabled otherwise.
21439 @item -mfused-madd
21440 @itemx -mno-fused-madd
21441 @opindex mfused-madd
21442 @opindex mno-fused-madd
21443 Generate code that uses (does not use) the floating-point multiply and
21444 accumulate instructions.  These instructions are generated by default
21445 if hardware floating point is used.  The machine-dependent
21446 @option{-mfused-madd} option is now mapped to the machine-independent
21447 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
21448 mapped to @option{-ffp-contract=off}.
21450 @item -mmulhw
21451 @itemx -mno-mulhw
21452 @opindex mmulhw
21453 @opindex mno-mulhw
21454 Generate code that uses (does not use) the half-word multiply and
21455 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
21456 These instructions are generated by default when targeting those
21457 processors.
21459 @item -mdlmzb
21460 @itemx -mno-dlmzb
21461 @opindex mdlmzb
21462 @opindex mno-dlmzb
21463 Generate code that uses (does not use) the string-search @samp{dlmzb}
21464 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
21465 generated by default when targeting those processors.
21467 @item -mno-bit-align
21468 @itemx -mbit-align
21469 @opindex mno-bit-align
21470 @opindex mbit-align
21471 On System V.4 and embedded PowerPC systems do not (do) force structures
21472 and unions that contain bit-fields to be aligned to the base type of the
21473 bit-field.
21475 For example, by default a structure containing nothing but 8
21476 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
21477 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
21478 the structure is aligned to a 1-byte boundary and is 1 byte in
21479 size.
21481 @item -mno-strict-align
21482 @itemx -mstrict-align
21483 @opindex mno-strict-align
21484 @opindex mstrict-align
21485 On System V.4 and embedded PowerPC systems do not (do) assume that
21486 unaligned memory references are handled by the system.
21488 @item -mrelocatable
21489 @itemx -mno-relocatable
21490 @opindex mrelocatable
21491 @opindex mno-relocatable
21492 Generate code that allows (does not allow) a static executable to be
21493 relocated to a different address at run time.  A simple embedded
21494 PowerPC system loader should relocate the entire contents of
21495 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
21496 a table of 32-bit addresses generated by this option.  For this to
21497 work, all objects linked together must be compiled with
21498 @option{-mrelocatable} or @option{-mrelocatable-lib}.
21499 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
21501 @item -mrelocatable-lib
21502 @itemx -mno-relocatable-lib
21503 @opindex mrelocatable-lib
21504 @opindex mno-relocatable-lib
21505 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
21506 @code{.fixup} section to allow static executables to be relocated at
21507 run time, but @option{-mrelocatable-lib} does not use the smaller stack
21508 alignment of @option{-mrelocatable}.  Objects compiled with
21509 @option{-mrelocatable-lib} may be linked with objects compiled with
21510 any combination of the @option{-mrelocatable} options.
21512 @item -mno-toc
21513 @itemx -mtoc
21514 @opindex mno-toc
21515 @opindex mtoc
21516 On System V.4 and embedded PowerPC systems do not (do) assume that
21517 register 2 contains a pointer to a global area pointing to the addresses
21518 used in the program.
21520 @item -mlittle
21521 @itemx -mlittle-endian
21522 @opindex mlittle
21523 @opindex mlittle-endian
21524 On System V.4 and embedded PowerPC systems compile code for the
21525 processor in little-endian mode.  The @option{-mlittle-endian} option is
21526 the same as @option{-mlittle}.
21528 @item -mbig
21529 @itemx -mbig-endian
21530 @opindex mbig
21531 @opindex mbig-endian
21532 On System V.4 and embedded PowerPC systems compile code for the
21533 processor in big-endian mode.  The @option{-mbig-endian} option is
21534 the same as @option{-mbig}.
21536 @item -mdynamic-no-pic
21537 @opindex mdynamic-no-pic
21538 On Darwin and Mac OS X systems, compile code so that it is not
21539 relocatable, but that its external references are relocatable.  The
21540 resulting code is suitable for applications, but not shared
21541 libraries.
21543 @item -msingle-pic-base
21544 @opindex msingle-pic-base
21545 Treat the register used for PIC addressing as read-only, rather than
21546 loading it in the prologue for each function.  The runtime system is
21547 responsible for initializing this register with an appropriate value
21548 before execution begins.
21550 @item -mprioritize-restricted-insns=@var{priority}
21551 @opindex mprioritize-restricted-insns
21552 This option controls the priority that is assigned to
21553 dispatch-slot restricted instructions during the second scheduling
21554 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
21555 or @samp{2} to assign no, highest, or second-highest (respectively) 
21556 priority to dispatch-slot restricted
21557 instructions.
21559 @item -msched-costly-dep=@var{dependence_type}
21560 @opindex msched-costly-dep
21561 This option controls which dependences are considered costly
21562 by the target during instruction scheduling.  The argument
21563 @var{dependence_type} takes one of the following values:
21565 @table @asis
21566 @item @samp{no}
21567 No dependence is costly.
21569 @item @samp{all}
21570 All dependences are costly.
21572 @item @samp{true_store_to_load}
21573 A true dependence from store to load is costly.
21575 @item @samp{store_to_load}
21576 Any dependence from store to load is costly.
21578 @item @var{number}
21579 Any dependence for which the latency is greater than or equal to 
21580 @var{number} is costly.
21581 @end table
21583 @item -minsert-sched-nops=@var{scheme}
21584 @opindex minsert-sched-nops
21585 This option controls which NOP insertion scheme is used during
21586 the second scheduling pass.  The argument @var{scheme} takes one of the
21587 following values:
21589 @table @asis
21590 @item @samp{no}
21591 Don't insert NOPs.
21593 @item @samp{pad}
21594 Pad with NOPs any dispatch group that has vacant issue slots,
21595 according to the scheduler's grouping.
21597 @item @samp{regroup_exact}
21598 Insert NOPs to force costly dependent insns into
21599 separate groups.  Insert exactly as many NOPs as needed to force an insn
21600 to a new group, according to the estimated processor grouping.
21602 @item @var{number}
21603 Insert NOPs to force costly dependent insns into
21604 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
21605 @end table
21607 @item -mcall-sysv
21608 @opindex mcall-sysv
21609 On System V.4 and embedded PowerPC systems compile code using calling
21610 conventions that adhere to the March 1995 draft of the System V
21611 Application Binary Interface, PowerPC processor supplement.  This is the
21612 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
21614 @item -mcall-sysv-eabi
21615 @itemx -mcall-eabi
21616 @opindex mcall-sysv-eabi
21617 @opindex mcall-eabi
21618 Specify both @option{-mcall-sysv} and @option{-meabi} options.
21620 @item -mcall-sysv-noeabi
21621 @opindex mcall-sysv-noeabi
21622 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
21624 @item -mcall-aixdesc
21625 @opindex m
21626 On System V.4 and embedded PowerPC systems compile code for the AIX
21627 operating system.
21629 @item -mcall-linux
21630 @opindex mcall-linux
21631 On System V.4 and embedded PowerPC systems compile code for the
21632 Linux-based GNU system.
21634 @item -mcall-freebsd
21635 @opindex mcall-freebsd
21636 On System V.4 and embedded PowerPC systems compile code for the
21637 FreeBSD operating system.
21639 @item -mcall-netbsd
21640 @opindex mcall-netbsd
21641 On System V.4 and embedded PowerPC systems compile code for the
21642 NetBSD operating system.
21644 @item -mcall-openbsd
21645 @opindex mcall-netbsd
21646 On System V.4 and embedded PowerPC systems compile code for the
21647 OpenBSD operating system.
21649 @item -maix-struct-return
21650 @opindex maix-struct-return
21651 Return all structures in memory (as specified by the AIX ABI)@.
21653 @item -msvr4-struct-return
21654 @opindex msvr4-struct-return
21655 Return structures smaller than 8 bytes in registers (as specified by the
21656 SVR4 ABI)@.
21658 @item -mabi=@var{abi-type}
21659 @opindex mabi
21660 Extend the current ABI with a particular extension, or remove such extension.
21661 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
21662 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
21663 @samp{elfv1}, @samp{elfv2}@.
21665 @item -mabi=spe
21666 @opindex mabi=spe
21667 Extend the current ABI with SPE ABI extensions.  This does not change
21668 the default ABI, instead it adds the SPE ABI extensions to the current
21669 ABI@.
21671 @item -mabi=no-spe
21672 @opindex mabi=no-spe
21673 Disable Book-E SPE ABI extensions for the current ABI@.
21675 @item -mabi=ibmlongdouble
21676 @opindex mabi=ibmlongdouble
21677 Change the current ABI to use IBM extended-precision long double.
21678 This is a PowerPC 32-bit SYSV ABI option.
21680 @item -mabi=ieeelongdouble
21681 @opindex mabi=ieeelongdouble
21682 Change the current ABI to use IEEE extended-precision long double.
21683 This is a PowerPC 32-bit Linux ABI option.
21685 @item -mabi=elfv1
21686 @opindex mabi=elfv1
21687 Change the current ABI to use the ELFv1 ABI.
21688 This is the default ABI for big-endian PowerPC 64-bit Linux.
21689 Overriding the default ABI requires special system support and is
21690 likely to fail in spectacular ways.
21692 @item -mabi=elfv2
21693 @opindex mabi=elfv2
21694 Change the current ABI to use the ELFv2 ABI.
21695 This is the default ABI for little-endian PowerPC 64-bit Linux.
21696 Overriding the default ABI requires special system support and is
21697 likely to fail in spectacular ways.
21699 @item -mgnu-attribute
21700 @itemx -mno-gnu-attribute
21701 @opindex mgnu-attribute
21702 @opindex mno-gnu-attribute
21703 Emit .gnu_attribute assembly directives to set tag/value pairs in a
21704 .gnu.attributes section that specify ABI variations in function
21705 parameters or return values.
21707 @item -mprototype
21708 @itemx -mno-prototype
21709 @opindex mprototype
21710 @opindex mno-prototype
21711 On System V.4 and embedded PowerPC systems assume that all calls to
21712 variable argument functions are properly prototyped.  Otherwise, the
21713 compiler must insert an instruction before every non-prototyped call to
21714 set or clear bit 6 of the condition code register (@code{CR}) to
21715 indicate whether floating-point values are passed in the floating-point
21716 registers in case the function takes variable arguments.  With
21717 @option{-mprototype}, only calls to prototyped variable argument functions
21718 set or clear the bit.
21720 @item -msim
21721 @opindex msim
21722 On embedded PowerPC systems, assume that the startup module is called
21723 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
21724 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
21725 configurations.
21727 @item -mmvme
21728 @opindex mmvme
21729 On embedded PowerPC systems, assume that the startup module is called
21730 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
21731 @file{libc.a}.
21733 @item -mads
21734 @opindex mads
21735 On embedded PowerPC systems, assume that the startup module is called
21736 @file{crt0.o} and the standard C libraries are @file{libads.a} and
21737 @file{libc.a}.
21739 @item -myellowknife
21740 @opindex myellowknife
21741 On embedded PowerPC systems, assume that the startup module is called
21742 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
21743 @file{libc.a}.
21745 @item -mvxworks
21746 @opindex mvxworks
21747 On System V.4 and embedded PowerPC systems, specify that you are
21748 compiling for a VxWorks system.
21750 @item -memb
21751 @opindex memb
21752 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
21753 header to indicate that @samp{eabi} extended relocations are used.
21755 @item -meabi
21756 @itemx -mno-eabi
21757 @opindex meabi
21758 @opindex mno-eabi
21759 On System V.4 and embedded PowerPC systems do (do not) adhere to the
21760 Embedded Applications Binary Interface (EABI), which is a set of
21761 modifications to the System V.4 specifications.  Selecting @option{-meabi}
21762 means that the stack is aligned to an 8-byte boundary, a function
21763 @code{__eabi} is called from @code{main} to set up the EABI
21764 environment, and the @option{-msdata} option can use both @code{r2} and
21765 @code{r13} to point to two separate small data areas.  Selecting
21766 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
21767 no EABI initialization function is called from @code{main}, and the
21768 @option{-msdata} option only uses @code{r13} to point to a single
21769 small data area.  The @option{-meabi} option is on by default if you
21770 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
21772 @item -msdata=eabi
21773 @opindex msdata=eabi
21774 On System V.4 and embedded PowerPC systems, put small initialized
21775 @code{const} global and static data in the @code{.sdata2} section, which
21776 is pointed to by register @code{r2}.  Put small initialized
21777 non-@code{const} global and static data in the @code{.sdata} section,
21778 which is pointed to by register @code{r13}.  Put small uninitialized
21779 global and static data in the @code{.sbss} section, which is adjacent to
21780 the @code{.sdata} section.  The @option{-msdata=eabi} option is
21781 incompatible with the @option{-mrelocatable} option.  The
21782 @option{-msdata=eabi} option also sets the @option{-memb} option.
21784 @item -msdata=sysv
21785 @opindex msdata=sysv
21786 On System V.4 and embedded PowerPC systems, put small global and static
21787 data in the @code{.sdata} section, which is pointed to by register
21788 @code{r13}.  Put small uninitialized global and static data in the
21789 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
21790 The @option{-msdata=sysv} option is incompatible with the
21791 @option{-mrelocatable} option.
21793 @item -msdata=default
21794 @itemx -msdata
21795 @opindex msdata=default
21796 @opindex msdata
21797 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
21798 compile code the same as @option{-msdata=eabi}, otherwise compile code the
21799 same as @option{-msdata=sysv}.
21801 @item -msdata=data
21802 @opindex msdata=data
21803 On System V.4 and embedded PowerPC systems, put small global
21804 data in the @code{.sdata} section.  Put small uninitialized global
21805 data in the @code{.sbss} section.  Do not use register @code{r13}
21806 to address small data however.  This is the default behavior unless
21807 other @option{-msdata} options are used.
21809 @item -msdata=none
21810 @itemx -mno-sdata
21811 @opindex msdata=none
21812 @opindex mno-sdata
21813 On embedded PowerPC systems, put all initialized global and static data
21814 in the @code{.data} section, and all uninitialized data in the
21815 @code{.bss} section.
21817 @item -mblock-move-inline-limit=@var{num}
21818 @opindex mblock-move-inline-limit
21819 Inline all block moves (such as calls to @code{memcpy} or structure
21820 copies) less than or equal to @var{num} bytes.  The minimum value for
21821 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
21822 targets.  The default value is target-specific.
21824 @item -G @var{num}
21825 @opindex G
21826 @cindex smaller data references (PowerPC)
21827 @cindex .sdata/.sdata2 references (PowerPC)
21828 On embedded PowerPC systems, put global and static items less than or
21829 equal to @var{num} bytes into the small data or BSS sections instead of
21830 the normal data or BSS section.  By default, @var{num} is 8.  The
21831 @option{-G @var{num}} switch is also passed to the linker.
21832 All modules should be compiled with the same @option{-G @var{num}} value.
21834 @item -mregnames
21835 @itemx -mno-regnames
21836 @opindex mregnames
21837 @opindex mno-regnames
21838 On System V.4 and embedded PowerPC systems do (do not) emit register
21839 names in the assembly language output using symbolic forms.
21841 @item -mlongcall
21842 @itemx -mno-longcall
21843 @opindex mlongcall
21844 @opindex mno-longcall
21845 By default assume that all calls are far away so that a longer and more
21846 expensive calling sequence is required.  This is required for calls
21847 farther than 32 megabytes (33,554,432 bytes) from the current location.
21848 A short call is generated if the compiler knows
21849 the call cannot be that far away.  This setting can be overridden by
21850 the @code{shortcall} function attribute, or by @code{#pragma
21851 longcall(0)}.
21853 Some linkers are capable of detecting out-of-range calls and generating
21854 glue code on the fly.  On these systems, long calls are unnecessary and
21855 generate slower code.  As of this writing, the AIX linker can do this,
21856 as can the GNU linker for PowerPC/64.  It is planned to add this feature
21857 to the GNU linker for 32-bit PowerPC systems as well.
21859 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
21860 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
21861 addresses represent the callee and the branch island.  The
21862 Darwin/PPC linker prefers the first address and generates a @code{bl
21863 callee} if the PPC @code{bl} instruction reaches the callee directly;
21864 otherwise, the linker generates @code{bl L42} to call the branch
21865 island.  The branch island is appended to the body of the
21866 calling function; it computes the full 32-bit address of the callee
21867 and jumps to it.
21869 On Mach-O (Darwin) systems, this option directs the compiler emit to
21870 the glue for every direct call, and the Darwin linker decides whether
21871 to use or discard it.
21873 In the future, GCC may ignore all longcall specifications
21874 when the linker is known to generate glue.
21876 @item -mtls-markers
21877 @itemx -mno-tls-markers
21878 @opindex mtls-markers
21879 @opindex mno-tls-markers
21880 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
21881 specifying the function argument.  The relocation allows the linker to
21882 reliably associate function call with argument setup instructions for
21883 TLS optimization, which in turn allows GCC to better schedule the
21884 sequence.
21886 @item -pthread
21887 @opindex pthread
21888 Adds support for multithreading with the @dfn{pthreads} library.
21889 This option sets flags for both the preprocessor and linker.
21891 @item -mrecip
21892 @itemx -mno-recip
21893 @opindex mrecip
21894 This option enables use of the reciprocal estimate and
21895 reciprocal square root estimate instructions with additional
21896 Newton-Raphson steps to increase precision instead of doing a divide or
21897 square root and divide for floating-point arguments.  You should use
21898 the @option{-ffast-math} option when using @option{-mrecip} (or at
21899 least @option{-funsafe-math-optimizations},
21900 @option{-ffinite-math-only}, @option{-freciprocal-math} and
21901 @option{-fno-trapping-math}).  Note that while the throughput of the
21902 sequence is generally higher than the throughput of the non-reciprocal
21903 instruction, the precision of the sequence can be decreased by up to 2
21904 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
21905 roots.
21907 @item -mrecip=@var{opt}
21908 @opindex mrecip=opt
21909 This option controls which reciprocal estimate instructions
21910 may be used.  @var{opt} is a comma-separated list of options, which may
21911 be preceded by a @code{!} to invert the option:
21913 @table @samp
21915 @item all
21916 Enable all estimate instructions.
21918 @item default 
21919 Enable the default instructions, equivalent to @option{-mrecip}.
21921 @item none 
21922 Disable all estimate instructions, equivalent to @option{-mno-recip}.
21924 @item div 
21925 Enable the reciprocal approximation instructions for both 
21926 single and double precision.
21928 @item divf 
21929 Enable the single-precision reciprocal approximation instructions.
21931 @item divd 
21932 Enable the double-precision reciprocal approximation instructions.
21934 @item rsqrt 
21935 Enable the reciprocal square root approximation instructions for both
21936 single and double precision.
21938 @item rsqrtf 
21939 Enable the single-precision reciprocal square root approximation instructions.
21941 @item rsqrtd 
21942 Enable the double-precision reciprocal square root approximation instructions.
21944 @end table
21946 So, for example, @option{-mrecip=all,!rsqrtd} enables
21947 all of the reciprocal estimate instructions, except for the
21948 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
21949 which handle the double-precision reciprocal square root calculations.
21951 @item -mrecip-precision
21952 @itemx -mno-recip-precision
21953 @opindex mrecip-precision
21954 Assume (do not assume) that the reciprocal estimate instructions
21955 provide higher-precision estimates than is mandated by the PowerPC
21956 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
21957 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
21958 The double-precision square root estimate instructions are not generated by
21959 default on low-precision machines, since they do not provide an
21960 estimate that converges after three steps.
21962 @item -mveclibabi=@var{type}
21963 @opindex mveclibabi
21964 Specifies the ABI type to use for vectorizing intrinsics using an
21965 external library.  The only type supported at present is @samp{mass},
21966 which specifies to use IBM's Mathematical Acceleration Subsystem
21967 (MASS) libraries for vectorizing intrinsics using external libraries.
21968 GCC currently emits calls to @code{acosd2}, @code{acosf4},
21969 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
21970 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
21971 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
21972 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
21973 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
21974 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
21975 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
21976 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
21977 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
21978 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
21979 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
21980 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
21981 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
21982 for power7.  Both @option{-ftree-vectorize} and
21983 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
21984 libraries must be specified at link time.
21986 @item -mfriz
21987 @itemx -mno-friz
21988 @opindex mfriz
21989 Generate (do not generate) the @code{friz} instruction when the
21990 @option{-funsafe-math-optimizations} option is used to optimize
21991 rounding of floating-point values to 64-bit integer and back to floating
21992 point.  The @code{friz} instruction does not return the same value if
21993 the floating-point number is too large to fit in an integer.
21995 @item -mpointers-to-nested-functions
21996 @itemx -mno-pointers-to-nested-functions
21997 @opindex mpointers-to-nested-functions
21998 Generate (do not generate) code to load up the static chain register
21999 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
22000 systems where a function pointer points to a 3-word descriptor giving
22001 the function address, TOC value to be loaded in register @code{r2}, and
22002 static chain value to be loaded in register @code{r11}.  The
22003 @option{-mpointers-to-nested-functions} is on by default.  You cannot
22004 call through pointers to nested functions or pointers
22005 to functions compiled in other languages that use the static chain if
22006 you use @option{-mno-pointers-to-nested-functions}.
22008 @item -msave-toc-indirect
22009 @itemx -mno-save-toc-indirect
22010 @opindex msave-toc-indirect
22011 Generate (do not generate) code to save the TOC value in the reserved
22012 stack location in the function prologue if the function calls through
22013 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
22014 saved in the prologue, it is saved just before the call through the
22015 pointer.  The @option{-mno-save-toc-indirect} option is the default.
22017 @item -mcompat-align-parm
22018 @itemx -mno-compat-align-parm
22019 @opindex mcompat-align-parm
22020 Generate (do not generate) code to pass structure parameters with a
22021 maximum alignment of 64 bits, for compatibility with older versions
22022 of GCC.
22024 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
22025 structure parameter on a 128-bit boundary when that structure contained
22026 a member requiring 128-bit alignment.  This is corrected in more
22027 recent versions of GCC.  This option may be used to generate code
22028 that is compatible with functions compiled with older versions of
22029 GCC.
22031 The @option{-mno-compat-align-parm} option is the default.
22032 @end table
22034 @node RX Options
22035 @subsection RX Options
22036 @cindex RX Options
22038 These command-line options are defined for RX targets:
22040 @table @gcctabopt
22041 @item -m64bit-doubles
22042 @itemx -m32bit-doubles
22043 @opindex m64bit-doubles
22044 @opindex m32bit-doubles
22045 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
22046 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
22047 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
22048 works on 32-bit values, which is why the default is
22049 @option{-m32bit-doubles}.
22051 @item -fpu
22052 @itemx -nofpu
22053 @opindex fpu
22054 @opindex nofpu
22055 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
22056 floating-point hardware.  The default is enabled for the RX600
22057 series and disabled for the RX200 series.
22059 Floating-point instructions are only generated for 32-bit floating-point 
22060 values, however, so the FPU hardware is not used for doubles if the
22061 @option{-m64bit-doubles} option is used.
22063 @emph{Note} If the @option{-fpu} option is enabled then
22064 @option{-funsafe-math-optimizations} is also enabled automatically.
22065 This is because the RX FPU instructions are themselves unsafe.
22067 @item -mcpu=@var{name}
22068 @opindex mcpu
22069 Selects the type of RX CPU to be targeted.  Currently three types are
22070 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
22071 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
22073 The only difference between @samp{RX600} and @samp{RX610} is that the
22074 @samp{RX610} does not support the @code{MVTIPL} instruction.
22076 The @samp{RX200} series does not have a hardware floating-point unit
22077 and so @option{-nofpu} is enabled by default when this type is
22078 selected.
22080 @item -mbig-endian-data
22081 @itemx -mlittle-endian-data
22082 @opindex mbig-endian-data
22083 @opindex mlittle-endian-data
22084 Store data (but not code) in the big-endian format.  The default is
22085 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
22086 format.
22088 @item -msmall-data-limit=@var{N}
22089 @opindex msmall-data-limit
22090 Specifies the maximum size in bytes of global and static variables
22091 which can be placed into the small data area.  Using the small data
22092 area can lead to smaller and faster code, but the size of area is
22093 limited and it is up to the programmer to ensure that the area does
22094 not overflow.  Also when the small data area is used one of the RX's
22095 registers (usually @code{r13}) is reserved for use pointing to this
22096 area, so it is no longer available for use by the compiler.  This
22097 could result in slower and/or larger code if variables are pushed onto
22098 the stack instead of being held in this register.
22100 Note, common variables (variables that have not been initialized) and
22101 constants are not placed into the small data area as they are assigned
22102 to other sections in the output executable.
22104 The default value is zero, which disables this feature.  Note, this
22105 feature is not enabled by default with higher optimization levels
22106 (@option{-O2} etc) because of the potentially detrimental effects of
22107 reserving a register.  It is up to the programmer to experiment and
22108 discover whether this feature is of benefit to their program.  See the
22109 description of the @option{-mpid} option for a description of how the
22110 actual register to hold the small data area pointer is chosen.
22112 @item -msim
22113 @itemx -mno-sim
22114 @opindex msim
22115 @opindex mno-sim
22116 Use the simulator runtime.  The default is to use the libgloss
22117 board-specific runtime.
22119 @item -mas100-syntax
22120 @itemx -mno-as100-syntax
22121 @opindex mas100-syntax
22122 @opindex mno-as100-syntax
22123 When generating assembler output use a syntax that is compatible with
22124 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
22125 assembler, but it has some restrictions so it is not generated by default.
22127 @item -mmax-constant-size=@var{N}
22128 @opindex mmax-constant-size
22129 Specifies the maximum size, in bytes, of a constant that can be used as
22130 an operand in a RX instruction.  Although the RX instruction set does
22131 allow constants of up to 4 bytes in length to be used in instructions,
22132 a longer value equates to a longer instruction.  Thus in some
22133 circumstances it can be beneficial to restrict the size of constants
22134 that are used in instructions.  Constants that are too big are instead
22135 placed into a constant pool and referenced via register indirection.
22137 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
22138 or 4 means that constants of any size are allowed.
22140 @item -mrelax
22141 @opindex mrelax
22142 Enable linker relaxation.  Linker relaxation is a process whereby the
22143 linker attempts to reduce the size of a program by finding shorter
22144 versions of various instructions.  Disabled by default.
22146 @item -mint-register=@var{N}
22147 @opindex mint-register
22148 Specify the number of registers to reserve for fast interrupt handler
22149 functions.  The value @var{N} can be between 0 and 4.  A value of 1
22150 means that register @code{r13} is reserved for the exclusive use
22151 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
22152 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
22153 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
22154 A value of 0, the default, does not reserve any registers.
22156 @item -msave-acc-in-interrupts
22157 @opindex msave-acc-in-interrupts
22158 Specifies that interrupt handler functions should preserve the
22159 accumulator register.  This is only necessary if normal code might use
22160 the accumulator register, for example because it performs 64-bit
22161 multiplications.  The default is to ignore the accumulator as this
22162 makes the interrupt handlers faster.
22164 @item -mpid
22165 @itemx -mno-pid
22166 @opindex mpid
22167 @opindex mno-pid
22168 Enables the generation of position independent data.  When enabled any
22169 access to constant data is done via an offset from a base address
22170 held in a register.  This allows the location of constant data to be
22171 determined at run time without requiring the executable to be
22172 relocated, which is a benefit to embedded applications with tight
22173 memory constraints.  Data that can be modified is not affected by this
22174 option.
22176 Note, using this feature reserves a register, usually @code{r13}, for
22177 the constant data base address.  This can result in slower and/or
22178 larger code, especially in complicated functions.
22180 The actual register chosen to hold the constant data base address
22181 depends upon whether the @option{-msmall-data-limit} and/or the
22182 @option{-mint-register} command-line options are enabled.  Starting
22183 with register @code{r13} and proceeding downwards, registers are
22184 allocated first to satisfy the requirements of @option{-mint-register},
22185 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
22186 is possible for the small data area register to be @code{r8} if both
22187 @option{-mint-register=4} and @option{-mpid} are specified on the
22188 command line.
22190 By default this feature is not enabled.  The default can be restored
22191 via the @option{-mno-pid} command-line option.
22193 @item -mno-warn-multiple-fast-interrupts
22194 @itemx -mwarn-multiple-fast-interrupts
22195 @opindex mno-warn-multiple-fast-interrupts
22196 @opindex mwarn-multiple-fast-interrupts
22197 Prevents GCC from issuing a warning message if it finds more than one
22198 fast interrupt handler when it is compiling a file.  The default is to
22199 issue a warning for each extra fast interrupt handler found, as the RX
22200 only supports one such interrupt.
22202 @item -mallow-string-insns
22203 @itemx -mno-allow-string-insns
22204 @opindex mallow-string-insns
22205 @opindex mno-allow-string-insns
22206 Enables or disables the use of the string manipulation instructions
22207 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
22208 @code{SWHILE} and also the @code{RMPA} instruction.  These
22209 instructions may prefetch data, which is not safe to do if accessing
22210 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
22211 for more information).
22213 The default is to allow these instructions, but it is not possible for
22214 GCC to reliably detect all circumstances where a string instruction
22215 might be used to access an I/O register, so their use cannot be
22216 disabled automatically.  Instead it is reliant upon the programmer to
22217 use the @option{-mno-allow-string-insns} option if their program
22218 accesses I/O space.
22220 When the instructions are enabled GCC defines the C preprocessor
22221 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
22222 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
22224 @item -mjsr
22225 @itemx -mno-jsr
22226 @opindex mjsr
22227 @opindex mno-jsr
22228 Use only (or not only) @code{JSR} instructions to access functions.
22229 This option can be used when code size exceeds the range of @code{BSR}
22230 instructions.  Note that @option{-mno-jsr} does not mean to not use
22231 @code{JSR} but instead means that any type of branch may be used.
22232 @end table
22234 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
22235 has special significance to the RX port when used with the
22236 @code{interrupt} function attribute.  This attribute indicates a
22237 function intended to process fast interrupts.  GCC ensures
22238 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
22239 and/or @code{r13} and only provided that the normal use of the
22240 corresponding registers have been restricted via the
22241 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
22242 options.
22244 @node S/390 and zSeries Options
22245 @subsection S/390 and zSeries Options
22246 @cindex S/390 and zSeries Options
22248 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
22250 @table @gcctabopt
22251 @item -mhard-float
22252 @itemx -msoft-float
22253 @opindex mhard-float
22254 @opindex msoft-float
22255 Use (do not use) the hardware floating-point instructions and registers
22256 for floating-point operations.  When @option{-msoft-float} is specified,
22257 functions in @file{libgcc.a} are used to perform floating-point
22258 operations.  When @option{-mhard-float} is specified, the compiler
22259 generates IEEE floating-point instructions.  This is the default.
22261 @item -mhard-dfp
22262 @itemx -mno-hard-dfp
22263 @opindex mhard-dfp
22264 @opindex mno-hard-dfp
22265 Use (do not use) the hardware decimal-floating-point instructions for
22266 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
22267 specified, functions in @file{libgcc.a} are used to perform
22268 decimal-floating-point operations.  When @option{-mhard-dfp} is
22269 specified, the compiler generates decimal-floating-point hardware
22270 instructions.  This is the default for @option{-march=z9-ec} or higher.
22272 @item -mlong-double-64
22273 @itemx -mlong-double-128
22274 @opindex mlong-double-64
22275 @opindex mlong-double-128
22276 These switches control the size of @code{long double} type. A size
22277 of 64 bits makes the @code{long double} type equivalent to the @code{double}
22278 type. This is the default.
22280 @item -mbackchain
22281 @itemx -mno-backchain
22282 @opindex mbackchain
22283 @opindex mno-backchain
22284 Store (do not store) the address of the caller's frame as backchain pointer
22285 into the callee's stack frame.
22286 A backchain may be needed to allow debugging using tools that do not understand
22287 DWARF call frame information.
22288 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
22289 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
22290 the backchain is placed into the topmost word of the 96/160 byte register
22291 save area.
22293 In general, code compiled with @option{-mbackchain} is call-compatible with
22294 code compiled with @option{-mmo-backchain}; however, use of the backchain
22295 for debugging purposes usually requires that the whole binary is built with
22296 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
22297 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
22298 to build a linux kernel use @option{-msoft-float}.
22300 The default is to not maintain the backchain.
22302 @item -mpacked-stack
22303 @itemx -mno-packed-stack
22304 @opindex mpacked-stack
22305 @opindex mno-packed-stack
22306 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
22307 specified, the compiler uses the all fields of the 96/160 byte register save
22308 area only for their default purpose; unused fields still take up stack space.
22309 When @option{-mpacked-stack} is specified, register save slots are densely
22310 packed at the top of the register save area; unused space is reused for other
22311 purposes, allowing for more efficient use of the available stack space.
22312 However, when @option{-mbackchain} is also in effect, the topmost word of
22313 the save area is always used to store the backchain, and the return address
22314 register is always saved two words below the backchain.
22316 As long as the stack frame backchain is not used, code generated with
22317 @option{-mpacked-stack} is call-compatible with code generated with
22318 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
22319 S/390 or zSeries generated code that uses the stack frame backchain at run
22320 time, not just for debugging purposes.  Such code is not call-compatible
22321 with code compiled with @option{-mpacked-stack}.  Also, note that the
22322 combination of @option{-mbackchain},
22323 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
22324 to build a linux kernel use @option{-msoft-float}.
22326 The default is to not use the packed stack layout.
22328 @item -msmall-exec
22329 @itemx -mno-small-exec
22330 @opindex msmall-exec
22331 @opindex mno-small-exec
22332 Generate (or do not generate) code using the @code{bras} instruction
22333 to do subroutine calls.
22334 This only works reliably if the total executable size does not
22335 exceed 64k.  The default is to use the @code{basr} instruction instead,
22336 which does not have this limitation.
22338 @item -m64
22339 @itemx -m31
22340 @opindex m64
22341 @opindex m31
22342 When @option{-m31} is specified, generate code compliant to the
22343 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
22344 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
22345 particular to generate 64-bit instructions.  For the @samp{s390}
22346 targets, the default is @option{-m31}, while the @samp{s390x}
22347 targets default to @option{-m64}.
22349 @item -mzarch
22350 @itemx -mesa
22351 @opindex mzarch
22352 @opindex mesa
22353 When @option{-mzarch} is specified, generate code using the
22354 instructions available on z/Architecture.
22355 When @option{-mesa} is specified, generate code using the
22356 instructions available on ESA/390.  Note that @option{-mesa} is
22357 not possible with @option{-m64}.
22358 When generating code compliant to the GNU/Linux for S/390 ABI,
22359 the default is @option{-mesa}.  When generating code compliant
22360 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
22362 @item -mhtm
22363 @itemx -mno-htm
22364 @opindex mhtm
22365 @opindex mno-htm
22366 The @option{-mhtm} option enables a set of builtins making use of
22367 instructions available with the transactional execution facility
22368 introduced with the IBM zEnterprise EC12 machine generation
22369 @ref{S/390 System z Built-in Functions}.
22370 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
22372 @item -mvx
22373 @itemx -mno-vx
22374 @opindex mvx
22375 @opindex mno-vx
22376 When @option{-mvx} is specified, generate code using the instructions
22377 available with the vector extension facility introduced with the IBM
22378 z13 machine generation.
22379 This option changes the ABI for some vector type values with regard to
22380 alignment and calling conventions.  In case vector type values are
22381 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
22382 command will be added to mark the resulting binary with the ABI used.
22383 @option{-mvx} is enabled by default when using @option{-march=z13}.
22385 @item -mzvector
22386 @itemx -mno-zvector
22387 @opindex mzvector
22388 @opindex mno-zvector
22389 The @option{-mzvector} option enables vector language extensions and
22390 builtins using instructions available with the vector extension
22391 facility introduced with the IBM z13 machine generation.
22392 This option adds support for @samp{vector} to be used as a keyword to
22393 define vector type variables and arguments.  @samp{vector} is only
22394 available when GNU extensions are enabled.  It will not be expanded
22395 when requesting strict standard compliance e.g. with @option{-std=c99}.
22396 In addition to the GCC low-level builtins @option{-mzvector} enables
22397 a set of builtins added for compatibility with AltiVec-style
22398 implementations like Power and Cell.  In order to make use of these
22399 builtins the header file @file{vecintrin.h} needs to be included.
22400 @option{-mzvector} is disabled by default.
22402 @item -mmvcle
22403 @itemx -mno-mvcle
22404 @opindex mmvcle
22405 @opindex mno-mvcle
22406 Generate (or do not generate) code using the @code{mvcle} instruction
22407 to perform block moves.  When @option{-mno-mvcle} is specified,
22408 use a @code{mvc} loop instead.  This is the default unless optimizing for
22409 size.
22411 @item -mdebug
22412 @itemx -mno-debug
22413 @opindex mdebug
22414 @opindex mno-debug
22415 Print (or do not print) additional debug information when compiling.
22416 The default is to not print debug information.
22418 @item -march=@var{cpu-type}
22419 @opindex march
22420 Generate code that runs on @var{cpu-type}, which is the name of a
22421 system representing a certain processor type.  Possible values for
22422 @var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
22423 @samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
22424 @samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11}, and
22425 @samp{native}.
22427 The default is @option{-march=z900}.  @samp{g5}/@samp{arch3} and
22428 @samp{g6} are deprecated and will be removed with future releases.
22430 Specifying @samp{native} as cpu type can be used to select the best
22431 architecture option for the host processor.
22432 @option{-march=native} has no effect if GCC does not recognize the
22433 processor.
22435 @item -mtune=@var{cpu-type}
22436 @opindex mtune
22437 Tune to @var{cpu-type} everything applicable about the generated code,
22438 except for the ABI and the set of available instructions.
22439 The list of @var{cpu-type} values is the same as for @option{-march}.
22440 The default is the value used for @option{-march}.
22442 @item -mtpf-trace
22443 @itemx -mno-tpf-trace
22444 @opindex mtpf-trace
22445 @opindex mno-tpf-trace
22446 Generate code that adds (does not add) in TPF OS specific branches to trace
22447 routines in the operating system.  This option is off by default, even
22448 when compiling for the TPF OS@.
22450 @item -mfused-madd
22451 @itemx -mno-fused-madd
22452 @opindex mfused-madd
22453 @opindex mno-fused-madd
22454 Generate code that uses (does not use) the floating-point multiply and
22455 accumulate instructions.  These instructions are generated by default if
22456 hardware floating point is used.
22458 @item -mwarn-framesize=@var{framesize}
22459 @opindex mwarn-framesize
22460 Emit a warning if the current function exceeds the given frame size.  Because
22461 this is a compile-time check it doesn't need to be a real problem when the program
22462 runs.  It is intended to identify functions that most probably cause
22463 a stack overflow.  It is useful to be used in an environment with limited stack
22464 size e.g.@: the linux kernel.
22466 @item -mwarn-dynamicstack
22467 @opindex mwarn-dynamicstack
22468 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
22469 arrays.  This is generally a bad idea with a limited stack size.
22471 @item -mstack-guard=@var{stack-guard}
22472 @itemx -mstack-size=@var{stack-size}
22473 @opindex mstack-guard
22474 @opindex mstack-size
22475 If these options are provided the S/390 back end emits additional instructions in
22476 the function prologue that trigger a trap if the stack size is @var{stack-guard}
22477 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
22478 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
22479 the frame size of the compiled function is chosen.
22480 These options are intended to be used to help debugging stack overflow problems.
22481 The additionally emitted code causes only little overhead and hence can also be
22482 used in production-like systems without greater performance degradation.  The given
22483 values have to be exact powers of 2 and @var{stack-size} has to be greater than
22484 @var{stack-guard} without exceeding 64k.
22485 In order to be efficient the extra code makes the assumption that the stack starts
22486 at an address aligned to the value given by @var{stack-size}.
22487 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
22489 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
22490 @opindex mhotpatch
22491 If the hotpatch option is enabled, a ``hot-patching'' function
22492 prologue is generated for all functions in the compilation unit.
22493 The funtion label is prepended with the given number of two-byte
22494 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
22495 the label, 2 * @var{post-halfwords} bytes are appended, using the
22496 largest NOP like instructions the architecture allows (maximum
22497 1000000).
22499 If both arguments are zero, hotpatching is disabled.
22501 This option can be overridden for individual functions with the
22502 @code{hotpatch} attribute.
22503 @end table
22505 @node Score Options
22506 @subsection Score Options
22507 @cindex Score Options
22509 These options are defined for Score implementations:
22511 @table @gcctabopt
22512 @item -meb
22513 @opindex meb
22514 Compile code for big-endian mode.  This is the default.
22516 @item -mel
22517 @opindex mel
22518 Compile code for little-endian mode.
22520 @item -mnhwloop
22521 @opindex mnhwloop
22522 Disable generation of @code{bcnz} instructions.
22524 @item -muls
22525 @opindex muls
22526 Enable generation of unaligned load and store instructions.
22528 @item -mmac
22529 @opindex mmac
22530 Enable the use of multiply-accumulate instructions. Disabled by default.
22532 @item -mscore5
22533 @opindex mscore5
22534 Specify the SCORE5 as the target architecture.
22536 @item -mscore5u
22537 @opindex mscore5u
22538 Specify the SCORE5U of the target architecture.
22540 @item -mscore7
22541 @opindex mscore7
22542 Specify the SCORE7 as the target architecture. This is the default.
22544 @item -mscore7d
22545 @opindex mscore7d
22546 Specify the SCORE7D as the target architecture.
22547 @end table
22549 @node SH Options
22550 @subsection SH Options
22552 These @samp{-m} options are defined for the SH implementations:
22554 @table @gcctabopt
22555 @item -m1
22556 @opindex m1
22557 Generate code for the SH1.
22559 @item -m2
22560 @opindex m2
22561 Generate code for the SH2.
22563 @item -m2e
22564 Generate code for the SH2e.
22566 @item -m2a-nofpu
22567 @opindex m2a-nofpu
22568 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
22569 that the floating-point unit is not used.
22571 @item -m2a-single-only
22572 @opindex m2a-single-only
22573 Generate code for the SH2a-FPU, in such a way that no double-precision
22574 floating-point operations are used.
22576 @item -m2a-single
22577 @opindex m2a-single
22578 Generate code for the SH2a-FPU assuming the floating-point unit is in
22579 single-precision mode by default.
22581 @item -m2a
22582 @opindex m2a
22583 Generate code for the SH2a-FPU assuming the floating-point unit is in
22584 double-precision mode by default.
22586 @item -m3
22587 @opindex m3
22588 Generate code for the SH3.
22590 @item -m3e
22591 @opindex m3e
22592 Generate code for the SH3e.
22594 @item -m4-nofpu
22595 @opindex m4-nofpu
22596 Generate code for the SH4 without a floating-point unit.
22598 @item -m4-single-only
22599 @opindex m4-single-only
22600 Generate code for the SH4 with a floating-point unit that only
22601 supports single-precision arithmetic.
22603 @item -m4-single
22604 @opindex m4-single
22605 Generate code for the SH4 assuming the floating-point unit is in
22606 single-precision mode by default.
22608 @item -m4
22609 @opindex m4
22610 Generate code for the SH4.
22612 @item -m4-100
22613 @opindex m4-100
22614 Generate code for SH4-100.
22616 @item -m4-100-nofpu
22617 @opindex m4-100-nofpu
22618 Generate code for SH4-100 in such a way that the
22619 floating-point unit is not used.
22621 @item -m4-100-single
22622 @opindex m4-100-single
22623 Generate code for SH4-100 assuming the floating-point unit is in
22624 single-precision mode by default.
22626 @item -m4-100-single-only
22627 @opindex m4-100-single-only
22628 Generate code for SH4-100 in such a way that no double-precision
22629 floating-point operations are used.
22631 @item -m4-200
22632 @opindex m4-200
22633 Generate code for SH4-200.
22635 @item -m4-200-nofpu
22636 @opindex m4-200-nofpu
22637 Generate code for SH4-200 without in such a way that the
22638 floating-point unit is not used.
22640 @item -m4-200-single
22641 @opindex m4-200-single
22642 Generate code for SH4-200 assuming the floating-point unit is in
22643 single-precision mode by default.
22645 @item -m4-200-single-only
22646 @opindex m4-200-single-only
22647 Generate code for SH4-200 in such a way that no double-precision
22648 floating-point operations are used.
22650 @item -m4-300
22651 @opindex m4-300
22652 Generate code for SH4-300.
22654 @item -m4-300-nofpu
22655 @opindex m4-300-nofpu
22656 Generate code for SH4-300 without in such a way that the
22657 floating-point unit is not used.
22659 @item -m4-300-single
22660 @opindex m4-300-single
22661 Generate code for SH4-300 in such a way that no double-precision
22662 floating-point operations are used.
22664 @item -m4-300-single-only
22665 @opindex m4-300-single-only
22666 Generate code for SH4-300 in such a way that no double-precision
22667 floating-point operations are used.
22669 @item -m4-340
22670 @opindex m4-340
22671 Generate code for SH4-340 (no MMU, no FPU).
22673 @item -m4-500
22674 @opindex m4-500
22675 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
22676 assembler.
22678 @item -m4a-nofpu
22679 @opindex m4a-nofpu
22680 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
22681 floating-point unit is not used.
22683 @item -m4a-single-only
22684 @opindex m4a-single-only
22685 Generate code for the SH4a, in such a way that no double-precision
22686 floating-point operations are used.
22688 @item -m4a-single
22689 @opindex m4a-single
22690 Generate code for the SH4a assuming the floating-point unit is in
22691 single-precision mode by default.
22693 @item -m4a
22694 @opindex m4a
22695 Generate code for the SH4a.
22697 @item -m4al
22698 @opindex m4al
22699 Same as @option{-m4a-nofpu}, except that it implicitly passes
22700 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
22701 instructions at the moment.
22703 @item -mb
22704 @opindex mb
22705 Compile code for the processor in big-endian mode.
22707 @item -ml
22708 @opindex ml
22709 Compile code for the processor in little-endian mode.
22711 @item -mdalign
22712 @opindex mdalign
22713 Align doubles at 64-bit boundaries.  Note that this changes the calling
22714 conventions, and thus some functions from the standard C library do
22715 not work unless you recompile it first with @option{-mdalign}.
22717 @item -mrelax
22718 @opindex mrelax
22719 Shorten some address references at link time, when possible; uses the
22720 linker option @option{-relax}.
22722 @item -mbigtable
22723 @opindex mbigtable
22724 Use 32-bit offsets in @code{switch} tables.  The default is to use
22725 16-bit offsets.
22727 @item -mbitops
22728 @opindex mbitops
22729 Enable the use of bit manipulation instructions on SH2A.
22731 @item -mfmovd
22732 @opindex mfmovd
22733 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
22734 alignment constraints.
22736 @item -mrenesas
22737 @opindex mrenesas
22738 Comply with the calling conventions defined by Renesas.
22740 @item -mno-renesas
22741 @opindex mno-renesas
22742 Comply with the calling conventions defined for GCC before the Renesas
22743 conventions were available.  This option is the default for all
22744 targets of the SH toolchain.
22746 @item -mnomacsave
22747 @opindex mnomacsave
22748 Mark the @code{MAC} register as call-clobbered, even if
22749 @option{-mrenesas} is given.
22751 @item -mieee
22752 @itemx -mno-ieee
22753 @opindex mieee
22754 @opindex mno-ieee
22755 Control the IEEE compliance of floating-point comparisons, which affects the
22756 handling of cases where the result of a comparison is unordered.  By default
22757 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
22758 enabled @option{-mno-ieee} is implicitly set, which results in faster
22759 floating-point greater-equal and less-equal comparisons.  The implicit settings
22760 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
22762 @item -minline-ic_invalidate
22763 @opindex minline-ic_invalidate
22764 Inline code to invalidate instruction cache entries after setting up
22765 nested function trampolines.
22766 This option has no effect if @option{-musermode} is in effect and the selected
22767 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
22768 instruction.
22769 If the selected code generation option does not allow the use of the @code{icbi}
22770 instruction, and @option{-musermode} is not in effect, the inlined code
22771 manipulates the instruction cache address array directly with an associative
22772 write.  This not only requires privileged mode at run time, but it also
22773 fails if the cache line had been mapped via the TLB and has become unmapped.
22775 @item -misize
22776 @opindex misize
22777 Dump instruction size and location in the assembly code.
22779 @item -mpadstruct
22780 @opindex mpadstruct
22781 This option is deprecated.  It pads structures to multiple of 4 bytes,
22782 which is incompatible with the SH ABI@.
22784 @item -matomic-model=@var{model}
22785 @opindex matomic-model=@var{model}
22786 Sets the model of atomic operations and additional parameters as a comma
22787 separated list.  For details on the atomic built-in functions see
22788 @ref{__atomic Builtins}.  The following models and parameters are supported:
22790 @table @samp
22792 @item none
22793 Disable compiler generated atomic sequences and emit library calls for atomic
22794 operations.  This is the default if the target is not @code{sh*-*-linux*}.
22796 @item soft-gusa
22797 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
22798 built-in functions.  The generated atomic sequences require additional support
22799 from the interrupt/exception handling code of the system and are only suitable
22800 for SH3* and SH4* single-core systems.  This option is enabled by default when
22801 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
22802 this option also partially utilizes the hardware atomic instructions
22803 @code{movli.l} and @code{movco.l} to create more efficient code, unless
22804 @samp{strict} is specified.  
22806 @item soft-tcb
22807 Generate software atomic sequences that use a variable in the thread control
22808 block.  This is a variation of the gUSA sequences which can also be used on
22809 SH1* and SH2* targets.  The generated atomic sequences require additional
22810 support from the interrupt/exception handling code of the system and are only
22811 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
22812 parameter has to be specified as well.
22814 @item soft-imask
22815 Generate software atomic sequences that temporarily disable interrupts by
22816 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
22817 in privileged mode and is only suitable for single-core systems.  Additional
22818 support from the interrupt/exception handling code of the system is not
22819 required.  This model is enabled by default when the target is
22820 @code{sh*-*-linux*} and SH1* or SH2*.
22822 @item hard-llcs
22823 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
22824 instructions only.  This is only available on SH4A and is suitable for
22825 multi-core systems.  Since the hardware instructions support only 32 bit atomic
22826 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
22827 Code compiled with this option is also compatible with other software
22828 atomic model interrupt/exception handling systems if executed on an SH4A
22829 system.  Additional support from the interrupt/exception handling code of the
22830 system is not required for this model.
22832 @item gbr-offset=
22833 This parameter specifies the offset in bytes of the variable in the thread
22834 control block structure that should be used by the generated atomic sequences
22835 when the @samp{soft-tcb} model has been selected.  For other models this
22836 parameter is ignored.  The specified value must be an integer multiple of four
22837 and in the range 0-1020.
22839 @item strict
22840 This parameter prevents mixed usage of multiple atomic models, even if they
22841 are compatible, and makes the compiler generate atomic sequences of the
22842 specified model only.
22844 @end table
22846 @item -mtas
22847 @opindex mtas
22848 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
22849 Notice that depending on the particular hardware and software configuration
22850 this can degrade overall performance due to the operand cache line flushes
22851 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
22852 processors the @code{tas.b} instruction must be used with caution since it
22853 can result in data corruption for certain cache configurations.
22855 @item -mprefergot
22856 @opindex mprefergot
22857 When generating position-independent code, emit function calls using
22858 the Global Offset Table instead of the Procedure Linkage Table.
22860 @item -musermode
22861 @itemx -mno-usermode
22862 @opindex musermode
22863 @opindex mno-usermode
22864 Don't allow (allow) the compiler generating privileged mode code.  Specifying
22865 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
22866 inlined code would not work in user mode.  @option{-musermode} is the default
22867 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
22868 @option{-musermode} has no effect, since there is no user mode.
22870 @item -multcost=@var{number}
22871 @opindex multcost=@var{number}
22872 Set the cost to assume for a multiply insn.
22874 @item -mdiv=@var{strategy}
22875 @opindex mdiv=@var{strategy}
22876 Set the division strategy to be used for integer division operations.
22877 @var{strategy} can be one of: 
22879 @table @samp
22881 @item call-div1
22882 Calls a library function that uses the single-step division instruction
22883 @code{div1} to perform the operation.  Division by zero calculates an
22884 unspecified result and does not trap.  This is the default except for SH4,
22885 SH2A and SHcompact.
22887 @item call-fp
22888 Calls a library function that performs the operation in double precision
22889 floating point.  Division by zero causes a floating-point exception.  This is
22890 the default for SHcompact with FPU.  Specifying this for targets that do not
22891 have a double precision FPU defaults to @code{call-div1}.
22893 @item call-table
22894 Calls a library function that uses a lookup table for small divisors and
22895 the @code{div1} instruction with case distinction for larger divisors.  Division
22896 by zero calculates an unspecified result and does not trap.  This is the default
22897 for SH4.  Specifying this for targets that do not have dynamic shift
22898 instructions defaults to @code{call-div1}.
22900 @end table
22902 When a division strategy has not been specified the default strategy is
22903 selected based on the current target.  For SH2A the default strategy is to
22904 use the @code{divs} and @code{divu} instructions instead of library function
22905 calls.
22907 @item -maccumulate-outgoing-args
22908 @opindex maccumulate-outgoing-args
22909 Reserve space once for outgoing arguments in the function prologue rather
22910 than around each call.  Generally beneficial for performance and size.  Also
22911 needed for unwinding to avoid changing the stack frame around conditional code.
22913 @item -mdivsi3_libfunc=@var{name}
22914 @opindex mdivsi3_libfunc=@var{name}
22915 Set the name of the library function used for 32-bit signed division to
22916 @var{name}.
22917 This only affects the name used in the @samp{call} division strategies, and
22918 the compiler still expects the same sets of input/output/clobbered registers as
22919 if this option were not present.
22921 @item -mfixed-range=@var{register-range}
22922 @opindex mfixed-range
22923 Generate code treating the given register range as fixed registers.
22924 A fixed register is one that the register allocator can not use.  This is
22925 useful when compiling kernel code.  A register range is specified as
22926 two registers separated by a dash.  Multiple register ranges can be
22927 specified separated by a comma.
22929 @item -mbranch-cost=@var{num}
22930 @opindex mbranch-cost=@var{num}
22931 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
22932 make the compiler try to generate more branch-free code if possible.  
22933 If not specified the value is selected depending on the processor type that
22934 is being compiled for.
22936 @item -mzdcbranch
22937 @itemx -mno-zdcbranch
22938 @opindex mzdcbranch
22939 @opindex mno-zdcbranch
22940 Assume (do not assume) that zero displacement conditional branch instructions
22941 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
22942 compiler prefers zero displacement branch code sequences.  This is
22943 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
22944 disabled by specifying @option{-mno-zdcbranch}.
22946 @item -mcbranch-force-delay-slot
22947 @opindex mcbranch-force-delay-slot
22948 Force the usage of delay slots for conditional branches, which stuffs the delay
22949 slot with a @code{nop} if a suitable instruction can't be found.  By default
22950 this option is disabled.  It can be enabled to work around hardware bugs as
22951 found in the original SH7055.
22953 @item -mfused-madd
22954 @itemx -mno-fused-madd
22955 @opindex mfused-madd
22956 @opindex mno-fused-madd
22957 Generate code that uses (does not use) the floating-point multiply and
22958 accumulate instructions.  These instructions are generated by default
22959 if hardware floating point is used.  The machine-dependent
22960 @option{-mfused-madd} option is now mapped to the machine-independent
22961 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
22962 mapped to @option{-ffp-contract=off}.
22964 @item -mfsca
22965 @itemx -mno-fsca
22966 @opindex mfsca
22967 @opindex mno-fsca
22968 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
22969 and cosine approximations.  The option @option{-mfsca} must be used in
22970 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
22971 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
22972 approximations even if @option{-funsafe-math-optimizations} is in effect.
22974 @item -mfsrra
22975 @itemx -mno-fsrra
22976 @opindex mfsrra
22977 @opindex mno-fsrra
22978 Allow or disallow the compiler to emit the @code{fsrra} instruction for
22979 reciprocal square root approximations.  The option @option{-mfsrra} must be used
22980 in combination with @option{-funsafe-math-optimizations} and
22981 @option{-ffinite-math-only}.  It is enabled by default when generating code for
22982 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
22983 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
22984 in effect.
22986 @item -mpretend-cmove
22987 @opindex mpretend-cmove
22988 Prefer zero-displacement conditional branches for conditional move instruction
22989 patterns.  This can result in faster code on the SH4 processor.
22991 @item -mfdpic
22992 @opindex fdpic
22993 Generate code using the FDPIC ABI.
22995 @end table
22997 @node Solaris 2 Options
22998 @subsection Solaris 2 Options
22999 @cindex Solaris 2 options
23001 These @samp{-m} options are supported on Solaris 2:
23003 @table @gcctabopt
23004 @item -mclear-hwcap
23005 @opindex mclear-hwcap
23006 @option{-mclear-hwcap} tells the compiler to remove the hardware
23007 capabilities generated by the Solaris assembler.  This is only necessary
23008 when object files use ISA extensions not supported by the current
23009 machine, but check at runtime whether or not to use them.
23011 @item -mimpure-text
23012 @opindex mimpure-text
23013 @option{-mimpure-text}, used in addition to @option{-shared}, tells
23014 the compiler to not pass @option{-z text} to the linker when linking a
23015 shared object.  Using this option, you can link position-dependent
23016 code into a shared object.
23018 @option{-mimpure-text} suppresses the ``relocations remain against
23019 allocatable but non-writable sections'' linker error message.
23020 However, the necessary relocations trigger copy-on-write, and the
23021 shared object is not actually shared across processes.  Instead of
23022 using @option{-mimpure-text}, you should compile all source code with
23023 @option{-fpic} or @option{-fPIC}.
23025 @end table
23027 These switches are supported in addition to the above on Solaris 2:
23029 @table @gcctabopt
23030 @item -pthreads
23031 @opindex pthreads
23032 Add support for multithreading using the POSIX threads library.  This
23033 option sets flags for both the preprocessor and linker.  This option does
23034 not affect the thread safety of object code produced  by the compiler or
23035 that of libraries supplied with it.
23037 @item -pthread
23038 @opindex pthread
23039 This is a synonym for @option{-pthreads}.
23040 @end table
23042 @node SPARC Options
23043 @subsection SPARC Options
23044 @cindex SPARC options
23046 These @samp{-m} options are supported on the SPARC:
23048 @table @gcctabopt
23049 @item -mno-app-regs
23050 @itemx -mapp-regs
23051 @opindex mno-app-regs
23052 @opindex mapp-regs
23053 Specify @option{-mapp-regs} to generate output using the global registers
23054 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
23055 global register 1, each global register 2 through 4 is then treated as an
23056 allocable register that is clobbered by function calls.  This is the default.
23058 To be fully SVR4 ABI-compliant at the cost of some performance loss,
23059 specify @option{-mno-app-regs}.  You should compile libraries and system
23060 software with this option.
23062 @item -mflat
23063 @itemx -mno-flat
23064 @opindex mflat
23065 @opindex mno-flat
23066 With @option{-mflat}, the compiler does not generate save/restore instructions
23067 and uses a ``flat'' or single register window model.  This model is compatible
23068 with the regular register window model.  The local registers and the input
23069 registers (0--5) are still treated as ``call-saved'' registers and are
23070 saved on the stack as needed.
23072 With @option{-mno-flat} (the default), the compiler generates save/restore
23073 instructions (except for leaf functions).  This is the normal operating mode.
23075 @item -mfpu
23076 @itemx -mhard-float
23077 @opindex mfpu
23078 @opindex mhard-float
23079 Generate output containing floating-point instructions.  This is the
23080 default.
23082 @item -mno-fpu
23083 @itemx -msoft-float
23084 @opindex mno-fpu
23085 @opindex msoft-float
23086 Generate output containing library calls for floating point.
23087 @strong{Warning:} the requisite libraries are not available for all SPARC
23088 targets.  Normally the facilities of the machine's usual C compiler are
23089 used, but this cannot be done directly in cross-compilation.  You must make
23090 your own arrangements to provide suitable library functions for
23091 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
23092 @samp{sparclite-*-*} do provide software floating-point support.
23094 @option{-msoft-float} changes the calling convention in the output file;
23095 therefore, it is only useful if you compile @emph{all} of a program with
23096 this option.  In particular, you need to compile @file{libgcc.a}, the
23097 library that comes with GCC, with @option{-msoft-float} in order for
23098 this to work.
23100 @item -mhard-quad-float
23101 @opindex mhard-quad-float
23102 Generate output containing quad-word (long double) floating-point
23103 instructions.
23105 @item -msoft-quad-float
23106 @opindex msoft-quad-float
23107 Generate output containing library calls for quad-word (long double)
23108 floating-point instructions.  The functions called are those specified
23109 in the SPARC ABI@.  This is the default.
23111 As of this writing, there are no SPARC implementations that have hardware
23112 support for the quad-word floating-point instructions.  They all invoke
23113 a trap handler for one of these instructions, and then the trap handler
23114 emulates the effect of the instruction.  Because of the trap handler overhead,
23115 this is much slower than calling the ABI library routines.  Thus the
23116 @option{-msoft-quad-float} option is the default.
23118 @item -mno-unaligned-doubles
23119 @itemx -munaligned-doubles
23120 @opindex mno-unaligned-doubles
23121 @opindex munaligned-doubles
23122 Assume that doubles have 8-byte alignment.  This is the default.
23124 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
23125 alignment only if they are contained in another type, or if they have an
23126 absolute address.  Otherwise, it assumes they have 4-byte alignment.
23127 Specifying this option avoids some rare compatibility problems with code
23128 generated by other compilers.  It is not the default because it results
23129 in a performance loss, especially for floating-point code.
23131 @item -muser-mode
23132 @itemx -mno-user-mode
23133 @opindex muser-mode
23134 @opindex mno-user-mode
23135 Do not generate code that can only run in supervisor mode.  This is relevant
23136 only for the @code{casa} instruction emitted for the LEON3 processor.  This
23137 is the default.
23139 @item -mfaster-structs
23140 @itemx -mno-faster-structs
23141 @opindex mfaster-structs
23142 @opindex mno-faster-structs
23143 With @option{-mfaster-structs}, the compiler assumes that structures
23144 should have 8-byte alignment.  This enables the use of pairs of
23145 @code{ldd} and @code{std} instructions for copies in structure
23146 assignment, in place of twice as many @code{ld} and @code{st} pairs.
23147 However, the use of this changed alignment directly violates the SPARC
23148 ABI@.  Thus, it's intended only for use on targets where the developer
23149 acknowledges that their resulting code is not directly in line with
23150 the rules of the ABI@.
23152 @item -mstd-struct-return
23153 @itemx -mno-std-struct-return
23154 @opindex mstd-struct-return
23155 @opindex mno-std-struct-return
23156 With @option{-mstd-struct-return}, the compiler generates checking code
23157 in functions returning structures or unions to detect size mismatches
23158 between the two sides of function calls, as per the 32-bit ABI@.
23160 The default is @option{-mno-std-struct-return}.  This option has no effect
23161 in 64-bit mode.
23163 @item -mcpu=@var{cpu_type}
23164 @opindex mcpu
23165 Set the instruction set, register set, and instruction scheduling parameters
23166 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
23167 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
23168 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
23169 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
23170 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
23171 @samp{niagara3}, @samp{niagara4} and @samp{niagara7}.
23173 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
23174 which selects the best architecture option for the host processor.
23175 @option{-mcpu=native} has no effect if GCC does not recognize
23176 the processor.
23178 Default instruction scheduling parameters are used for values that select
23179 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
23180 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
23182 Here is a list of each supported architecture and their supported
23183 implementations.
23185 @table @asis
23186 @item v7
23187 cypress, leon3v7
23189 @item v8
23190 supersparc, hypersparc, leon, leon3
23192 @item sparclite
23193 f930, f934, sparclite86x
23195 @item sparclet
23196 tsc701
23198 @item v9
23199 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4, niagara7
23200 @end table
23202 By default (unless configured otherwise), GCC generates code for the V7
23203 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
23204 additionally optimizes it for the Cypress CY7C602 chip, as used in the
23205 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
23206 SPARCStation 1, 2, IPX etc.
23208 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
23209 architecture.  The only difference from V7 code is that the compiler emits
23210 the integer multiply and integer divide instructions which exist in SPARC-V8
23211 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
23212 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
23213 2000 series.
23215 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
23216 the SPARC architecture.  This adds the integer multiply, integer divide step
23217 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
23218 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
23219 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
23220 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
23221 MB86934 chip, which is the more recent SPARClite with FPU@.
23223 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
23224 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
23225 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
23226 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
23227 optimizes it for the TEMIC SPARClet chip.
23229 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
23230 architecture.  This adds 64-bit integer and floating-point move instructions,
23231 3 additional floating-point condition code registers and conditional move
23232 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
23233 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
23234 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
23235 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
23236 @option{-mcpu=niagara}, the compiler additionally optimizes it for
23237 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
23238 additionally optimizes it for Sun UltraSPARC T2 chips. With
23239 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
23240 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
23241 additionally optimizes it for Sun UltraSPARC T4 chips.  With
23242 @option{-mcpu=niagara7}, the compiler additionally optimizes it for
23243 Oracle SPARC M7 chips.
23245 @item -mtune=@var{cpu_type}
23246 @opindex mtune
23247 Set the instruction scheduling parameters for machine type
23248 @var{cpu_type}, but do not set the instruction set or register set that the
23249 option @option{-mcpu=@var{cpu_type}} does.
23251 The same values for @option{-mcpu=@var{cpu_type}} can be used for
23252 @option{-mtune=@var{cpu_type}}, but the only useful values are those
23253 that select a particular CPU implementation.  Those are
23254 @samp{cypress}, @samp{supersparc}, @samp{hypersparc}, @samp{leon},
23255 @samp{leon3}, @samp{leon3v7}, @samp{f930}, @samp{f934},
23256 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
23257 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
23258 @samp{niagara4} and @samp{niagara7}.  With native Solaris and
23259 GNU/Linux toolchains, @samp{native} can also be used.
23261 @item -mv8plus
23262 @itemx -mno-v8plus
23263 @opindex mv8plus
23264 @opindex mno-v8plus
23265 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
23266 difference from the V8 ABI is that the global and out registers are
23267 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
23268 mode for all SPARC-V9 processors.
23270 @item -mvis
23271 @itemx -mno-vis
23272 @opindex mvis
23273 @opindex mno-vis
23274 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
23275 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
23277 @item -mvis2
23278 @itemx -mno-vis2
23279 @opindex mvis2
23280 @opindex mno-vis2
23281 With @option{-mvis2}, GCC generates code that takes advantage of
23282 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
23283 default is @option{-mvis2} when targeting a cpu that supports such
23284 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
23285 also sets @option{-mvis}.
23287 @item -mvis3
23288 @itemx -mno-vis3
23289 @opindex mvis3
23290 @opindex mno-vis3
23291 With @option{-mvis3}, GCC generates code that takes advantage of
23292 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
23293 default is @option{-mvis3} when targeting a cpu that supports such
23294 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
23295 also sets @option{-mvis2} and @option{-mvis}.
23297 @item -mvis4
23298 @itemx -mno-vis4
23299 @opindex mvis4
23300 @opindex mno-vis4
23301 With @option{-mvis4}, GCC generates code that takes advantage of
23302 version 4.0 of the UltraSPARC Visual Instruction Set extensions.  The
23303 default is @option{-mvis4} when targeting a cpu that supports such
23304 instructions, such as niagara-7 and later.  Setting @option{-mvis4}
23305 also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
23307 @item -mcbcond
23308 @itemx -mno-cbcond
23309 @opindex mcbcond
23310 @opindex mno-cbcond
23311 With @option{-mcbcond}, GCC generates code that takes advantage of the UltraSPARC
23312 Compare-and-Branch-on-Condition instructions.  The default is @option{-mcbcond}
23313 when targeting a CPU that supports such instructions, such as Niagara-4 and
23314 later.
23316 @item -mfmaf
23317 @itemx -mno-fmaf
23318 @opindex mfmaf
23319 @opindex mno-fmaf
23320 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
23321 Fused Multiply-Add Floating-point instructions.  The default is @option{-mfmaf}
23322 when targeting a CPU that supports such instructions, such as Niagara-3 and
23323 later.
23325 @item -mpopc
23326 @itemx -mno-popc
23327 @opindex mpopc
23328 @opindex mno-popc
23329 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
23330 Population Count instruction.  The default is @option{-mpopc}
23331 when targeting a CPU that supports such an instruction, such as Niagara-2 and
23332 later.
23334 @item -msubxc
23335 @itemx -mno-subxc
23336 @opindex msubxc
23337 @opindex mno-subxc
23338 With @option{-msubxc}, GCC generates code that takes advantage of the UltraSPARC
23339 Subtract-Extended-with-Carry instruction.  The default is @option{-msubxc}
23340 when targeting a CPU that supports such an instruction, such as Niagara-7 and
23341 later.
23343 @item -mfix-at697f
23344 @opindex mfix-at697f
23345 Enable the documented workaround for the single erratum of the Atmel AT697F
23346 processor (which corresponds to erratum #13 of the AT697E processor).
23348 @item -mfix-ut699
23349 @opindex mfix-ut699
23350 Enable the documented workarounds for the floating-point errata and the data
23351 cache nullify errata of the UT699 processor.
23352 @end table
23354 These @samp{-m} options are supported in addition to the above
23355 on SPARC-V9 processors in 64-bit environments:
23357 @table @gcctabopt
23358 @item -m32
23359 @itemx -m64
23360 @opindex m32
23361 @opindex m64
23362 Generate code for a 32-bit or 64-bit environment.
23363 The 32-bit environment sets int, long and pointer to 32 bits.
23364 The 64-bit environment sets int to 32 bits and long and pointer
23365 to 64 bits.
23367 @item -mcmodel=@var{which}
23368 @opindex mcmodel
23369 Set the code model to one of
23371 @table @samp
23372 @item medlow
23373 The Medium/Low code model: 64-bit addresses, programs
23374 must be linked in the low 32 bits of memory.  Programs can be statically
23375 or dynamically linked.
23377 @item medmid
23378 The Medium/Middle code model: 64-bit addresses, programs
23379 must be linked in the low 44 bits of memory, the text and data segments must
23380 be less than 2GB in size and the data segment must be located within 2GB of
23381 the text segment.
23383 @item medany
23384 The Medium/Anywhere code model: 64-bit addresses, programs
23385 may be linked anywhere in memory, the text and data segments must be less
23386 than 2GB in size and the data segment must be located within 2GB of the
23387 text segment.
23389 @item embmedany
23390 The Medium/Anywhere code model for embedded systems:
23391 64-bit addresses, the text and data segments must be less than 2GB in
23392 size, both starting anywhere in memory (determined at link time).  The
23393 global register %g4 points to the base of the data segment.  Programs
23394 are statically linked and PIC is not supported.
23395 @end table
23397 @item -mmemory-model=@var{mem-model}
23398 @opindex mmemory-model
23399 Set the memory model in force on the processor to one of
23401 @table @samp
23402 @item default
23403 The default memory model for the processor and operating system.
23405 @item rmo
23406 Relaxed Memory Order
23408 @item pso
23409 Partial Store Order
23411 @item tso
23412 Total Store Order
23414 @item sc
23415 Sequential Consistency
23416 @end table
23418 These memory models are formally defined in Appendix D of the Sparc V9
23419 architecture manual, as set in the processor's @code{PSTATE.MM} field.
23421 @item -mstack-bias
23422 @itemx -mno-stack-bias
23423 @opindex mstack-bias
23424 @opindex mno-stack-bias
23425 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
23426 frame pointer if present, are offset by @minus{}2047 which must be added back
23427 when making stack frame references.  This is the default in 64-bit mode.
23428 Otherwise, assume no such offset is present.
23429 @end table
23431 @node SPU Options
23432 @subsection SPU Options
23433 @cindex SPU options
23435 These @samp{-m} options are supported on the SPU:
23437 @table @gcctabopt
23438 @item -mwarn-reloc
23439 @itemx -merror-reloc
23440 @opindex mwarn-reloc
23441 @opindex merror-reloc
23443 The loader for SPU does not handle dynamic relocations.  By default, GCC
23444 gives an error when it generates code that requires a dynamic
23445 relocation.  @option{-mno-error-reloc} disables the error,
23446 @option{-mwarn-reloc} generates a warning instead.
23448 @item -msafe-dma
23449 @itemx -munsafe-dma
23450 @opindex msafe-dma
23451 @opindex munsafe-dma
23453 Instructions that initiate or test completion of DMA must not be
23454 reordered with respect to loads and stores of the memory that is being
23455 accessed.
23456 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
23457 memory accesses, but that can lead to inefficient code in places where the
23458 memory is known to not change.  Rather than mark the memory as volatile,
23459 you can use @option{-msafe-dma} to tell the compiler to treat
23460 the DMA instructions as potentially affecting all memory.  
23462 @item -mbranch-hints
23463 @opindex mbranch-hints
23465 By default, GCC generates a branch hint instruction to avoid
23466 pipeline stalls for always-taken or probably-taken branches.  A hint
23467 is not generated closer than 8 instructions away from its branch.
23468 There is little reason to disable them, except for debugging purposes,
23469 or to make an object a little bit smaller.
23471 @item -msmall-mem
23472 @itemx -mlarge-mem
23473 @opindex msmall-mem
23474 @opindex mlarge-mem
23476 By default, GCC generates code assuming that addresses are never larger
23477 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
23478 a full 32-bit address.
23480 @item -mstdmain
23481 @opindex mstdmain
23483 By default, GCC links against startup code that assumes the SPU-style
23484 main function interface (which has an unconventional parameter list).
23485 With @option{-mstdmain}, GCC links your program against startup
23486 code that assumes a C99-style interface to @code{main}, including a
23487 local copy of @code{argv} strings.
23489 @item -mfixed-range=@var{register-range}
23490 @opindex mfixed-range
23491 Generate code treating the given register range as fixed registers.
23492 A fixed register is one that the register allocator cannot use.  This is
23493 useful when compiling kernel code.  A register range is specified as
23494 two registers separated by a dash.  Multiple register ranges can be
23495 specified separated by a comma.
23497 @item -mea32
23498 @itemx -mea64
23499 @opindex mea32
23500 @opindex mea64
23501 Compile code assuming that pointers to the PPU address space accessed
23502 via the @code{__ea} named address space qualifier are either 32 or 64
23503 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
23504 all object code in an executable must be compiled with the same setting.
23506 @item -maddress-space-conversion
23507 @itemx -mno-address-space-conversion
23508 @opindex maddress-space-conversion
23509 @opindex mno-address-space-conversion
23510 Allow/disallow treating the @code{__ea} address space as superset
23511 of the generic address space.  This enables explicit type casts
23512 between @code{__ea} and generic pointer as well as implicit
23513 conversions of generic pointers to @code{__ea} pointers.  The
23514 default is to allow address space pointer conversions.
23516 @item -mcache-size=@var{cache-size}
23517 @opindex mcache-size
23518 This option controls the version of libgcc that the compiler links to an
23519 executable and selects a software-managed cache for accessing variables
23520 in the @code{__ea} address space with a particular cache size.  Possible
23521 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
23522 and @samp{128}.  The default cache size is 64KB.
23524 @item -matomic-updates
23525 @itemx -mno-atomic-updates
23526 @opindex matomic-updates
23527 @opindex mno-atomic-updates
23528 This option controls the version of libgcc that the compiler links to an
23529 executable and selects whether atomic updates to the software-managed
23530 cache of PPU-side variables are used.  If you use atomic updates, changes
23531 to a PPU variable from SPU code using the @code{__ea} named address space
23532 qualifier do not interfere with changes to other PPU variables residing
23533 in the same cache line from PPU code.  If you do not use atomic updates,
23534 such interference may occur; however, writing back cache lines is
23535 more efficient.  The default behavior is to use atomic updates.
23537 @item -mdual-nops
23538 @itemx -mdual-nops=@var{n}
23539 @opindex mdual-nops
23540 By default, GCC inserts NOPs to increase dual issue when it expects
23541 it to increase performance.  @var{n} can be a value from 0 to 10.  A
23542 smaller @var{n} inserts fewer NOPs.  10 is the default, 0 is the
23543 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
23545 @item -mhint-max-nops=@var{n}
23546 @opindex mhint-max-nops
23547 Maximum number of NOPs to insert for a branch hint.  A branch hint must
23548 be at least 8 instructions away from the branch it is affecting.  GCC
23549 inserts up to @var{n} NOPs to enforce this, otherwise it does not
23550 generate the branch hint.
23552 @item -mhint-max-distance=@var{n}
23553 @opindex mhint-max-distance
23554 The encoding of the branch hint instruction limits the hint to be within
23555 256 instructions of the branch it is affecting.  By default, GCC makes
23556 sure it is within 125.
23558 @item -msafe-hints
23559 @opindex msafe-hints
23560 Work around a hardware bug that causes the SPU to stall indefinitely.
23561 By default, GCC inserts the @code{hbrp} instruction to make sure
23562 this stall won't happen.
23564 @end table
23566 @node System V Options
23567 @subsection Options for System V
23569 These additional options are available on System V Release 4 for
23570 compatibility with other compilers on those systems:
23572 @table @gcctabopt
23573 @item -G
23574 @opindex G
23575 Create a shared object.
23576 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
23578 @item -Qy
23579 @opindex Qy
23580 Identify the versions of each tool used by the compiler, in a
23581 @code{.ident} assembler directive in the output.
23583 @item -Qn
23584 @opindex Qn
23585 Refrain from adding @code{.ident} directives to the output file (this is
23586 the default).
23588 @item -YP,@var{dirs}
23589 @opindex YP
23590 Search the directories @var{dirs}, and no others, for libraries
23591 specified with @option{-l}.
23593 @item -Ym,@var{dir}
23594 @opindex Ym
23595 Look in the directory @var{dir} to find the M4 preprocessor.
23596 The assembler uses this option.
23597 @c This is supposed to go with a -Yd for predefined M4 macro files, but
23598 @c the generic assembler that comes with Solaris takes just -Ym.
23599 @end table
23601 @node TILE-Gx Options
23602 @subsection TILE-Gx Options
23603 @cindex TILE-Gx options
23605 These @samp{-m} options are supported on the TILE-Gx:
23607 @table @gcctabopt
23608 @item -mcmodel=small
23609 @opindex mcmodel=small
23610 Generate code for the small model.  The distance for direct calls is
23611 limited to 500M in either direction.  PC-relative addresses are 32
23612 bits.  Absolute addresses support the full address range.
23614 @item -mcmodel=large
23615 @opindex mcmodel=large
23616 Generate code for the large model.  There is no limitation on call
23617 distance, pc-relative addresses, or absolute addresses.
23619 @item -mcpu=@var{name}
23620 @opindex mcpu
23621 Selects the type of CPU to be targeted.  Currently the only supported
23622 type is @samp{tilegx}.
23624 @item -m32
23625 @itemx -m64
23626 @opindex m32
23627 @opindex m64
23628 Generate code for a 32-bit or 64-bit environment.  The 32-bit
23629 environment sets int, long, and pointer to 32 bits.  The 64-bit
23630 environment sets int to 32 bits and long and pointer to 64 bits.
23632 @item -mbig-endian
23633 @itemx -mlittle-endian
23634 @opindex mbig-endian
23635 @opindex mlittle-endian
23636 Generate code in big/little endian mode, respectively.
23637 @end table
23639 @node TILEPro Options
23640 @subsection TILEPro Options
23641 @cindex TILEPro options
23643 These @samp{-m} options are supported on the TILEPro:
23645 @table @gcctabopt
23646 @item -mcpu=@var{name}
23647 @opindex mcpu
23648 Selects the type of CPU to be targeted.  Currently the only supported
23649 type is @samp{tilepro}.
23651 @item -m32
23652 @opindex m32
23653 Generate code for a 32-bit environment, which sets int, long, and
23654 pointer to 32 bits.  This is the only supported behavior so the flag
23655 is essentially ignored.
23656 @end table
23658 @node V850 Options
23659 @subsection V850 Options
23660 @cindex V850 Options
23662 These @samp{-m} options are defined for V850 implementations:
23664 @table @gcctabopt
23665 @item -mlong-calls
23666 @itemx -mno-long-calls
23667 @opindex mlong-calls
23668 @opindex mno-long-calls
23669 Treat all calls as being far away (near).  If calls are assumed to be
23670 far away, the compiler always loads the function's address into a
23671 register, and calls indirect through the pointer.
23673 @item -mno-ep
23674 @itemx -mep
23675 @opindex mno-ep
23676 @opindex mep
23677 Do not optimize (do optimize) basic blocks that use the same index
23678 pointer 4 or more times to copy pointer into the @code{ep} register, and
23679 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
23680 option is on by default if you optimize.
23682 @item -mno-prolog-function
23683 @itemx -mprolog-function
23684 @opindex mno-prolog-function
23685 @opindex mprolog-function
23686 Do not use (do use) external functions to save and restore registers
23687 at the prologue and epilogue of a function.  The external functions
23688 are slower, but use less code space if more than one function saves
23689 the same number of registers.  The @option{-mprolog-function} option
23690 is on by default if you optimize.
23692 @item -mspace
23693 @opindex mspace
23694 Try to make the code as small as possible.  At present, this just turns
23695 on the @option{-mep} and @option{-mprolog-function} options.
23697 @item -mtda=@var{n}
23698 @opindex mtda
23699 Put static or global variables whose size is @var{n} bytes or less into
23700 the tiny data area that register @code{ep} points to.  The tiny data
23701 area can hold up to 256 bytes in total (128 bytes for byte references).
23703 @item -msda=@var{n}
23704 @opindex msda
23705 Put static or global variables whose size is @var{n} bytes or less into
23706 the small data area that register @code{gp} points to.  The small data
23707 area can hold up to 64 kilobytes.
23709 @item -mzda=@var{n}
23710 @opindex mzda
23711 Put static or global variables whose size is @var{n} bytes or less into
23712 the first 32 kilobytes of memory.
23714 @item -mv850
23715 @opindex mv850
23716 Specify that the target processor is the V850.
23718 @item -mv850e3v5
23719 @opindex mv850e3v5
23720 Specify that the target processor is the V850E3V5.  The preprocessor
23721 constant @code{__v850e3v5__} is defined if this option is used.
23723 @item -mv850e2v4
23724 @opindex mv850e2v4
23725 Specify that the target processor is the V850E3V5.  This is an alias for
23726 the @option{-mv850e3v5} option.
23728 @item -mv850e2v3
23729 @opindex mv850e2v3
23730 Specify that the target processor is the V850E2V3.  The preprocessor
23731 constant @code{__v850e2v3__} is defined if this option is used.
23733 @item -mv850e2
23734 @opindex mv850e2
23735 Specify that the target processor is the V850E2.  The preprocessor
23736 constant @code{__v850e2__} is defined if this option is used.
23738 @item -mv850e1
23739 @opindex mv850e1
23740 Specify that the target processor is the V850E1.  The preprocessor
23741 constants @code{__v850e1__} and @code{__v850e__} are defined if
23742 this option is used.
23744 @item -mv850es
23745 @opindex mv850es
23746 Specify that the target processor is the V850ES.  This is an alias for
23747 the @option{-mv850e1} option.
23749 @item -mv850e
23750 @opindex mv850e
23751 Specify that the target processor is the V850E@.  The preprocessor
23752 constant @code{__v850e__} is defined if this option is used.
23754 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
23755 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
23756 are defined then a default target processor is chosen and the
23757 relevant @samp{__v850*__} preprocessor constant is defined.
23759 The preprocessor constants @code{__v850} and @code{__v851__} are always
23760 defined, regardless of which processor variant is the target.
23762 @item -mdisable-callt
23763 @itemx -mno-disable-callt
23764 @opindex mdisable-callt
23765 @opindex mno-disable-callt
23766 This option suppresses generation of the @code{CALLT} instruction for the
23767 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
23768 architecture.
23770 This option is enabled by default when the RH850 ABI is
23771 in use (see @option{-mrh850-abi}), and disabled by default when the
23772 GCC ABI is in use.  If @code{CALLT} instructions are being generated
23773 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
23775 @item -mrelax
23776 @itemx -mno-relax
23777 @opindex mrelax
23778 @opindex mno-relax
23779 Pass on (or do not pass on) the @option{-mrelax} command-line option
23780 to the assembler.
23782 @item -mlong-jumps
23783 @itemx -mno-long-jumps
23784 @opindex mlong-jumps
23785 @opindex mno-long-jumps
23786 Disable (or re-enable) the generation of PC-relative jump instructions.
23788 @item -msoft-float
23789 @itemx -mhard-float
23790 @opindex msoft-float
23791 @opindex mhard-float
23792 Disable (or re-enable) the generation of hardware floating point
23793 instructions.  This option is only significant when the target
23794 architecture is @samp{V850E2V3} or higher.  If hardware floating point
23795 instructions are being generated then the C preprocessor symbol
23796 @code{__FPU_OK__} is defined, otherwise the symbol
23797 @code{__NO_FPU__} is defined.
23799 @item -mloop
23800 @opindex mloop
23801 Enables the use of the e3v5 LOOP instruction.  The use of this
23802 instruction is not enabled by default when the e3v5 architecture is
23803 selected because its use is still experimental.
23805 @item -mrh850-abi
23806 @itemx -mghs
23807 @opindex mrh850-abi
23808 @opindex mghs
23809 Enables support for the RH850 version of the V850 ABI.  This is the
23810 default.  With this version of the ABI the following rules apply:
23812 @itemize
23813 @item
23814 Integer sized structures and unions are returned via a memory pointer
23815 rather than a register.
23817 @item
23818 Large structures and unions (more than 8 bytes in size) are passed by
23819 value.
23821 @item
23822 Functions are aligned to 16-bit boundaries.
23824 @item
23825 The @option{-m8byte-align} command-line option is supported.
23827 @item
23828 The @option{-mdisable-callt} command-line option is enabled by
23829 default.  The @option{-mno-disable-callt} command-line option is not
23830 supported.
23831 @end itemize
23833 When this version of the ABI is enabled the C preprocessor symbol
23834 @code{__V850_RH850_ABI__} is defined.
23836 @item -mgcc-abi
23837 @opindex mgcc-abi
23838 Enables support for the old GCC version of the V850 ABI.  With this
23839 version of the ABI the following rules apply:
23841 @itemize
23842 @item
23843 Integer sized structures and unions are returned in register @code{r10}.
23845 @item
23846 Large structures and unions (more than 8 bytes in size) are passed by
23847 reference.
23849 @item
23850 Functions are aligned to 32-bit boundaries, unless optimizing for
23851 size.
23853 @item
23854 The @option{-m8byte-align} command-line option is not supported.
23856 @item
23857 The @option{-mdisable-callt} command-line option is supported but not
23858 enabled by default.
23859 @end itemize
23861 When this version of the ABI is enabled the C preprocessor symbol
23862 @code{__V850_GCC_ABI__} is defined.
23864 @item -m8byte-align
23865 @itemx -mno-8byte-align
23866 @opindex m8byte-align
23867 @opindex mno-8byte-align
23868 Enables support for @code{double} and @code{long long} types to be
23869 aligned on 8-byte boundaries.  The default is to restrict the
23870 alignment of all objects to at most 4-bytes.  When
23871 @option{-m8byte-align} is in effect the C preprocessor symbol
23872 @code{__V850_8BYTE_ALIGN__} is defined.
23874 @item -mbig-switch
23875 @opindex mbig-switch
23876 Generate code suitable for big switch tables.  Use this option only if
23877 the assembler/linker complain about out of range branches within a switch
23878 table.
23880 @item -mapp-regs
23881 @opindex mapp-regs
23882 This option causes r2 and r5 to be used in the code generated by
23883 the compiler.  This setting is the default.
23885 @item -mno-app-regs
23886 @opindex mno-app-regs
23887 This option causes r2 and r5 to be treated as fixed registers.
23889 @end table
23891 @node VAX Options
23892 @subsection VAX Options
23893 @cindex VAX options
23895 These @samp{-m} options are defined for the VAX:
23897 @table @gcctabopt
23898 @item -munix
23899 @opindex munix
23900 Do not output certain jump instructions (@code{aobleq} and so on)
23901 that the Unix assembler for the VAX cannot handle across long
23902 ranges.
23904 @item -mgnu
23905 @opindex mgnu
23906 Do output those jump instructions, on the assumption that the
23907 GNU assembler is being used.
23909 @item -mg
23910 @opindex mg
23911 Output code for G-format floating-point numbers instead of D-format.
23912 @end table
23914 @node Visium Options
23915 @subsection Visium Options
23916 @cindex Visium options
23918 @table @gcctabopt
23920 @item -mdebug
23921 @opindex mdebug
23922 A program which performs file I/O and is destined to run on an MCM target
23923 should be linked with this option.  It causes the libraries libc.a and
23924 libdebug.a to be linked.  The program should be run on the target under
23925 the control of the GDB remote debugging stub.
23927 @item -msim
23928 @opindex msim
23929 A program which performs file I/O and is destined to run on the simulator
23930 should be linked with option.  This causes libraries libc.a and libsim.a to
23931 be linked.
23933 @item -mfpu
23934 @itemx -mhard-float
23935 @opindex mfpu
23936 @opindex mhard-float
23937 Generate code containing floating-point instructions.  This is the
23938 default.
23940 @item -mno-fpu
23941 @itemx -msoft-float
23942 @opindex mno-fpu
23943 @opindex msoft-float
23944 Generate code containing library calls for floating-point.
23946 @option{-msoft-float} changes the calling convention in the output file;
23947 therefore, it is only useful if you compile @emph{all} of a program with
23948 this option.  In particular, you need to compile @file{libgcc.a}, the
23949 library that comes with GCC, with @option{-msoft-float} in order for
23950 this to work.
23952 @item -mcpu=@var{cpu_type}
23953 @opindex mcpu
23954 Set the instruction set, register set, and instruction scheduling parameters
23955 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
23956 @samp{mcm}, @samp{gr5} and @samp{gr6}.
23958 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
23960 By default (unless configured otherwise), GCC generates code for the GR5
23961 variant of the Visium architecture.  
23963 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
23964 architecture.  The only difference from GR5 code is that the compiler will
23965 generate block move instructions.
23967 @item -mtune=@var{cpu_type}
23968 @opindex mtune
23969 Set the instruction scheduling parameters for machine type @var{cpu_type},
23970 but do not set the instruction set or register set that the option
23971 @option{-mcpu=@var{cpu_type}} would.
23973 @item -msv-mode
23974 @opindex msv-mode
23975 Generate code for the supervisor mode, where there are no restrictions on
23976 the access to general registers.  This is the default.
23978 @item -muser-mode
23979 @opindex muser-mode
23980 Generate code for the user mode, where the access to some general registers
23981 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
23982 mode; on the GR6, only registers r29 to r31 are affected.
23983 @end table
23985 @node VMS Options
23986 @subsection VMS Options
23988 These @samp{-m} options are defined for the VMS implementations:
23990 @table @gcctabopt
23991 @item -mvms-return-codes
23992 @opindex mvms-return-codes
23993 Return VMS condition codes from @code{main}. The default is to return POSIX-style
23994 condition (e.g.@ error) codes.
23996 @item -mdebug-main=@var{prefix}
23997 @opindex mdebug-main=@var{prefix}
23998 Flag the first routine whose name starts with @var{prefix} as the main
23999 routine for the debugger.
24001 @item -mmalloc64
24002 @opindex mmalloc64
24003 Default to 64-bit memory allocation routines.
24005 @item -mpointer-size=@var{size}
24006 @opindex mpointer-size=@var{size}
24007 Set the default size of pointers. Possible options for @var{size} are
24008 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
24009 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
24010 The later option disables @code{pragma pointer_size}.
24011 @end table
24013 @node VxWorks Options
24014 @subsection VxWorks Options
24015 @cindex VxWorks Options
24017 The options in this section are defined for all VxWorks targets.
24018 Options specific to the target hardware are listed with the other
24019 options for that target.
24021 @table @gcctabopt
24022 @item -mrtp
24023 @opindex mrtp
24024 GCC can generate code for both VxWorks kernels and real time processes
24025 (RTPs).  This option switches from the former to the latter.  It also
24026 defines the preprocessor macro @code{__RTP__}.
24028 @item -non-static
24029 @opindex non-static
24030 Link an RTP executable against shared libraries rather than static
24031 libraries.  The options @option{-static} and @option{-shared} can
24032 also be used for RTPs (@pxref{Link Options}); @option{-static}
24033 is the default.
24035 @item -Bstatic
24036 @itemx -Bdynamic
24037 @opindex Bstatic
24038 @opindex Bdynamic
24039 These options are passed down to the linker.  They are defined for
24040 compatibility with Diab.
24042 @item -Xbind-lazy
24043 @opindex Xbind-lazy
24044 Enable lazy binding of function calls.  This option is equivalent to
24045 @option{-Wl,-z,now} and is defined for compatibility with Diab.
24047 @item -Xbind-now
24048 @opindex Xbind-now
24049 Disable lazy binding of function calls.  This option is the default and
24050 is defined for compatibility with Diab.
24051 @end table
24053 @node x86 Options
24054 @subsection x86 Options
24055 @cindex x86 Options
24057 These @samp{-m} options are defined for the x86 family of computers.
24059 @table @gcctabopt
24061 @item -march=@var{cpu-type}
24062 @opindex march
24063 Generate instructions for the machine type @var{cpu-type}.  In contrast to
24064 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
24065 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
24066 to generate code that may not run at all on processors other than the one
24067 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
24068 @option{-mtune=@var{cpu-type}}.
24070 The choices for @var{cpu-type} are:
24072 @table @samp
24073 @item native
24074 This selects the CPU to generate code for at compilation time by determining
24075 the processor type of the compiling machine.  Using @option{-march=native}
24076 enables all instruction subsets supported by the local machine (hence
24077 the result might not run on different machines).  Using @option{-mtune=native}
24078 produces code optimized for the local machine under the constraints
24079 of the selected instruction set.  
24081 @item i386
24082 Original Intel i386 CPU@.
24084 @item i486
24085 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
24087 @item i586
24088 @itemx pentium
24089 Intel Pentium CPU with no MMX support.
24091 @item lakemont
24092 Intel Lakemont MCU, based on Intel Pentium CPU.
24094 @item pentium-mmx
24095 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
24097 @item pentiumpro
24098 Intel Pentium Pro CPU@.
24100 @item i686
24101 When used with @option{-march}, the Pentium Pro
24102 instruction set is used, so the code runs on all i686 family chips.
24103 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
24105 @item pentium2
24106 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
24107 support.
24109 @item pentium3
24110 @itemx pentium3m
24111 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
24112 set support.
24114 @item pentium-m
24115 Intel Pentium M; low-power version of Intel Pentium III CPU
24116 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
24118 @item pentium4
24119 @itemx pentium4m
24120 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
24122 @item prescott
24123 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
24124 set support.
24126 @item nocona
24127 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
24128 SSE2 and SSE3 instruction set support.
24130 @item core2
24131 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
24132 instruction set support.
24134 @item nehalem
24135 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24136 SSE4.1, SSE4.2 and POPCNT instruction set support.
24138 @item westmere
24139 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24140 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
24142 @item sandybridge
24143 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24144 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
24146 @item ivybridge
24147 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24148 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
24149 instruction set support.
24151 @item haswell
24152 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24153 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24154 BMI, BMI2 and F16C instruction set support.
24156 @item broadwell
24157 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24158 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24159 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
24161 @item skylake
24162 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24163 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24164 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
24165 XSAVES instruction set support.
24167 @item bonnell
24168 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
24169 instruction set support.
24171 @item silvermont
24172 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24173 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
24175 @item knl
24176 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
24177 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24178 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
24179 AVX512CD instruction set support.
24181 @item skylake-avx512
24182 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
24183 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24184 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
24185 AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
24187 @item k6
24188 AMD K6 CPU with MMX instruction set support.
24190 @item k6-2
24191 @itemx k6-3
24192 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
24194 @item athlon
24195 @itemx athlon-tbird
24196 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
24197 support.
24199 @item athlon-4
24200 @itemx athlon-xp
24201 @itemx athlon-mp
24202 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
24203 instruction set support.
24205 @item k8
24206 @itemx opteron
24207 @itemx athlon64
24208 @itemx athlon-fx
24209 Processors based on the AMD K8 core with x86-64 instruction set support,
24210 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
24211 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
24212 instruction set extensions.)
24214 @item k8-sse3
24215 @itemx opteron-sse3
24216 @itemx athlon64-sse3
24217 Improved versions of AMD K8 cores with SSE3 instruction set support.
24219 @item amdfam10
24220 @itemx barcelona
24221 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
24222 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
24223 instruction set extensions.)
24225 @item bdver1
24226 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
24227 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
24228 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
24229 @item bdver2
24230 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
24231 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
24232 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
24233 extensions.)
24234 @item bdver3
24235 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
24236 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
24237 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
24238 64-bit instruction set extensions.
24239 @item bdver4
24240 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
24241 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
24242 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
24243 SSE4.2, ABM and 64-bit instruction set extensions.
24245 @item znver1
24246 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
24247 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
24248 SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
24249 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
24250 instruction set extensions.
24252 @item btver1
24253 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
24254 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
24255 instruction set extensions.)
24257 @item btver2
24258 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
24259 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
24260 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
24262 @item winchip-c6
24263 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
24264 set support.
24266 @item winchip2
24267 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
24268 instruction set support.
24270 @item c3
24271 VIA C3 CPU with MMX and 3DNow!@: instruction set support.
24272 (No scheduling is implemented for this chip.)
24274 @item c3-2
24275 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
24276 (No scheduling is implemented for this chip.)
24278 @item c7
24279 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
24280 (No scheduling is implemented for this chip.)
24282 @item samuel-2
24283 VIA Eden Samuel 2 CPU with MMX and 3DNow!@: instruction set support.
24284 (No scheduling is implemented for this chip.)
24286 @item nehemiah
24287 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
24288 (No scheduling is implemented for this chip.)
24290 @item esther
24291 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
24292 (No scheduling is implemented for this chip.)
24294 @item eden-x2
24295 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3 instruction set support.
24296 (No scheduling is implemented for this chip.)
24298 @item eden-x4
24299 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2,
24300 AVX and AVX2 instruction set support.
24301 (No scheduling is implemented for this chip.)
24303 @item nano
24304 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
24305 instruction set support.
24306 (No scheduling is implemented for this chip.)
24308 @item nano-1000
24309 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
24310 instruction set support.
24311 (No scheduling is implemented for this chip.)
24313 @item nano-2000
24314 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
24315 instruction set support.
24316 (No scheduling is implemented for this chip.)
24318 @item nano-3000
24319 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
24320 instruction set support.
24321 (No scheduling is implemented for this chip.)
24323 @item nano-x2
24324 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
24325 instruction set support.
24326 (No scheduling is implemented for this chip.)
24328 @item nano-x4
24329 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
24330 instruction set support.
24331 (No scheduling is implemented for this chip.)
24333 @item geode
24334 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
24335 @end table
24337 @item -mtune=@var{cpu-type}
24338 @opindex mtune
24339 Tune to @var{cpu-type} everything applicable about the generated code, except
24340 for the ABI and the set of available instructions.  
24341 While picking a specific @var{cpu-type} schedules things appropriately
24342 for that particular chip, the compiler does not generate any code that
24343 cannot run on the default machine type unless you use a
24344 @option{-march=@var{cpu-type}} option.
24345 For example, if GCC is configured for i686-pc-linux-gnu
24346 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
24347 but still runs on i686 machines.
24349 The choices for @var{cpu-type} are the same as for @option{-march}.
24350 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
24352 @table @samp
24353 @item generic
24354 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
24355 If you know the CPU on which your code will run, then you should use
24356 the corresponding @option{-mtune} or @option{-march} option instead of
24357 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
24358 of your application will have, then you should use this option.
24360 As new processors are deployed in the marketplace, the behavior of this
24361 option will change.  Therefore, if you upgrade to a newer version of
24362 GCC, code generation controlled by this option will change to reflect
24363 the processors
24364 that are most common at the time that version of GCC is released.
24366 There is no @option{-march=generic} option because @option{-march}
24367 indicates the instruction set the compiler can use, and there is no
24368 generic instruction set applicable to all processors.  In contrast,
24369 @option{-mtune} indicates the processor (or, in this case, collection of
24370 processors) for which the code is optimized.
24372 @item intel
24373 Produce code optimized for the most current Intel processors, which are
24374 Haswell and Silvermont for this version of GCC.  If you know the CPU
24375 on which your code will run, then you should use the corresponding
24376 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
24377 But, if you want your application performs better on both Haswell and
24378 Silvermont, then you should use this option.
24380 As new Intel processors are deployed in the marketplace, the behavior of
24381 this option will change.  Therefore, if you upgrade to a newer version of
24382 GCC, code generation controlled by this option will change to reflect
24383 the most current Intel processors at the time that version of GCC is
24384 released.
24386 There is no @option{-march=intel} option because @option{-march} indicates
24387 the instruction set the compiler can use, and there is no common
24388 instruction set applicable to all processors.  In contrast,
24389 @option{-mtune} indicates the processor (or, in this case, collection of
24390 processors) for which the code is optimized.
24391 @end table
24393 @item -mcpu=@var{cpu-type}
24394 @opindex mcpu
24395 A deprecated synonym for @option{-mtune}.
24397 @item -mfpmath=@var{unit}
24398 @opindex mfpmath
24399 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
24400 for @var{unit} are:
24402 @table @samp
24403 @item 387
24404 Use the standard 387 floating-point coprocessor present on the majority of chips and
24405 emulated otherwise.  Code compiled with this option runs almost everywhere.
24406 The temporary results are computed in 80-bit precision instead of the precision
24407 specified by the type, resulting in slightly different results compared to most
24408 of other chips.  See @option{-ffloat-store} for more detailed description.
24410 This is the default choice for x86-32 targets.
24412 @item sse
24413 Use scalar floating-point instructions present in the SSE instruction set.
24414 This instruction set is supported by Pentium III and newer chips,
24415 and in the AMD line
24416 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
24417 instruction set supports only single-precision arithmetic, thus the double and
24418 extended-precision arithmetic are still done using 387.  A later version, present
24419 only in Pentium 4 and AMD x86-64 chips, supports double-precision
24420 arithmetic too.
24422 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
24423 or @option{-msse2} switches to enable SSE extensions and make this option
24424 effective.  For the x86-64 compiler, these extensions are enabled by default.
24426 The resulting code should be considerably faster in the majority of cases and avoid
24427 the numerical instability problems of 387 code, but may break some existing
24428 code that expects temporaries to be 80 bits.
24430 This is the default choice for the x86-64 compiler.
24432 @item sse,387
24433 @itemx sse+387
24434 @itemx both
24435 Attempt to utilize both instruction sets at once.  This effectively doubles the
24436 amount of available registers, and on chips with separate execution units for
24437 387 and SSE the execution resources too.  Use this option with care, as it is
24438 still experimental, because the GCC register allocator does not model separate
24439 functional units well, resulting in unstable performance.
24440 @end table
24442 @item -masm=@var{dialect}
24443 @opindex masm=@var{dialect}
24444 Output assembly instructions using selected @var{dialect}.  Also affects
24445 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
24446 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
24447 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
24448 not support @samp{intel}.
24450 @item -mieee-fp
24451 @itemx -mno-ieee-fp
24452 @opindex mieee-fp
24453 @opindex mno-ieee-fp
24454 Control whether or not the compiler uses IEEE floating-point
24455 comparisons.  These correctly handle the case where the result of a
24456 comparison is unordered.
24458 @item -m80387
24459 @item -mhard-float
24460 @opindex 80387
24461 @opindex mhard-float
24462 Generate output containing 80387 instructions for floating point.
24464 @item -mno-80387
24465 @item -msoft-float
24466 @opindex no-80387
24467 @opindex msoft-float
24468 Generate output containing library calls for floating point.
24470 @strong{Warning:} the requisite libraries are not part of GCC@.
24471 Normally the facilities of the machine's usual C compiler are used, but
24472 this can't be done directly in cross-compilation.  You must make your
24473 own arrangements to provide suitable library functions for
24474 cross-compilation.
24476 On machines where a function returns floating-point results in the 80387
24477 register stack, some floating-point opcodes may be emitted even if
24478 @option{-msoft-float} is used.
24480 @item -mno-fp-ret-in-387
24481 @opindex mno-fp-ret-in-387
24482 Do not use the FPU registers for return values of functions.
24484 The usual calling convention has functions return values of types
24485 @code{float} and @code{double} in an FPU register, even if there
24486 is no FPU@.  The idea is that the operating system should emulate
24487 an FPU@.
24489 The option @option{-mno-fp-ret-in-387} causes such values to be returned
24490 in ordinary CPU registers instead.
24492 @item -mno-fancy-math-387
24493 @opindex mno-fancy-math-387
24494 Some 387 emulators do not support the @code{sin}, @code{cos} and
24495 @code{sqrt} instructions for the 387.  Specify this option to avoid
24496 generating those instructions.  This option is the default on
24497 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
24498 indicates that the target CPU always has an FPU and so the
24499 instruction does not need emulation.  These
24500 instructions are not generated unless you also use the
24501 @option{-funsafe-math-optimizations} switch.
24503 @item -malign-double
24504 @itemx -mno-align-double
24505 @opindex malign-double
24506 @opindex mno-align-double
24507 Control whether GCC aligns @code{double}, @code{long double}, and
24508 @code{long long} variables on a two-word boundary or a one-word
24509 boundary.  Aligning @code{double} variables on a two-word boundary
24510 produces code that runs somewhat faster on a Pentium at the
24511 expense of more memory.
24513 On x86-64, @option{-malign-double} is enabled by default.
24515 @strong{Warning:} if you use the @option{-malign-double} switch,
24516 structures containing the above types are aligned differently than
24517 the published application binary interface specifications for the x86-32
24518 and are not binary compatible with structures in code compiled
24519 without that switch.
24521 @item -m96bit-long-double
24522 @itemx -m128bit-long-double
24523 @opindex m96bit-long-double
24524 @opindex m128bit-long-double
24525 These switches control the size of @code{long double} type.  The x86-32
24526 application binary interface specifies the size to be 96 bits,
24527 so @option{-m96bit-long-double} is the default in 32-bit mode.
24529 Modern architectures (Pentium and newer) prefer @code{long double}
24530 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
24531 conforming to the ABI, this is not possible.  So specifying
24532 @option{-m128bit-long-double} aligns @code{long double}
24533 to a 16-byte boundary by padding the @code{long double} with an additional
24534 32-bit zero.
24536 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
24537 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
24539 Notice that neither of these options enable any extra precision over the x87
24540 standard of 80 bits for a @code{long double}.
24542 @strong{Warning:} if you override the default value for your target ABI, this
24543 changes the size of 
24544 structures and arrays containing @code{long double} variables,
24545 as well as modifying the function calling convention for functions taking
24546 @code{long double}.  Hence they are not binary-compatible
24547 with code compiled without that switch.
24549 @item -mlong-double-64
24550 @itemx -mlong-double-80
24551 @itemx -mlong-double-128
24552 @opindex mlong-double-64
24553 @opindex mlong-double-80
24554 @opindex mlong-double-128
24555 These switches control the size of @code{long double} type. A size
24556 of 64 bits makes the @code{long double} type equivalent to the @code{double}
24557 type. This is the default for 32-bit Bionic C library.  A size
24558 of 128 bits makes the @code{long double} type equivalent to the
24559 @code{__float128} type. This is the default for 64-bit Bionic C library.
24561 @strong{Warning:} if you override the default value for your target ABI, this
24562 changes the size of
24563 structures and arrays containing @code{long double} variables,
24564 as well as modifying the function calling convention for functions taking
24565 @code{long double}.  Hence they are not binary-compatible
24566 with code compiled without that switch.
24568 @item -malign-data=@var{type}
24569 @opindex malign-data
24570 Control how GCC aligns variables.  Supported values for @var{type} are
24571 @samp{compat} uses increased alignment value compatible uses GCC 4.8
24572 and earlier, @samp{abi} uses alignment value as specified by the
24573 psABI, and @samp{cacheline} uses increased alignment value to match
24574 the cache line size.  @samp{compat} is the default.
24576 @item -mlarge-data-threshold=@var{threshold}
24577 @opindex mlarge-data-threshold
24578 When @option{-mcmodel=medium} is specified, data objects larger than
24579 @var{threshold} are placed in the large data section.  This value must be the
24580 same across all objects linked into the binary, and defaults to 65535.
24582 @item -mrtd
24583 @opindex mrtd
24584 Use a different function-calling convention, in which functions that
24585 take a fixed number of arguments return with the @code{ret @var{num}}
24586 instruction, which pops their arguments while returning.  This saves one
24587 instruction in the caller since there is no need to pop the arguments
24588 there.
24590 You can specify that an individual function is called with this calling
24591 sequence with the function attribute @code{stdcall}.  You can also
24592 override the @option{-mrtd} option by using the function attribute
24593 @code{cdecl}.  @xref{Function Attributes}.
24595 @strong{Warning:} this calling convention is incompatible with the one
24596 normally used on Unix, so you cannot use it if you need to call
24597 libraries compiled with the Unix compiler.
24599 Also, you must provide function prototypes for all functions that
24600 take variable numbers of arguments (including @code{printf});
24601 otherwise incorrect code is generated for calls to those
24602 functions.
24604 In addition, seriously incorrect code results if you call a
24605 function with too many arguments.  (Normally, extra arguments are
24606 harmlessly ignored.)
24608 @item -mregparm=@var{num}
24609 @opindex mregparm
24610 Control how many registers are used to pass integer arguments.  By
24611 default, no registers are used to pass arguments, and at most 3
24612 registers can be used.  You can control this behavior for a specific
24613 function by using the function attribute @code{regparm}.
24614 @xref{Function Attributes}.
24616 @strong{Warning:} if you use this switch, and
24617 @var{num} is nonzero, then you must build all modules with the same
24618 value, including any libraries.  This includes the system libraries and
24619 startup modules.
24621 @item -msseregparm
24622 @opindex msseregparm
24623 Use SSE register passing conventions for float and double arguments
24624 and return values.  You can control this behavior for a specific
24625 function by using the function attribute @code{sseregparm}.
24626 @xref{Function Attributes}.
24628 @strong{Warning:} if you use this switch then you must build all
24629 modules with the same value, including any libraries.  This includes
24630 the system libraries and startup modules.
24632 @item -mvect8-ret-in-mem
24633 @opindex mvect8-ret-in-mem
24634 Return 8-byte vectors in memory instead of MMX registers.  This is the
24635 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
24636 Studio compilers until version 12.  Later compiler versions (starting
24637 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
24638 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
24639 you need to remain compatible with existing code produced by those
24640 previous compiler versions or older versions of GCC@.
24642 @item -mpc32
24643 @itemx -mpc64
24644 @itemx -mpc80
24645 @opindex mpc32
24646 @opindex mpc64
24647 @opindex mpc80
24649 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
24650 is specified, the significands of results of floating-point operations are
24651 rounded to 24 bits (single precision); @option{-mpc64} rounds the
24652 significands of results of floating-point operations to 53 bits (double
24653 precision) and @option{-mpc80} rounds the significands of results of
24654 floating-point operations to 64 bits (extended double precision), which is
24655 the default.  When this option is used, floating-point operations in higher
24656 precisions are not available to the programmer without setting the FPU
24657 control word explicitly.
24659 Setting the rounding of floating-point operations to less than the default
24660 80 bits can speed some programs by 2% or more.  Note that some mathematical
24661 libraries assume that extended-precision (80-bit) floating-point operations
24662 are enabled by default; routines in such libraries could suffer significant
24663 loss of accuracy, typically through so-called ``catastrophic cancellation'',
24664 when this option is used to set the precision to less than extended precision.
24666 @item -mstackrealign
24667 @opindex mstackrealign
24668 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
24669 option generates an alternate prologue and epilogue that realigns the
24670 run-time stack if necessary.  This supports mixing legacy codes that keep
24671 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
24672 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
24673 applicable to individual functions.
24675 @item -mpreferred-stack-boundary=@var{num}
24676 @opindex mpreferred-stack-boundary
24677 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
24678 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
24679 the default is 4 (16 bytes or 128 bits).
24681 @strong{Warning:} When generating code for the x86-64 architecture with
24682 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
24683 used to keep the stack boundary aligned to 8 byte boundary.  Since
24684 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
24685 intended to be used in controlled environment where stack space is
24686 important limitation.  This option leads to wrong code when functions
24687 compiled with 16 byte stack alignment (such as functions from a standard
24688 library) are called with misaligned stack.  In this case, SSE
24689 instructions may lead to misaligned memory access traps.  In addition,
24690 variable arguments are handled incorrectly for 16 byte aligned
24691 objects (including x87 long double and __int128), leading to wrong
24692 results.  You must build all modules with
24693 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
24694 includes the system libraries and startup modules.
24696 @item -mincoming-stack-boundary=@var{num}
24697 @opindex mincoming-stack-boundary
24698 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
24699 boundary.  If @option{-mincoming-stack-boundary} is not specified,
24700 the one specified by @option{-mpreferred-stack-boundary} is used.
24702 On Pentium and Pentium Pro, @code{double} and @code{long double} values
24703 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
24704 suffer significant run time performance penalties.  On Pentium III, the
24705 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
24706 properly if it is not 16-byte aligned.
24708 To ensure proper alignment of this values on the stack, the stack boundary
24709 must be as aligned as that required by any value stored on the stack.
24710 Further, every function must be generated such that it keeps the stack
24711 aligned.  Thus calling a function compiled with a higher preferred
24712 stack boundary from a function compiled with a lower preferred stack
24713 boundary most likely misaligns the stack.  It is recommended that
24714 libraries that use callbacks always use the default setting.
24716 This extra alignment does consume extra stack space, and generally
24717 increases code size.  Code that is sensitive to stack space usage, such
24718 as embedded systems and operating system kernels, may want to reduce the
24719 preferred alignment to @option{-mpreferred-stack-boundary=2}.
24721 @need 200
24722 @item -mmmx
24723 @opindex mmmx
24724 @need 200
24725 @itemx -msse
24726 @opindex msse
24727 @need 200
24728 @itemx -msse2
24729 @opindex msse2
24730 @need 200
24731 @itemx -msse3
24732 @opindex msse3
24733 @need 200
24734 @itemx -mssse3
24735 @opindex mssse3
24736 @need 200
24737 @itemx -msse4
24738 @opindex msse4
24739 @need 200
24740 @itemx -msse4a
24741 @opindex msse4a
24742 @need 200
24743 @itemx -msse4.1
24744 @opindex msse4.1
24745 @need 200
24746 @itemx -msse4.2
24747 @opindex msse4.2
24748 @need 200
24749 @itemx -mavx
24750 @opindex mavx
24751 @need 200
24752 @itemx -mavx2
24753 @opindex mavx2
24754 @need 200
24755 @itemx -mavx512f
24756 @opindex mavx512f
24757 @need 200
24758 @itemx -mavx512pf
24759 @opindex mavx512pf
24760 @need 200
24761 @itemx -mavx512er
24762 @opindex mavx512er
24763 @need 200
24764 @itemx -mavx512cd
24765 @opindex mavx512cd
24766 @need 200
24767 @itemx -mavx512vl
24768 @opindex mavx512vl
24769 @need 200
24770 @itemx -mavx512bw
24771 @opindex mavx512bw
24772 @need 200
24773 @itemx -mavx512dq
24774 @opindex mavx512dq
24775 @need 200
24776 @itemx -mavx512ifma
24777 @opindex mavx512ifma
24778 @need 200
24779 @itemx -mavx512vbmi
24780 @opindex mavx512vbmi
24781 @need 200
24782 @itemx -msha
24783 @opindex msha
24784 @need 200
24785 @itemx -maes
24786 @opindex maes
24787 @need 200
24788 @itemx -mpclmul
24789 @opindex mpclmul
24790 @need 200
24791 @itemx -mclfushopt
24792 @opindex mclfushopt
24793 @need 200
24794 @itemx -mfsgsbase
24795 @opindex mfsgsbase
24796 @need 200
24797 @itemx -mrdrnd
24798 @opindex mrdrnd
24799 @need 200
24800 @itemx -mf16c
24801 @opindex mf16c
24802 @need 200
24803 @itemx -mfma
24804 @opindex mfma
24805 @need 200
24806 @itemx -mfma4
24807 @opindex mfma4
24808 @need 200
24809 @itemx -mprefetchwt1
24810 @opindex mprefetchwt1
24811 @need 200
24812 @itemx -mxop
24813 @opindex mxop
24814 @need 200
24815 @itemx -mlwp
24816 @opindex mlwp
24817 @need 200
24818 @itemx -m3dnow
24819 @opindex m3dnow
24820 @need 200
24821 @itemx -mpopcnt
24822 @opindex mpopcnt
24823 @need 200
24824 @itemx -mabm
24825 @opindex mabm
24826 @need 200
24827 @itemx -mbmi
24828 @opindex mbmi
24829 @need 200
24830 @itemx -mbmi2
24831 @need 200
24832 @itemx -mlzcnt
24833 @opindex mlzcnt
24834 @need 200
24835 @itemx -mfxsr
24836 @opindex mfxsr
24837 @need 200
24838 @itemx -mxsave
24839 @opindex mxsave
24840 @need 200
24841 @itemx -mxsaveopt
24842 @opindex mxsaveopt
24843 @need 200
24844 @itemx -mxsavec
24845 @opindex mxsavec
24846 @need 200
24847 @itemx -mxsaves
24848 @opindex mxsaves
24849 @need 200
24850 @itemx -mrtm
24851 @opindex mrtm
24852 @need 200
24853 @itemx -mtbm
24854 @opindex mtbm
24855 @need 200
24856 @itemx -mmpx
24857 @opindex mmpx
24858 @need 200
24859 @itemx -mmwaitx
24860 @opindex mmwaitx
24861 @need 200
24862 @itemx -mclzero
24863 @opindex mclzero
24864 @itemx -mpku
24865 @opindex mpku
24866 These switches enable the use of instructions in the MMX, SSE,
24867 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
24868 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
24869 AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA AVX512VBMI, BMI, BMI2, FXSR,
24870 XSAVE, XSAVEOPT, LZCNT, RTM, MPX, MWAITX, PKU or 3DNow!@:
24871 extended instruction sets.  Each has a corresponding @option{-mno-} option
24872 to disable use of these instructions.
24874 These extensions are also available as built-in functions: see
24875 @ref{x86 Built-in Functions}, for details of the functions enabled and
24876 disabled by these switches.
24878 To generate SSE/SSE2 instructions automatically from floating-point
24879 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
24881 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
24882 generates new AVX instructions or AVX equivalence for all SSEx instructions
24883 when needed.
24885 These options enable GCC to use these extended instructions in
24886 generated code, even without @option{-mfpmath=sse}.  Applications that
24887 perform run-time CPU detection must compile separate files for each
24888 supported architecture, using the appropriate flags.  In particular,
24889 the file containing the CPU detection code should be compiled without
24890 these options.
24892 @item -mdump-tune-features
24893 @opindex mdump-tune-features
24894 This option instructs GCC to dump the names of the x86 performance 
24895 tuning features and default settings. The names can be used in 
24896 @option{-mtune-ctrl=@var{feature-list}}.
24898 @item -mtune-ctrl=@var{feature-list}
24899 @opindex mtune-ctrl=@var{feature-list}
24900 This option is used to do fine grain control of x86 code generation features.
24901 @var{feature-list} is a comma separated list of @var{feature} names. See also
24902 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
24903 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
24904 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
24905 developers. Using it may lead to code paths not covered by testing and can
24906 potentially result in compiler ICEs or runtime errors.
24908 @item -mno-default
24909 @opindex mno-default
24910 This option instructs GCC to turn off all tunable features. See also 
24911 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
24913 @item -mcld
24914 @opindex mcld
24915 This option instructs GCC to emit a @code{cld} instruction in the prologue
24916 of functions that use string instructions.  String instructions depend on
24917 the DF flag to select between autoincrement or autodecrement mode.  While the
24918 ABI specifies the DF flag to be cleared on function entry, some operating
24919 systems violate this specification by not clearing the DF flag in their
24920 exception dispatchers.  The exception handler can be invoked with the DF flag
24921 set, which leads to wrong direction mode when string instructions are used.
24922 This option can be enabled by default on 32-bit x86 targets by configuring
24923 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
24924 instructions can be suppressed with the @option{-mno-cld} compiler option
24925 in this case.
24927 @item -mvzeroupper
24928 @opindex mvzeroupper
24929 This option instructs GCC to emit a @code{vzeroupper} instruction
24930 before a transfer of control flow out of the function to minimize
24931 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
24932 intrinsics.
24934 @item -mprefer-avx128
24935 @opindex mprefer-avx128
24936 This option instructs GCC to use 128-bit AVX instructions instead of
24937 256-bit AVX instructions in the auto-vectorizer.
24939 @item -mcx16
24940 @opindex mcx16
24941 This option enables GCC to generate @code{CMPXCHG16B} instructions.
24942 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
24943 (or oword) data types.  
24944 This is useful for high-resolution counters that can be updated
24945 by multiple processors (or cores).  This instruction is generated as part of
24946 atomic built-in functions: see @ref{__sync Builtins} or
24947 @ref{__atomic Builtins} for details.
24949 @item -msahf
24950 @opindex msahf
24951 This option enables generation of @code{SAHF} instructions in 64-bit code.
24952 Early Intel Pentium 4 CPUs with Intel 64 support,
24953 prior to the introduction of Pentium 4 G1 step in December 2005,
24954 lacked the @code{LAHF} and @code{SAHF} instructions
24955 which are supported by AMD64.
24956 These are load and store instructions, respectively, for certain status flags.
24957 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
24958 @code{drem}, and @code{remainder} built-in functions;
24959 see @ref{Other Builtins} for details.
24961 @item -mmovbe
24962 @opindex mmovbe
24963 This option enables use of the @code{movbe} instruction to implement
24964 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
24966 @item -mcrc32
24967 @opindex mcrc32
24968 This option enables built-in functions @code{__builtin_ia32_crc32qi},
24969 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
24970 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
24972 @item -mrecip
24973 @opindex mrecip
24974 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
24975 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
24976 with an additional Newton-Raphson step
24977 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
24978 (and their vectorized
24979 variants) for single-precision floating-point arguments.  These instructions
24980 are generated only when @option{-funsafe-math-optimizations} is enabled
24981 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
24982 Note that while the throughput of the sequence is higher than the throughput
24983 of the non-reciprocal instruction, the precision of the sequence can be
24984 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
24986 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
24987 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
24988 combination), and doesn't need @option{-mrecip}.
24990 Also note that GCC emits the above sequence with additional Newton-Raphson step
24991 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
24992 already with @option{-ffast-math} (or the above option combination), and
24993 doesn't need @option{-mrecip}.
24995 @item -mrecip=@var{opt}
24996 @opindex mrecip=opt
24997 This option controls which reciprocal estimate instructions
24998 may be used.  @var{opt} is a comma-separated list of options, which may
24999 be preceded by a @samp{!} to invert the option:
25001 @table @samp
25002 @item all
25003 Enable all estimate instructions.
25005 @item default
25006 Enable the default instructions, equivalent to @option{-mrecip}.
25008 @item none
25009 Disable all estimate instructions, equivalent to @option{-mno-recip}.
25011 @item div
25012 Enable the approximation for scalar division.
25014 @item vec-div
25015 Enable the approximation for vectorized division.
25017 @item sqrt
25018 Enable the approximation for scalar square root.
25020 @item vec-sqrt
25021 Enable the approximation for vectorized square root.
25022 @end table
25024 So, for example, @option{-mrecip=all,!sqrt} enables
25025 all of the reciprocal approximations, except for square root.
25027 @item -mveclibabi=@var{type}
25028 @opindex mveclibabi
25029 Specifies the ABI type to use for vectorizing intrinsics using an
25030 external library.  Supported values for @var{type} are @samp{svml} 
25031 for the Intel short
25032 vector math library and @samp{acml} for the AMD math core library.
25033 To use this option, both @option{-ftree-vectorize} and
25034 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
25035 ABI-compatible library must be specified at link time.
25037 GCC currently emits calls to @code{vmldExp2},
25038 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
25039 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
25040 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
25041 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
25042 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
25043 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
25044 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
25045 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
25046 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
25047 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
25048 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
25049 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
25050 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
25051 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
25052 when @option{-mveclibabi=acml} is used.  
25054 @item -mabi=@var{name}
25055 @opindex mabi
25056 Generate code for the specified calling convention.  Permissible values
25057 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
25058 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
25059 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
25060 You can control this behavior for specific functions by
25061 using the function attributes @code{ms_abi} and @code{sysv_abi}.
25062 @xref{Function Attributes}.
25064 @item -mtls-dialect=@var{type}
25065 @opindex mtls-dialect
25066 Generate code to access thread-local storage using the @samp{gnu} or
25067 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
25068 @samp{gnu2} is more efficient, but it may add compile- and run-time
25069 requirements that cannot be satisfied on all systems.
25071 @item -mpush-args
25072 @itemx -mno-push-args
25073 @opindex mpush-args
25074 @opindex mno-push-args
25075 Use PUSH operations to store outgoing parameters.  This method is shorter
25076 and usually equally fast as method using SUB/MOV operations and is enabled
25077 by default.  In some cases disabling it may improve performance because of
25078 improved scheduling and reduced dependencies.
25080 @item -maccumulate-outgoing-args
25081 @opindex maccumulate-outgoing-args
25082 If enabled, the maximum amount of space required for outgoing arguments is
25083 computed in the function prologue.  This is faster on most modern CPUs
25084 because of reduced dependencies, improved scheduling and reduced stack usage
25085 when the preferred stack boundary is not equal to 2.  The drawback is a notable
25086 increase in code size.  This switch implies @option{-mno-push-args}.
25088 @item -mthreads
25089 @opindex mthreads
25090 Support thread-safe exception handling on MinGW.  Programs that rely
25091 on thread-safe exception handling must compile and link all code with the
25092 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
25093 @option{-D_MT}; when linking, it links in a special thread helper library
25094 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
25096 @item -mms-bitfields
25097 @itemx -mno-ms-bitfields
25098 @opindex mms-bitfields
25099 @opindex mno-ms-bitfields
25101 Enable/disable bit-field layout compatible with the native Microsoft
25102 Windows compiler.  
25104 If @code{packed} is used on a structure, or if bit-fields are used,
25105 it may be that the Microsoft ABI lays out the structure differently
25106 than the way GCC normally does.  Particularly when moving packed
25107 data between functions compiled with GCC and the native Microsoft compiler
25108 (either via function call or as data in a file), it may be necessary to access
25109 either format.
25111 This option is enabled by default for Microsoft Windows
25112 targets.  This behavior can also be controlled locally by use of variable
25113 or type attributes.  For more information, see @ref{x86 Variable Attributes}
25114 and @ref{x86 Type Attributes}.
25116 The Microsoft structure layout algorithm is fairly simple with the exception
25117 of the bit-field packing.  
25118 The padding and alignment of members of structures and whether a bit-field 
25119 can straddle a storage-unit boundary are determine by these rules:
25121 @enumerate
25122 @item Structure members are stored sequentially in the order in which they are
25123 declared: the first member has the lowest memory address and the last member
25124 the highest.
25126 @item Every data object has an alignment requirement.  The alignment requirement
25127 for all data except structures, unions, and arrays is either the size of the
25128 object or the current packing size (specified with either the
25129 @code{aligned} attribute or the @code{pack} pragma),
25130 whichever is less.  For structures, unions, and arrays,
25131 the alignment requirement is the largest alignment requirement of its members.
25132 Every object is allocated an offset so that:
25134 @smallexample
25135 offset % alignment_requirement == 0
25136 @end smallexample
25138 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
25139 unit if the integral types are the same size and if the next bit-field fits
25140 into the current allocation unit without crossing the boundary imposed by the
25141 common alignment requirements of the bit-fields.
25142 @end enumerate
25144 MSVC interprets zero-length bit-fields in the following ways:
25146 @enumerate
25147 @item If a zero-length bit-field is inserted between two bit-fields that
25148 are normally coalesced, the bit-fields are not coalesced.
25150 For example:
25152 @smallexample
25153 struct
25154  @{
25155    unsigned long bf_1 : 12;
25156    unsigned long : 0;
25157    unsigned long bf_2 : 12;
25158  @} t1;
25159 @end smallexample
25161 @noindent
25162 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
25163 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
25165 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
25166 alignment of the zero-length bit-field is greater than the member that follows it,
25167 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
25169 For example:
25171 @smallexample
25172 struct
25173  @{
25174    char foo : 4;
25175    short : 0;
25176    char bar;
25177  @} t2;
25179 struct
25180  @{
25181    char foo : 4;
25182    short : 0;
25183    double bar;
25184  @} t3;
25185 @end smallexample
25187 @noindent
25188 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
25189 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
25190 bit-field does not affect the alignment of @code{bar} or, as a result, the size
25191 of the structure.
25193 Taking this into account, it is important to note the following:
25195 @enumerate
25196 @item If a zero-length bit-field follows a normal bit-field, the type of the
25197 zero-length bit-field may affect the alignment of the structure as whole. For
25198 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
25199 normal bit-field, and is of type short.
25201 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
25202 still affect the alignment of the structure:
25204 @smallexample
25205 struct
25206  @{
25207    char foo : 6;
25208    long : 0;
25209  @} t4;
25210 @end smallexample
25212 @noindent
25213 Here, @code{t4} takes up 4 bytes.
25214 @end enumerate
25216 @item Zero-length bit-fields following non-bit-field members are ignored:
25218 @smallexample
25219 struct
25220  @{
25221    char foo;
25222    long : 0;
25223    char bar;
25224  @} t5;
25225 @end smallexample
25227 @noindent
25228 Here, @code{t5} takes up 2 bytes.
25229 @end enumerate
25232 @item -mno-align-stringops
25233 @opindex mno-align-stringops
25234 Do not align the destination of inlined string operations.  This switch reduces
25235 code size and improves performance in case the destination is already aligned,
25236 but GCC doesn't know about it.
25238 @item -minline-all-stringops
25239 @opindex minline-all-stringops
25240 By default GCC inlines string operations only when the destination is 
25241 known to be aligned to least a 4-byte boundary.  
25242 This enables more inlining and increases code
25243 size, but may improve performance of code that depends on fast
25244 @code{memcpy}, @code{strlen},
25245 and @code{memset} for short lengths.
25247 @item -minline-stringops-dynamically
25248 @opindex minline-stringops-dynamically
25249 For string operations of unknown size, use run-time checks with
25250 inline code for small blocks and a library call for large blocks.
25252 @item -mstringop-strategy=@var{alg}
25253 @opindex mstringop-strategy=@var{alg}
25254 Override the internal decision heuristic for the particular algorithm to use
25255 for inlining string operations.  The allowed values for @var{alg} are:
25257 @table @samp
25258 @item rep_byte
25259 @itemx rep_4byte
25260 @itemx rep_8byte
25261 Expand using i386 @code{rep} prefix of the specified size.
25263 @item byte_loop
25264 @itemx loop
25265 @itemx unrolled_loop
25266 Expand into an inline loop.
25268 @item libcall
25269 Always use a library call.
25270 @end table
25272 @item -mmemcpy-strategy=@var{strategy}
25273 @opindex mmemcpy-strategy=@var{strategy}
25274 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
25275 should be inlined and what inline algorithm to use when the expected size
25276 of the copy operation is known. @var{strategy} 
25277 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
25278 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
25279 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
25280 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
25281 in the list must be specified in increasing order.  The minimal byte size for 
25282 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
25283 preceding range.
25285 @item -mmemset-strategy=@var{strategy}
25286 @opindex mmemset-strategy=@var{strategy}
25287 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
25288 @code{__builtin_memset} expansion.
25290 @item -momit-leaf-frame-pointer
25291 @opindex momit-leaf-frame-pointer
25292 Don't keep the frame pointer in a register for leaf functions.  This
25293 avoids the instructions to save, set up, and restore frame pointers and
25294 makes an extra register available in leaf functions.  The option
25295 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
25296 which might make debugging harder.
25298 @item -mtls-direct-seg-refs
25299 @itemx -mno-tls-direct-seg-refs
25300 @opindex mtls-direct-seg-refs
25301 Controls whether TLS variables may be accessed with offsets from the
25302 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
25303 or whether the thread base pointer must be added.  Whether or not this
25304 is valid depends on the operating system, and whether it maps the
25305 segment to cover the entire TLS area.
25307 For systems that use the GNU C Library, the default is on.
25309 @item -msse2avx
25310 @itemx -mno-sse2avx
25311 @opindex msse2avx
25312 Specify that the assembler should encode SSE instructions with VEX
25313 prefix.  The option @option{-mavx} turns this on by default.
25315 @item -mfentry
25316 @itemx -mno-fentry
25317 @opindex mfentry
25318 If profiling is active (@option{-pg}), put the profiling
25319 counter call before the prologue.
25320 Note: On x86 architectures the attribute @code{ms_hook_prologue}
25321 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
25323 @item -mrecord-mcount
25324 @itemx -mno-record-mcount
25325 @opindex mrecord-mcount
25326 If profiling is active (@option{-pg}), generate a __mcount_loc section
25327 that contains pointers to each profiling call. This is useful for
25328 automatically patching and out calls.
25330 @item -mnop-mcount
25331 @itemx -mno-nop-mcount
25332 @opindex mnop-mcount
25333 If profiling is active (@option{-pg}), generate the calls to
25334 the profiling functions as NOPs. This is useful when they
25335 should be patched in later dynamically. This is likely only
25336 useful together with @option{-mrecord-mcount}.
25338 @item -mskip-rax-setup
25339 @itemx -mno-skip-rax-setup
25340 @opindex mskip-rax-setup
25341 When generating code for the x86-64 architecture with SSE extensions
25342 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
25343 register when there are no variable arguments passed in vector registers.
25345 @strong{Warning:} Since RAX register is used to avoid unnecessarily
25346 saving vector registers on stack when passing variable arguments, the
25347 impacts of this option are callees may waste some stack space,
25348 misbehave or jump to a random location.  GCC 4.4 or newer don't have
25349 those issues, regardless the RAX register value.
25351 @item -m8bit-idiv
25352 @itemx -mno-8bit-idiv
25353 @opindex m8bit-idiv
25354 On some processors, like Intel Atom, 8-bit unsigned integer divide is
25355 much faster than 32-bit/64-bit integer divide.  This option generates a
25356 run-time check.  If both dividend and divisor are within range of 0
25357 to 255, 8-bit unsigned integer divide is used instead of
25358 32-bit/64-bit integer divide.
25360 @item -mavx256-split-unaligned-load
25361 @itemx -mavx256-split-unaligned-store
25362 @opindex mavx256-split-unaligned-load
25363 @opindex mavx256-split-unaligned-store
25364 Split 32-byte AVX unaligned load and store.
25366 @item -mstack-protector-guard=@var{guard}
25367 @opindex mstack-protector-guard=@var{guard}
25368 Generate stack protection code using canary at @var{guard}.  Supported
25369 locations are @samp{global} for global canary or @samp{tls} for per-thread
25370 canary in the TLS block (the default).  This option has effect only when
25371 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
25373 @item -mmitigate-rop
25374 @opindex mmitigate-rop
25375 Try to avoid generating code sequences that contain unintended return
25376 opcodes, to mitigate against certain forms of attack. At the moment,
25377 this option is limited in what it can do and should not be relied
25378 on to provide serious protection.
25380 @item -mgeneral-regs-only
25381 @opindex mgeneral-regs-only
25382 Generate code that uses only the general-purpose registers.  This
25383 prevents the compiler from using floating-point, vector, mask and bound
25384 registers.
25386 @end table
25388 These @samp{-m} switches are supported in addition to the above
25389 on x86-64 processors in 64-bit environments.
25391 @table @gcctabopt
25392 @item -m32
25393 @itemx -m64
25394 @itemx -mx32
25395 @itemx -m16
25396 @itemx -miamcu
25397 @opindex m32
25398 @opindex m64
25399 @opindex mx32
25400 @opindex m16
25401 @opindex miamcu
25402 Generate code for a 16-bit, 32-bit or 64-bit environment.
25403 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
25404 to 32 bits, and
25405 generates code that runs on any i386 system.
25407 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
25408 types to 64 bits, and generates code for the x86-64 architecture.
25409 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
25410 and @option{-mdynamic-no-pic} options.
25412 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
25413 to 32 bits, and
25414 generates code for the x86-64 architecture.
25416 The @option{-m16} option is the same as @option{-m32}, except for that
25417 it outputs the @code{.code16gcc} assembly directive at the beginning of
25418 the assembly output so that the binary can run in 16-bit mode.
25420 The @option{-miamcu} option generates code which conforms to Intel MCU
25421 psABI.  It requires the @option{-m32} option to be turned on.
25423 @item -mno-red-zone
25424 @opindex mno-red-zone
25425 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
25426 by the x86-64 ABI; it is a 128-byte area beyond the location of the
25427 stack pointer that is not modified by signal or interrupt handlers
25428 and therefore can be used for temporary data without adjusting the stack
25429 pointer.  The flag @option{-mno-red-zone} disables this red zone.
25431 @item -mcmodel=small
25432 @opindex mcmodel=small
25433 Generate code for the small code model: the program and its symbols must
25434 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
25435 Programs can be statically or dynamically linked.  This is the default
25436 code model.
25438 @item -mcmodel=kernel
25439 @opindex mcmodel=kernel
25440 Generate code for the kernel code model.  The kernel runs in the
25441 negative 2 GB of the address space.
25442 This model has to be used for Linux kernel code.
25444 @item -mcmodel=medium
25445 @opindex mcmodel=medium
25446 Generate code for the medium model: the program is linked in the lower 2
25447 GB of the address space.  Small symbols are also placed there.  Symbols
25448 with sizes larger than @option{-mlarge-data-threshold} are put into
25449 large data or BSS sections and can be located above 2GB.  Programs can
25450 be statically or dynamically linked.
25452 @item -mcmodel=large
25453 @opindex mcmodel=large
25454 Generate code for the large model.  This model makes no assumptions
25455 about addresses and sizes of sections.
25457 @item -maddress-mode=long
25458 @opindex maddress-mode=long
25459 Generate code for long address mode.  This is only supported for 64-bit
25460 and x32 environments.  It is the default address mode for 64-bit
25461 environments.
25463 @item -maddress-mode=short
25464 @opindex maddress-mode=short
25465 Generate code for short address mode.  This is only supported for 32-bit
25466 and x32 environments.  It is the default address mode for 32-bit and
25467 x32 environments.
25468 @end table
25470 @node x86 Windows Options
25471 @subsection x86 Windows Options
25472 @cindex x86 Windows Options
25473 @cindex Windows Options for x86
25475 These additional options are available for Microsoft Windows targets:
25477 @table @gcctabopt
25478 @item -mconsole
25479 @opindex mconsole
25480 This option
25481 specifies that a console application is to be generated, by
25482 instructing the linker to set the PE header subsystem type
25483 required for console applications.
25484 This option is available for Cygwin and MinGW targets and is
25485 enabled by default on those targets.
25487 @item -mdll
25488 @opindex mdll
25489 This option is available for Cygwin and MinGW targets.  It
25490 specifies that a DLL---a dynamic link library---is to be
25491 generated, enabling the selection of the required runtime
25492 startup object and entry point.
25494 @item -mnop-fun-dllimport
25495 @opindex mnop-fun-dllimport
25496 This option is available for Cygwin and MinGW targets.  It
25497 specifies that the @code{dllimport} attribute should be ignored.
25499 @item -mthread
25500 @opindex mthread
25501 This option is available for MinGW targets. It specifies
25502 that MinGW-specific thread support is to be used.
25504 @item -municode
25505 @opindex municode
25506 This option is available for MinGW-w64 targets.  It causes
25507 the @code{UNICODE} preprocessor macro to be predefined, and
25508 chooses Unicode-capable runtime startup code.
25510 @item -mwin32
25511 @opindex mwin32
25512 This option is available for Cygwin and MinGW targets.  It
25513 specifies that the typical Microsoft Windows predefined macros are to
25514 be set in the pre-processor, but does not influence the choice
25515 of runtime library/startup code.
25517 @item -mwindows
25518 @opindex mwindows
25519 This option is available for Cygwin and MinGW targets.  It
25520 specifies that a GUI application is to be generated by
25521 instructing the linker to set the PE header subsystem type
25522 appropriately.
25524 @item -fno-set-stack-executable
25525 @opindex fno-set-stack-executable
25526 This option is available for MinGW targets. It specifies that
25527 the executable flag for the stack used by nested functions isn't
25528 set. This is necessary for binaries running in kernel mode of
25529 Microsoft Windows, as there the User32 API, which is used to set executable
25530 privileges, isn't available.
25532 @item -fwritable-relocated-rdata
25533 @opindex fno-writable-relocated-rdata
25534 This option is available for MinGW and Cygwin targets.  It specifies
25535 that relocated-data in read-only section is put into the @code{.data}
25536 section.  This is a necessary for older runtimes not supporting
25537 modification of @code{.rdata} sections for pseudo-relocation.
25539 @item -mpe-aligned-commons
25540 @opindex mpe-aligned-commons
25541 This option is available for Cygwin and MinGW targets.  It
25542 specifies that the GNU extension to the PE file format that
25543 permits the correct alignment of COMMON variables should be
25544 used when generating code.  It is enabled by default if
25545 GCC detects that the target assembler found during configuration
25546 supports the feature.
25547 @end table
25549 See also under @ref{x86 Options} for standard options.
25551 @node Xstormy16 Options
25552 @subsection Xstormy16 Options
25553 @cindex Xstormy16 Options
25555 These options are defined for Xstormy16:
25557 @table @gcctabopt
25558 @item -msim
25559 @opindex msim
25560 Choose startup files and linker script suitable for the simulator.
25561 @end table
25563 @node Xtensa Options
25564 @subsection Xtensa Options
25565 @cindex Xtensa Options
25567 These options are supported for Xtensa targets:
25569 @table @gcctabopt
25570 @item -mconst16
25571 @itemx -mno-const16
25572 @opindex mconst16
25573 @opindex mno-const16
25574 Enable or disable use of @code{CONST16} instructions for loading
25575 constant values.  The @code{CONST16} instruction is currently not a
25576 standard option from Tensilica.  When enabled, @code{CONST16}
25577 instructions are always used in place of the standard @code{L32R}
25578 instructions.  The use of @code{CONST16} is enabled by default only if
25579 the @code{L32R} instruction is not available.
25581 @item -mfused-madd
25582 @itemx -mno-fused-madd
25583 @opindex mfused-madd
25584 @opindex mno-fused-madd
25585 Enable or disable use of fused multiply/add and multiply/subtract
25586 instructions in the floating-point option.  This has no effect if the
25587 floating-point option is not also enabled.  Disabling fused multiply/add
25588 and multiply/subtract instructions forces the compiler to use separate
25589 instructions for the multiply and add/subtract operations.  This may be
25590 desirable in some cases where strict IEEE 754-compliant results are
25591 required: the fused multiply add/subtract instructions do not round the
25592 intermediate result, thereby producing results with @emph{more} bits of
25593 precision than specified by the IEEE standard.  Disabling fused multiply
25594 add/subtract instructions also ensures that the program output is not
25595 sensitive to the compiler's ability to combine multiply and add/subtract
25596 operations.
25598 @item -mserialize-volatile
25599 @itemx -mno-serialize-volatile
25600 @opindex mserialize-volatile
25601 @opindex mno-serialize-volatile
25602 When this option is enabled, GCC inserts @code{MEMW} instructions before
25603 @code{volatile} memory references to guarantee sequential consistency.
25604 The default is @option{-mserialize-volatile}.  Use
25605 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
25607 @item -mforce-no-pic
25608 @opindex mforce-no-pic
25609 For targets, like GNU/Linux, where all user-mode Xtensa code must be
25610 position-independent code (PIC), this option disables PIC for compiling
25611 kernel code.
25613 @item -mtext-section-literals
25614 @itemx -mno-text-section-literals
25615 @opindex mtext-section-literals
25616 @opindex mno-text-section-literals
25617 These options control the treatment of literal pools.  The default is
25618 @option{-mno-text-section-literals}, which places literals in a separate
25619 section in the output file.  This allows the literal pool to be placed
25620 in a data RAM/ROM, and it also allows the linker to combine literal
25621 pools from separate object files to remove redundant literals and
25622 improve code size.  With @option{-mtext-section-literals}, the literals
25623 are interspersed in the text section in order to keep them as close as
25624 possible to their references.  This may be necessary for large assembly
25625 files.  Literals for each function are placed right before that function.
25627 @item -mauto-litpools
25628 @itemx -mno-auto-litpools
25629 @opindex mauto-litpools
25630 @opindex mno-auto-litpools
25631 These options control the treatment of literal pools.  The default is
25632 @option{-mno-auto-litpools}, which places literals in a separate
25633 section in the output file unless @option{-mtext-section-literals} is
25634 used.  With @option{-mauto-litpools} the literals are interspersed in
25635 the text section by the assembler.  Compiler does not produce explicit
25636 @code{.literal} directives and loads literals into registers with
25637 @code{MOVI} instructions instead of @code{L32R} to let the assembler
25638 do relaxation and place literals as necessary.  This option allows
25639 assembler to create several literal pools per function and assemble
25640 very big functions, which may not be possible with
25641 @option{-mtext-section-literals}.
25643 @item -mtarget-align
25644 @itemx -mno-target-align
25645 @opindex mtarget-align
25646 @opindex mno-target-align
25647 When this option is enabled, GCC instructs the assembler to
25648 automatically align instructions to reduce branch penalties at the
25649 expense of some code density.  The assembler attempts to widen density
25650 instructions to align branch targets and the instructions following call
25651 instructions.  If there are not enough preceding safe density
25652 instructions to align a target, no widening is performed.  The
25653 default is @option{-mtarget-align}.  These options do not affect the
25654 treatment of auto-aligned instructions like @code{LOOP}, which the
25655 assembler always aligns, either by widening density instructions or
25656 by inserting NOP instructions.
25658 @item -mlongcalls
25659 @itemx -mno-longcalls
25660 @opindex mlongcalls
25661 @opindex mno-longcalls
25662 When this option is enabled, GCC instructs the assembler to translate
25663 direct calls to indirect calls unless it can determine that the target
25664 of a direct call is in the range allowed by the call instruction.  This
25665 translation typically occurs for calls to functions in other source
25666 files.  Specifically, the assembler translates a direct @code{CALL}
25667 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
25668 The default is @option{-mno-longcalls}.  This option should be used in
25669 programs where the call target can potentially be out of range.  This
25670 option is implemented in the assembler, not the compiler, so the
25671 assembly code generated by GCC still shows direct call
25672 instructions---look at the disassembled object code to see the actual
25673 instructions.  Note that the assembler uses an indirect call for
25674 every cross-file call, not just those that really are out of range.
25675 @end table
25677 @node zSeries Options
25678 @subsection zSeries Options
25679 @cindex zSeries options
25681 These are listed under @xref{S/390 and zSeries Options}.
25684 @c man end
25686 @node Spec Files
25687 @section Specifying Subprocesses and the Switches to Pass to Them
25688 @cindex Spec Files
25690 @command{gcc} is a driver program.  It performs its job by invoking a
25691 sequence of other programs to do the work of compiling, assembling and
25692 linking.  GCC interprets its command-line parameters and uses these to
25693 deduce which programs it should invoke, and which command-line options
25694 it ought to place on their command lines.  This behavior is controlled
25695 by @dfn{spec strings}.  In most cases there is one spec string for each
25696 program that GCC can invoke, but a few programs have multiple spec
25697 strings to control their behavior.  The spec strings built into GCC can
25698 be overridden by using the @option{-specs=} command-line switch to specify
25699 a spec file.
25701 @dfn{Spec files} are plain-text files that are used to construct spec
25702 strings.  They consist of a sequence of directives separated by blank
25703 lines.  The type of directive is determined by the first non-whitespace
25704 character on the line, which can be one of the following:
25706 @table @code
25707 @item %@var{command}
25708 Issues a @var{command} to the spec file processor.  The commands that can
25709 appear here are:
25711 @table @code
25712 @item %include <@var{file}>
25713 @cindex @code{%include}
25714 Search for @var{file} and insert its text at the current point in the
25715 specs file.
25717 @item %include_noerr <@var{file}>
25718 @cindex @code{%include_noerr}
25719 Just like @samp{%include}, but do not generate an error message if the include
25720 file cannot be found.
25722 @item %rename @var{old_name} @var{new_name}
25723 @cindex @code{%rename}
25724 Rename the spec string @var{old_name} to @var{new_name}.
25726 @end table
25728 @item *[@var{spec_name}]:
25729 This tells the compiler to create, override or delete the named spec
25730 string.  All lines after this directive up to the next directive or
25731 blank line are considered to be the text for the spec string.  If this
25732 results in an empty string then the spec is deleted.  (Or, if the
25733 spec did not exist, then nothing happens.)  Otherwise, if the spec
25734 does not currently exist a new spec is created.  If the spec does
25735 exist then its contents are overridden by the text of this
25736 directive, unless the first character of that text is the @samp{+}
25737 character, in which case the text is appended to the spec.
25739 @item [@var{suffix}]:
25740 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
25741 and up to the next directive or blank line are considered to make up the
25742 spec string for the indicated suffix.  When the compiler encounters an
25743 input file with the named suffix, it processes the spec string in
25744 order to work out how to compile that file.  For example:
25746 @smallexample
25747 .ZZ:
25748 z-compile -input %i
25749 @end smallexample
25751 This says that any input file whose name ends in @samp{.ZZ} should be
25752 passed to the program @samp{z-compile}, which should be invoked with the
25753 command-line switch @option{-input} and with the result of performing the
25754 @samp{%i} substitution.  (See below.)
25756 As an alternative to providing a spec string, the text following a
25757 suffix directive can be one of the following:
25759 @table @code
25760 @item @@@var{language}
25761 This says that the suffix is an alias for a known @var{language}.  This is
25762 similar to using the @option{-x} command-line switch to GCC to specify a
25763 language explicitly.  For example:
25765 @smallexample
25766 .ZZ:
25767 @@c++
25768 @end smallexample
25770 Says that .ZZ files are, in fact, C++ source files.
25772 @item #@var{name}
25773 This causes an error messages saying:
25775 @smallexample
25776 @var{name} compiler not installed on this system.
25777 @end smallexample
25778 @end table
25780 GCC already has an extensive list of suffixes built into it.
25781 This directive adds an entry to the end of the list of suffixes, but
25782 since the list is searched from the end backwards, it is effectively
25783 possible to override earlier entries using this technique.
25785 @end table
25787 GCC has the following spec strings built into it.  Spec files can
25788 override these strings or create their own.  Note that individual
25789 targets can also add their own spec strings to this list.
25791 @smallexample
25792 asm          Options to pass to the assembler
25793 asm_final    Options to pass to the assembler post-processor
25794 cpp          Options to pass to the C preprocessor
25795 cc1          Options to pass to the C compiler
25796 cc1plus      Options to pass to the C++ compiler
25797 endfile      Object files to include at the end of the link
25798 link         Options to pass to the linker
25799 lib          Libraries to include on the command line to the linker
25800 libgcc       Decides which GCC support library to pass to the linker
25801 linker       Sets the name of the linker
25802 predefines   Defines to be passed to the C preprocessor
25803 signed_char  Defines to pass to CPP to say whether @code{char} is signed
25804              by default
25805 startfile    Object files to include at the start of the link
25806 @end smallexample
25808 Here is a small example of a spec file:
25810 @smallexample
25811 %rename lib                 old_lib
25813 *lib:
25814 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
25815 @end smallexample
25817 This example renames the spec called @samp{lib} to @samp{old_lib} and
25818 then overrides the previous definition of @samp{lib} with a new one.
25819 The new definition adds in some extra command-line options before
25820 including the text of the old definition.
25822 @dfn{Spec strings} are a list of command-line options to be passed to their
25823 corresponding program.  In addition, the spec strings can contain
25824 @samp{%}-prefixed sequences to substitute variable text or to
25825 conditionally insert text into the command line.  Using these constructs
25826 it is possible to generate quite complex command lines.
25828 Here is a table of all defined @samp{%}-sequences for spec
25829 strings.  Note that spaces are not generated automatically around the
25830 results of expanding these sequences.  Therefore you can concatenate them
25831 together or combine them with constant text in a single argument.
25833 @table @code
25834 @item %%
25835 Substitute one @samp{%} into the program name or argument.
25837 @item %i
25838 Substitute the name of the input file being processed.
25840 @item %b
25841 Substitute the basename of the input file being processed.
25842 This is the substring up to (and not including) the last period
25843 and not including the directory.
25845 @item %B
25846 This is the same as @samp{%b}, but include the file suffix (text after
25847 the last period).
25849 @item %d
25850 Marks the argument containing or following the @samp{%d} as a
25851 temporary file name, so that that file is deleted if GCC exits
25852 successfully.  Unlike @samp{%g}, this contributes no text to the
25853 argument.
25855 @item %g@var{suffix}
25856 Substitute a file name that has suffix @var{suffix} and is chosen
25857 once per compilation, and mark the argument in the same way as
25858 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
25859 name is now chosen in a way that is hard to predict even when previously
25860 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
25861 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
25862 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
25863 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
25864 was simply substituted with a file name chosen once per compilation,
25865 without regard to any appended suffix (which was therefore treated
25866 just like ordinary text), making such attacks more likely to succeed.
25868 @item %u@var{suffix}
25869 Like @samp{%g}, but generates a new temporary file name
25870 each time it appears instead of once per compilation.
25872 @item %U@var{suffix}
25873 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
25874 new one if there is no such last file name.  In the absence of any
25875 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
25876 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
25877 involves the generation of two distinct file names, one
25878 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
25879 simply substituted with a file name chosen for the previous @samp{%u},
25880 without regard to any appended suffix.
25882 @item %j@var{suffix}
25883 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
25884 writable, and if @option{-save-temps} is not used; 
25885 otherwise, substitute the name
25886 of a temporary file, just like @samp{%u}.  This temporary file is not
25887 meant for communication between processes, but rather as a junk
25888 disposal mechanism.
25890 @item %|@var{suffix}
25891 @itemx %m@var{suffix}
25892 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
25893 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
25894 all.  These are the two most common ways to instruct a program that it
25895 should read from standard input or write to standard output.  If you
25896 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
25897 construct: see for example @file{f/lang-specs.h}.
25899 @item %.@var{SUFFIX}
25900 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
25901 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
25902 terminated by the next space or %.
25904 @item %w
25905 Marks the argument containing or following the @samp{%w} as the
25906 designated output file of this compilation.  This puts the argument
25907 into the sequence of arguments that @samp{%o} substitutes.
25909 @item %o
25910 Substitutes the names of all the output files, with spaces
25911 automatically placed around them.  You should write spaces
25912 around the @samp{%o} as well or the results are undefined.
25913 @samp{%o} is for use in the specs for running the linker.
25914 Input files whose names have no recognized suffix are not compiled
25915 at all, but they are included among the output files, so they are
25916 linked.
25918 @item %O
25919 Substitutes the suffix for object files.  Note that this is
25920 handled specially when it immediately follows @samp{%g, %u, or %U},
25921 because of the need for those to form complete file names.  The
25922 handling is such that @samp{%O} is treated exactly as if it had already
25923 been substituted, except that @samp{%g, %u, and %U} do not currently
25924 support additional @var{suffix} characters following @samp{%O} as they do
25925 following, for example, @samp{.o}.
25927 @item %p
25928 Substitutes the standard macro predefinitions for the
25929 current target machine.  Use this when running @command{cpp}.
25931 @item %P
25932 Like @samp{%p}, but puts @samp{__} before and after the name of each
25933 predefined macro, except for macros that start with @samp{__} or with
25934 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
25937 @item %I
25938 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
25939 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
25940 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
25941 and @option{-imultilib} as necessary.
25943 @item %s
25944 Current argument is the name of a library or startup file of some sort.
25945 Search for that file in a standard list of directories and substitute
25946 the full name found.  The current working directory is included in the
25947 list of directories scanned.
25949 @item %T
25950 Current argument is the name of a linker script.  Search for that file
25951 in the current list of directories to scan for libraries. If the file
25952 is located insert a @option{--script} option into the command line
25953 followed by the full path name found.  If the file is not found then
25954 generate an error message.  Note: the current working directory is not
25955 searched.
25957 @item %e@var{str}
25958 Print @var{str} as an error message.  @var{str} is terminated by a newline.
25959 Use this when inconsistent options are detected.
25961 @item %(@var{name})
25962 Substitute the contents of spec string @var{name} at this point.
25964 @item %x@{@var{option}@}
25965 Accumulate an option for @samp{%X}.
25967 @item %X
25968 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
25969 spec string.
25971 @item %Y
25972 Output the accumulated assembler options specified by @option{-Wa}.
25974 @item %Z
25975 Output the accumulated preprocessor options specified by @option{-Wp}.
25977 @item %a
25978 Process the @code{asm} spec.  This is used to compute the
25979 switches to be passed to the assembler.
25981 @item %A
25982 Process the @code{asm_final} spec.  This is a spec string for
25983 passing switches to an assembler post-processor, if such a program is
25984 needed.
25986 @item %l
25987 Process the @code{link} spec.  This is the spec for computing the
25988 command line passed to the linker.  Typically it makes use of the
25989 @samp{%L %G %S %D and %E} sequences.
25991 @item %D
25992 Dump out a @option{-L} option for each directory that GCC believes might
25993 contain startup files.  If the target supports multilibs then the
25994 current multilib directory is prepended to each of these paths.
25996 @item %L
25997 Process the @code{lib} spec.  This is a spec string for deciding which
25998 libraries are included on the command line to the linker.
26000 @item %G
26001 Process the @code{libgcc} spec.  This is a spec string for deciding
26002 which GCC support library is included on the command line to the linker.
26004 @item %S
26005 Process the @code{startfile} spec.  This is a spec for deciding which
26006 object files are the first ones passed to the linker.  Typically
26007 this might be a file named @file{crt0.o}.
26009 @item %E
26010 Process the @code{endfile} spec.  This is a spec string that specifies
26011 the last object files that are passed to the linker.
26013 @item %C
26014 Process the @code{cpp} spec.  This is used to construct the arguments
26015 to be passed to the C preprocessor.
26017 @item %1
26018 Process the @code{cc1} spec.  This is used to construct the options to be
26019 passed to the actual C compiler (@command{cc1}).
26021 @item %2
26022 Process the @code{cc1plus} spec.  This is used to construct the options to be
26023 passed to the actual C++ compiler (@command{cc1plus}).
26025 @item %*
26026 Substitute the variable part of a matched option.  See below.
26027 Note that each comma in the substituted string is replaced by
26028 a single space.
26030 @item %<@code{S}
26031 Remove all occurrences of @code{-S} from the command line.  Note---this
26032 command is position dependent.  @samp{%} commands in the spec string
26033 before this one see @code{-S}, @samp{%} commands in the spec string
26034 after this one do not.
26036 @item %:@var{function}(@var{args})
26037 Call the named function @var{function}, passing it @var{args}.
26038 @var{args} is first processed as a nested spec string, then split
26039 into an argument vector in the usual fashion.  The function returns
26040 a string which is processed as if it had appeared literally as part
26041 of the current spec.
26043 The following built-in spec functions are provided:
26045 @table @code
26046 @item @code{getenv}
26047 The @code{getenv} spec function takes two arguments: an environment
26048 variable name and a string.  If the environment variable is not
26049 defined, a fatal error is issued.  Otherwise, the return value is the
26050 value of the environment variable concatenated with the string.  For
26051 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
26053 @smallexample
26054 %:getenv(TOPDIR /include)
26055 @end smallexample
26057 expands to @file{/path/to/top/include}.
26059 @item @code{if-exists}
26060 The @code{if-exists} spec function takes one argument, an absolute
26061 pathname to a file.  If the file exists, @code{if-exists} returns the
26062 pathname.  Here is a small example of its usage:
26064 @smallexample
26065 *startfile:
26066 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
26067 @end smallexample
26069 @item @code{if-exists-else}
26070 The @code{if-exists-else} spec function is similar to the @code{if-exists}
26071 spec function, except that it takes two arguments.  The first argument is
26072 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
26073 returns the pathname.  If it does not exist, it returns the second argument.
26074 This way, @code{if-exists-else} can be used to select one file or another,
26075 based on the existence of the first.  Here is a small example of its usage:
26077 @smallexample
26078 *startfile:
26079 crt0%O%s %:if-exists(crti%O%s) \
26080 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
26081 @end smallexample
26083 @item @code{replace-outfile}
26084 The @code{replace-outfile} spec function takes two arguments.  It looks for the
26085 first argument in the outfiles array and replaces it with the second argument.  Here
26086 is a small example of its usage:
26088 @smallexample
26089 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
26090 @end smallexample
26092 @item @code{remove-outfile}
26093 The @code{remove-outfile} spec function takes one argument.  It looks for the
26094 first argument in the outfiles array and removes it.  Here is a small example
26095 its usage:
26097 @smallexample
26098 %:remove-outfile(-lm)
26099 @end smallexample
26101 @item @code{pass-through-libs}
26102 The @code{pass-through-libs} spec function takes any number of arguments.  It
26103 finds any @option{-l} options and any non-options ending in @file{.a} (which it
26104 assumes are the names of linker input library archive files) and returns a
26105 result containing all the found arguments each prepended by
26106 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
26107 intended to be passed to the LTO linker plugin.
26109 @smallexample
26110 %:pass-through-libs(%G %L %G)
26111 @end smallexample
26113 @item @code{print-asm-header}
26114 The @code{print-asm-header} function takes no arguments and simply
26115 prints a banner like:
26117 @smallexample
26118 Assembler options
26119 =================
26121 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
26122 @end smallexample
26124 It is used to separate compiler options from assembler options
26125 in the @option{--target-help} output.
26126 @end table
26128 @item %@{@code{S}@}
26129 Substitutes the @code{-S} switch, if that switch is given to GCC@.
26130 If that switch is not specified, this substitutes nothing.  Note that
26131 the leading dash is omitted when specifying this option, and it is
26132 automatically inserted if the substitution is performed.  Thus the spec
26133 string @samp{%@{foo@}} matches the command-line option @option{-foo}
26134 and outputs the command-line option @option{-foo}.
26136 @item %W@{@code{S}@}
26137 Like %@{@code{S}@} but mark last argument supplied within as a file to be
26138 deleted on failure.
26140 @item %@{@code{S}*@}
26141 Substitutes all the switches specified to GCC whose names start
26142 with @code{-S}, but which also take an argument.  This is used for
26143 switches like @option{-o}, @option{-D}, @option{-I}, etc.
26144 GCC considers @option{-o foo} as being
26145 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
26146 text, including the space.  Thus two arguments are generated.
26148 @item %@{@code{S}*&@code{T}*@}
26149 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
26150 (the order of @code{S} and @code{T} in the spec is not significant).
26151 There can be any number of ampersand-separated variables; for each the
26152 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
26154 @item %@{@code{S}:@code{X}@}
26155 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
26157 @item %@{!@code{S}:@code{X}@}
26158 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
26160 @item %@{@code{S}*:@code{X}@}
26161 Substitutes @code{X} if one or more switches whose names start with
26162 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
26163 once, no matter how many such switches appeared.  However, if @code{%*}
26164 appears somewhere in @code{X}, then @code{X} is substituted once
26165 for each matching switch, with the @code{%*} replaced by the part of
26166 that switch matching the @code{*}.
26168 If @code{%*} appears as the last part of a spec sequence then a space
26169 is added after the end of the last substitution.  If there is more
26170 text in the sequence, however, then a space is not generated.  This
26171 allows the @code{%*} substitution to be used as part of a larger
26172 string.  For example, a spec string like this:
26174 @smallexample
26175 %@{mcu=*:--script=%*/memory.ld@}
26176 @end smallexample
26178 @noindent
26179 when matching an option like @option{-mcu=newchip} produces:
26181 @smallexample
26182 --script=newchip/memory.ld
26183 @end smallexample
26185 @item %@{.@code{S}:@code{X}@}
26186 Substitutes @code{X}, if processing a file with suffix @code{S}.
26188 @item %@{!.@code{S}:@code{X}@}
26189 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
26191 @item %@{,@code{S}:@code{X}@}
26192 Substitutes @code{X}, if processing a file for language @code{S}.
26194 @item %@{!,@code{S}:@code{X}@}
26195 Substitutes @code{X}, if not processing a file for language @code{S}.
26197 @item %@{@code{S}|@code{P}:@code{X}@}
26198 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
26199 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
26200 @code{*} sequences as well, although they have a stronger binding than
26201 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
26202 alternatives must be starred, and only the first matching alternative
26203 is substituted.
26205 For example, a spec string like this:
26207 @smallexample
26208 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
26209 @end smallexample
26211 @noindent
26212 outputs the following command-line options from the following input
26213 command-line options:
26215 @smallexample
26216 fred.c        -foo -baz
26217 jim.d         -bar -boggle
26218 -d fred.c     -foo -baz -boggle
26219 -d jim.d      -bar -baz -boggle
26220 @end smallexample
26222 @item %@{S:X; T:Y; :D@}
26224 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
26225 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
26226 be as many clauses as you need.  This may be combined with @code{.},
26227 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
26230 @end table
26232 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
26233 construct may contain other nested @samp{%} constructs or spaces, or
26234 even newlines.  They are processed as usual, as described above.
26235 Trailing white space in @code{X} is ignored.  White space may also
26236 appear anywhere on the left side of the colon in these constructs,
26237 except between @code{.} or @code{*} and the corresponding word.
26239 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
26240 handled specifically in these constructs.  If another value of
26241 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
26242 @option{-W} switch is found later in the command line, the earlier
26243 switch value is ignored, except with @{@code{S}*@} where @code{S} is
26244 just one letter, which passes all matching options.
26246 The character @samp{|} at the beginning of the predicate text is used to
26247 indicate that a command should be piped to the following command, but
26248 only if @option{-pipe} is specified.
26250 It is built into GCC which switches take arguments and which do not.
26251 (You might think it would be useful to generalize this to allow each
26252 compiler's spec to say which switches take arguments.  But this cannot
26253 be done in a consistent fashion.  GCC cannot even decide which input
26254 files have been specified without knowing which switches take arguments,
26255 and it must know which input files to compile in order to tell which
26256 compilers to run).
26258 GCC also knows implicitly that arguments starting in @option{-l} are to be
26259 treated as compiler output files, and passed to the linker in their
26260 proper position among the other output files.
26262 @node Environment Variables
26263 @section Environment Variables Affecting GCC
26264 @cindex environment variables
26266 @c man begin ENVIRONMENT
26267 This section describes several environment variables that affect how GCC
26268 operates.  Some of them work by specifying directories or prefixes to use
26269 when searching for various kinds of files.  Some are used to specify other
26270 aspects of the compilation environment.
26272 Note that you can also specify places to search using options such as
26273 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
26274 take precedence over places specified using environment variables, which
26275 in turn take precedence over those specified by the configuration of GCC@.
26276 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
26277 GNU Compiler Collection (GCC) Internals}.
26279 @table @env
26280 @item LANG
26281 @itemx LC_CTYPE
26282 @c @itemx LC_COLLATE
26283 @itemx LC_MESSAGES
26284 @c @itemx LC_MONETARY
26285 @c @itemx LC_NUMERIC
26286 @c @itemx LC_TIME
26287 @itemx LC_ALL
26288 @findex LANG
26289 @findex LC_CTYPE
26290 @c @findex LC_COLLATE
26291 @findex LC_MESSAGES
26292 @c @findex LC_MONETARY
26293 @c @findex LC_NUMERIC
26294 @c @findex LC_TIME
26295 @findex LC_ALL
26296 @cindex locale
26297 These environment variables control the way that GCC uses
26298 localization information which allows GCC to work with different
26299 national conventions.  GCC inspects the locale categories
26300 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
26301 so.  These locale categories can be set to any value supported by your
26302 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
26303 Kingdom encoded in UTF-8.
26305 The @env{LC_CTYPE} environment variable specifies character
26306 classification.  GCC uses it to determine the character boundaries in
26307 a string; this is needed for some multibyte encodings that contain quote
26308 and escape characters that are otherwise interpreted as a string
26309 end or escape.
26311 The @env{LC_MESSAGES} environment variable specifies the language to
26312 use in diagnostic messages.
26314 If the @env{LC_ALL} environment variable is set, it overrides the value
26315 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
26316 and @env{LC_MESSAGES} default to the value of the @env{LANG}
26317 environment variable.  If none of these variables are set, GCC
26318 defaults to traditional C English behavior.
26320 @item TMPDIR
26321 @findex TMPDIR
26322 If @env{TMPDIR} is set, it specifies the directory to use for temporary
26323 files.  GCC uses temporary files to hold the output of one stage of
26324 compilation which is to be used as input to the next stage: for example,
26325 the output of the preprocessor, which is the input to the compiler
26326 proper.
26328 @item GCC_COMPARE_DEBUG
26329 @findex GCC_COMPARE_DEBUG
26330 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
26331 @option{-fcompare-debug} to the compiler driver.  See the documentation
26332 of this option for more details.
26334 @item GCC_EXEC_PREFIX
26335 @findex GCC_EXEC_PREFIX
26336 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
26337 names of the subprograms executed by the compiler.  No slash is added
26338 when this prefix is combined with the name of a subprogram, but you can
26339 specify a prefix that ends with a slash if you wish.
26341 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
26342 an appropriate prefix to use based on the pathname it is invoked with.
26344 If GCC cannot find the subprogram using the specified prefix, it
26345 tries looking in the usual places for the subprogram.
26347 The default value of @env{GCC_EXEC_PREFIX} is
26348 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
26349 the installed compiler. In many cases @var{prefix} is the value
26350 of @code{prefix} when you ran the @file{configure} script.
26352 Other prefixes specified with @option{-B} take precedence over this prefix.
26354 This prefix is also used for finding files such as @file{crt0.o} that are
26355 used for linking.
26357 In addition, the prefix is used in an unusual way in finding the
26358 directories to search for header files.  For each of the standard
26359 directories whose name normally begins with @samp{/usr/local/lib/gcc}
26360 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
26361 replacing that beginning with the specified prefix to produce an
26362 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
26363 @file{foo/bar} just before it searches the standard directory 
26364 @file{/usr/local/lib/bar}.
26365 If a standard directory begins with the configured
26366 @var{prefix} then the value of @var{prefix} is replaced by
26367 @env{GCC_EXEC_PREFIX} when looking for header files.
26369 @item COMPILER_PATH
26370 @findex COMPILER_PATH
26371 The value of @env{COMPILER_PATH} is a colon-separated list of
26372 directories, much like @env{PATH}.  GCC tries the directories thus
26373 specified when searching for subprograms, if it can't find the
26374 subprograms using @env{GCC_EXEC_PREFIX}.
26376 @item LIBRARY_PATH
26377 @findex LIBRARY_PATH
26378 The value of @env{LIBRARY_PATH} is a colon-separated list of
26379 directories, much like @env{PATH}.  When configured as a native compiler,
26380 GCC tries the directories thus specified when searching for special
26381 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
26382 using GCC also uses these directories when searching for ordinary
26383 libraries for the @option{-l} option (but directories specified with
26384 @option{-L} come first).
26386 @item LANG
26387 @findex LANG
26388 @cindex locale definition
26389 This variable is used to pass locale information to the compiler.  One way in
26390 which this information is used is to determine the character set to be used
26391 when character literals, string literals and comments are parsed in C and C++.
26392 When the compiler is configured to allow multibyte characters,
26393 the following values for @env{LANG} are recognized:
26395 @table @samp
26396 @item C-JIS
26397 Recognize JIS characters.
26398 @item C-SJIS
26399 Recognize SJIS characters.
26400 @item C-EUCJP
26401 Recognize EUCJP characters.
26402 @end table
26404 If @env{LANG} is not defined, or if it has some other value, then the
26405 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
26406 recognize and translate multibyte characters.
26407 @end table
26409 @noindent
26410 Some additional environment variables affect the behavior of the
26411 preprocessor.
26413 @include cppenv.texi
26415 @c man end
26417 @node Precompiled Headers
26418 @section Using Precompiled Headers
26419 @cindex precompiled headers
26420 @cindex speed of compilation
26422 Often large projects have many header files that are included in every
26423 source file.  The time the compiler takes to process these header files
26424 over and over again can account for nearly all of the time required to
26425 build the project.  To make builds faster, GCC allows you to
26426 @dfn{precompile} a header file.
26428 To create a precompiled header file, simply compile it as you would any
26429 other file, if necessary using the @option{-x} option to make the driver
26430 treat it as a C or C++ header file.  You may want to use a
26431 tool like @command{make} to keep the precompiled header up-to-date when
26432 the headers it contains change.
26434 A precompiled header file is searched for when @code{#include} is
26435 seen in the compilation.  As it searches for the included file
26436 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
26437 compiler looks for a precompiled header in each directory just before it
26438 looks for the include file in that directory.  The name searched for is
26439 the name specified in the @code{#include} with @samp{.gch} appended.  If
26440 the precompiled header file can't be used, it is ignored.
26442 For instance, if you have @code{#include "all.h"}, and you have
26443 @file{all.h.gch} in the same directory as @file{all.h}, then the
26444 precompiled header file is used if possible, and the original
26445 header is used otherwise.
26447 Alternatively, you might decide to put the precompiled header file in a
26448 directory and use @option{-I} to ensure that directory is searched
26449 before (or instead of) the directory containing the original header.
26450 Then, if you want to check that the precompiled header file is always
26451 used, you can put a file of the same name as the original header in this
26452 directory containing an @code{#error} command.
26454 This also works with @option{-include}.  So yet another way to use
26455 precompiled headers, good for projects not designed with precompiled
26456 header files in mind, is to simply take most of the header files used by
26457 a project, include them from another header file, precompile that header
26458 file, and @option{-include} the precompiled header.  If the header files
26459 have guards against multiple inclusion, they are skipped because
26460 they've already been included (in the precompiled header).
26462 If you need to precompile the same header file for different
26463 languages, targets, or compiler options, you can instead make a
26464 @emph{directory} named like @file{all.h.gch}, and put each precompiled
26465 header in the directory, perhaps using @option{-o}.  It doesn't matter
26466 what you call the files in the directory; every precompiled header in
26467 the directory is considered.  The first precompiled header
26468 encountered in the directory that is valid for this compilation is
26469 used; they're searched in no particular order.
26471 There are many other possibilities, limited only by your imagination,
26472 good sense, and the constraints of your build system.
26474 A precompiled header file can be used only when these conditions apply:
26476 @itemize
26477 @item
26478 Only one precompiled header can be used in a particular compilation.
26480 @item
26481 A precompiled header can't be used once the first C token is seen.  You
26482 can have preprocessor directives before a precompiled header; you cannot
26483 include a precompiled header from inside another header.
26485 @item
26486 The precompiled header file must be produced for the same language as
26487 the current compilation.  You can't use a C precompiled header for a C++
26488 compilation.
26490 @item
26491 The precompiled header file must have been produced by the same compiler
26492 binary as the current compilation is using.
26494 @item
26495 Any macros defined before the precompiled header is included must
26496 either be defined in the same way as when the precompiled header was
26497 generated, or must not affect the precompiled header, which usually
26498 means that they don't appear in the precompiled header at all.
26500 The @option{-D} option is one way to define a macro before a
26501 precompiled header is included; using a @code{#define} can also do it.
26502 There are also some options that define macros implicitly, like
26503 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
26504 defined this way.
26506 @item If debugging information is output when using the precompiled
26507 header, using @option{-g} or similar, the same kind of debugging information
26508 must have been output when building the precompiled header.  However,
26509 a precompiled header built using @option{-g} can be used in a compilation
26510 when no debugging information is being output.
26512 @item The same @option{-m} options must generally be used when building
26513 and using the precompiled header.  @xref{Submodel Options},
26514 for any cases where this rule is relaxed.
26516 @item Each of the following options must be the same when building and using
26517 the precompiled header:
26519 @gccoptlist{-fexceptions}
26521 @item
26522 Some other command-line options starting with @option{-f},
26523 @option{-p}, or @option{-O} must be defined in the same way as when
26524 the precompiled header was generated.  At present, it's not clear
26525 which options are safe to change and which are not; the safest choice
26526 is to use exactly the same options when generating and using the
26527 precompiled header.  The following are known to be safe:
26529 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
26530 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
26531 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
26532 -pedantic-errors}
26534 @end itemize
26536 For all of these except the last, the compiler automatically
26537 ignores the precompiled header if the conditions aren't met.  If you
26538 find an option combination that doesn't work and doesn't cause the
26539 precompiled header to be ignored, please consider filing a bug report,
26540 see @ref{Bugs}.
26542 If you do use differing options when generating and using the
26543 precompiled header, the actual behavior is a mixture of the
26544 behavior for the options.  For instance, if you use @option{-g} to
26545 generate the precompiled header but not when using it, you may or may
26546 not get debugging information for routines in the precompiled header.